/* ==========================================================================
   ระบบเผยแพร่เอกสาร ITA โรงพยาบาลแม่วงก์ — Official Clean Design System
   Color Palette matched to Mae Wong Hospital ITA Official Banner
   ========================================================================== */

:root {
  --brand-navy: #1E3F66;
  --brand-primary: #2F5B88;
  --brand-primary-hover: #24496E;
  --brand-accent: #0077C8;
  --brand-soft: #EDF4FB;
  --brand-border: #D6E3F0;

  --pdf-red: #C81E1E;
  --pdf-red-bg: #FEF2F2;
  --pdf-red-border: #FECACA;

  --link-blue: #0369A1;
  --link-blue-bg: #F0F9FF;

  --success: #0F766E;
  --success-bg: #F0FDFA;
  --warning: #B45309;
  --warning-bg: #FFFBEB;

  --bg-page: #F3F6FA;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F8FAFC;
  --text-main: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --border-light: #E2E8F0;
  --border-strong: #CBD5E1;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.14);

  --font-body: 'Sarabun', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Prompt', 'Sarabun', 'Noto Sans Thai', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-main);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-accent);
  text-decoration: none;
}

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

/* ---------------- Top Official Utility Bar ---------------- */
.topbar {
  background: var(--brand-navy);
  color: rgba(255, 255, 255, 0.92);
  font-size: 13.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.topbar-inner {
  max-width: 1460px;
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-org {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.topbar-org svg {
  opacity: 0.9;
  flex-shrink: 0;
}

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

.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.18s ease;
}

.topbar-link:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ---------------- Official Hero Header ---------------- */
.hero-header {
  background: linear-gradient(135deg, #2B547E 0%, #346291 55%, #1E3F66 100%);
  color: #fff;
  border-bottom: 4px solid #0077C8;
  position: relative;
}

.hero-inner {
  max-width: 1460px;
  margin: 0 auto;
  padding: 22px 20px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr);
  gap: 24px;
  align-items: center;
}

.hero-banner-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22);
  border: 2px solid rgba(255, 255, 255, 0.85);
  max-width: 680px;
}

.hero-banner-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.hero-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 4px 12px;
  border-radius: 999px;
  width: fit-content;
  font-weight: 600;
}

.hero-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
  color: #ffffff;
}

.hero-subtitle {
  margin: 0;
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.86);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  min-width: 112px;
}

.stat-pill-num {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
}

.stat-pill-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
}

/* ---------------- Fiscal Year Bar & Search Toolbar ---------------- */
.controls-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 30;
}

.controls-inner {
  max-width: 1460px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.year-tabs-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.year-tabs-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 4px;
}

.year-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: #fff;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.18s ease;
}

.year-tab:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--brand-soft);
}

.year-tab.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(47, 91, 136, 0.25);
}

.year-tab .badge-count {
  font-family: var(--font-body);
  font-size: 12px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
}

.year-tab.active .badge-count {
  background: rgba(255, 255, 255, 0.22);
}

.search-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
  min-width: 280px;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 390px;
  min-width: 220px;
}

.search-box input {
  width: 100%;
  padding: 8px 34px 8px 36px;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  font-size: 14.5px;
  color: var(--text-main);
  background: var(--bg-subtle);
  transition: all 0.18s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--brand-accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 119, 200, 0.14);
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: #E2E8F0;
  color: #475569;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.search-clear-btn.show {
  display: inline-flex;
}

.filter-pills {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.filter-pill {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill.active {
  background: #fff;
  color: var(--brand-navy);
  box-shadow: var(--shadow-sm);
}

.btn-outline-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-outline-sm:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--brand-soft);
}

/* ---------------- Main Split-Pane PDF Workspace ---------------- */
.workspace-container {
  max-width: 1460px;
  margin: 0 auto;
  padding: 20px 20px 44px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(440px, 0.95fr);
  gap: 22px;
  align-items: start;
}

.workspace-grid.viewer-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.workspace-grid.viewer-collapsed .pdf-pane {
  display: none;
}

/* ---------------- MOIT Accordion List ---------------- */
.moit-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.moit-list-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--brand-navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.moit-list-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.moit-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.moit-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.moit-card.open {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-md);
}

.moit-card.hidden-by-filter {
  display: none;
}

