/* ============================================================
   MP Cabinet · Government-style theme
   Palette: deep navy + emblem saffron + ivory/cream parchment
   Typography: Noto Serif Devanagari / Mangal / Nirmala UI — all system fonts
   (Fonts are NOT loaded from an external CDN so the app works on firewalled
    gov networks where fonts.googleapis.com is unreachable.)
   ============================================================ */

:root {
  /* Palette — inspired by MP government letterhead. A deep indigo-navy
     that lets the crimson/gold emblem pop, with warm gold accents and a
     cream / ivory paper surface. */
  --navy: #0e244a;
  --navy-dark: #071832;
  --navy-deep: #041023;
  --navy-soft: #24467e;
  --gold: #d4a24c;              /* warm aureate gold */
  --gold-bright: #eec46a;
  --gold-dark: #a97a28;
  --saffron: #c8702c;
  --saffron-dark: #9a561f;
  --crimson: #7a1d1d;            /* complements the emblem red */
  --ink: #101828;
  --ink-soft: #344054;
  --muted: #667085;
  --line: #e5dcc3;               /* warm parchment hairline */
  --line-strong: #b5a985;
  --bg: #ebeae6;                 /* neutral off-white */
  --surface: #fffdf6;            /* ivory card */
  --surface-alt: #f5edd7;
  --danger: #9a2121;
  --danger-dark: #6d1717;
  --success: #156b3d;
  --hover: #efe5c8;
  --shadow: 0 1px 2px rgba(14,36,74,0.08), 0 2px 10px rgba(14,36,74,0.05);
  --shadow-lg: 0 8px 22px rgba(14,36,74,0.16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: Georgia, "Noto Serif Devanagari", "Mangal", "Nirmala UI", "Times New Roman", serif;
  color: var(--ink);
  background: var(--bg);
  height: 100%;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

[lang="hi"] body,
[lang="hi"] input,
[lang="hi"] textarea,
[lang="hi"] button {
  font-family: "Noto Serif Devanagari", "Mangal", "Nirmala UI", Georgia, serif;
}

a { color: var(--navy-soft); text-decoration: none; border-bottom: 1px dotted transparent; }
a:hover { border-bottom-color: var(--navy-soft); }

/* ---------- Top bar (masthead) ---------- */
.topbar {
  display: flex; align-items: stretch; justify-content: flex-start;
  padding: 0 8px;
  background:
    linear-gradient(180deg, #1b0409 0%, #2a0a12 55%, #1b0409 100%);
  color: #fff9e7;
  box-shadow: 0 2px 10px rgba(14,36,74,0.18);
  position: relative;
  min-height: 74px;
  border-top: 3px solid var(--gold);
  border-bottom: 1px solid rgba(212, 162, 76, 0.35);
  font-family: "Noto Serif Devanagari", "Mangal", Georgia, serif;
  width: 100%;
}
/* Bottom gold filigree stripe */
.topbar::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--gold-dark) 8%,
    var(--gold-bright) 50%,
    var(--gold-dark) 92%,
    transparent 100%);
}

.topbar .brand {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 24px 10px 22px;
  text-decoration: none !important;
  border: 0;
  border-right: 1px solid rgba(212, 162, 76, 0.18);
  position: relative;
}
.topbar .brand:hover { background: rgba(255,255,255,0.03); }

.topbar .emblem-img {
  width: 48px; height: 48px; flex-shrink: 0;
  border-radius: 50%;
  background: #f7efd8;
  padding: 2px;
  border: 2px solid var(--gold);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.3),
    0 2px 6px rgba(0,0,0,0.35);
}

.topbar .brand .title-block { line-height: 1.2; }
.topbar .brand .title-block .t1 {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.3px;
  color: #fff9e7;
  font-family: "Noto Serif Devanagari", Georgia, serif;
}
.topbar .brand .title-block .t2 {
  font-size: 11.5px;
  color: var(--gold-bright);
  letter-spacing: 0.6px;
  margin-top: 2px;
  font-family: "Noto Serif Devanagari", Georgia, serif;
  font-weight: 500;
}

