@font-face { font-family: 'Panton'; src: url('./fonts/Panton-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Panton'; src: url('./fonts/Panton-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Panton'; src: url('./fonts/Panton-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --background: #f4f6fa;
  --foreground: #111827;
  --card: #ffffff;
  --card-foreground: #111827;
  --muted: #f1f5f9;
  --muted-foreground: #667085;
  --border: #dbe3ec;
  --border-strong: #c9d4df;
  --input: #9aa8b7;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn-soft: #fff6d8;
  --primary: #4a7b90;
  --primary-hover: #5d91a6;
  --primary-dark: #354855;
  --sidebar: #ffffff;
  --sidebar-accent: #f4f6f8;
  --radius: 8px;
  --header-height: 64px;
  --sidebar-width: 236px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 8px 24px rgba(15, 23, 42, 0.04);
  --font: 'Panton', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* --- shell --- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width); flex: 0 0 var(--sidebar-width);
  background: var(--sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 16px; gap: 24px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.sidebar-brand-mark { width: 32px; height: 32px; }
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.sidebar-brand-text strong { font-size: 16px; font-weight: 700; }
.sidebar-brand-text span { font-size: 12px; color: var(--muted-foreground); }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: var(--radius); color: var(--muted-foreground);
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.nav-item:hover { background: var(--sidebar-accent); }
.nav-item.nav-item-active { background: var(--sidebar-accent); color: var(--primary); }
.nav-icon { display: inline-flex; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-item-button { width: 100%; border: 0; background: none; font: inherit; text-align: left; }
.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.sidebar-user { margin: 0 8px; font-size: 12px; color: var(--muted-foreground); }

.app-frame { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--header-height); display: flex; align-items: center; gap: 16px;
  padding: 0 28px; border-bottom: 1px solid var(--border); background: var(--card);
}
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted-foreground); }
.breadcrumb strong { color: var(--foreground); }
.topbar-right { margin-left: auto; }
/* De-chromed native selects: our own border + custom chevron (the open option
   list stays native, but the control matches the app). */
.select-field {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  height: 34px; border: 1px solid var(--input); border-radius: 6px;
  padding: 0 32px 0 10px; font: inherit; color: var(--foreground);
  background-color: var(--card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
  cursor: pointer;
}
.select-field:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74, 123, 144, 0.2); }
.lang-switch { min-width: 120px; }
.burger { display: none; cursor: pointer; color: var(--foreground); }
.burger svg { width: 22px; height: 22px; }
.nav-backdrop { display: none; }

.screen { flex: 1 1 auto; padding: 28px; }
.screen-inner { max-width: 1100px; margin: 0 auto; }

.title-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.title-copy h1 { margin: 0 0 4px; font-size: 24px; font-weight: 700; }
.title-copy p { margin: 0; color: var(--muted-foreground); font-size: 14px; }

/* --- cluster toggle --- */
.cluster-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.cluster-option { border: 0; background: none; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted-foreground); cursor: pointer; }
.cluster-option + .cluster-option { border-left: 1px solid var(--border); }
.cluster-option.cluster-option-active { background: var(--primary); color: #fff; }

/* --- meetings list --- */
.meetings-list { display: flex; flex-direction: column; gap: 2px; }
.group-header { padding: 16px 4px 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); }
.meeting-row {
  display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(150px, 200px) auto auto; align-items: center; gap: 16px;
  padding: 12px 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
}
.meeting-row:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.meeting-date { font-size: 13px; color: var(--muted-foreground); }
.meeting-date strong { display: block; color: var(--foreground); font-size: 14px; }
.meeting-title { min-width: 0; }
.meeting-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meeting-meta { font-size: 12px; color: var(--muted-foreground); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-imported { background: #e7f6ec; color: #15803d; }
.badge-pending { background: var(--warn-soft); color: #92700c; }
.badge-failed { background: #fde8e8; color: var(--danger); }
.meeting-actions { display: flex; gap: 8px; }

/* --- customer status cell --- */
.meeting-customer { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cust { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-confirmed { color: var(--foreground); }
.cust-confirmed .cust-check { display: inline-flex; color: var(--ok); }
.cust-confirmed .cust-check svg { width: 15px; height: 15px; }
.cust-derived { color: #92700c; }
.cust-derived .cust-dot { width: 8px; height: 8px; border-radius: 999px; background: #d9a406; flex: 0 0 auto; }
.cust-unknown { color: var(--muted-foreground); font-weight: 500; font-style: italic; }
.cust-action { border: 1px solid var(--border-strong); background: var(--card); color: var(--primary); border-radius: 6px; padding: 2px 8px; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.cust-action:hover { border-color: var(--primary); background: var(--sidebar-accent); }
.cust-confirm { color: #fff; background: var(--primary); border-color: var(--primary); }
.cust-confirm:hover { background: var(--primary-hover); }

/* --- pager --- */
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; }
.pager-status { font-size: 13px; color: var(--muted-foreground); }
.empty-state { padding: 48px 16px; text-align: center; color: var(--muted-foreground); }

/* --- buttons --- */
.primary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 0 14px; border: 0; border-radius: 6px; color: #fff; background: var(--primary); font-size: 12px; font-weight: 700; cursor: pointer; }
.primary-button:hover { background: var(--primary-hover); }
.primary-button:disabled { opacity: 0.5; cursor: not-allowed; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--card); color: var(--foreground); font-size: 12px; font-weight: 600; cursor: pointer; }
.secondary-button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.secondary-button:disabled { opacity: 0.45; cursor: not-allowed; }
.link-button { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; }
.link-button:hover { text-decoration: underline; }
.icon-button { background: none; border: 0; padding: 6px; border-radius: 6px; color: var(--muted-foreground); cursor: pointer; }
.icon-button:hover { background: var(--muted); color: var(--foreground); }
.icon-button svg { width: 18px; height: 18px; }

/* --- modals --- */
.modal-overlay { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 24px; }
.modal-overlay[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.46); }
.incident-modal {
  position: relative; z-index: 1; display: flex; flex-direction: column;
  width: min(720px, 100%); max-height: min(820px, calc(100vh - 48px));
  overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); box-shadow: 0 22px 70px rgba(15, 23, 42, 0.24);
}
.login-modal { max-width: 360px; }
.transcript-modal { width: min(760px, 100%); }
.incident-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px; border-bottom: 1px solid var(--border); }
.incident-modal-header h2 { margin: 0 0 6px; font-family: var(--font); font-size: 22px; font-weight: 700; line-height: 1.25; }
.incident-modal-header p { margin: 0; color: var(--muted-foreground); font-size: 14px; line-height: 1.5; }
.incident-modal-body { min-height: 0; overflow-y: auto; padding: 24px; }

/* detail modal content */
.detail-grid { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; margin-bottom: 8px; }
.detail-grid dt { color: var(--muted-foreground); font-size: 13px; font-weight: 600; }
.detail-grid dd { margin: 0; font-size: 14px; }
.detail-section-title { margin: 20px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); }
.participant-list, .summary-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.participant-list li, .summary-list li { font-size: 13px; }
.participant-list .p-email { color: var(--muted-foreground); }
.customer-edit { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.customer-edit select { flex: 1; min-width: 150px; }
.customer-edit input { height: 34px; padding: 0 10px; border: 1px solid var(--input); border-radius: 6px; font: inherit; color: var(--foreground); background: var(--card); flex: 1; min-width: 150px; }
.customer-edit input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74, 123, 144, 0.2); }
.scope-modal { max-width: 440px; }
.scope-actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.scope-actions .primary-button, .scope-actions .secondary-button { width: 100%; min-height: 40px; }
.scope-actions .link-button { align-self: center; margin-top: 4px; }
.detail-note { font-size: 12px; color: var(--muted-foreground); margin-top: 6px; }
.transcript-text { white-space: pre-wrap; word-break: break-word; font-family: var(--font); font-size: 14px; line-height: 1.6; margin: 0; }

/* --- login/forms --- */
.manage-form .form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.manage-form .form-row span { font-size: 12px; font-weight: 600; color: var(--muted-foreground); }
.manage-form input { height: 36px; padding: 0 10px; border: 1px solid var(--input); border-radius: 6px; font: inherit; background: var(--card); }
.manage-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74, 123, 144, 0.2); }
.modal-footer { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.footer-spacer { flex: 1; }
.login-hint { margin: 0 0 12px; font-size: 13px; color: var(--muted-foreground); }
.form-error { margin: 0 0 12px; color: var(--danger); font-size: 12px; font-weight: 600; }
.login-error { padding: 0 24px 16px; }
.login-sso { padding-bottom: 0; }
.login-google { width: 100%; justify-content: center; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0 0; color: var(--muted-foreground); font-size: 0.85rem; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.modal-success { color: var(--ok); font-weight: 600; }

/* --- responsive --- */
@media (max-width: 820px) {
  .sidebar { position: fixed; z-index: 40; transform: translateX(-100%); transition: transform 0.2s ease; }
  .nav-toggle:checked ~ .sidebar { transform: translateX(0); }
  .nav-toggle:checked ~ .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(15, 23, 42, 0.35); }
  .burger { display: inline-flex; }
  .meeting-row { grid-template-columns: 1fr; gap: 8px; }
  .meeting-customer, .meeting-actions { justify-self: start; }
}
