/* AuFait Agents — logo palette (orange + wave blues) */
:root {
  --orange: #f87008;
  --orange-hot: #ff8a1a;
  --orange-deep: #d65f00;
  --cyan: #10b0e0;
  --cyan-soft: #3ec4eb;
  --blue-mid: #087098;
  --navy: #003050;
  --navy-deep: #001f33;
  --ink: #003050;
  --ink-soft: #2a4a5e;
  --muted: #5a7383;
  --cream: #f3f8fb;
  --cream-dark: #e4eef4;
  --white: #ffffff;
  --line: rgba(0, 48, 80, 0.12);
  --bg: var(--cream);
  --surface: var(--white);
  --accent: var(--orange);
  --shadow: 0 10px 36px rgba(0, 48, 80, 0.1);
  --shadow-lg: 0 22px 60px rgba(0, 48, 80, 0.14);
  --radius: 12px;
  --radius-lg: 20px;
  --sidebar: 268px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Roboto Flex", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}
body {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink-soft);
  background:
    radial-gradient(900px 420px at 0% 0%, rgba(16, 176, 224, 0.16), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(248, 112, 8, 0.14), transparent 50%),
    linear-gradient(180deg, #f7fbfd 0%, var(--cream) 45%, #eaf3f8 100%);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--blue-mid);
  text-decoration: none;
}
a:hover {
  color: var(--orange);
}
button,
input,
select,
textarea {
  font: inherit;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--navy);
  margin: 0 0 0.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
p {
  margin: 0 0 0.85rem;
}
.hidden {
  display: none !important;
}

/* Login */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(700px 400px at 20% 10%, rgba(16, 176, 224, 0.2), transparent 50%),
    radial-gradient(600px 360px at 90% 80%, rgba(248, 112, 8, 0.18), transparent 45%),
    #061820;
}
.login-card {
  width: min(440px, 100%);
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-lg);
}
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  text-align: center;
}
.login-brand img {
  width: min(280px, 100%);
  height: auto;
  background: #ffffff;
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}
.login-brand span {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Shell — navy sidebar + orange/cyan accents */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}
.sidebar {
  background: linear-gradient(180deg, var(--navy-deep) 0%, var(--navy) 55%, #024060 100%);
  color: #e8f4fa;
  padding: 1.15rem 1rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(16, 176, 224, 0.2);
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.25rem 0.35rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1rem;
}
.brand img {
  width: 100%;
  max-width: 220px;
  height: auto;
  display: block;
  border-radius: 12px;
  background: #ffffff;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(16, 176, 224, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.brand small {
  color: rgba(62, 196, 235, 0.9);
  font-size: 0.78rem;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-left: 0.15rem;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}
.nav-link {
  border: 0;
  background: transparent;
  color: rgba(232, 244, 250, 0.82);
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-link:hover {
  background: rgba(16, 176, 224, 0.15);
  color: #fff;
}
.nav-link.is-active {
  background: var(--orange);
  color: #fff;
}
.sidebar-foot {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.88rem;
  color: rgba(232, 244, 250, 0.55);
}
.sidebar-foot a {
  color: var(--cyan-soft);
}
.sidebar-foot .nav-link {
  width: 100%;
  color: rgba(232, 244, 250, 0.82);
}
.main {
  min-width: 0;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.35rem 1.5rem 0.4rem;
}
.topbar h1 {
  font-size: clamp(1.6rem, 2vw, 2.1rem);
}
.userchip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}
.userchip-name {
  font-weight: 600;
  color: var(--navy);
  font-family: var(--font-display);
}
.userchip-meta {
  font-size: 0.8rem;
  color: var(--orange);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.content {
  padding: 0.75rem 1.5rem 2.5rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--orange);
}
.stat:nth-child(2) {
  border-top-color: var(--cyan);
}
.stat:nth-child(3) {
  border-top-color: var(--blue-mid);
}
.stat:nth-child(4) {
  border-top-color: var(--navy);
}
.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 0.4rem;
}
.stat span {
  color: var(--muted);
  font-size: 0.9rem;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.field label {
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy);
}
.field input,
.field select,
.field textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  background: var(--cream);
  color: var(--navy);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid rgba(16, 176, 224, 0.35);
  border-color: var(--cyan);
  background: var(--white);
}
.field textarea {
  min-height: 110px;
  resize: vertical;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  background: var(--navy);
  color: #fff;
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.btn-pink,
.btn-orange {
  background: var(--orange);
}
.btn-pink:hover,
.btn-orange:hover {
  background: var(--orange-hot);
}
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--line);
}
.btn-soft {
  background: rgba(16, 176, 224, 0.12);
  color: var(--blue-mid);
}