.topbar nav {
  display: flex; gap: 0; flex: 1;
  padding-left: 18px;
  align-items: stretch;
}
.topbar nav a {
  display: flex; align-items: center;
  color: rgba(247, 239, 216, 0.74);
  padding: 0 22px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  border: 0 !important;
  border-bottom: 3px solid transparent !important;
  position: relative;
  transition: color 0.14s, background 0.14s, border-bottom-color 0.14s;
}
.topbar nav a:hover { color: #fff9e7; background: rgba(212, 162, 76, 0.08); }
.topbar nav a.active {
  color: #fff9e7;
  background: linear-gradient(180deg, rgba(212, 162, 76, 0.14) 0%, rgba(212, 162, 76, 0.04) 100%);
  border-bottom-color: var(--gold) !important;
}

.topbar .user {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px;
  font-size: 13px;
  color: var(--gold-bright);
  font-family: inherit;
}
.topbar .user #uname { letter-spacing: 0.4px; }
.topbar .user button {
  background: rgba(247, 239, 216, 0.06);
  color: #fff9e7;
  border: 1px solid rgba(212, 162, 76, 0.35);
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  border-radius: 2px;
  font-family: inherit;
}
.topbar .user button:hover {
  background: rgba(212, 162, 76, 0.16);
  border-color: var(--gold);
  color: #fff9e7;
}

/* ---------- Generic ---------- */
main { padding: 28px 32px; max-width: 1680px; margin: 0 auto; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 22px 26px;
  box-shadow: var(--shadow);
}
.card h2, .card h3 {
  font-family: "Noto Serif Devanagari", "Mangal", "Nirmala UI", Georgia, serif;
  font-weight: 700;
  color: var(--navy);
  margin-top: 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  letter-spacing: 0.2px;
}
.card h3 { font-size: 17px; }
.card h4 {
  font-family: "Noto Serif Devanagari", "Mangal", "Nirmala UI", Georgia, serif;
  font-weight: 600;
  color: var(--navy);
  margin-top: 0; margin-bottom: 10px;
  letter-spacing: 0.2px;
}

button, .btn {
  font: inherit;
  font-family: inherit;
  padding: 8px 16px;
  border-radius: 3px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--navy);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.12s;
}
button:hover { background: var(--hover); border-color: var(--navy-soft); }
button.primary, .btn.primary {
  background: var(--navy);
  border-color: var(--navy-dark);
  color: #fffdf7;
  font-weight: 600;
}
button.primary:hover { background: var(--navy-dark); border-color: var(--navy-dark); }
button.accent {
  background: var(--saffron);
  border-color: var(--saffron-dark);
  color: #fffdf7;
  font-weight: 600;
}
button.accent:hover { background: var(--saffron-dark); }
button.danger { background: var(--danger); border-color: var(--danger-dark); color: #fffdf7; }
button.danger:hover { background: var(--danger-dark); }
button.ghost { background: transparent; border-color: transparent; color: var(--navy); }
button.ghost:hover { background: var(--hover); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

input, select, textarea {
  font: inherit;
  font-family: Georgia, "Noto Serif Devanagari", "Mangal", "Nirmala UI", serif;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--surface);
  color: var(--ink);
  width: 100%;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy-soft);
  box-shadow: 0 0 0 2px rgba(30,58,101,0.12);
}
label {
  font-size: 12px;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: Georgia, "Noto Serif Devanagari", "Mangal", serif;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
th {
  background: var(--surface-alt);
  font-weight: 700;
  font-size: 11px;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 2px solid var(--line-strong);
  font-family: Georgia, "Noto Serif Devanagari", "Mangal", serif;
}
tbody tr:hover { background: #fcfaf1; }

.tag {
  display: inline-block; padding: 3px 10px; border-radius: 2px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase;
  border: 1px solid;
}
.tag.open { background: #e4f1e7; color: var(--success); border-color: #a3c9af; }
.tag.closed { background: #f3e3e3; color: var(--danger); border-color: #c79e9e; }

/* ---------- Login ---------- */
.login-wrap {
  max-width: 400px;
  margin: 80px auto;
  background: var(--surface);
  padding: 34px 32px;
  border-radius: 4px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--saffron);
  position: relative;
}
.login-wrap::before {
  content: "";
  position: absolute; top: -4px; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--saffron), #cfa04a, var(--saffron));
}
.login-wrap h2 {
  margin: 0;
  font-family: "Noto Serif Devanagari", serif;
  color: var(--navy);
  font-size: 22px;
  font-weight: 700;
}
.login-wrap .subtle { color: var(--muted); margin: 4px 0 24px; font-size: 13px; font-style: italic; }
.login-wrap label { margin-top: 14px; }
.login-wrap button { margin-top: 22px; width: 100%; padding: 11px; font-size: 14px; }
.login-wrap .err { color: var(--danger); font-size: 13px; margin-top: 12px; font-weight: 500; }

/* ---------- Cabinet split-screen ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(420px, 42%) 1fr;
  gap: 14px;
  height: calc(100vh - 68px);
  padding: 14px;
}
.pane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.pane > .pane-body { padding: 18px 20px; flex: 1; }

.toolbar {
  display: flex; gap: 8px; padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
  position: sticky; top: 0; z-index: 3;
  align-items: center;
}
.toolbar .spacer { flex: 1; }
.toolbar strong {
  color: var(--navy);
  font-family: "Noto Serif Devanagari", serif;
  font-weight: 700;
  font-size: 15px;
}

.status-row {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-left: 4px solid var(--saffron);
  border-radius: 3px;
  font-size: 13px;
}

.meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}

/* ---------- Upload ---------- */
.upload-zone {
  border: 2px dashed var(--line-strong);
  border-radius: 4px;
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  background: #fefcf3;
}
.upload-zone:hover { border-color: var(--navy-soft); background: #faf5e2; }
.upload-zone.drag { background: #ece4ca; border-color: var(--navy); color: var(--navy); }
.upload-zone input { display: none; }
.upload-zone .u-title {
  font-size: 15px;
  color: var(--navy);
  font-weight: 600;
  margin-bottom: 4px;
}

/* ---------- Decision cards ---------- */
.decision-card {
  border: 1px solid var(--line);
  border-left: 3px solid var(--saffron);
  border-radius: 3px;
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--surface);
}
.decision-card header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  gap: 8px;
}
.decision-card .num {
  display: inline-block;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--navy);
  color: #fffdf7;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 24px;
  margin-right: 8px;
}
.decision-card .dept { font-weight: 600; color: var(--navy); }
.decision-card .source { color: var(--muted); font-size: 12px; font-style: italic; }
.decision-card .body { padding: 12px 14px; }
.decision-card .field { margin-bottom: 10px; }
.decision-card .field label {
  font-size: 11px; color: var(--navy); font-weight: 700; letter-spacing: 0.6px;
  margin-bottom: 3px;
}
.decision-card .field .text {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  padding: 6px 0;
}
.decision-card .actions { display: flex; gap: 6px; }
.decision-card .actions button { padding: 4px 10px; font-size: 12px; }

.subtle { color: var(--muted); font-size: 12px; }

/* ---------- Word preview ---------- */
.docx-container {
  background: #e8e1cc;
  padding: 22px;
  flex: 1;
  overflow: auto;
}
.docx-container .docx-wrapper { background: transparent; }
.docx-container .docx-wrapper > section.docx {
  background: #fffdf7;
  box-shadow: 0 2px 12px rgba(10,35,66,0.14);
  margin: 0 auto 22px;
  padding: 60px 70px;
  border: 1px solid var(--line);
}

/* MD pre */
/* Rendered markdown (cabinet output.md + drawer OCR formatted) */
.md-preview, .ocr-page .ptext.md {
  flex: 1;
  padding: 30px 40px;
  font-family: "Noto Serif Devanagari", "Mangal", "Nirmala UI", Georgia, serif;
  font-size: 15px;
  line-height: 1.8;
  background: var(--surface);
  color: var(--ink);
  overflow: auto;
}
.md-preview h1, .ocr-page .ptext.md h1 {
  font-family: "Noto Serif Devanagari", Georgia, serif;
  font-size: 20px; color: var(--navy); font-weight: 700;
  border-bottom: 2px solid var(--saffron);
  padding-bottom: 10px; margin: 6px 0 22px;
}
.md-preview h2, .ocr-page .ptext.md h2 {
  font-family: "Noto Serif Devanagari", Georgia, serif;
  font-size: 17px; color: var(--navy); font-weight: 700;
  border-bottom: 1px solid var(--line); padding-bottom: 6px;
  margin: 22px 0 12px;
}
.md-preview h3, .ocr-page .ptext.md h3 {
  font-family: "Noto Serif Devanagari", Georgia, serif;
  font-size: 15px; color: var(--navy-soft); font-weight: 700;
  letter-spacing: 0.3px;
  margin: 16px 0 8px;
}
.md-preview p, .ocr-page .ptext.md p { margin: 0 0 10px; }
.md-preview strong, .ocr-page .ptext.md strong { color: var(--navy); font-weight: 700; }
.md-preview em, .ocr-page .ptext.md em { font-style: italic; color: var(--ink-soft); }
.md-preview ul, .md-preview ol, .ocr-page .ptext.md ul, .ocr-page .ptext.md ol {
  margin: 8px 0 14px; padding-left: 26px;
}
.md-preview li, .ocr-page .ptext.md li { margin: 4px 0; }
.md-preview code, .ocr-page .ptext.md code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--surface-alt); padding: 1px 5px; border-radius: 2px;
  font-size: 0.88em;
}
.md-preview hr, .ocr-page .ptext.md hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.md-preview blockquote, .ocr-page .ptext.md blockquote {
  border-left: 3px solid var(--saffron);
  padding: 6px 14px; margin: 10px 0;
  background: var(--surface-alt); color: var(--ink-soft);
}
.md-empty {
  margin: auto; color: var(--muted); font-style: italic; padding: 40px;
  text-align: center;
}

