:root {
  --ink: #1d2733;
  --muted: #64748b;
  --line: #d8e0e8;
  --paper: #ffffff;
  --wash: #f5f7fa;
  --nav: #17324d;
  --nav-2: #234d63;
  --teal: #2f7f83;
  --green: #4c956c;
  --gold: #f2c14e;
  --coral: #de6b48;
  --red: #b42318;
  --blue-soft: #e9f3f7;
  --green-soft: #edf7ef;
  --gold-soft: #fff6d8;
  --coral-soft: #fff0ea;
  --shadow: 0 14px 38px rgba(20, 36, 58, 0.12);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--nav);
  color: #fff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 10px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: #17324d;
  font-weight: 800;
  border-radius: 8px;
}

.brand h1 {
  font-size: 18px;
  line-height: 1.15;
  margin: 0;
}

.brand p,
.eyebrow {
  margin: 3px 0 0;
  color: #bfd1df;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 700;
}

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

.nav-item,
.ghost-button,
.primary-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  min-height: 40px;
}

.nav-item {
  background: transparent;
  color: #e7f0f6;
  text-align: left;
  padding: 10px 12px;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.13);
}

.sidebar-actions {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.cloud-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #bfd1df;
  font-size: 12px;
  padding: 0 4px;
}

.cloud-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8ca4b7;
  flex: 0 0 auto;
}

.cloud-status.connected .cloud-dot {
  background: #7bd19a;
  box-shadow: 0 0 0 3px rgba(123, 209, 154, 0.14);
}

.cloud-status.syncing .cloud-dot {
  background: var(--gold);
}

.cloud-status.error .cloud-dot {
  background: #ff8f7d;
}

.sign-out-button {
  width: 100%;
}

.ghost-button {
  background: #eef3f7;
  color: var(--ink);
  padding: 0 12px;
}

.sidebar .ghost-button {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.ghost-button.danger {
  color: #ffd2ca;
}

.file-label {
  display: grid;
  place-items: center;
}

.file-label input {
  display: none;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #edf2f6;
}

.auth-gate[hidden] {
  display: none;
}

.auth-panel {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(20, 36, 58, 0.18);
  padding: 30px;
}

.auth-panel .eyebrow {
  color: var(--muted);
  margin-top: 20px;
}

.auth-panel h2 {
  margin: 4px 0 10px;
  font-size: 28px;
}

.auth-panel p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.auth-sign-out {
  width: 100%;
  margin-top: 12px;
}

.auth-form label {
  font-size: 12px;
  font-weight: 800;
}

.auth-form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  min-height: 44px;
}

.migration-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  margin-bottom: 22px;
  background: var(--gold-soft);
  border: 1px solid #e8cf76;
  border-radius: 8px;
}

.migration-banner h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.migration-banner p {
  margin: 0;
  color: #715800;
  font-size: 13px;
}

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

.topbar h2 {
  margin: 0;
  font-size: 28px;
}

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

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search,
.year-filter,
.field input,
.field select,
.field textarea {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 40px;
  outline: none;
}

.search {
  width: min(34vw, 360px);
}

.year-filter {
  width: 130px;
}

.search:focus,
.year-filter:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(47, 127, 131, 0.13);
}

.primary-button {
  background: var(--teal);
  color: #fff;
  padding: 0 16px;
  font-weight: 700;
}

.content {
  padding: 24px 28px 40px;
}

.grid {
  display: grid;
  gap: 16px;
}

.dashboard-section {
  margin-top: 22px;
}

.dashboard-section + .dashboard-section {
  margin-top: 28px;
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.split-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
}

.card,
.panel,
.record-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card {
  padding: 16px;
}

.kpi {
  display: grid;
  gap: 8px;
  text-align: left;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.kpi-link {
  width: 100%;
  min-height: 112px;
}

.kpi-link:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 127, 131, 0.45);
  box-shadow: 0 18px 42px rgba(20, 36, 58, 0.16);
}

.kpi-link:focus-visible {
  outline: 3px solid rgba(47, 127, 131, 0.3);
  outline-offset: 3px;
}

.kpi strong {
  font-size: 30px;
  line-height: 1;
}

.kpi span {
  color: var(--muted);
  font-weight: 700;
}

.panel {
  overflow: hidden;
  border-top: 4px solid transparent;
}

.panel-blue {
  border-top-color: #2f7f83;
}

.panel-green {
  border-top-color: #4c956c;
}

.panel-gold {
  border-top-color: #f2c14e;
}

.panel-coral {
  border-top-color: #de6b48;
}

