@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700&display=swap');

:root {
  --navy:        #1B3A4B;
  --teal:        #1F6F5C;
  --teal-light:  #E8F5F1;
  --amber:       #D4870A;
  --amber-light: #FEF3DC;
  --red:         #C0392B;
  --red-light:   #FDEDEC;
  --text:        #1A1A2E;
  --text-2:      #5A6272;
  --border:      #E2E8ED;
  --bg:          #F7F9FB;
  --white:       #FFFFFF;
  --radius:      10px;
  --shadow:      0 1px 4px rgba(0,0,0,0.08);
}

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

body {
  font-family: 'Hind Siliguri', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Login ──────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 16px;
}

.login-wrap { width: 100%; max-width: 400px; }

.login-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  overflow: hidden;
}

.login-head {
  background: var(--navy);
  padding: 32px 32px 24px;
  text-align: center;
  color: var(--white);
}
.login-head h1 { font-size: 22px; font-weight: 700; letter-spacing: 0.3px; }
.login-head p  { font-size: 12px; opacity: 0.6; margin-top: 4px; }

.login-body { padding: 28px 32px 32px; }

/* ── Forms ──────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--teal); }

.form-group textarea { resize: vertical; min-height: 72px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary  { background: var(--teal); color: var(--white); }
.btn-danger   { background: var(--red-light); color: var(--red); border-color: #f5c6c2; }
.btn-outline  { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-amber    { background: var(--amber-light); color: var(--amber); border-color: #f0d5a0; }
.btn-navy     { background: var(--navy); color: var(--white); }
.btn-full     { width: 100%; padding: 11px; font-size: 15px; }
.btn-sm       { padding: 5px 12px; font-size: 12px; }

/* ── Alerts ──────────────────────────────────────── */
.alert {
  padding: 11px 15px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
}
.alert-error   { background: var(--red-light);   color: var(--red);   border: 1px solid #f5c6c2; }
.alert-success { background: var(--teal-light);  color: var(--teal);  border: 1px solid #b8dfd5; }
.alert-warning { background: var(--amber-light); color: var(--amber); border: 1px solid #f0d5a0; }
.alert-info    { background: #EEF2FF; color: #3730A3; border: 1px solid #c7d2fe; }

/* ── Badges ──────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.badge-teal   { background: var(--teal-light);  color: var(--teal); }
.badge-red    { background: var(--red-light);   color: var(--red); }
.badge-amber  { background: var(--amber-light); color: var(--amber); }
.badge-purple { background: #EDE7F6; color: #6A1B9A; }
.badge-gray   { background: #F4F6F8; color: var(--text-2); }
.badge-navy   { background: rgba(27,58,75,0.12); color: var(--navy); }

/* ── App Layout ──────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 230px;
  background: var(--navy);
  color: var(--white);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.2s;
}

.sidebar-brand {
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand-logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.sidebar-brand-text h2 { font-size: 14px; font-weight: 700; }
.sidebar-brand-text p  { font-size: 10px; opacity: 0.45; margin-top: 1px; }

.sidebar-nav { padding: 8px 0; flex: 1; }

.nav-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.35;
  padding: 14px 18px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: rgba(255,255,255,0.68);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.12s, color 0.12s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: var(--white); text-decoration: none; }
.nav-item.active {
  background: rgba(31,111,92,0.28);
  color: var(--white);
  border-left-color: var(--teal);
  font-weight: 600;
}
.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  color: #fff;
  line-height: 1;
}

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.85);
  min-width: 22px;
  text-align: center;
}
.nav-badge-admin {
  background: rgba(212,135,10,0.35);
  color: #FFD580;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}
.sidebar-footer strong { color: rgba(255,255,255,0.75); display: block; font-size: 13px; }

/* Main */
.main-wrap { margin-left: 230px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.topbar-title { font-size: 15px; font-weight: 700; color: var(--navy); }
.topbar-right { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--text-2); }
.topbar-right a { color: var(--text-2); }
.topbar-right a:hover { color: var(--red); }

.page-body { padding: 24px; flex: 1; }

/* ── Cards ───────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-head h3 { font-size: 14px; font-weight: 700; color: var(--navy); }
.card-body    { padding: 18px; }

/* ── Stat Grid ───────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat-label { font-size: 11px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 30px; font-weight: 700; color: var(--navy); margin-top: 6px; line-height: 1; }
.stat-sub   { font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* ── Tables ──────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead tr { background: var(--navy); }
thead th {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  text-align: left;
  white-space: nowrap;
}
thead th:first-child { border-radius: 0; }

tbody tr { transition: background 0.1s; }
tbody tr:nth-child(even) { background: #F4F6F8; }
tbody tr:hover { background: var(--teal-light); }

tbody td {
  padding: 9px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tfoot td {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  border-top: 2px solid var(--border);
  background: #F8FAFB;
}

/* ── Modal ───────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 440px;
  padding: 24px;
  margin: 16px;
}
.modal h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: var(--navy); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ── Utilities ───────────────────────────────────── */
.flex          { display: flex; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.gap-8         { gap: 8px; }
.gap-12        { gap: 12px; }
.mt-4          { margin-top: 4px; }
.mt-12         { margin-top: 12px; }
.mt-16         { margin-top: 16px; }
.mb-16         { margin-bottom: 16px; }
.text-sm       { font-size: 12px; }
.text-muted    { color: var(--text-2); }
.text-danger   { color: var(--red); }
.text-success  { color: var(--teal); }
.text-right    { text-align: right; }
.fw-bold       { font-weight: 700; }
.locked-btn    { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.form-hint     { display: block; font-size: 11px; color: var(--text-2); margin-top: 4px; }

/* ── Pagination ──────────────────────────────────── */
.pagination    { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ── Footer Copyright ────────────────────────────── */
.footer-bar {
  text-align: center;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
  background: var(--white);
  margin-top: 8px;
}

/* ── Progress bar ────────────────────────────────── */
.progress-wrap { background: var(--border); border-radius: 4px; height: 6px; overflow: hidden; }
.progress-bar  { height: 100%; border-radius: 4px; transition: width .4s; }

/* ── Toggle Switch ───────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row-label { font-size: 13px; color: var(--text); }

.toggle {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.18s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: transform 0.18s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle input:checked + .toggle-slider { background: var(--teal); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .page-body { padding: 14px; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .login-body { padding: 20px; }
}