/* ---------- Side drawer (Precis viewer) ---------- */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(10,35,66,0.45);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(78vw, 1080px);
  background: var(--bg);
  box-shadow: -10px 0 24px rgba(10,35,66,0.2);
  z-index: 90;
  transform: translateX(100%);
  transition: transform 0.24s cubic-bezier(0.2,0.8,0.2,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  background: var(--navy);
  color: #fffdf7;
  border-bottom: 3px solid var(--saffron);
}
.drawer header .dtitle { flex: 1; font-weight: 700; font-size: 15px; }
.drawer header button {
  background: rgba(255,255,255,0.1);
  color: #fffdf7;
  border: 1px solid rgba(255,255,255,0.25);
}
.drawer header button:hover { background: rgba(255,255,255,0.2); }
.drawer-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  overflow: hidden;
}
.drawer-pane {
  background: var(--surface);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.drawer-pane header {
  background: var(--surface-alt);
  color: var(--navy);
  border-bottom: 1px solid var(--line);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px;
  padding: 10px 14px;
  font-weight: 700;
}
.drawer-pane .content { flex: 1; overflow: auto; }
.drawer-pane iframe { width: 100%; height: 100%; border: 0; background: #fff; }

.ocr-page {
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.7;
}
.ocr-page .plabel {
  font-size: 11px; color: var(--muted); font-weight: 600;
  letter-spacing: 0.6px; text-transform: uppercase;
  margin-bottom: 8px;
}
.ocr-page .ptext {
  white-space: pre-wrap;
  font-family: "Noto Serif Devanagari", serif;
  color: var(--ink);
}
.ocr-page.md-mode .ptext {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  background: #fbf6e8;
  padding: 10px;
  border-radius: 3px;
  border: 1px solid var(--line);
}

/* ---------- Hindi rich editor ---------- */
.he-wrap {
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface);
}
.he-toolbar {
  display: flex; gap: 2px; padding: 6px 8px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  align-items: center;
}
.he-toolbar .he-group {
  display: flex; gap: 1px;
  border-right: 1px solid var(--line);
  padding-right: 6px; margin-right: 4px;
}
.he-toolbar .he-group:last-child { border-right: 0; }
.he-toolbar button {
  padding: 5px 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  min-width: 28px;
  border-radius: 3px;
}
.he-toolbar button:hover { background: var(--hover); border-color: var(--line); }
.he-toolbar button.on { background: var(--navy); color: #fffdf7; border-color: var(--navy-dark); }
.he-toolbar select {
  width: auto; padding: 4px 6px; font-size: 12px; height: 28px;
}
.he-toolbar .lang-toggle {
  margin-left: auto;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
  background: var(--saffron);
  color: #fffdf7;
  border-color: var(--saffron-dark);
  padding: 5px 10px;
}
.he-toolbar .lang-toggle.en {
  background: var(--surface);
  color: var(--navy);
  border-color: var(--line-strong);
}
.he-editor {
  min-height: 120px;
  padding: 10px 14px;
  font-family: "Noto Serif Devanagari", "Mangal", "Nirmala UI", Georgia, serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  outline: none;
  overflow-y: auto;
  max-height: 360px;
}
.he-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  font-style: italic;
}
.he-editor p { margin: 0 0 10px 0; }
.he-suggest {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  max-width: 320px;
  z-index: 50;
  font-size: 14px;
  border-radius: 3px;
}
.he-suggest .opt {
  padding: 7px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.he-suggest .opt:last-child { border-bottom: 0; }
.he-suggest .opt.on { background: var(--navy); color: #fffdf7; }
.he-suggest .opt:hover { background: var(--hover); }
.he-suggest .opt.on:hover { background: var(--navy-dark); }

/* ---------- Documents (new grid) ---------- */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 10px;
}
.doc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--navy);
  border-radius: 3px;
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.14s;
}
.doc-card:hover { border-left-color: var(--saffron); box-shadow: var(--shadow); }
.doc-card .d1 {
  font-size: 16px;
  color: var(--navy);
  font-weight: 700;
  font-family: "Noto Serif Devanagari", serif;
}
.doc-card .d2 {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 8px;
  letter-spacing: 0.3px;
}
.doc-card .d3 {
  display: flex; gap: 14px;
  font-size: 12px;
  color: var(--ink-soft);
}
.doc-card .d3 span b { color: var(--navy); font-weight: 700; }