.moit-header {
  width: 100%;
  border: none;
  background: #fff;
  padding: 15px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.moit-header:hover {
  background: #F8FBFF;
}

.moit-card.open .moit-header {
  background: linear-gradient(90deg, #F0F6FC 0%, #FFFFFF 100%);
  border-bottom: 1px solid var(--border-light);
}

.moit-header-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.moit-badge {
  flex-shrink: 0;
  background: var(--brand-primary);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
  margin-top: 2px;
  min-width: 76px;
  text-align: center;
  white-space: nowrap;
}

.moit-title-text {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.5;
}

.moit-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-top: 2px;
}

.moit-count-chip {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  white-space: nowrap;
}

.moit-copy-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.moit-copy-btn:hover {
  background: var(--brand-soft);
  color: var(--brand-primary);
  border-color: var(--brand-border);
}

.moit-chevron {
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.moit-card.open .moit-chevron {
  transform: rotate(180deg);
  color: var(--brand-primary);
}

.moit-body {
  display: none;
  padding: 10px 14px 14px;
  background: #fff;
}

.moit-card.open .moit-body {
  display: block;
}

.moit-desc {
  margin: 4px 6px 12px;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border-left: 3px solid var(--brand-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ---------------- Document / Heading Items inside MOIT ---------------- */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.item-heading {
  margin-top: 10px;
  margin-bottom: 2px;
  padding: 8px 12px;
  background: #F1F5F9;
  border-left: 3px solid var(--brand-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--brand-navy);
  line-height: 1.5;
}

.item-heading:first-child {
  margin-top: 2px;
}

.item-heading.indent-1 {
  margin-left: 16px;
  background: #F8FAFC;
  border-left-color: #94A3B8;
  font-weight: 600;
  color: var(--text-secondary);
}

.doc-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: #fff;
  transition: all 0.16s ease;
  cursor: pointer;
}

.doc-row.indent-1 {
  margin-left: 14px;
}

.doc-row.indent-2 {
  margin-left: 28px;
}

.doc-row:hover {
  border-color: #93C5FD;
  background: #F8FBFF;
  transform: translateY(-1px);
}

.doc-row.active-preview {
  border-color: var(--brand-accent);
  background: #EFF6FF;
  box-shadow: 0 0 0 2px rgba(0, 119, 200, 0.18);
}

.doc-row.hidden-by-filter {
  display: none;
}

.doc-row-main {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  flex: 1;
  min-width: 0;
}

.doc-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  margin-top: 1px;
}

.doc-icon.pdf {
  background: var(--pdf-red-bg);
  color: var(--pdf-red);
  border: 1px solid var(--pdf-red-border);
}

.doc-icon.link {
  background: var(--link-blue-bg);
  color: var(--link-blue);
  border: 1px solid #BAE6FD;
}

.doc-text-wrap {
  flex: 1;
  min-width: 0;
}

.doc-title {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.55;
  word-break: break-word;
}

.doc-row.active-preview .doc-title {
  color: var(--brand-navy);
  font-weight: 600;
}

.doc-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-muted);
}

.doc-source-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #F1F5F9;
  color: #475569;
}

.doc-source-tag.local {
  background: var(--success-bg);
  color: var(--success);
}

.doc-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-top: 2px;
}

.btn-doc {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-doc:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--brand-soft);
}

.btn-doc.btn-view-pdf {
  border-color: var(--brand-primary);
  background: var(--brand-primary);
  color: #fff;
}

.btn-doc.btn-view-pdf:hover {
  background: var(--brand-primary-hover);
}

.btn-doc.copied {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--success);
}

.search-mark {
  background: #FEF08A;
  color: #0F172A;
  padding: 0 2px;
  border-radius: 3px;
}

/* ---------------- Sticky Right-Side PDF Viewer Pane ---------------- */
.pdf-pane {
  position: sticky;
  top: 76px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 96px);
  min-height: 560px;
}

.pdf-pane-header {
  background: var(--brand-navy);
  color: #fff;
  padding: 13px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pdf-pane-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.pdf-pane-breadcrumb {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
}

.pdf-pane-title {
  margin: 2px 0 0;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.45;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pdf-pane-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.pdf-nav-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pdf-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.pdf-tool-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.24);
}

.pdf-tool-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pdf-url-bar {
  background: #F8FAFC;
  border-bottom: 1px solid var(--border-light);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdf-url-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.pdf-url-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 5px 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--text-secondary);
  background: #fff;
}

.pdf-url-copy-btn {
  border: none;
  background: var(--brand-primary);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.pdf-url-copy-btn:hover {
  background: var(--brand-primary-hover);
}

.pdf-stage {
  flex: 1;
  position: relative;
  background: #525659;
  display: flex;
  flex-direction: column;
}

.pdf-frame {
  width: 100%;
  height: 100%;
  border: none;
  flex: 1;
  background: #525659;
}

.pdf-empty-state {
  flex: 1;
  background: linear-gradient(180deg, #F8FAFC 0%, #EFF5FB 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px 28px;
  color: var(--text-secondary);
}

.pdf-empty-icon {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--brand-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary);
  margin-bottom: 16px;
}

.pdf-empty-state h3 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 17px;
  color: var(--brand-navy);
}

.pdf-empty-state p {
  margin: 0;
  max-width: 340px;
  font-size: 14px;
  color: var(--text-muted);
}

.pdf-tips {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.pdf-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(248, 250, 252, 0.92);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 5;
  color: var(--brand-navy);
  font-weight: 600;
}

.pdf-loading-overlay.show {
  display: flex;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #CBD5E1;
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------------- Fullscreen PDF Modal ---------------- */
.pdf-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pdf-modal-backdrop.open {
  display: flex;
}

.pdf-modal-dialog {
  width: 100%;
  max-width: 1240px;
  height: 92vh;
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

/* ---------------- Empty Search / No Data ---------------- */
.empty-search-box {
  display: none;
  background: #fff;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-search-box.show {
  display: block;
}

/* ---------------- Toast Notification ---------------- */
.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #0F172A;
  color: #fff;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 400px;
  animation: toastIn 0.2s ease;
}

.toast.success {
  background: #0F766E;
}

.toast.error {
  background: #B91C1C;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Footer ---------------- */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--border-light);
  padding: 20px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.footer-inner {
  max-width: 1460px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------------- Responsive Breakpoints ---------------- */
@media (max-width: 1120px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .pdf-pane {
    display: none; /* On tablet/mobile, clicking a PDF opens the crisp Fullscreen Modal */
  }
  .desktop-only-toggle {
    display: none !important;
  }
}

@media (max-width: 680px) {
  .controls-inner {
    padding: 10px 14px;
  }
  .workspace-container {
    padding: 14px 12px 32px;
  }
  .doc-row {
    flex-direction: column;
    align-items: stretch;
  }
  .doc-row.indent-1 {
    margin-left: 6px;
  }
  .doc-row.indent-2 {
    margin-left: 12px;
  }
  .doc-actions {
    justify-content: flex-end;
    padding-top: 4px;
    border-top: 1px dashed var(--border-light);
  }
  .pdf-modal-backdrop {
    padding: 0;
  }
  .pdf-modal-dialog {
    height: 100vh;
    border-radius: 0;
  }
}
