/* ============================================================
   ODAS - Office Document Automation System
   Main Stylesheet
   ============================================================ */

/* --- CSS Variables (Light Mode) --- */
:root {
  --primary:        #003366;
  --primary-light:  #004080;
  --primary-dark:   #002244;
  --accent:         #8b0000;
  --saffron:        #FF9933;
  --sidebar-width:  260px;
  --sidebar-collapsed: 60px;
  --header-height:  58px;

  --bg:             #f0f2f5;
  --bg-card:        #ffffff;
  --bg-table-head:  #003366;
  --text:           #1a1a1a;
  --text-muted:     #6c757d;
  --border:         #c8cdd5;
  --border-dark:    #000000;
  --shadow:         rgba(0,0,0,0.08);
  --sidebar-bg:     #001f3f;
  --sidebar-text:   #c9d6e3;
  --sidebar-hover:  #00306b;
  --sidebar-active: #1a5276;
  --header-bg:      #003366;
  --header-text:    #ffffff;
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --bg:            #0f1117;
  --bg-card:       #1a1d27;
  --bg-table-head: #1a2744;
  --text:          #d0d6e0;
  --text-muted:    #8892a4;
  --border:        #2e3347;
  --border-dark:   #4a5568;
  --shadow:        rgba(0,0,0,0.3);
  --sidebar-bg:    #0d1117;
  --sidebar-text:  #a8b4c8;
  --sidebar-hover: #1a2744;
  --sidebar-active:#243566;
  --header-bg:     #0d1117;
  --header-text:   #d0d6e0;
}

/* --- Global Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans', 'Noto Sans Devanagari', 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  transition: background 0.3s ease, color 0.3s ease;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
a:hover { color: var(--primary); }

/* ============================================================
   PRELOADER
   ============================================================ */
#preloader {
  position: fixed;
  inset: 0;
  background: var(--primary-dark);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity 0.5s ease;
}
#preloader.fade-out { opacity: 0; pointer-events: none; }

.preloader-logo {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
}
.preloader-logo small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.7;
  margin-top: 4px;
}

.preloader-spinner {
  width: 56px;
  height: 56px;
  border: 5px solid rgba(255,255,255,0.15);
  border-top-color: var(--saffron);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.preloader-text {
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100%{opacity:.4} 50%{opacity:1} }

/* ============================================================
   LAYOUT WRAPPER
   ============================================================ */
#wrapper {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: width 0.28s ease, transform 0.28s ease;
  overflow: hidden;
  box-shadow: 2px 0 12px rgba(0,0,0,0.2);
}
#sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-brand {
  background: var(--primary-dark);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--header-height);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .brand-icon {
  font-size: 22px;
  color: var(--saffron);
  flex-shrink: 0;
}
.sidebar-brand .brand-text {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-brand .brand-text small {
  display: block;
  font-weight: 400;
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  margin-top: 2px;
}
#sidebar.collapsed .brand-text { display: none; }

/* Nav menu */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.nav-section-title {
  color: rgba(255,255,255,0.3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 14px 18px 4px;
  white-space: nowrap;
  overflow: hidden;
}
#sidebar.collapsed .nav-section-title { padding: 14px 0 4px; text-align: center; font-size: 7px; }

.sidebar-nav .nav-item { list-style: none; }

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
  border-left: 3px solid transparent;
  position: relative;
}
.sidebar-nav .nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
  border-left-color: var(--saffron);
}
.sidebar-nav .nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
  border-left-color: var(--saffron);
}
.sidebar-nav .nav-link .nav-icon {
  font-size: 17px;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}
.sidebar-nav .nav-link .nav-label { flex: 1; }
.sidebar-nav .nav-link .nav-arrow { font-size: 11px; transition: transform 0.25s; }
.sidebar-nav .nav-link[aria-expanded="true"] .nav-arrow { transform: rotate(90deg); }

#sidebar.collapsed .nav-label,
#sidebar.collapsed .nav-arrow { display: none; }
#sidebar.collapsed .sidebar-nav .nav-link { justify-content: center; padding: 12px 0; border-left: none; }

/* Submenu */
.sidebar-submenu {
  background: rgba(0,0,0,0.15);
  overflow: hidden;
}
.sidebar-submenu .nav-link {
  padding: 8px 18px 8px 46px;
  font-size: 13px;
  color: rgba(201,214,227,0.75);
}
.sidebar-submenu .nav-link:hover,
.sidebar-submenu .nav-link.active { color: #fff; background: rgba(255,255,255,0.06); }
#sidebar.collapsed .sidebar-submenu { display: none !important; }

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  white-space: nowrap;
  overflow: hidden;
  text-align: center;
}
#sidebar.collapsed .sidebar-footer { font-size: 9px; padding: 8px 4px; }

