:root {
  color-scheme: light;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --paper: #f5f5f7;
  --panel: #ffffff;
  --panel-soft: rgba(255, 255, 255, 0.78);
  --line: rgba(60, 60, 67, 0.14);
  --line-strong: rgba(60, 60, 67, 0.24);
  --accent: #007aff;
  --accent-soft: #e8f2ff;
  --danger: #ff3b30;
  --warning: #ff9500;
  --success: #34c759;
  --gold: #af8f2c;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --control: rgba(118, 118, 128, 0.12);
  --control-hover: rgba(118, 118, 128, 0.18);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  background: var(--control);
  color: var(--ink);
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 120ms ease, color 120ms ease, transform 120ms ease;
}

button:hover {
  background: var(--control-hover);
}

button:active {
  transform: scale(0.98);
}

.primary {
  background: var(--accent);
  color: white;
}

.danger {
  color: var(--danger);
  background: rgba(255, 59, 48, 0.1);
}

.ghost {
  background: transparent;
  color: var(--accent);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 122, 255, 0.11), transparent 32%),
    var(--paper);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 8px;
  background: linear-gradient(180deg, #3aa0ff, var(--accent));
  color: white;
  font-weight: 700;
  font-size: 32px;
  box-shadow: var(--shadow);
}

.auth-shell h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 0;
  font-weight: 700;
}

.auth-form {
  display: grid;
  gap: 10px;
  width: min(390px, 92vw);
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-form input {
  flex: 1;
}

input,
textarea,
select {
  width: 100%;
  border: 0;
  background: var(--control);
  color: var(--ink);
  border-radius: 8px;
  padding: 12px 13px;
  min-height: 42px;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.18);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.app-shell {
  display: grid;
  grid-template-columns: 236px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  background: rgba(245, 245, 247, 0.82);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(22px);
}

.sidebar-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.sidebar .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 22px;
  box-shadow: none;
}

.sidebar h1 {
  font-size: 20px;
  margin: 0;
  font-weight: 700;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav button {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}

.nav button.active {
  background: var(--control);
  color: var(--ink);
}

.main {
  max-width: 1180px;
  width: 100%;
  padding: 24px 28px 40px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: -24px -28px 20px;
  padding: 18px 28px 14px;
  background: rgba(245, 245, 247, 0.84);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(22px);
}

.topbar h2 {
  font-size: 30px;
  margin: 0;
  font-weight: 700;
  letter-spacing: 0;
}

.quick-capture {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.quick-capture textarea {
  min-height: 58px;
  background: transparent;
  padding: 8px;
  box-shadow: none;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 20px;
}

.section {
  margin-bottom: 22px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.section-header h3 {
  margin: 0;
  font-size: 15px;
  text-transform: none;
  color: var(--muted);
  font-weight: 650;
}

.item-list {
  display: grid;
  gap: 8px;
}

.item-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.item-card h4 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
}

.item-card p {
  margin: 0;
  color: var(--muted);
  white-space: pre-wrap;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.suggestion-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
}

.suggestion-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.quadrant-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.quadrant {
  border-top: 3px solid var(--success);
}

.quadrant.schedule {
  border-top-color: var(--accent);
}

.quadrant.delegate {
  border-top-color: var(--gold);
}

.quadrant.eliminate {
  border-top-color: var(--danger);
}

.warning {
  padding: 12px 14px;
  background: rgba(255, 149, 0, 0.12);
  color: #7a4a00;
  border: 1px solid rgba(255, 149, 0, 0.22);
  border-radius: 8px;
  margin-bottom: 14px;
}

.muted {
  color: var(--muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid {
  display: grid;
  gap: 11px;
  max-width: 760px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.recording {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
}

.mobile-tabs {
  display: none;
}

@media (max-width: 880px) {
  .app-shell {
    display: block;
    padding-bottom: 72px;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 14px 14px 86px;
    max-width: none;
  }

  .topbar {
    margin: -14px -14px 14px;
    padding: 14px;
  }

  .topbar h2 {
    font-size: 26px;
  }

  .dashboard-grid,
  .split,
  .matrix {
    grid-template-columns: 1fr;
  }

  .quick-capture {
    grid-template-columns: 1fr;
    margin-bottom: 16px;
  }

  .mobile-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: rgba(255, 255, 255, 0.86);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(22px);
    z-index: 10;
  }

  .mobile-tabs button {
    border: 0;
    border-radius: 0;
    min-height: 60px;
    font-size: 12px;
    background: transparent;
    color: var(--muted);
  }

  .auth-form {
    display: grid;
  }
}
