/*
 * "Sonali navy" skin for the AI-Based Digital Archive POC (light mode of the default theme).
 * One brand colour taken from the Sonali Bank logo panel (navy), gold only for highlights,
 * white surfaces on a cool grey page, 8-px spacing, 12-px corners, one shadow level.
 * Dark mode and the other themes keep their own look from tokens.css.
 */
html[data-mode="light"][data-theme="green"] {
  --bcg: #1d2a7e;          /* Sonali navy (logo panel #293a92, banner #170d58) */
  --bcg-dark: #141b5c;
  --bcg-mid: #23318f;
  --bcg-soft: #eef0fa;
  --bcg-gold: #c5922f;
  --bcg-accent: #8a6216;
  --text: #141933;
  --text-secondary: #3a4060;
  --muted: #5a6080;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --border: #e3e6f0;
  --border-strong: #cdd2e3;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(20, 25, 51, 0.06), 0 1px 1px rgba(20, 25, 51, 0.03);
  --shadow-md: 0 1px 2px rgba(20, 25, 51, 0.06), 0 4px 14px rgba(20, 25, 51, 0.06);
  --shadow-lg: 0 12px 32px rgba(20, 25, 51, 0.12);
  --sidebar-bg: linear-gradient(180deg, #1d2a7e 0%, #161f66 55%, #111852 100%);
  --sidebar-fg: rgba(255, 255, 255, 0.95);
  --sidebar-muted: rgba(255, 255, 255, 0.68);
  --sidebar-border: rgba(255, 255, 255, 0.10);
  --sidebar-active: rgba(255, 255, 255, 0.12);
  --sidebar-accent: #e0b65a;
  --login-brand-overlay: linear-gradient(165deg, rgba(20, 27, 92, 0.55), rgba(29, 42, 126, 0.35));
  --theme-meta: #1d2a7e;
  --focus-color: #1d2a7e;
  --focus-ring: 0 0 0 3px rgba(29, 42, 126, 0.30);
}

html[data-mode="light"][data-theme="green"] body:not(.auth-page) { background: var(--bg); }
.page-header h1 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.75rem); font-weight: 700; }