/* ============================================================
   HEADER
   ============================================================ */
#header {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--header-height);
  background: var(--header-bg);
  color: var(--header-text);
  z-index: 1030;
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: left 0.28s ease;
}
#header.sidebar-collapsed { left: var(--sidebar-collapsed); }

.header-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 20px;
  cursor: pointer;
  padding: 6px 10px 6px 0;
  line-height: 1;
  transition: color 0.2s;
}
.header-toggle:hover { color: #fff; }

.header-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.header-title small {
  display: block;
  font-size: 10.5px;
  font-weight: 400;
  opacity: 0.65;
  margin-top: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.header-btn:hover { background: rgba(255,255,255,0.2); }
.header-btn.dark-toggle { font-size: 16px; padding: 5px 8px; }

.header-user {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 4px 12px 4px 8px;
  cursor: pointer;
}
.header-user .avatar {
  width: 26px;
  height: 26px;
  background: var(--saffron);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
}
.header-user .uname { font-size: 12.5px; }

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
#page-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 24px;
  min-height: calc(100vh - var(--header-height));
  transition: margin-left 0.28s ease;
  background: var(--bg);
}
#page-content.sidebar-collapsed { margin-left: var(--sidebar-collapsed); }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.page-breadcrumb .bc-sep { font-size: 10px; }
.page-breadcrumb a { color: var(--primary); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 6px var(--shadow);
  transition: background 0.3s, border 0.3s;
}
.card-header-gov {
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 7px 7px 0 0;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-body { padding: 18px; }

/* Dashboard stat cards */
.stat-card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 6px var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px var(--shadow); }
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #e8f0fe; color: #1a3a6b; }
.stat-icon.green  { background: #e6f4ea; color: #1e7e34; }
.stat-icon.orange { background: #fff3e0; color: #e65100; }
.stat-icon.red    { background: #fce8e6; color: #8b0000; }
[data-theme="dark"] .stat-icon.blue   { background: #1a2744; color: #7da8e8; }
[data-theme="dark"] .stat-icon.green  { background: #0d2e1a; color: #68c98a; }
[data-theme="dark"] .stat-icon.orange { background: #2e1e0d; color: #f5a742; }
[data-theme="dark"] .stat-icon.red    { background: #2e0d0d; color: #e07070; }

.stat-info { flex: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; margin-bottom: 4px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-sub   { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   TABLES (Government Style)
   ============================================================ */
.table-gov {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--bg-card);
}
.table-gov th,
.table-gov td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  vertical-align: middle;
}
.table-gov thead th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.3px;
  text-align: center;
  border-color: var(--primary-dark);
  white-space: nowrap;
}
.table-gov tbody tr:hover { background: rgba(0,51,102,0.04); }
[data-theme="dark"] .table-gov tbody tr:hover { background: rgba(255,255,255,0.04); }
.table-gov tfoot td {
  background: #f0f4f8;
  font-weight: 700;
  border-top: 2px solid var(--primary);
}
[data-theme="dark"] .table-gov tfoot td { background: #1e2433; }
.table-gov .text-center { text-align: center; }
.table-gov .text-right  { text-align: right; }

/* Table actions in cells */
.table-actions { white-space: nowrap; }
.table-actions .btn { padding: 3px 8px; font-size: 12px; }

/* Dynamic row remove btn */
.btn-remove-row {
  background: none;
  border: none;
  color: #dc3545;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: transform 0.15s;
}
.btn-remove-row:hover { transform: scale(1.2); }

/* ============================================================
   FORMS (Government Style)
   ============================================================ */
.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
}
.form-section-header {
  background: var(--primary);
  color: #fff;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-section-header .section-badge {
  background: var(--saffron);
  color: var(--primary-dark);
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
}
.form-section-body { padding: 18px; }

.form-label { font-weight: 600; font-size: 12.5px; color: var(--text-muted); margin-bottom: 4px; }
.form-control, .form-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13.5px;
  border-radius: 5px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,51,102,0.12);
  background: var(--bg-card);
  color: var(--text);
}
.form-control[readonly] { background: #f8f9fa; color: var(--text-muted); }
[data-theme="dark"] .form-control[readonly] { background: #1a1d27; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-gov {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 5px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-gov:hover { background: var(--primary-light); color: #fff; transform: translateY(-1px); }
.btn-gov-accent { background: var(--accent); }
.btn-gov-accent:hover { background: #a00000; color: #fff; }
.btn-gov-success { background: #1e7e34; }
.btn-gov-success:hover { background: #155724; color: #fff; }
.btn-add-row {
  background: #1e7e34;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-add-row:hover { background: #155724; }
.btn-print {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 7px 18px;
  border-radius: 5px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.btn-print:hover { background: #a00000; color: #fff; }

/* ============================================================
   BADGE & STATUS
   ============================================================ */
.badge-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}
.badge-active   { background: #d4edda; color: #155724; }
.badge-pending  { background: #fff3cd; color: #856404; }
.badge-complete { background: #d1ecf1; color: #0c5460; }
[data-theme="dark"] .badge-active   { background: #1a3d22; color: #7ec894; }
[data-theme="dark"] .badge-pending  { background: #3d3010; color: #e0c060; }
[data-theme="dark"] .badge-complete { background: #0e2e33; color: #5ac8d8; }

/* ============================================================
   TOTALS ROW BAR
   ============================================================ */
.totals-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--primary-dark);
  border-radius: 6px;
  padding: 12px 18px;
  margin-top: 8px;
}
.totals-bar .total-item {
  flex: 1;
  min-width: 140px;
  text-align: center;
}
.totals-bar .total-label {
  font-size: 11.5px;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 3px;
}
.totals-bar .total-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--saffron);
}

/* ============================================================
   FOOTER
   ============================================================ */
#footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 12px 24px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.28s ease;
}
#footer.sidebar-collapsed { margin-left: var(--sidebar-collapsed); }

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-bar {
  position: relative;
}
.search-bar .bi-search {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}
.search-bar input {
  padding-left: 33px;
}

/* ============================================================
   ALERTS / TOAST
   ============================================================ */
#toast-container {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gov-toast {
  min-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  padding: 12px 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: slideIn 0.3s ease;
}
.gov-toast.success { border-left-color: #28a745; }
.gov-toast.error   { border-left-color: #dc3545; }
.gov-toast.warning { border-left-color: #ffc107; }
.gov-toast .toast-icon { font-size: 18px; margin-top: 1px; }
.gov-toast .toast-msg  { flex: 1; font-size: 13px; color: var(--text); }
.gov-toast .toast-close{ cursor: pointer; color: var(--text-muted); font-size: 16px; }
@keyframes slideIn { from{ opacity:0; transform: translateX(20px); } to{ opacity:1; transform: translateX(0); } }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #001f3f 0%, #003366 50%, #001f3f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 0;
  width: 440px;
  max-width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.login-card-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  padding: 28px 32px 22px;
  text-align: center;
  color: #fff;
  position: relative;
}
.login-card-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--saffron), #fff, #138808);
}
.login-logo {
  width: 68px;
  height: 68px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 32px;
  border: 2px solid rgba(255,255,255,0.3);
}
.login-system-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}
.login-subtitle {
  font-size: 11.5px;
  opacity: 0.7;
  letter-spacing: 0.5px;
}
.login-card-body { padding: 28px 32px; }
.login-card-body .form-label { font-size: 13px; font-weight: 600; color: #444; }
.login-card-body .form-control,
.login-card-body .form-select {
  border-radius: 6px;
  border: 1.5px solid #d0d5dd;
  padding: 10px 14px;
  font-size: 14px;
  color: #1a1a1a;
  background: #fff;
}
.login-card-body .form-control:focus,
.login-card-body .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,51,102,0.1);
}
.btn-login {
  background: var(--primary);
  color: #fff;
  border: none;
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  margin-top: 6px;
}
.btn-login:hover { background: var(--primary-light); transform: translateY(-1px); }
.login-footer {
  text-align: center;
  font-size: 11.5px;
  color: #888;
  padding: 14px 32px 20px;
  border-top: 1px solid #f0f0f0;
}

/* ============================================================
   PAGE HEADER STRIP
   ============================================================ */
.page-header-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header-strip h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.page-header-strip h4 small {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

/* ============================================================
   MASTER PAGES
   ============================================================ */
.master-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-content {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}
.modal-header {
  background: var(--primary);
  color: #fff;
  border-bottom: none;
  padding: 12px 18px;
}
.modal-header .btn-close {
  filter: invert(1);
}
.modal-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
  #sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
  }
  #sidebar.mobile-open { transform: translateX(0); }
  #header { left: 0 !important; }
  #page-content { margin-left: 0 !important; }
  #footer { margin-left: 0 !important; }
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
  }
}
@media (max-width: 576px) {
  #page-content { padding: 14px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 20px; }
}

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.text-gov      { color: var(--primary) !important; }
.bg-gov        { background: var(--primary) !important; color: #fff !important; }
.border-gov    { border-color: var(--primary) !important; }
.fw-600        { font-weight: 600; }
.fw-700        { font-weight: 700; }
.fs-13         { font-size: 13px; }
.fs-12         { font-size: 12px; }
.cursor-pointer { cursor: pointer; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 3px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

/* Sidebar user block */
.sidebar-user-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(0,0,0,0.15);
}
#sidebar.collapsed .sidebar-user-block { justify-content: center; padding: 8px 0; }
.sidebar-user-avatar {
  width: 30px;
  height: 30px;
  background: var(--saffron);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; }
.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 10.5px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
#sidebar.collapsed .sidebar-user-info { display: none; }

/* Toast icon colors (no inline style) */
.toast-icon-success { color: #28a745; }
.toast-icon-error   { color: #dc3545; }
.toast-icon-warning { color: #ffc107; }

/* Login input group */
.login-input-group { position: relative; }
.login-input-group .input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
  font-size: 15px;
  z-index: 5;
}
.login-input-group input,
.login-input-group select { padding-left: 38px !important; }
.pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #aaa;
  font-size: 15px;
  z-index: 5;
}

/* Preloader icon sizing */
.preloader-logo .bi { font-size: 40px; color: var(--saffron); }

/* Login decorative background circles */
.login-deco-circle-1 {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.05);
  top: -80px;
  right: -80px;
}
.login-deco-circle-2 {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.05);
  bottom: 60px;
  left: -60px;
}

/* Login subtitle gov label */
.login-gov-label { font-size: 10px; margin-top: 3px; display: block; }

/* Login error alert */
.login-error-alert { font-size: 13px; border-radius: 6px; }

/* Login footer copyright text */
.login-footer-copy { color: #bbb; }

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */
/* Main content column flex wrapper */
.main-column { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* Display contents passthrough */
.d-contents { display: contents; }

/* ============================================================
   STAT CARD VARIANTS
   ============================================================ */
/* Smaller font size for rupee stat values */
.stat-value-sm { font-size: 18px; }

/* ============================================================
   BUTTON VARIANTS
   ============================================================ */
/* Small card-header action button */
.btn-gov-sm { font-size: 12px; padding: 4px 12px; }

/* Full-padding block button (quick actions) */
.btn-gov-block { padding: 10px; }

/* Grey button (Masters) */
.btn-gov-grey { background: #555; color: #fff; }
.btn-gov-grey:hover { background: #444; color: #fff; }

/* ============================================================
   TABLE COLUMN WIDTHS
   ============================================================ */
.col-id   { width: 50px; }
.col-kram { width: 35px; }
.col-sign { width: 80px; }
.col-actions { width: 100px; white-space: nowrap; }
.col-xs { width: 60px; }
.col-sm { width: 90px; }
.col-md { width: 130px; }

/* ============================================================
   HEADER DROPDOWN
   ============================================================ */
.dropdown-chevron { font-size: 10px; }
.dropdown-menu-gov { font-size: 13px; }

/* ============================================================
   PRINT PAGES — SCREEN PREVIEW WRAPPER
   ============================================================ */
.doc-wrapper {
  background: #fff;
  max-width: 210mm;
  margin: 0 auto;
  padding: 20mm 20mm 20mm 25mm;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: #000;
  font-family: 'Times New Roman', 'Noto Serif Devanagari', serif;
  font-size: 13px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.doc-header {
  text-align: center;
  border-bottom: 3px double #000;
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.doc-header .dept-name {
  font-size: 16px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.doc-header .doc-title {
  font-size: 14px;
  font-weight: bold;
  margin-top: 4px;
  text-decoration: underline;
}
.doc-header .doc-subtitle { font-size: 12px; margin-top: 3px; }
.doc-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
}
.doc-meta-item { display: flex; flex-direction: column; gap: 4px; }
.doc-meta-row { display: flex; gap: 8px; font-size: 12px; }
.doc-meta-row strong { min-width: 120px; display: inline-block; }

/* Print document table */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  font-size: 12px;
}
.doc-table th,
.doc-table td { border: 1px solid #000; padding: 5px 7px; vertical-align: middle; }
.doc-table thead th {
  background: #d0d0d0;
  font-weight: bold;
  text-align: center;
  font-size: 12px;
  text-transform: uppercase;
}
.doc-table tfoot td { background: #e8e8e8; font-weight: bold; border-top: 2px solid #000; }
.doc-table .text-right  { text-align: right; }
.doc-table .text-center { text-align: center; }

/* Print doc signature block */
.doc-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  font-size: 12px;
}
.doc-sign-box { text-align: center; min-width: 120px; }
.doc-sign-box .sign-line { border-top: 1px solid #000; margin-bottom: 4px; padding-top: 4px; }

/* Print footer note */
.doc-footer-note { font-size: 11px; border-top: 1px solid #000; margin-top: 14px; padding-top: 6px; color: #333; }

/* ============================================================
   PRINT PAGE ACTION BAR (screen only)
   ============================================================ */
.print-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.print-project-select { max-width: 320px; }

/* ============================================================
   MASTER PAGE FORM INLINE CARD
   ============================================================ */
.master-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}
.master-form-card .form-section-header {
  margin: -20px -20px 16px -20px;
  border-radius: 7px 7px 0 0;
}