.panel-head {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.panel-head h3 {
  margin: 0;
  font-size: 16px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef3f7;
  color: var(--nav-2);
  font-weight: 900;
}

.panel-body {
  padding: 18px;
}

.record-list {
  display: grid;
  gap: 10px;
}

.record-card {
  padding: 14px;
}

.record-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.record-title {
  margin: 0;
  font-size: 16px;
}

.record-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #234d63;
  font-size: 12px;
  font-weight: 700;
}

.tag.green {
  background: var(--green-soft);
  color: #2f6848;
}

.tag.gold {
  background: var(--gold-soft);
  color: #7a5b00;
}

.tag.coral {
  background: var(--coral-soft);
  color: #9b3f24;
}

.tag.red {
  background: #fee4e2;
  color: var(--red);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  border-collapse: collapse;
  min-width: 960px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 10px 12px;
  vertical-align: top;
  font-size: 13px;
}

th {
  background: #edf3f7;
  color: #29445c;
  position: sticky;
  top: 0;
  z-index: 1;
}

tr:hover td {
  background: #fbfdff;
}

.task-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0;
  align-items: center;
}

.toolbar-spacer {
  flex: 1 1 auto;
}

.filter-pill {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  min-height: 36px;
  border-radius: 999px;
  padding: 6px 13px;
  font-weight: 800;
}

.month-picker {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  min-height: 36px;
  border-radius: 8px;
  padding: 6px 10px;
}

.filter-pill.active,
.filter-pill:hover {
  background: var(--nav-2);
  border-color: var(--nav-2);
  color: #fff;
}

.task-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  align-items: start;
}

.communications-planner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  align-items: start;
}

.planner-channel {
  background: #eef3f7;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.task-lane {
  background: #eef3f7;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 320px;
  overflow: hidden;
}

.task-lane-head {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.task-lane-head h3 {
  margin: 0;
  font-size: 15px;
}

.task-card-list {
  padding: 10px;
  display: grid;
  gap: 10px;
}

.task-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 8px 20px rgba(20, 36, 58, 0.08);
}

.task-card-main h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}

.task-card-main p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.task-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.small-button,
.link-button {
  border: 1px solid var(--line);
  min-height: 30px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 4px 8px;
}

.link-button {
  border-color: transparent;
  color: var(--teal);
  font-weight: 700;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(108px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.day,
.weekday {
  background: #fff;
  min-height: 110px;
  padding: 8px;
}

.weekday {
  min-height: 38px;
  background: #edf3f7;
  font-weight: 800;
  color: #29445c;
}

.day.muted {
  background: #f8fafc;
  color: #94a3b8;
}

.day-number {
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 6px;
}

.calendar-chip {
  display: block;
  width: 100%;
  border: 0;
  border-left: 4px solid var(--teal);
  background: var(--blue-soft);
  color: var(--ink);
  border-radius: 6px;
  margin: 4px 0;
  padding: 5px 6px;
  text-align: left;
  font-size: 12px;
}

.calendar-chip.event {
  border-left-color: var(--green);
  background: var(--green-soft);
}

.calendar-chip.deadline {
  border-left-color: var(--coral);
  background: var(--coral-soft);
}

.calendar-chip.social {
  border-left-color: var(--gold);
  background: var(--gold-soft);
}

.progress-track {
  height: 9px;
  background: #e9eef3;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-bar {
  height: 100%;
  background: var(--green);
}

.modal {
  width: min(860px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.25);
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.38);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
}

.modal-head .eyebrow {
  color: var(--muted);
}

.icon-button {
  width: 34px;
  min-height: 34px;
  background: #eef3f7;
  color: var(--ink);
}

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

.field {
  display: grid;
  gap: 6px;
}

.field.wide {
  grid-column: 1 / -1;
}

.field label {
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

#otterTranscript {
  min-height: 190px;
}

#otterActionItems {
  min-height: 140px;
}

#exportText {
  min-height: min(52vh, 420px);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #334155;
  font-weight: 700;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.action-review-list {
  padding: 18px 20px;
  display: grid;
  gap: 12px;
  max-height: min(62vh, 620px);
  overflow: auto;
}

.action-review-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  background: #fff;
}

.action-review-item.converted {
  background: #f4f8f4;
}

.action-review-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px 150px;
  gap: 10px;
}

.action-review-fields input {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 10px;
}

.action-review-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

@media (max-width: 720px) {
  .action-review-fields {
    grid-template-columns: 1fr;
  }
}

.modal-actions {
  padding: 14px 20px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .search {
    width: 100%;
  }

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

  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-board {
    grid-template-columns: 1fr;
  }

  .weekday {
    display: none;
  }
}

@media (max-width: 640px) {
  .content,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}
