/* ============================================================
   STATUTORY AUDIT FEE CALCULATOR – STYLE.CSS
   Office of the Assistant Registrar, Co-operative Societies, Shahapur
   Modern Multi-page Government Dashboard with Sidebar
   ============================================================ */

/* ─── CSS VARIABLES ─────────────────────────────────────────────── */
:root {
  --clr-primary:       #142a42;     /* deep government navy */
  --clr-primary-lt:    #1f558a;     /* royal accent blue */
  --clr-primary-hover: #296bb0;
  --clr-accent:        #d98218;     /* warm gold / saffron */
  --clr-accent-lt:     #fcd374;
  --clr-bg:            #f1f5f9;     /* sleek soft neutral bg */
  --clr-card:          #ffffff;
  --clr-border:        #cbd5e1;
  --clr-border-lt:     #e2e8f0;
  --clr-text:          #0f172a;     /* high contrast slate */
  --clr-text-muted:    #64748b;
  --clr-success:       #0d9488;     /* teal/emerald */
  --clr-success-bg:    #f0fdf4;
  --clr-error:         #dc2626;
  --clr-warning:       #d97706;
  --clr-highlight:     #f0f7ff;
  --sidebar-w:         280px;
  --topbar-h:          64px;
  --radius:            10px;
  --shadow-sm:         0 1px 3px rgba(15,23,42,0.06);
  --shadow:            0 4px 14px rgba(15,23,42,0.08);
  --shadow-lg:         0 10px 28px rgba(15,23,42,0.12);
  --font-main:         'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

/* ─── RESET ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--clr-bg);
  color: var(--clr-text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── APP SHELL LAYOUT ───────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ─── SIDEBAR ────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #102133 0%, #15273c 50%, #0d1927 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  box-shadow: 2px 0 16px rgba(0,0,0,0.18);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

/* Sidebar Branding */
.sb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.15);
}
.sb-emblem {
  width: 38px;
  height: auto;
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}
.sb-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #fff;
  line-height: 1.2;
}
.sb-sub {
  font-size: 0.72rem;
  color: var(--clr-accent-lt);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-top: 3px;
}

/* Sidebar Sections */
.sb-section {
  padding: 16px 14px 8px;
}
.sb-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #8da4be;
  font-weight: 700;
  margin-bottom: 10px;
  padding-left: 8px;
}

/* Quick Access Buttons */
.quick-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  color: #e2e8f0;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  font-family: inherit;
}
.quick-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.22);
  transform: translateX(3px);
  color: #fff;
}
.quick-btn.active {
  background: linear-gradient(90deg, rgba(37,99,167,0.45) 0%, rgba(37,99,167,0.2) 100%);
  border-color: var(--clr-accent-lt);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.qb-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}
.qb-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.qb-name {
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qb-sr {
  font-size: 0.7rem;
  color: #93b2d2;
  font-weight: 500;
}
.quick-btn.active .qb-sr {
  color: var(--clr-accent-lt);
}

/* Navigation Buttons */
.nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
  color: #cbd5e1;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
}
.nav-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  transform: translateX(3px);
}
.nav-btn.active {
  background: var(--clr-primary-lt);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(31,85,138,0.3);
}
.nb-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

/* Mobile Sidebar Close */
.sb-close {
  display: none;
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ─── MAIN PANEL ─────────────────────────────────────────────────── */
.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--clr-bg);
}