.doc-tree {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  overflow: hidden;
}
.doc-tree .doc-item {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  font-size: 14px;
  transition: background 0.1s;
}
.doc-tree .doc-item:last-child { border-bottom: 0; }
.doc-tree .doc-item:hover { background: var(--hover); }
.doc-tree .doc-item .ico { font-size: 18px; text-align: center; color: var(--navy); }
.doc-tree .doc-item .nm { font-weight: 500; color: var(--ink); }
.doc-tree .doc-item .nm.dir { color: var(--navy); font-weight: 600; cursor: pointer; }
.doc-tree .doc-item .meta { font-size: 12px; color: var(--muted); }
.doc-tree .doc-item .del {
  color: var(--danger);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 3px;
}
.doc-tree .doc-item .del:hover { background: #f3e3e3; border-color: #c79e9e; }

.breadcrumb {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 3px;
  display: flex; gap: 8px; align-items: center;
}
.breadcrumb a { color: var(--navy); font-weight: 500; }
.breadcrumb .sep { color: var(--line-strong); }

/* ---------- Attendees picker (3 tabs: CM / Ministers / Officers) ---------- */
.att-tabs {
  display: flex; gap: 2px; align-items: center;
  padding: 4px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 3px 3px 0 0;
  border-bottom: 0;
}
.att-tab {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.att-tab:hover { color: var(--navy); background: rgba(212, 162, 76, 0.08); }
.att-tab.on {
  color: var(--navy);
  background: var(--surface);
  border-bottom-color: var(--gold);
}
.att-tab .badge {
  font-size: 11px;
  background: var(--navy);
  color: var(--surface);
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: 6px;
  font-weight: 700;
}
.att-summary { font-size: 12px; padding-right: 8px; }
.att-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
  padding: 10px 12px;
  border-radius: 0 0 3px 3px;
  max-height: 320px;
  overflow-y: auto;
}
.att-actions {
  display: flex; gap: 6px; margin-bottom: 8px; align-items: center;
  padding: 8px 10px; background: var(--surface-alt);
  border: 1px solid var(--line); border-radius: 3px;
}
.att-actions button { padding: 5px 12px; font-size: 12px; }
.att-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 8px 10px;
  background: var(--surface);
}
.att-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 5px 4px;
  font-size: 13px;
  cursor: pointer;
  line-height: 1.45;
}
.att-row:hover { background: var(--hover); }
.att-row input { width: 15px; height: 15px; margin-top: 3px; flex-shrink: 0; }
.att-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Upload progress ---------- */
.uprog {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--saffron);
  border-radius: 3px;
  background: var(--surface-alt);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink);
}
.uprog-head {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; color: var(--navy);
  margin-bottom: 8px;
}
.uprog .spinner {
  width: 16px; height: 16px; flex-shrink: 0;
  border: 2px solid var(--line-strong);
  border-top-color: var(--saffron);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.uprog-row {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  gap: 8px; align-items: center;
  padding: 4px 0;
  border-top: 1px dashed var(--line);
  font-size: 12px;
}
.uprog-row:first-of-type { border-top: 0; }
.uprog-row .icon { text-align: center; font-size: 14px; }
.uprog-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uprog-row .status { color: var(--muted); font-style: italic; }
.uprog-row.ok .icon { color: var(--success); }
.uprog-row.ok .status { color: var(--success); font-style: normal; font-weight: 600; }
.uprog-row.err .icon { color: var(--danger); }
.uprog-row.err .status { color: var(--danger); font-style: normal; font-weight: 600; }
.uprog-row.running .icon {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--saffron);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.uprog-foot {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  display: flex; gap: 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; right: 20px; bottom: 20px;
  background: var(--navy);
  color: #fffdf7;
  padding: 10px 16px;
  border-left: 3px solid var(--saffron);
  border-radius: 2px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  z-index: 99;
  font-weight: 500;
}

details > summary {
  font-family: "Noto Serif Devanagari", "Mangal", "Nirmala UI", Georgia, serif;
  font-weight: 600;
  color: var(--navy);
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
  list-style: none;
  cursor: pointer;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.15s;
  color: var(--saffron);
}
details[open] > summary::before { transform: rotate(90deg); }