.alert {
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
}
.alert-error {
  background: #ffe8d6;
  color: #8a3b00;
}
.alert-ok {
  background: #e5f7fd;
  color: #03506e;
}

.table-wrap {
  overflow: auto;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
table.data th,
table.data td {
  text-align: left;
  padding: 0.75rem 0.55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-family: var(--font-display);
}
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--cream-dark);
  color: var(--navy);
}
.badge-hot {
  background: rgba(248, 112, 8, 0.14);
  color: var(--orange-deep);
}
.badge-ok {
  background: rgba(16, 176, 224, 0.15);
  color: var(--blue-mid);
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
}
.cal-dow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: center;
  padding: 0.35rem;
  font-family: var(--font-display);
}
.cal-day {
  min-height: 92px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.4rem;
  cursor: pointer;
}
.cal-day.is-muted {
  opacity: 0.4;
}
.cal-day.is-today {
  border-color: var(--orange);
  background: rgba(248, 112, 8, 0.08);
  box-shadow: inset 0 0 0 1px var(--orange);
}
.cal-day-num {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.25rem;
  font-family: var(--font-display);
}
.cal-event {
  display: block;
  font-size: 0.72rem;
  background: rgba(16, 176, 224, 0.16);
  color: #03506e;
  border-radius: 6px;
  padding: 0.15rem 0.3rem;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recorder {
  display: grid;
  gap: 1rem;
}
.rec-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--navy);
}
.rec-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
}
.rec-dot.is-live {
  background: var(--orange);
  box-shadow: 0 0 0 0 rgba(248, 112, 8, 0.5);
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  70% {
    box-shadow: 0 0 0 12px rgba(248, 112, 8, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(248, 112, 8, 0);
  }
}
.transcript {
  white-space: pre-wrap;
  background: var(--cream);
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--line);
  max-height: min(50vh, 360px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  line-height: 1.55;
  word-break: break-word;
}

/* Meeting cards (mobile-first library) */
.meeting-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.meeting-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--cream);
  padding: 0.95rem 1rem;
}
.meeting-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}
.meeting-card .meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.55rem;
}
.meeting-card .summary-preview {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0 0 0.75rem;
  line-height: 1.45;
}
.meeting-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.meeting-actions .btn {
  flex: 1 1 auto;
  min-height: 44px;
  min-width: 140px;
  touch-action: manipulation;
}

/* Full-screen transcript sheet */
.tx-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  background: rgba(0, 31, 51, 0.45);
  padding: 0;
}
.tx-sheet.hidden {
  display: none !important;
}
.tx-sheet-panel {
  margin-top: auto;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  max-height: min(92vh, 920px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 -12px 40px rgba(0, 48, 80, 0.25);
  width: 100%;
}
.tx-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.tx-sheet-head h3 {
  margin: 0;
  font-size: 1.15rem;
}
.tx-sheet-head .sub {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.tx-sheet-close {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--cream);
  color: var(--navy);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
.tx-sheet-body {
  padding: 1rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  flex: 1 1 auto;
  min-height: 0;
}
.tx-sheet-body .tx-block {
  margin: 0 0 1.1rem;
}
.tx-sheet-body .tx-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--orange);
  font-weight: 700;
  margin: 0 0 0.35rem;
}
.tx-sheet-body pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-body);
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--navy);
}

@media (min-width: 761px) {
  .tx-sheet {
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
  }
  .tx-sheet-panel {
    margin-top: 0;
    border-radius: var(--radius-lg);
    max-width: 720px;
    max-height: min(86vh, 800px);
    width: min(720px, 100%);
  }
}

@media (max-width: 960px) {
  html,
  body {
    overflow-x: hidden;
  }
  .shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .sidebar {
    position: static;
    height: auto;
  }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .nav-link {
    min-height: 42px;
  }
  .content {
    padding: 0.75rem 1rem 3rem;
    overflow: visible;
  }
  .main {
    overflow: visible;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cal-day {
    min-height: 68px;
  }
  .btn {
    min-height: 44px;
    touch-action: manipulation;
  }
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Prefer cards over cramped tables on phones */
  .meeting-table-desktop {
    display: none;
  }
}

@media (min-width: 961px) {
  .meeting-list-mobile {
    display: none;
  }
}