/* ─── TOPBAR ─────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: #ffffff;
  border-bottom: 1px solid var(--clr-border-lt);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.topbar-menu {
  display: none;
  background: none;
  border: 1px solid var(--clr-border);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--clr-primary);
}
.topbar-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.topbar-office {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--clr-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-sub {
  font-size: 0.74rem;
  color: var(--clr-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-print {
  background: var(--clr-primary);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.topbar-print:hover {
  background: var(--clr-primary-lt);
}

/* ─── MULTI-PAGE SYSTEM ──────────────────────────────────────────── */
.page {
  display: none;
  animation: pageFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.page.active {
  display: block;
}
@keyframes pageFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-inner {
  max-width: 1360px;
  width: 100%;
  margin: 20px auto;
  padding: 0 28px 48px;
  transition: max-width 0.2s ease;
}

/* ─── QUICK CALC HEROES ──────────────────────────────────────────── */
.qc-hero {
  border-radius: var(--radius);
  padding: 22px 28px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.qc-icon {
  font-size: 2.4rem;
  background: rgba(255,255,255,0.18);
  width: 64px;
  height: 64px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qc-hero h2 {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 4px;
}
.qc-hero p {
  font-size: 0.86rem;
  opacity: 0.9;
}
.qc-green  { background: linear-gradient(135deg, #0e5b38 0%, #15803d 100%); }
.qc-blue   { background: linear-gradient(135deg, #163659 0%, #1e5a96 100%); }
.qc-orange { background: linear-gradient(135deg, #9a3412 0%, #ea580c 100%); }
.qc-navy   { background: linear-gradient(135deg, #0f1f33 0%, #1a3c61 100%); }

/* ─── QUICK CALC GRID — RESPONSIVE TO MONITORS ───────────────────── */
.qc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 24px;
  align-items: stretch;
}

/* Equal-height form cards */
.qc-form-card {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  margin-bottom: 0 !important;
}
.qc-form-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 24px;
}

/* Stacked inputs container */
.qc-fields-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}
.qc-fields-wrap .form-group {
  min-width: 100%;
}

/* Informative guideline box inside Card 1 for visual balance */
.qc-guide-box {
  background: #f8fafc;
  border: 1px solid var(--clr-border-lt);
  border-left: 4px solid var(--clr-primary-lt);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 0.81rem;
  color: var(--clr-text-muted);
  line-height: 1.55;
  margin-top: auto;
}
.qc-guide-box strong {
  color: var(--clr-primary);
  display: block;
  font-size: 0.84rem;
  margin-bottom: 4px;
}

/* Full-width anchored calculate button */
.qc-btn-row {
  margin-top: auto;
  padding-top: 18px;
  margin-bottom: 0;
  text-align: center;
}
.qc-btn-row .btn-calculate {
  width: 100%;
  padding: 13px 20px;
}

/* ─── RATE BADGE DISPLAY ─────────────────────────────────────────── */
.qc-rate-badge {
  background: #f8fafc;
  border: 1px solid var(--clr-border-lt);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.qcr-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  color: var(--clr-text-muted);
}
.qcr-item strong {
  color: var(--clr-primary);
  font-weight: 600;
}
.qcr-item.cap {
  border-top: 1px dashed var(--clr-border);
  padding-top: 6px;
  margin-top: 2px;
  color: var(--clr-text);
}
.qcr-item.cap strong {
  color: var(--clr-accent);
  font-size: 0.92rem;
}

/* ─── CARDS ──────────────────────────────────────────────────────── */
.card {
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
  background: linear-gradient(90deg, var(--clr-primary) 0%, var(--clr-primary-lt) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
}
.card-num {
  background: var(--clr-accent);
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  flex-shrink: 0;
}
.card-header h3 { font-size: 1.0rem; font-weight: 600; flex: 1; }
.card-body { padding: 20px; }

/* Result header with buttons */
.result-header { flex-wrap: wrap; gap: 8px; }
.result-actions { display: flex; gap: 8px; margin-left: auto; }
.btn-view-gr, .btn-print {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.btn-view-gr:hover, .btn-print:hover { background: rgba(255,255,255,0.28); }

/* ─── FORM ELEMENTS ──────────────────────────────────────────────── */
.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.form-row:last-child { margin-bottom: 0; }
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 220px;
}
.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--clr-primary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
  border: 1.5px solid var(--clr-border);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 0.95rem;
  font-family: var(--font-main);
  color: var(--clr-text);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--clr-primary-lt);
  box-shadow: 0 0 0 3px rgba(37,99,167,0.12);
}
.form-group input.input-error { border-color: var(--clr-error); }
.error-msg {
  color: var(--clr-error);
  font-size: 0.78rem;
  font-weight: 500;
  margin-top: 2px;
}
.helper-text {
  font-size: 0.8rem;
  color: var(--clr-text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ─── SECTION 2 SOCIETY SELECTOR ────────────────────────────────── */
#section-society-type .card-body {
  padding: 20px 24px 16px;
}
.society-search-wrap {
  position: relative;
}
#societySearch {
  display: block;
  width: 100%;
  padding: 10px 36px 10px 0;
  font-size: 1rem;
  font-family: var(--font-main);
  color: var(--clr-text);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--clr-border);
  border-radius: 0;
  outline: none;
  transition: border-color 0.25s;
  caret-color: var(--clr-primary-lt);
}
#societySearch::placeholder {
  color: #94a8bc;
  font-size: 0.93rem;
}
#societySearch:focus {
  border-bottom-color: var(--clr-primary-lt);
}
.search-icon {
  position: absolute;
  right: 2px;
  top: 10px;
  color: var(--clr-text-muted);
  pointer-events: none;
  font-size: 0.95rem;
}
.search-underline {
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--clr-primary-lt);
  transition: width 0.3s ease;
}
#societySearch:focus ~ .search-underline { width: 100%; }
.search-hint {
  margin-top: 6px;
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Always-visible inline listbox */
.dropdown-list {
  position: static !important;
  display: block !important;
  margin-top: 10px;
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--clr-border);
  border-radius: 7px;
  height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
}
.dropdown-list::-webkit-scrollbar { width: 6px; }
.dropdown-list::-webkit-scrollbar-track { background: #f8fafc; border-radius: 4px; }
.dropdown-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.dropdown-list li {
  padding: 9px 14px 9px 12px;
  cursor: pointer;
  font-size: 0.88rem;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.4;
  transition: background 0.1s, color 0.1s;
  user-select: none;
}
.dropdown-list li:last-child { border-bottom: none; }
.dropdown-list li:hover {
  background: #f0f7ff;
  color: var(--clr-primary-lt);
}
.dropdown-list li.selected {
  background: var(--clr-primary);
  color: #fff;
}
.dropdown-list li.selected .sr-num {
  color: rgba(255,255,255,0.7) !important;
  opacity: 1 !important;
}
.dropdown-list li .sr-num {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--clr-text-muted);
  width: 24px;
  text-align: right;
  opacity: 0.55;
}
.dropdown-list li:hover .sr-num {
  opacity: 1;
  color: var(--clr-primary-lt);
}
.dropdown-list li .soc-name { flex: 1; }
.dropdown-list li em {
  color: var(--clr-accent);
  font-style: normal;
  font-weight: 700;
}
.dropdown-list li.dd-empty {
  color: #94a3b8;
  font-style: italic;
  cursor: default;
  justify-content: center;
  padding: 20px;
}

/* Inline selected confirmation */
.selected-line {
  display: none;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--clr-success);
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.selected-line.visible { display: flex; }
.selected-line .sel-name { font-weight: 600; color: var(--clr-text); }
.selected-line .sel-sr {
  font-size: 0.72rem;
  color: var(--clr-text-muted);
  background: #f1f5f9;
  padding: 1px 8px;
  border-radius: 10px;
}
.selected-badge { display: none !important; }

/* ─── RADIO / TOGGLE ─────────────────────────────────────────────── */
.toggle-row { display: flex; gap: 20px; align-items: center; margin-top: 4px; }
.radio-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.92rem; cursor: pointer; font-weight: 500;
}
.radio-label input[type="radio"] { accent-color: var(--clr-primary-lt); width: 16px; height: 16px; }

/* ─── LOCATION SELECTOR (Housing) ───────────────────────────────── */
.location-option {
  border: 1.5px solid var(--clr-border);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s;
  font-size: 0.88rem;
}
.location-option:hover { border-color: var(--clr-primary-lt); background: var(--clr-highlight); }
.location-option.selected {
  border-color: var(--clr-primary);
  background: var(--clr-highlight);
  font-weight: 600;
  color: var(--clr-primary);
}
.location-option input[type="radio"] { accent-color: var(--clr-primary); width: 16px; height: 16px; }
.location-rate {
  margin-left: auto;
  background: var(--clr-accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 12px;
}

/* ─── CALCULATE BUTTON ───────────────────────────────────────────── */
.calculate-row { text-align: center; margin: 8px 0 20px; }
.btn-calculate {
  background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-primary-lt) 100%);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 13px 42px;
  font-size: 1.02rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.4px;
  box-shadow: 0 4px 16px rgba(20,42,66,0.22);
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.btn-calculate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(20,42,66,0.3);
}
.btn-calculate:active { transform: translateY(0); }
.btn-calculate span { margin-right: 8px; }

/* ─── CALCULATION RESULT SHEET ───────────────────────────────────── */
.result-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
  margin-bottom: 20px;
  padding: 14px;
  background: var(--clr-highlight);
  border-radius: 6px;
  border: 1px solid var(--clr-border);
}
.info-row { display: flex; flex-direction: column; gap: 2px; }
.info-label { font-size: 0.72rem; color: var(--clr-text-muted); text-transform: uppercase; font-weight: 600; }
.info-value { font-size: 0.92rem; color: var(--clr-text); font-weight: 600; }