/* —— Sidebar: navy rail, six entries at most, quiet account links at the foot —— */
html[data-mode="light"][data-theme="green"] .sidebar-nav { background: var(--sidebar-bg); border-right: 0; }
html[data-mode="light"][data-theme="green"] .sidebar-brand { border-bottom: 1px solid var(--sidebar-border); }
html[data-mode="light"][data-theme="green"] .sidebar-brand-text .brand-title { color: #fff; font-weight: 700; }
html[data-mode="light"][data-theme="green"] .sidebar-brand-text .brand-subtitle { color: var(--sidebar-accent); }
.sidebar-menu { padding-top: 12px; }
html[data-mode="light"][data-theme="green"] .sidebar-link {
  color: var(--sidebar-fg); border-radius: 10px; margin: 2px 12px; padding: 11px 14px; font-weight: 550; gap: 12px;
}
html[data-mode="light"][data-theme="green"] .sidebar-link svg { color: rgba(255, 255, 255, 0.78); }
html[data-mode="light"][data-theme="green"] .sidebar-link:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
html[data-mode="light"][data-theme="green"] .sidebar-link.is-active {
  background: var(--sidebar-active); color: #fff; font-weight: 650; box-shadow: inset 3px 0 0 var(--sidebar-accent);
}
html[data-mode="light"][data-theme="green"] .sidebar-link.is-active svg { color: var(--sidebar-accent); }
html[data-mode="light"][data-theme="green"] .sidebar-foot { border-top: 1px solid var(--sidebar-border); }
.sidebar-account { display: grid; gap: 2px; margin: 0 0 10px; }
.sidebar-account-link {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; font-size: 0.85rem;
  color: var(--sidebar-muted, rgba(255,255,255,.7)); text-decoration: none;
}
.sidebar-account-link:hover, .sidebar-account-link.is-active { color: #fff; background: rgba(255, 255, 255, 0.07); }
html[data-mode="light"][data-theme="green"] .sidebar-user-name { color: #fff; }
html[data-mode="light"][data-theme="green"] .sidebar-user-role { color: var(--sidebar-accent); }
html[data-mode="light"][data-theme="green"] .sidebar-logout { color: #fff; border-color: rgba(255, 255, 255, 0.25); }

/* —— Top bar: white, one search field —— */
html[data-mode="light"][data-theme="green"] .app-topbar { background: #fff; border-bottom: 1px solid var(--border); box-shadow: none; }
html[data-mode="light"][data-theme="green"] .app-topbar-search input {
  background: #f1f3f9 !important; border: 1px solid transparent !important; border-radius: 999px !important; height: 42px;
}
html[data-mode="light"][data-theme="green"] .app-topbar-search input:focus { background: #fff !important; border-color: var(--bcg) !important; }

/* —— Hub header: module name (the requirement's wording) + tabs for the other pages of the hub —— */
.hub-head { margin: 0 0 var(--space-4, 16px); display: grid; gap: 10px; min-width: 0; }
.hub-module { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.hub-module-name { color: var(--bcg-accent, #8a6216); }
.hub-tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border);
  max-width: 100%;
}
.hub-tabs::-webkit-scrollbar { display: none; }
.hub-tab {
  flex-shrink: 0; padding: 10px 14px; font-size: 0.9rem; font-weight: 600; color: var(--muted); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 6px 6px 0 0;
}
.hub-tab:hover { color: var(--bcg); background: var(--bcg-soft); }
.hub-tab.is-active { color: var(--bcg); border-bottom-color: var(--bcg); }

/* —— Cards and panels: flat white, hairline border —— */
html[data-mode="light"][data-theme="green"] .panel:not(.viewer-panel),
html[data-mode="light"][data-theme="green"] .card,
html[data-mode="light"][data-theme="green"] .list-card,
html[data-mode="light"][data-theme="green"] .dest-card,
html[data-mode="light"][data-theme="green"] .meeting-tile {
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); background: #fff;
}
html[data-mode="light"][data-theme="green"] .dest-card:hover,
html[data-mode="light"][data-theme="green"] .list-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }

/* —— Buttons: solid navy primary, outlined secondary —— */
html[data-mode="light"][data-theme="green"] button:not(.icon-btn):not(.sidebar-logout):not(.link-button):not(.password-toggle):not(.nav-tab),
html[data-mode="light"][data-theme="green"] .button { border-radius: 10px; font-weight: 600; }
html[data-mode="light"][data-theme="green"] .button-secondary:not(.viewer-panel *),
html[data-mode="light"][data-theme="green"] button.button-secondary:not(.viewer-panel *) { background: #fff; color: var(--bcg); border: 1px solid var(--border-strong); }
html[data-mode="light"][data-theme="green"] .button-secondary:not(.viewer-panel *):hover { border-color: var(--bcg); }
html[data-mode="light"][data-theme="green"] input[type="text"],
html[data-mode="light"][data-theme="green"] input[type="search"],
html[data-mode="light"][data-theme="green"] input[type="password"],
html[data-mode="light"][data-theme="green"] input[type="date"],
html[data-mode="light"][data-theme="green"] select,
html[data-mode="light"][data-theme="green"] textarea { border-radius: 10px; border-color: var(--border-strong); }

/* —— Dashboard: greeting, then "Your next step", then the rest —— */
.home-greeting { margin: 0 0 var(--space-4, 16px); }
.home-greeting h1 { margin: 0 0 4px; }
.home-greeting p { margin: 0; color: var(--muted); }
.next-step {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 20px 22px; margin: 0 0 var(--space-5, 20px); border-radius: 12px; text-decoration: none;
  background: var(--bcg); color: #fff; box-shadow: var(--shadow-md);
}
.next-step:hover { background: var(--bcg-mid); }
.next-step-kicker { margin: 0 0 2px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #e0b65a; }
.next-step-title { margin: 0; font-size: 1.15rem; font-weight: 700; color: #fff; overflow-wrap: anywhere; }
.next-step-sub { margin: 2px 0 0; font-size: 0.88rem; color: rgba(255, 255, 255, 0.82); }
.next-step-count {
  min-width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 1.25rem;
  background: rgba(255, 255, 255, 0.14); color: #fff;
}
.next-step-go { font-weight: 700; white-space: nowrap; color: #fff; }
@media (max-width: 599px) {
  .next-step { grid-template-columns: auto minmax(0, 1fr); padding: 16px; }
  .next-step-go { grid-column: 1 / -1; justify-self: start; }
}

/* —— Unified Search / Ask bar: the Find hub tabs become one segmented switch above the input —— */
.hub-tabs--find { display: inline-flex; width: auto; max-width: 100%; gap: 4px; padding: 4px; border: 0; border-radius: 12px; background: #eceff7; }
.hub-tabs--find .hub-tab { margin: 0; border: 0; border-radius: 9px; padding: 8px 18px; }
.hub-tabs--find .hub-tab:hover { background: rgba(255, 255, 255, 0.6); }
.hub-tabs--find .hub-tab.is-active { background: #fff; color: var(--bcg); box-shadow: var(--shadow-sm); }
html[data-mode="dark"] .hub-tabs--find { background: rgba(255, 255, 255, 0.06); }
html[data-mode="dark"] .hub-tabs--find .hub-tab.is-active { background: rgba(255, 255, 255, 0.12); color: #fff; }
.find-switch { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: #eceff7; margin: 0 0 12px; }
.find-switch a {
  padding: 8px 16px; border-radius: 9px; font-weight: 650; font-size: 0.9rem; color: var(--muted); text-decoration: none;
}
.find-switch a[aria-current="page"] { background: #fff; color: var(--bcg); box-shadow: var(--shadow-sm); }

/* —— Admin lists: every admin page renders rows as .list-card; below 768 px they stack as full-width cards —— */
@media (max-width: 767px) {
  .list-card-top { flex-wrap: wrap; gap: 6px 10px; }
  .list-card-actions { flex-wrap: wrap; }
  .list-card-actions > * { flex: 1 1 auto; }
  .list-card-meta { overflow-wrap: anywhere; }
}

/* —— Document viewer: navy toolbar; on phones one row of zoom + download + "More" —— */
html[data-theme="green"] .viewer-toolbar { background: rgba(17, 24, 82, 0.97); }
html[data-theme="green"] .viewer-panel, html[data-theme="green"] .viewer-related-panel { background: #10142e; }
html[data-theme="green"] .viewer-pager,
html[data-theme="green"] .viewer-seal-footer { background: rgba(16, 20, 46, 0.97); }
.viewer-pager label, .viewer-goto label, .viewer-goto span { color: rgba(255, 255, 255, 0.85); }
.viewer-panel .viewer-hl-note { color: rgba(255, 255, 255, 0.85); font-size: 0.82rem; padding: 6px 12px; }
.viewer-extra { display: contents; }
.viewer-more { display: none; position: relative; }
.viewer-more > summary { list-style: none; cursor: pointer; }
.viewer-more > summary::-webkit-details-marker { display: none; }
.viewer-more-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 180px; display: grid; padding: 6px;
  background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.viewer-more-item { padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.viewer-more-item:hover { background: var(--bcg-soft); }
@media (max-width: 599px) {
  .hub-tabs--find { display: flex; width: 100%; }
  .hub-tabs--find .hub-tab { flex: 1 1 auto; padding: 8px 10px; text-align: center; }
}
@media (max-width: 600px) {
  .viewer-extra { display: none; }
  .viewer-more { display: block; margin-left: auto; }
  .viewer-controls { overflow: visible; justify-content: flex-start; flex-wrap: nowrap; }
  .viewer-download { margin-left: 0; }
  .viewer-back .viewer-back-label { display: none; }
  .viewer-panel .secure-note { display: none; }
}

/* —— Ask answers: rendered markdown —— */
.ask-answer .banner { display: block; }
.answer-text strong { font-weight: 700; color: var(--text); }
.answer-text ul, .answer-text ol { margin: 6px 0 6px 1.2rem; padding: 0; }
.answer-text p { margin: 0 0 8px; }

/* —— Chips —— */
.chip-gold { display: inline-block; background: #fbf3e2; color: #8a6216; border: 1px solid #ecd9ad; border-radius: 999px; padding: 2px 10px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.chair-review { border-left: 4px solid var(--bcg-gold) !important; }
.chair-review-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }

/* —— Cloud / offline mode badge (POC) —— */
.ai-mode-badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 12px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.ai-mode-badge.cloud { background: #eef0fa; color: #1d2a7e; border: 1px solid #cfd5ef; }
.ai-mode-badge.offline { background: #fbf3e2; color: #8a6216; border: 1px solid #ecd9ad; }
.ai-mode-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* —— Login: logo-blue brand panel, white form card —— */
html[data-mode="light"][data-theme="green"] body.auth-page { background: #f6f7fb; }
html[data-mode="light"][data-theme="green"] .login-brand-panel { background: #293a92; }
html[data-mode="light"][data-theme="green"] .auth-card h1 { color: var(--text); }
html[data-mode="light"][data-theme="green"] .auth-card .brand-splash strong { color: var(--bcg); }
html[data-mode="light"][data-theme="green"] #loginSubmit { background: var(--bcg); border-radius: 10px; }
html[data-mode="light"][data-theme="green"] #loginSubmit:hover { background: var(--bcg-mid); }