.calc-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 0.88rem;
}
.calc-table th {
  background: var(--clr-primary);
  color: #fff;
  padding: 9px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.calc-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}
.calc-table tr:nth-child(even) td { background: #f8fafc; }
.calc-table tr.subtotal td { background: #e0f2fe; font-weight: 600; }
.calc-table tr.ceiling td { background: #fef3c7; color: #b45309; font-weight: 600; }
.calc-table tr.total-row td {
  background: var(--clr-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}
.calc-table .amount { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }

/* Final fee summary box */
.final-fee-box {
  border: 2px solid var(--clr-primary);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}
.fee-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 18px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.92rem;
}
.fee-row:last-child { border-bottom: none; }
.fee-row.highlight { background: #f0f7ff; }
.fee-row.grand-total {
  background: var(--clr-primary);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 14px 18px;
}
.fee-row.grand-total .fee-amount { color: var(--clr-accent-lt); font-size: 1.15rem; }
.fee-label { font-weight: 600; color: var(--clr-text); }
.fee-amount {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--clr-primary);
  font-size: 0.98rem;
}
.fee-note { font-size: 0.75rem; color: var(--clr-text-muted); font-weight: 400; }

.liquidation-notice {
  background: #fffbeb;
  border: 1.5px solid var(--clr-accent);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #92400e;
}
.liquidation-notice .liq-icon { font-size: 1.3rem; }

/* Additional Charges */
.additional-block {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f1f5f9;
}
.additional-block:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.additional-block h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--clr-primary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.travel-calc-result { flex: 1; min-width: 200px; }
.travel-result-box {
  border: 1.5px solid var(--clr-border);
  border-radius: 6px;
  padding: 10px 14px;
  background: var(--clr-highlight);
}
.travel-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  padding: 4px 0;
  border-bottom: 1px solid #e2e8f0;
}
.travel-row:last-child { border-bottom: none; }
.travel-row.allowed { font-weight: 700; color: var(--clr-success); }
.gst-note { font-size: 0.78rem; color: var(--clr-text-muted); margin-top: 8px; font-style: italic; }
.align-center { align-items: flex-end; }
.gst-toggle-group .toggle-row { margin-top: 8px; }

/* ─── VARIANCE ANALYSIS BOX ──────────────────────────────────────── */
.variance-result-box {
  border: 1.5px solid var(--clr-border);
  border-radius: 6px;
  padding: 12px 14px;
  background: var(--clr-highlight);
}
.variance-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  padding: 4px 0;
  border-bottom: 1px solid #e2e8f0;
}
.variance-row:last-child {
  border-bottom: none;
}
.variance-badge {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.35;
}
.var-exact {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.var-over {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.var-under {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
.var-none {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* ─── QUICK CALC RESULT AREA ─────────────────────────────────────── */
.qc-result-area {
  animation: pageFade 0.25s ease;
  margin-top: 20px;
}

/* ─── GR RATE SCHEDULE TABLE ─────────────────────────────────────── */
.gr-schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.gr-schedule-table th {
  background: var(--clr-primary);
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.gr-schedule-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.gr-schedule-table tr:hover td {
  background: #f0f7ff;
}
.gr-schedule-table .badge-method {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-cumul  { background: #e0f2fe; color: #0369a1; }
.badge-range  { background: #fef3c7; color: #b45309; }
.badge-member { background: #f0fdf4; color: #15803d; }
.badge-sub    { background: #f3e8ff; color: #7e22ce; }

.btn-table-calc {
  background: var(--clr-primary-lt);
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-table-calc:hover {
  background: var(--clr-primary-hover);
}

/* ─── GR GENERAL NOTES STYLES ────────────────────────────────────── */
.notes-category-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.nc-tag {
  background: var(--clr-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.notes-category-title h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--clr-primary);
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}

.note-card {
  background: #fff;
  border: 1.5px solid var(--clr-border-lt);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.04);
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}
.note-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.note-card.highlight-card {
  border-color: var(--clr-accent);
  background: #fffdfa;
}

.note-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.note-pill {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}
.note-pill-amber {
  background: #fef3c7;
  color: #b45309;
}
.note-pill-blue {
  background: #ede9fe;
  color: #6d28d9;
}
.note-header h4 {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--clr-text);
  line-height: 1.3;
}

.note-body {
  font-size: 0.86rem;
  color: #334155;
  line-height: 1.5;
  flex: 1;
}
.note-body p + p {
  margin-top: 6px;
}
.note-formula {
  background: var(--clr-highlight);
  border: 1px dashed var(--clr-primary-lt);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 0.82rem;
  color: var(--clr-primary);
  line-height: 1.45;
}
.note-sub {
  font-size: 0.78rem;
  color: var(--clr-text-muted);
}

.nc-sr-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0;
}
.nc-sr-tags span {
  background: #fee2e2;
  color: #991b1b;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #fecaca;
}

/* ─── MODAL ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.6);
  backdrop-filter: blur(2px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-box {
  background: #fff;
  border-radius: 12px;
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
  overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: var(--clr-primary);
  color: #fff;
}
.modal-header h3 { font-size: 1.0rem; }
.modal-close {
  background: none; border: none; color: #fff;
  font-size: 1.3rem; cursor: pointer; line-height: 1;
  opacity: 0.8;
}
.modal-close:hover { opacity: 1; }
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.gr-table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
.gr-table th {
  background: var(--clr-primary); color: #fff;
  padding: 8px 10px; text-align: left; font-size: 0.78rem; text-transform: uppercase;
}
.gr-table td { padding: 8px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.gr-table tr:nth-child(even) td { background: #f8fafc; }
.gr-table .slab-row td { background: #f0f7ff; font-size: 0.84rem; }

/* ─── FOOTER ─────────────────────────────────────────────────────── */
.site-footer {
  background: var(--clr-primary);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 16px 24px;
  font-size: 0.78rem;
  line-height: 1.6;
  margin-top: auto;
}
.site-footer strong { color: rgba(255,255,255,0.95); }
.site-footer p + p { margin-top: 4px; }

/* ─── UTILITIES & OVERLAYS ───────────────────────────────────────── */
.hidden { display: none !important; }
.sb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 95;
  display: block;
}

/* ─── OFFICIAL REPORT PREVIEW MODAL & BUTTONS ───────────────────── */
.btn-preview,
.btn-topbar-preview {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.45);
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-preview:hover,
.btn-topbar-preview:hover {
  background: rgba(255,255,255,0.28);
  border-color: #fff;
  transform: translateY(-1px);
}
.btn-topbar-preview {
  background: #f1f5f9;
  border: 1.5px solid var(--clr-border);
  color: var(--clr-primary);
  font-size: 0.84rem;
}
.btn-topbar-preview:hover {
  background: #e2e8f0;
  border-color: var(--clr-primary-lt);
  color: var(--clr-primary-lt);
}

.report-modal-box {
  max-width: 860px !important;
  width: 95% !important;
  max-height: 92vh !important;
  border-radius: 12px !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35) !important;
}
.report-preview-body {
  padding: 24px 28px !important;
  background: #f8fafc !important;
  overflow-y: auto !important;
}
.btn-modal-print {
  background: var(--clr-accent);
  color: #fff;
  border: none;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-modal-print:hover {
  background: #b86e06;
}

/* ─── PRINT STYLES: STRICTLY ONLY THE OFFICIAL REPORT ────────────── */
.print-only { display: none; }

@media print {
  /* A4 Page Formatting */
  @page {
    size: A4 portrait;
    margin: 10mm 12mm 12mm 12mm;
  }

  /* Reset body */
  html, body {
    background: #fff !important;
    color: #000 !important;
    font-family: 'Segoe UI', Arial, sans-serif !important;
    font-size: 9.5pt !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  /* HIDE ALL INTERACTIVE WEB UI: app-shell, sidebar, pages, forms, inputs, modals */
  .app-shell,
  .sidebar,
  .main-panel,
  .topbar,
  .site-footer,
  .page,
  .page-inner,
  .card,
  .calculate-row,
  .modal-overlay,
  .sb-overlay,
  .search-wrap,
  .btn-calculate,
  .btn-print,
  .btn-view-gr,
  .btn-preview,
  .btn-topbar-preview {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  /* SHOW ONLY THE OFFICIAL PRINT SHEET */
  .print-only,
  #printSheet {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: #fff !important;
  }

  /* Official Government Document Styling */
  .official-report-card {
    border: 2px solid #0e2a47;
    border-radius: 6px;
    padding: 16px 20px;
    background: #fff;
    box-sizing: border-box;
    page-break-inside: avoid;
  }

  .print-memo-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    border-bottom: 2px solid #0e2a47;
    padding-bottom: 10px;
    margin-bottom: 12px;
    text-align: center;
  }
  .print-memo-emblem {
    width: 48px;
    height: auto;
    flex-shrink: 0;
  }
  .print-memo-titles h1 {
    font-size: 12.5pt;
    font-weight: 800;
    color: #0e2a47;
    margin: 0 0 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }
  .print-memo-titles h2 {
    font-size: 10.5pt;
    font-weight: 700;
    color: #1f558a;
    margin: 0 0 2px;
  }
  .print-memo-titles p {
    font-size: 7.5pt;
    color: #475569;
    margin: 0;
  }

  .print-meta-grid {
    display: flex;
    justify-content: space-between;
    font-size: 8pt;
    color: #334155;
    margin-bottom: 10px;
    border-bottom: 1px dashed #cbd5e1;
    padding-bottom: 6px;
  }

  .print-info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    font-size: 8.8pt;
  }
  .print-info-table td {
    padding: 5px 8px;
    border: 1px solid #94a3b8;
    vertical-align: middle;
  }
  .print-info-table td.lbl {
    background: #f1f5f9;
    font-weight: 700;
    color: #0e2a47;
    width: 25%;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .print-info-table td.val {
    color: #0f172a;
    font-weight: 600;
    width: 25%;
  }

  .print-calc-section {
    margin-bottom: 12px;
  }
  .print-section-title {
    background: #0e2a47;
    color: #fff;
    font-size: 8.5pt;
    font-weight: 700;
    padding: 4px 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .calc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 8.5pt;
    margin-bottom: 8px;
  }
  .calc-table th {
    background: #f1f5f9;
    color: #0e2a47;
    padding: 5px 8px;
    border: 1px solid #94a3b8;
    font-size: 7.8pt;
    font-weight: 700;
    text-transform: uppercase;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .calc-table td {
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
  }
  .calc-table tr.subtotal td {
    background: #f8fafc;
    font-weight: 700;
  }
  .calc-table tr.ceiling td {
    background: #fffbeb;
    font-weight: 700;
    color: #b45309;
  }
  .calc-table tr.total-row td {
    background: #0e2a47;
    color: #fff;
    font-weight: 700;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .calc-table .amount {
    text-align: right;
  }

  .print-verification-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    margin-bottom: 12px;
    font-size: 8.8pt;
    border: 1.5px solid #0e2a47;
  }
  .print-verification-table td {
    padding: 5px 8px;
    border: 1px solid #94a3b8;
  }
  .print-verification-table tr.hdr td {
    background: #f1f5f9;
    font-weight: 700;
    color: #0e2a47;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-cert-text {
    font-size: 8pt;
    color: #334155;
    font-style: italic;
    margin-top: 8px;
    margin-bottom: 16px;
    line-height: 1.4;
  }

  .print-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-top: 18px;
    padding-top: 6px;
  }
  .print-sig-box {
    border-top: 1.5px solid #0e2a47;
    padding-top: 4px;
    font-size: 7.8pt;
    color: #1e293b;
    line-height: 1.4;
  }
  .print-sig-box strong {
    color: #0e2a47;
    display: block;
    margin-bottom: 16px;
  }

  .print-disclaimer {
    font-size: 7pt;
    color: #64748b;
    border-top: 1px solid #cbd5e1;
    margin-top: 12px;
    padding-top: 6px;
    text-align: justify;
    line-height: 1.35;
  }
}


/* ─── RESPONSIVE (MONITORS, TABLETS & MOBILE) ───────────────────── */
@media (min-width: 1440px) {
  .page-inner {
    max-width: 1480px;
    padding: 0 36px 56px;
  }
  .qc-grid {
    gap: 30px;
  }
}

@media (max-width: 992px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: -290px;
    width: 280px;
    height: 100vh;
    transition: left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .sidebar.open {
    left: 0;
  }
  .sb-close {
    display: block;
  }
  .topbar-menu {
    display: inline-block;
  }
  .qc-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .page-inner {
    padding: 0 18px 36px;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 0 16px;
  }
  .topbar-office {
    font-size: 0.88rem;
  }
  .page-inner {
    padding: 0 12px 28px;
    margin: 16px auto;
  }
  .qc-hero {
    padding: 16px;
    gap: 12px;
  }
  .qc-icon {
    width: 48px;
    height: 48px;
    font-size: 1.8rem;
  }
  .qc-hero h2 {
    font-size: 1.15rem;
  }
  .form-row {
    flex-direction: column;
  }
  .form-group {
    min-width: 100%;
  }
  .result-info-grid {
    grid-template-columns: 1fr;
  }
  .btn-calculate {
    padding: 12px 28px;
    font-size: 0.95rem;
  }
}
