/* ============================================================
   R&B File Management System - Design System
   Roads & Buildings Department, Government of Gujarat
   Premium Light Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- CSS Variables / Design Tokens --- */
:root {
  --primary-900: #0f1d2f;
  --primary-800: #1a2e4a;
  --primary-700: #1d4ed8;
  --primary-600: #2563eb;
  --primary-500: #3b82f6;
  --primary-400: #60a5fa;
  --primary-300: #93bbfd;
  --primary-200: #bfdbfe;
  --primary-100: #dbeafe;
  --primary-50: #eff6ff;

  --gray-900: #0f172a;
  --gray-800: #1e293b;
  --gray-700: #334155;
  --gray-600: #475569;
  --gray-500: #64748b;
  --gray-400: #94a3b8;
  --gray-300: #cbd5e1;
  --gray-200: #e2e8f0;
  --gray-100: #f1f5f9;
  --gray-50: #f8fafc;

  --success-700: #15803d;
  --success-800: #166534;
  --success-600: #16a34a;
  --success-500: #22c55e;
  --success-100: #dcfce7;
  --success-50: #f0fdf4;

  --warning-700: #a16207;
  --warning-800: #854d0e;
  --warning-600: #d97706;
  --warning-900: #713f12;
  --warning-500: #f59e0b;
  --warning-100: #fef3c7;
  --warning-50: #fffbeb;

  --danger-700: #b91c1c;
  --danger-600: #dc2626;
  --danger-500: #ef4444;
  --danger-100: #fee2e2;
  --danger-50: #fef2f2;

  --info-600: #0284c7;
  --info-700: #0369a1;
  --info-500: #0ea5e9;
  --info-100: #e0f2fe;

  --orange-600: #ea580c;
  --orange-700: #c2410c;
  --orange-100: #ffedd5;

  --white: #ffffff;
  --body-bg: #f1f5f9;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --card-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --card-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);

  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: all 0.2s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: var(--font-family);
  background: var(--body-bg);
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a { color: var(--primary-600); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-700); }

img { max-width: 100%; display: block; }

/* --- Typography --- */
h1 { font-size: 1.875rem; font-weight: 700; color: var(--gray-900); line-height: 1.3; }
h2 { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); line-height: 1.35; }
h3 { font-size: 1.25rem; font-weight: 600; color: var(--gray-800); line-height: 1.4; }
h4 { font-size: 1.1rem; font-weight: 600; color: var(--gray-800); line-height: 1.4; }
h5 { font-size: 1rem; font-weight: 600; color: var(--gray-700); }
.text-sm { font-size: 0.857rem; }
.text-xs { font-size: 0.786rem; }
.text-lg { font-size: 1.143rem; }
.text-muted { color: var(--gray-600); }
.text-primary { color: var(--primary-600); }
.text-success { color: var(--success-600); }
.text-warning { color: var(--warning-600); }
.text-danger { color: var(--danger-600); }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.uppercase { text-transform: uppercase; letter-spacing: 0.05em; }

/* --- Layout --- */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  padding: 24px 32px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.container { max-width: 1400px; margin: 0 auto; padding: 0 32px; width: 100%; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 20px; }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.grid-sidebar { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
.grid-sidebar-left { display: grid; grid-template-columns: 320px 1fr; gap: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* --- Header / Navbar --- */
.navbar {
  background: var(--primary-900);
  color: var(--white);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.navbar-light {
  background: var(--white);
  color: var(--gray-800);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.navbar .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
}

.navbar .logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary-600);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.navbar-light .logo .logo-icon {
  background: var(--primary-100);
  color: var(--primary-700);
}

.navbar .logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.navbar .logo-text .dept-name { font-size: 0.95rem; font-weight: 700; }
.navbar .logo-text .dept-sub { font-size: 0.7rem; font-weight: 400; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.04em; }

.navbar-light .logo-text .dept-name { color: var(--gray-900); }
.navbar-light .logo-text .dept-sub { color: var(--gray-500); }

.navbar-search {
  flex: 1;
  max-width: 420px;
  margin: 0 32px;
  position: relative;
}

.navbar-search input {
  width: 100%;
  height: 38px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-full);
  padding: 0 16px 0 40px;
  background: rgba(255,255,255,0.08);
  color: var(--white);
  font-size: 0.857rem;
  font-family: var(--font-family);
  transition: var(--transition);
}

.navbar-search input::placeholder { color: rgba(255,255,255,0.45); }
.navbar-search input:focus { outline: none; background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.3); }

.navbar-light .navbar-search input {
  background: var(--gray-100);
  border-color: var(--gray-200);
  color: var(--gray-800);
}
.navbar-light .navbar-search input::placeholder { color: var(--gray-500); }
.navbar-light .navbar-search input:focus { border-color: var(--primary-400); background: var(--white); }

.navbar-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  font-size: 0.9rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  color: rgba(255,255,255,0.7);
  font-size: 0.857rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: var(--transition);
}
.nav-links a:hover { color: var(--white); background: rgba(255,255,255,0.08); }
.nav-links a.active { color: var(--white); background: rgba(255,255,255,0.12); font-weight: 600; }

.navbar-light .nav-links a { color: var(--gray-600); }
.navbar-light .nav-links a:hover { color: var(--gray-900); background: var(--gray-100); }
.navbar-light .nav-links a.active { color: var(--primary-600); background: var(--primary-50); border-bottom: 2px solid var(--primary-600); }

.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.navbar-right .notif-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  position: relative;
  font-size: 1rem;
  transition: var(--transition);
}
.navbar-right .notif-btn:hover { background: rgba(255,255,255,0.14); color: var(--white); }

.navbar-light .navbar-right .notif-btn {
  background: var(--gray-100);
  color: var(--gray-500);
}
.navbar-light .navbar-right .notif-btn:hover { background: var(--gray-200); color: var(--gray-700); }

.notif-btn .notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--danger-500);
  border-radius: 50%;
  border: 2px solid var(--primary-900);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.12);
}

.navbar-light .user-profile { border-left-color: var(--gray-200); }

.user-profile .user-info { text-align: right; line-height: 1.3; }
.user-profile .user-name { font-size: 0.857rem; font-weight: 600; }
.user-profile .user-role { font-size: 0.714rem; opacity: 0.6; }
.navbar-light .user-profile .user-name { color: var(--gray-800); }
.navbar-light .user-profile .user-role { color: var(--gray-500); }

.user-profile .avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.857rem;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.2);
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.857rem;
  color: var(--gray-500);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--primary-600); font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--gray-600); }

/* --- Page Header --- */
.page-header {
  margin-bottom: 24px;
}

.page-header .subtitle {
  font-size: 0.857rem;
  color: var(--gray-600);
  margin-top: 4px;
}

.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

/* --- Sub Header / Info Bar --- */
.sub-header {
  background: var(--primary-800);
  color: var(--white);
  padding: 12px 28px;
  font-size: 0.857rem;
  display: flex;
  align-items: center;
  gap: 16px;
}

.sub-header .label { font-weight: 600; }
.sub-header .tag {
  background: rgba(255,255,255,0.12);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.786rem;
  font-weight: 500;
}

/* --- Cards --- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 { font-size: 1rem; margin: 0; }
.card-header h4 { font-size: 0.929rem; margin: 0; }

.card-body { padding: 20px; }
.card-body-compact { padding: 16px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--gray-100); }

/* --- Stat Cards / KPI Tiles --- */
.stat-card {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--card-shadow-md); transform: translateY(-1px); }

.stat-card .stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.2;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-card .stat-change {
  font-size: 0.786rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.stat-change.up { color: var(--success-700); background: var(--success-50); }
.stat-change.down { color: var(--danger-700); background: var(--danger-50); }

.stat-card .stat-sub {
  font-size: 0.786rem;
  color: var(--gray-500);
}

.stat-card .stat-icon {
  font-size: 1.1rem;
  margin-left: auto;
}

.stat-card.accent-blue { border-left: 4px solid var(--primary-600); }
.stat-card.accent-green { border-left: 4px solid var(--success-600); }
.stat-card.accent-amber { border-left: 4px solid var(--warning-500); }
.stat-card.accent-red { border-left: 4px solid var(--danger-500); }
.stat-card.accent-orange { border-left: 4px solid var(--orange-600); }

.stat-card.danger-bg { background: #fef8f8; border-color: #fde2e2; }
.stat-card.danger-bg .stat-value { color: var(--danger-600); }
.stat-card.danger-bg .stat-label { color: var(--danger-600); }

/* --- Badges & Tags --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.714rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge-blue { background: var(--primary-100); color: var(--primary-700); }
.badge-green { background: var(--success-100); color: var(--success-700); }
.badge-amber { background: var(--warning-100); color: var(--warning-800); }
.badge-red { background: var(--danger-100); color: var(--danger-700); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-orange { background: var(--orange-100); color: var(--orange-700); }

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.badge-dot.green { background: var(--success-500); }
.badge-dot.amber { background: var(--warning-500); }
.badge-dot.red { background: var(--danger-500); }
.badge-dot.blue { background: var(--primary-500); }
.badge-dot.gray { background: var(--gray-400); }

.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.714rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.priority-critical { background: var(--danger-600); color: var(--white); }
.priority-high { background: var(--orange-700); color: var(--white); }
.priority-normal { background: var(--primary-100); color: var(--primary-700); }
.priority-low { background: var(--gray-100); color: var(--gray-600); }
.priority-urgent { background: var(--danger-700); color: var(--white); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.786rem;
  font-weight: 600;
}
.status-active { background: var(--success-100); color: var(--success-700); }
.status-processing { background: var(--primary-100); color: var(--primary-700); }
.status-returned { background: var(--warning-100); color: var(--warning-800); }
.status-approved { background: var(--success-100); color: var(--success-700); }
.status-pending { background: var(--warning-100); color: var(--warning-800); }
.status-in-progress { background: var(--info-100); color: var(--info-700); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 20px;
  font-family: var(--font-family);
  font-size: 0.857rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}

.btn-primary { background: var(--primary-600); color: var(--white); }
.btn-primary:hover { background: var(--primary-700); box-shadow: 0 2px 8px rgba(37,99,235,0.3); }

.btn-success { background: var(--success-700); color: var(--white); }
.btn-success:hover { background: var(--success-800); }

.btn-danger { background: var(--danger-600); color: var(--white); }
.btn-danger:hover { background: var(--danger-700); }

.btn-warning { background: var(--warning-500); color: var(--white); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
}
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-400); }

.btn-outline-primary {
  background: transparent;
  border: 1px solid var(--primary-300);
  color: var(--primary-600);
}
.btn-outline-primary:hover { background: var(--primary-50); }

.btn-ghost { background: transparent; color: var(--gray-600); padding: 8px 12px; }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-800); }

.btn-sm { padding: 6px 14px; font-size: 0.786rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius); }

/* --- Tables --- */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.857rem;
}

table thead th {
  background: var(--gray-50);
  color: var(--gray-500);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}

table tbody tr:hover { background: var(--gray-50); }
table tbody tr:last-child td { border-bottom: none; }

.table-actions {
  display: flex;
  gap: 6px;
}

/* --- Forms --- */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 0.786rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-family: var(--font-family);
  font-size: 0.929rem;
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary-500); box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
.form-control::placeholder { color: var(--gray-500); }

.form-control-icon {
  position: relative;
}
.form-control-icon .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
}
.form-control-icon input { padding-left: 40px; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

textarea.form-control { height: auto; padding: 12px 14px; resize: vertical; min-height: 100px; }

.form-hint { font-size: 0.75rem; color: var(--gray-500); margin-top: 4px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.radio-group, .checkbox-group {
  display: flex;
  gap: 20px;
  align-items: center;
}

.radio-group label, .checkbox-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.857rem;
  cursor: pointer;
  color: var(--gray-700);
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 24px;
}

.tabs .tab {
  padding: 10px 20px;
  font-size: 0.857rem;
  font-weight: 500;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.tabs .tab:hover { color: var(--gray-700); }
.tabs .tab.active { color: var(--primary-600); border-bottom-color: var(--primary-600); font-weight: 600; }

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  font-size: 0.857rem;
  color: var(--gray-500);
}

.pagination .pages {
  display: flex;
  gap: 4px;
}

.pagination .page-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  color: var(--gray-600);
  font-size: 0.857rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--white);
  transition: var(--transition);
  text-decoration: none;
}
.page-btn:hover { background: var(--gray-50); border-color: var(--gray-300); color: var(--gray-700); }
.page-btn.active { background: var(--primary-600); color: var(--white); border-color: var(--primary-600); }

/* --- Alert Boxes --- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.857rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}
.alert-info { background: var(--info-100); color: var(--info-700); border: 1px solid #bae6fd; }
.alert-warning { background: var(--warning-50); color: var(--warning-700); border: 1px solid #fde68a; }
.alert-danger { background: var(--danger-50); color: var(--danger-700); border: 1px solid #fecaca; }
.alert-success { background: var(--success-50); color: var(--success-700); border: 1px solid #bbf7d0; }

.alert .alert-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* --- Section Divider --- */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 16px;
}

.section-title .icon { font-size: 1.1rem; }

.section-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--card-shadow);
}

/* --- Upload Area --- */
.upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  color: var(--gray-500);
  background: var(--gray-50);
  cursor: pointer;
  transition: var(--transition);
}
.upload-area:hover { border-color: var(--primary-400); background: var(--primary-50); }
.upload-area .upload-icon { font-size: 2rem; margin-bottom: 8px; color: var(--primary-400); }

/* --- Timeline --- */
.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
  padding-left: 24px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item .timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid var(--primary-500);
  background: var(--white);
  z-index: 1;
}
.timeline-dot.completed { background: var(--success-500); border-color: var(--success-500); }
.timeline-dot.returned { background: var(--warning-500); border-color: var(--warning-500); }
.timeline-dot.active { background: var(--primary-500); border-color: var(--primary-500); }

.timeline-item .timeline-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.timeline-card .timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.timeline-card .officer-name { font-weight: 600; color: var(--gray-800); }
.timeline-card .officer-desg { font-size: 0.786rem; color: var(--gray-500); }
.timeline-card .timeline-date { font-size: 0.786rem; color: var(--gray-500); text-align: right; }
.timeline-card .timeline-remarks { font-size: 0.857rem; color: var(--gray-600); margin-top: 6px; line-height: 1.6; }

/* --- Stage Tracker --- */
.stage-tracker {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 32px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.stage-tracker .stage-step {
  flex: 1;
  min-width: 160px;
  text-align: center;
  position: relative;
}

.stage-tracker .stage-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin: 0 auto 10px;
  position: relative;
  z-index: 1;
}
.stage-circle.completed { background: var(--success-500); color: var(--white); }
.stage-circle.active { background: var(--primary-600); color: var(--white); box-shadow: 0 0 0 4px var(--primary-100); }
.stage-circle.pending { background: var(--gray-200); color: var(--gray-600); }

.stage-tracker .stage-label {
  font-size: 0.786rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.stage-label.completed { color: var(--success-700); }
.stage-label.active { color: var(--primary-700); }
.stage-label.pending { color: var(--gray-600); }

.stage-tracker .stage-line {
  position: absolute;
  top: 22px;
  left: calc(50% + 22px);
  right: calc(-50% + 22px);
  height: 3px;
  background: var(--gray-200);
}
.stage-line.completed { background: var(--success-500); }
.stage-line.active { background: var(--primary-300); }

/* --- Stage Cards --- */
.stage-columns {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.stage-column {
  min-width: 260px;
  flex: 1;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.stage-column .stage-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-weight: 700;
  font-size: 0.929rem;
}

.stage-column .stage-col-body { padding: 16px; }

.stage-event {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.stage-event:last-child { margin-bottom: 0; }
.stage-event .event-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.event-dot.completed { background: var(--success-500); }
.event-dot.active { background: var(--primary-500); }
.event-dot.pending { background: var(--gray-300); }

.stage-event .event-text { font-size: 0.857rem; font-weight: 500; color: var(--gray-700); }
.stage-event .event-date { font-size: 0.75rem; color: var(--gray-500); }

.stage-column .stage-col-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--gray-100);
  font-size: 0.786rem;
  color: var(--gray-500);
}

/* --- Workflow Path --- */
.workflow-path {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.workflow-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  position: relative;
}

.workflow-step .step-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.step-dot.done { background: var(--success-500); }
.step-dot.current { background: var(--primary-500); box-shadow: 0 0 0 3px var(--primary-100); }
.step-dot.upcoming { background: var(--gray-300); }

.workflow-step .step-info { font-size: 0.857rem; }
.workflow-step .step-label { font-weight: 600; color: var(--gray-800); }
.workflow-step .step-sub { font-size: 0.75rem; color: var(--gray-500); }

/* --- Modal / Dialog Overlay --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px rgba(0,0,0,0.15);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 20px 24px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.modal-header h3 { margin: 0; }
.modal-header .close-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--gray-500);
  font-size: 1.1rem;
}

.modal-body { padding: 0 24px 20px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-100); display: flex; justify-content: flex-end; gap: 10px; }

/* --- Footer --- */
.footer {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.786rem;
  color: var(--gray-500);
}
.footer a { color: var(--gray-500); }
.footer a:hover { color: var(--primary-600); }
.footer-links { display: flex; gap: 16px; }
.system-status { display: flex; align-items: center; gap: 6px; }
.system-status .online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success-500); }

/* --- Donut Chart Placeholder --- */
.chart-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: var(--gray-50);
  border-radius: var(--radius);
  color: var(--gray-500);
  font-size: 0.857rem;
}

.donut-chart {
  position: relative;
  width: 180px;
  height: 180px;
}

.donut-chart svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-chart .donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.donut-center .donut-value { font-size: 1.5rem; font-weight: 800; color: var(--gray-900); display: block; }
.donut-center .donut-label { font-size: 0.714rem; color: var(--gray-500); text-transform: uppercase; }

/* --- Bar chart placeholder --- */
.bar-chart-group {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  height: 160px;
  padding-top: 16px;
}

.bar-pair {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 6px;
}

.bar-pair .bars {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 120px;
}

.bar-pair .bar {
  width: 28px;
  border-radius: 4px 4px 0 0;
  min-height: 8px;
}
.bar.budget { background: var(--primary-500); }
.bar.disbursed { background: var(--primary-200); }

.bar-pair .bar-label { font-size: 0.714rem; color: var(--gray-500); font-weight: 500; }

/* --- Horizontal Bar --- */
.h-bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.h-bar-item .h-bar-label { width: 120px; font-size: 0.857rem; color: var(--gray-700); flex-shrink: 0; }
.h-bar-item .h-bar-track { flex: 1; height: 24px; background: var(--gray-100); border-radius: var(--radius-full); overflow: hidden; }
.h-bar-item .h-bar-fill { height: 100%; border-radius: var(--radius-full); }
.h-bar-fill.blue { background: var(--primary-500); }
.h-bar-fill.amber { background: var(--warning-500); }
.h-bar-fill.green { background: var(--success-500); }
.h-bar-item .h-bar-value { font-size: 0.786rem; font-weight: 600; color: var(--gray-600); width: 90px; text-align: right; flex-shrink: 0; }

/* --- Urgency Card --- */
.urgent-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: var(--transition);
}
.urgent-card:hover { box-shadow: var(--card-shadow-md); border-color: var(--primary-200); }

.urgent-card .uc-thumb {
  width: 48px;
  height: 48px;
  background: var(--gray-100);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gray-500);
}

.urgent-card .uc-body { flex: 1; min-width: 0; }
.urgent-card .uc-title { font-weight: 600; font-size: 0.857rem; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.urgent-card .uc-sub { font-size: 0.75rem; color: var(--gray-500); }

/* --- Auth Pages --- */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.auth-header {
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}

.auth-header .auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-header .auth-logo-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-100);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-700);
  font-size: 1.2rem;
}

.auth-header .auth-logo-text { line-height: 1.25; }
.auth-header .auth-logo-title { font-weight: 700; font-size: 1rem; color: var(--gray-900); }
.auth-header .auth-logo-sub { font-size: 0.714rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.04em; }

.auth-nav { display: flex; gap: 24px; }
.auth-nav a { color: var(--gray-600); font-size: 0.857rem; font-weight: 500; }
.auth-nav a:hover { color: var(--primary-600); }

.auth-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow-lg);
  overflow: hidden;
}

.auth-card-header {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: var(--white);
  text-align: center;
  padding: 32px 24px 28px;
}
.auth-card-header .auth-icon {
  width: 52px;
  height: 52px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 1.4rem;
}
.auth-card-header h2 { font-size: 1.35rem; margin-bottom: 0; color: var(--white); }

.auth-card-body { padding: 28px 28px 24px; }

.auth-card-footer {
  padding: 16px 28px 28px;
  text-align: center;
}

.otp-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
}
.otp-inputs input {
  width: 48px;
  height: 52px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  color: var(--gray-800);
  transition: var(--transition);
}
.otp-inputs input:focus { border-color: var(--primary-500); outline: none; box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }

.auth-footer-bar {
  text-align: center;
  padding: 16px;
  font-size: 0.75rem;
  color: var(--gray-500);
  border-top: 1px solid var(--gray-100);
}

.auth-trust-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  font-size: 0.75rem;
  color: var(--gray-500);
}
.auth-trust-badges span { display: flex; align-items: center; gap: 5px; }

/* --- Returned Files Panel --- */
.returned-panel {
  background: #fffbf5;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.returned-panel .rp-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #fed7aa;
}
.returned-panel .rp-header h4 { color: var(--danger-600); font-size: 0.929rem; }
.returned-panel .rp-body { padding: 16px; }

.returned-item {
  padding: 12px 0;
  border-bottom: 1px solid #fef3c7;
}
.returned-item:last-child { border-bottom: none; }
.returned-item .ri-label { font-size: 0.714rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.returned-item .ri-title { font-weight: 600; font-size: 0.929rem; color: var(--gray-800); margin: 4px 0; }
.returned-item .ri-reason { font-size: 0.786rem; color: var(--gray-500); }

/* --- Info Bar (File Header) --- */
.file-info-bar {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.file-info-bar .file-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.file-info-bar .file-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.857rem;
  color: var(--gray-500);
  flex-wrap: wrap;
}

.file-info-bar .file-meta .sep { color: var(--gray-600); }

.file-info-bar .file-kpis {
  display: flex;
  gap: 32px;
  margin-left: auto;
}

.file-kpi { text-align: center; }
.file-kpi .fk-label { font-size: 0.714rem; color: var(--gray-500); text-transform: uppercase; font-weight: 500; letter-spacing: 0.04em; }
.file-kpi .fk-value { font-size: 1.1rem; font-weight: 700; color: var(--gray-800); }

/* --- Audit Summary Sidebar --- */
.audit-summary {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.audit-summary h4 { margin-bottom: 16px; font-size: 0.929rem; }

.audit-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.857rem;
}
.audit-stat-row:last-child { border-bottom: none; }
.audit-stat-row .asr-label { color: var(--gray-500); }
.audit-stat-row .asr-value { font-weight: 700; color: var(--gray-800); }
.audit-stat-row .asr-value.danger { color: var(--danger-600); }

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--gray-50);
  border-radius: var(--radius);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-bar .filter-label {
  font-size: 0.786rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
}

.filter-bar select {
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-family: var(--font-family);
  font-size: 0.857rem;
  color: var(--gray-700);
  background: var(--white);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.filter-bar input[type="text"], .filter-bar input[type="date"] {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-family: var(--font-family);
  font-size: 0.857rem;
  color: var(--gray-700);
  background: var(--white);
}

/* --- Routing Preview --- */
.routing-preview {
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.routing-preview .rp-icon {
  width: 44px;
  height: 44px;
  background: var(--primary-600);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.routing-preview .rp-label { font-size: 0.786rem; color: var(--primary-600); font-weight: 600; }
.routing-preview .rp-detail { font-size: 0.929rem; font-weight: 600; color: var(--gray-800); }

/* --- Info Boxes --- */
.info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.info-item {
  padding: 12px 0;
}
.info-item .ii-label { font-size: 0.714rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; margin-bottom: 3px; }
.info-item .ii-value { font-size: 0.929rem; font-weight: 600; color: var(--gray-800); }

/* --- Quick Attachments --- */
.quick-attach-list { display: flex; flex-direction: column; gap: 10px; }
.quick-attach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--gray-50);
  border-radius: var(--radius);
  font-size: 0.857rem;
}
.quick-attach-item .qa-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.786rem;
  flex-shrink: 0;
}
.qa-icon.pdf { background: #fee2e2; color: #991b1b; }
.qa-icon.xlsx { background: #dcfce7; color: #166534; }
.qa-icon.jpg { background: #dbeafe; color: #1e40af; }
.qa-icon.docx { background: #dbeafe; color: #1e40af; }

.quick-attach-item .qa-name { font-weight: 500; color: var(--gray-700); }
.quick-attach-item .qa-meta { font-size: 0.714rem; color: var(--gray-500); }

/* --- Administrative Flags --- */
.admin-flags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.786rem;
  font-weight: 600;
}
.admin-flag.cleared { background: var(--success-100); color: var(--success-700); }
.admin-flag.pending { background: var(--warning-100); color: var(--warning-800); }
.admin-flag.obtained { background: var(--primary-100); color: var(--primary-700); }

/* --- Tip cards (bottom) --- */
.tip-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.tip-card {
  padding: 16px;
  border-radius: var(--radius-lg);
  font-size: 0.857rem;
}
.tip-card.info { background: var(--primary-100); color: var(--primary-800); }
.tip-card.privacy { background: var(--gray-800); color: rgba(255,255,255,0.85); }
.tip-card.support { background: var(--warning-100); color: var(--warning-800); }

.tip-card .tip-icon { font-size: 1.2rem; margin-bottom: 6px; }
.tip-card .tip-title { font-weight: 700; margin-bottom: 4px; font-size: 0.857rem; }
.tip-card .tip-text { font-size: 0.786rem; opacity: 0.85; line-height: 1.5; }

/* --- Print hidden --- */
@media print {
  .navbar, .footer, .no-print { display: none !important; }
  .main-content { padding: 0; }
  body { background: white; }
}

/* --- Responsive --- */
@media (max-width: 1200px) {
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-sidebar { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .main-content { padding: 16px; }
  .navbar { padding: 0 16px; }
  .nav-links { display: none; }
  .tip-cards { grid-template-columns: 1fr; }
}

/* --- Version history drawer --- */
.version-drawer {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.version-drawer .vd-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-100);
}

.version-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.version-item:last-child { border-bottom: none; }
.version-item .vi-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.version-item .vi-tag { font-weight: 700; font-size: 0.857rem; color: var(--gray-800); }
.version-item .vi-date { font-size: 0.75rem; color: var(--gray-500); }
.version-item .vi-summary { font-size: 0.857rem; color: var(--gray-600); margin-bottom: 8px; background: var(--gray-50); padding: 8px 12px; border-radius: var(--radius); }
.version-item .vi-foot { display: flex; align-items: center; justify-content: space-between; font-size: 0.786rem; color: var(--gray-500); }

/* --- Noting editor --- */
.noting-editor {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.noting-editor .ne-toolbar {
  padding: 8px 14px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  gap: 4px;
}

.noting-editor .ne-toolbar button {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--gray-600);
  font-size: 0.857rem;
  font-weight: 700;
  font-family: var(--font-family);
}
.noting-editor .ne-toolbar button:hover { background: var(--gray-200); }
.noting-editor .ne-toolbar .sep { width: 1px; background: var(--gray-200); margin: 4px 4px; }

.noting-editor .ne-body {
  padding: 16px;
  min-height: 180px;
  font-size: 0.929rem;
  line-height: 1.7;
  color: var(--gray-700);
}

.noting-editor .ne-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* --- Last confirmed action --- */
.confirmed-note {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.confirmed-note .cn-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.714rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-800);
  margin-bottom: 12px;
}

.confirmed-note .cn-text {
  font-size: 0.929rem;
  color: var(--gray-600);
  line-height: 1.7;
  font-style: italic;
  margin-bottom: 12px;
  padding: 0 4px;
}

.confirmed-note .cn-officer {
  text-align: right;
  font-size: 0.857rem;
}
.confirmed-note .cn-officer .name { font-weight: 700; color: var(--gray-800); }
.confirmed-note .cn-officer .desg { font-size: 0.75rem; color: var(--gray-500); text-transform: uppercase; }
.confirmed-note .cn-officer .date { font-size: 0.714rem; color: var(--gray-500); margin-top: 2px; }

/* --- Action buttons panel (file detail) --- */
.action-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-panel .action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.929rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: var(--font-family);
  transition: var(--transition);
  text-align: left;
  text-decoration: none;
}

.action-btn.forward { background: var(--primary-600); color: var(--white); }
.action-btn.forward:hover { background: var(--primary-700); }
.action-btn.approve { background: var(--success-700); color: var(--white); }
.action-btn.approve:hover { background: var(--success-800); }
.action-btn.return { background: var(--white); color: var(--gray-700); border: 1px solid var(--gray-300); }
.action-btn.return:hover { background: var(--gray-50); }

/* --- Recent Movement Box --- */
.recent-movement {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.recent-movement h5 { font-size: 0.786rem; text-transform: uppercase; color: var(--gray-500); letter-spacing: 0.04em; margin-bottom: 12px; }
.recent-movement .rm-entry { margin-bottom: 10px; }
.recent-movement .rm-label { font-size: 0.786rem; font-weight: 600; color: var(--gray-700); }
.recent-movement .rm-date { font-size: 0.714rem; color: var(--gray-500); }

/* --- Checkbox styled --- */
.checkbox-styled {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.857rem;
  transition: var(--transition);
}
.checkbox-styled:hover { border-color: var(--primary-300); background: var(--primary-50); }

/* --- Additional responsive helpers --- */
.hide-mobile { }
@media (max-width: 768px) { .hide-mobile { display: none !important; } }

/* ============================================================
   ADDITIONS — interaction components, admin panel, reports
   ============================================================ */

/* --- Toasts --- */
.toast-host {
  position: fixed; right: 20px; bottom: 20px; z-index: 2000;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  min-width: 260px; max-width: 380px;
  padding: 12px 16px;
  background: var(--gray-900); color: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow-lg);
  font-size: 0.857rem; line-height: 1.4;
  animation: toast-in 0.22s ease;
}
.toast .toast-icon { font-size: 1rem; }
.toast-success { background: var(--success-700); }
.toast-error   { background: var(--danger-700); }
.toast-info    { background: var(--primary-800); }
.toast.is-out  { opacity: 0; transform: translateY(6px); transition: all 0.35s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* --- Dropdown menus --- */
.dropdown { position: relative; }
.dropdown-menu {
  display: none;
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 210px; z-index: 900;
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow-lg);
  padding: 6px;
}
.dropdown-menu.is-open { display: block; }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 12px; border: none; background: none;
  font-family: inherit; font-size: 0.857rem; color: var(--gray-700);
  text-align: left; border-radius: var(--radius-sm); cursor: pointer;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--primary-50); color: var(--primary-700); }
.dropdown-menu .dd-divider { height: 1px; background: var(--gray-200); margin: 6px 4px; }
.dropdown-menu .dd-head {
  padding: 8px 12px 6px; font-size: 0.714rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px; color: var(--gray-500);
}
.notif-item { display: block; padding: 10px 12px; border-radius: var(--radius-sm); }
.notif-item .ni-title { font-weight: 600; color: var(--gray-800); font-size: 0.857rem; }
.notif-item .ni-meta { font-size: 0.714rem; color: var(--gray-500); margin-top: 2px; }

/* --- Multi-select with checkboxes --- */
.multiselect { position: relative; }
.multiselect-field {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 42px; padding: 10px 14px;
  background: var(--white);
  border: 1px solid var(--gray-300); border-radius: var(--radius);
  font-size: 0.929rem; color: var(--gray-800);
  cursor: pointer; transition: var(--transition);
}
.multiselect-field:hover { border-color: var(--primary-400); }
.multiselect.is-open .multiselect-field { border-color: var(--primary-500); box-shadow: 0 0 0 3px var(--primary-100); }
.multiselect-text.is-placeholder { color: var(--gray-500); }
.multiselect-caret { color: var(--gray-500); font-size: 0.7rem; }
.multiselect-menu {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  z-index: 800; max-height: 260px; overflow-y: auto;
  background: var(--white); border: 1px solid var(--card-border);
  border-radius: var(--radius-md); box-shadow: var(--card-shadow-lg); padding: 6px;
}
.multiselect.is-open .multiselect-menu { display: block; }
.multiselect-menu label {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 0.857rem; color: var(--gray-700); cursor: pointer;
}
.multiselect-menu label:hover { background: var(--primary-50); }
.multiselect-menu input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary-600); }

/* --- Validation --- */
.form-control.is-invalid,
.multiselect-field.is-invalid { border-color: var(--danger-500); background: var(--danger-50); }
.form-error { margin-top: 5px; font-size: 0.786rem; color: var(--danger-600); font-weight: 500; }
.required-star { color: var(--danger-600); margin-left: 2px; }

/* --- Uploaded file chips --- */
.uploaded-file {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-top: 8px;
  border: 1px solid var(--gray-200); border-radius: var(--radius);
  background: var(--gray-50); font-size: 0.857rem;
}
.uploaded-file .uf-name { font-weight: 500; color: var(--gray-800); flex: 1; }
.uploaded-file .uf-size { font-size: 0.75rem; color: var(--gray-500); }
.uploaded-file .uf-remove {
  border: none; background: none; cursor: pointer;
  color: var(--gray-500); font-size: 0.9rem; padding: 2px 6px; border-radius: var(--radius-sm);
}
.uploaded-file .uf-remove:hover { background: var(--danger-100); color: var(--danger-600); }
.upload-area.is-drag { border-color: var(--primary-500); background: var(--primary-50); }

/* --- Sortable table headers --- */
th.is-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.is-sortable:hover { color: var(--primary-700); }
th.is-sortable::after { content: ' \2195'; opacity: 0.35; font-size: 0.75rem; }
th[data-sort-dir="asc"]::after  { content: ' \2191'; opacity: 1; }
th[data-sort-dir="desc"]::after { content: ' \2193'; opacity: 1; }

/* --- Dynamic modals (static demo modals stay visible) --- */
.modal-overlay.modal-dynamic { display: none; }
.modal-overlay.modal-dynamic.is-open { display: flex; }

/* --- Captcha --- */
.captcha-row { display: flex; align-items: center; gap: 10px; }
.captcha-box {
  flex: 0 0 auto; min-width: 118px; padding: 9px 16px;
  font-family: "Courier New", monospace; font-size: 1.15rem; font-weight: 700;
  letter-spacing: 5px; color: var(--primary-900);
  background: repeating-linear-gradient(45deg, #eef2f7, #eef2f7 6px, #e2e8f0 6px, #e2e8f0 12px);
  border: 1px solid var(--gray-300); border-radius: var(--radius);
  text-align: center; user-select: none; text-decoration: line-through;
  text-decoration-color: rgba(30,58,95,0.35);
}
.captcha-refresh {
  border: 1px solid var(--gray-300); background: var(--white);
  width: 38px; height: 38px; border-radius: var(--radius);
  cursor: pointer; font-size: 1rem; color: var(--primary-600);
}
.captcha-refresh:hover { background: var(--primary-50); border-color: var(--primary-400); }

/* --- Report filter panel --- */
.report-filters {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
}
@media (max-width: 720px) { .report-filters { grid-template-columns: 1fr; } }
.report-filters .form-group { margin-bottom: 0; }
.report-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; background: var(--gray-100);
  border-bottom: 1px solid var(--card-border);
}
.report-toolbar .rt-title {
  flex: 1; text-align: center; font-weight: 600; color: var(--gray-800); font-size: 0.929rem;
}
.report-meta {
  padding: 12px 16px; background: var(--primary-50);
  border-bottom: 1px solid var(--primary-100);
  font-size: 0.786rem; color: var(--gray-700); line-height: 1.7;
}
.report-meta strong { color: var(--gray-800); }
.report-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
@media (max-width: 820px) { .report-card-grid { grid-template-columns: 1fr; } }
.report-tile {
  display: block; padding: 22px; background: var(--white);
  border: 1px solid var(--card-border); border-left: 4px solid var(--primary-500);
  border-radius: var(--radius-lg); box-shadow: var(--card-shadow);
  text-decoration: none; transition: var(--transition);
}
.report-tile:hover { box-shadow: var(--card-shadow-lg); transform: translateY(-2px); border-left-color: var(--primary-700); }
.report-tile .rt-icon { font-size: 1.5rem; margin-bottom: 10px; display: block; }
.report-tile h4 { font-size: 1rem; color: var(--gray-900); margin-bottom: 6px; }
.report-tile p { font-size: 0.821rem; color: var(--gray-600); line-height: 1.55; margin: 0; }

/* --- Sachivalay internal chain (SO > DE > US > CE > Secretary) --- */
.post-chain {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 14px 16px; background: var(--gray-50);
  border: 1px dashed var(--gray-300); border-radius: var(--radius-lg);
}
.post-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: var(--radius-full);
  background: var(--white); border: 1px solid var(--gray-300);
  font-size: 0.786rem; font-weight: 600; color: var(--gray-600); white-space: nowrap;
}
.post-chip.done    { background: var(--success-50); border-color: var(--success-500); color: var(--success-700); }
.post-chip.current { background: var(--primary-600); border-color: var(--primary-700); color: #fff; box-shadow: 0 0 0 3px var(--primary-100); }
.post-chip-sep { color: var(--gray-500); font-weight: 700; }

/* --- Admin / profile screens --- */
.admin-form { max-width: 780px; }
.admin-form .form-row-label {
  display: grid; grid-template-columns: 230px 1fr; gap: 18px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--gray-100);
}
.admin-form .form-row-label:last-of-type { border-bottom: none; }
.admin-form .form-row-label > label {
  font-size: 0.857rem; font-weight: 600; color: var(--gray-700);
}
.admin-form .inline-actions { display: flex; gap: 8px; align-items: center; }
@media (max-width: 720px) {
  .admin-form .form-row-label { grid-template-columns: 1fr; gap: 6px; }
}
.pw-meter { height: 6px; border-radius: var(--radius-full); background: var(--gray-200); overflow: hidden; margin-top: 8px; }
.pw-meter span { display: block; height: 100%; width: 0; background: var(--success-500); transition: width 0.25s ease; }

/* --- Print --- */
@media print {
  .navbar, .sub-header, .footer, .tabs, .toast-host, .action-panel,
  .breadcrumb, .btn, .dropdown-menu { display: none !important; }
  .main-content { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #999 !important; }
}

/* --- Status colour convention (green / amber / red / grey) --- */
.status-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
  padding: 10px 16px;
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  font-size: 0.786rem; color: var(--gray-600);
}
.status-legend span { display: inline-flex; align-items: center; gap: 7px; }
.status-legend .sl-dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; flex: 0 0 auto;
}
.mb-20 { margin-bottom: 20px; }

/* Exception state for the officer chain chips */
.post-chip.exception {
  background: var(--danger-50); border-color: var(--danger-500); color: var(--danger-700);
}

/* --- Honest notes where a static demo genuinely stops --- */
.footer-note {
  font-size: 0.714rem; color: var(--gray-500); font-style: italic;
  margin-left: 4px;
}
.ne-body[contenteditable="true"]:focus {
  outline: none; box-shadow: inset 0 0 0 2px var(--primary-200); border-radius: var(--radius-sm);
}
.ne-toolbar button { cursor: pointer; }
tr[data-editing] td[contenteditable="true"]:focus { outline: 2px solid var(--primary-400); outline-offset: -2px; }

/* --- Department mark --- */
.rnb-mark { width: 22px; height: 22px; display: block; }
.auth-header .auth-logo-icon .rnb-mark { width: 25px; height: 25px; }
.navbar .logo .logo-icon { color: #fff; }

/* --- Global search results --- */
.search-results {
  display: none;
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  z-index: 950; max-height: 380px; overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow-lg);
  padding: 6px;
  text-align: left;
}
.search-results.is-open { display: block; }
.search-results .sr-head {
  padding: 8px 12px 4px; font-size: 0.688rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px; color: var(--gray-500);
}
.search-results .sr-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--gray-700);
}
.search-results .sr-item:hover,
.search-results .sr-item.is-active { background: var(--primary-50); }
.search-results .sr-icon { font-size: 0.9rem; line-height: 1.4; flex: 0 0 auto; }
.search-results .sr-body { display: flex; flex-direction: column; min-width: 0; }
.search-results .sr-title { font-size: 0.857rem; font-weight: 600; color: var(--gray-900); }
.search-results .sr-sub {
  font-size: 0.75rem; color: var(--gray-500); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-results .sr-empty {
  padding: 16px 14px; font-size: 0.857rem; color: var(--gray-600);
  display: flex; flex-direction: column; gap: 4px;
}
.search-results .sr-empty span { font-size: 0.75rem; color: var(--gray-500); }

/* --- Vendor credit --- */
.footer-credit {
  display: block; margin-top: 3px;
  font-size: 0.714rem; color: var(--gray-500); font-weight: 400;
}
.footer-credit strong { color: var(--gray-600); font-weight: 600; }

/* ============================================================
   READABILITY FIXES - colour and layout only
   ============================================================ */

/* Sub-header buttons carry white inline text. The default outline hover
   turns the background near-white, which hid the label. Keep them
   light-on-dark instead; !important is needed to beat the inline colour. */
.sub-header .btn-outline:hover,
.sub-header .btn:hover {
  background: rgba(255,255,255,0.18) !important;
  border-color: rgba(255,255,255,0.6) !important;
  color: #fff !important;
}
.sub-header .btn-success:hover {
  background: var(--success-800) !important;
  border-color: var(--success-800) !important;
  color: #fff !important;
}

/* Nothing should collide when the window narrows */
.sub-header { flex-wrap: wrap; row-gap: 8px; }
.footer { flex-wrap: wrap; row-gap: 10px; color: var(--gray-500); }
.footer a { color: var(--gray-600); }
.file-info-bar .file-meta { flex-wrap: wrap; row-gap: 6px; }
.navbar { flex-wrap: nowrap; }

/* Placeholder text on the dark navbar was too faint to read */
.navbar-search input::placeholder { color: rgba(255,255,255,0.62); }

/* Ghost buttons that carry an inline brand colour keep it on hover
   instead of inheriting a grey that fights the background */
.btn-ghost:hover { background: var(--gray-100); }

/* Table rows: keep the link colour legible on the hover tint */
table tbody tr:hover a { color: var(--primary-700); }

/* Disabled resend link was grey-on-grey while the timer ran */
.is-disabled { opacity: 0.55; pointer-events: none; }

/* Status legend and hints sit on white - hold them at the readable step */
.status-legend { color: var(--gray-600); }
.form-hint { color: var(--gray-500); }
.footer-note { color: var(--gray-500); }

/* --- Contrast touch-ups found by scanning rendered pages --- */
.footer-credit { color: var(--gray-600); }
.footer-credit strong { color: var(--gray-700); }
.alert-info .alert-icon { color: var(--info-700); }

/* --- NAVBAR CONTRAST --------------------------------------
   The logo is an <a>, so the global link colour was painting the
   portal name blue on the navy bar (3.28:1). The language toggle
   used .btn-ghost, which is built for light backgrounds, so it sat
   dark-grey on navy (2.24:1). Both are now light-on-dark. */
.navbar .logo,
.navbar .logo:hover,
.navbar .logo .dept-name,
.navbar .logo .dept-sub { color: var(--white); }
.navbar-light .logo,
.navbar-light .logo .dept-name { color: var(--gray-900); }
.navbar-light .logo .dept-sub { color: var(--gray-500); }

.navbar [data-lang-toggle] { color: rgba(255,255,255,0.88); }
.navbar [data-lang-toggle]:hover {
  background: rgba(255,255,255,0.16);
  color: #fff;
}
.navbar-light [data-lang-toggle] { color: var(--gray-700); }
.auth-nav [data-lang-toggle] { color: var(--primary-700); }

/* --- UTILITY TEXT CONTRAST ---------------------------------
   The 600-step brand colours are 3.2-3.3:1 as text on white.
   As *text* they step darker; as backgrounds they are unchanged. */
.text-success { color: var(--success-700) !important; }
.text-warning { color: var(--warning-800) !important; }
.text-danger  { color: var(--danger-700) !important; }
.subtitle, .page-header p, .page-header .subtitle { color: var(--gray-600); }

/* --- TAB + BREADCRUMB CONTRAST ----------------------------
   Inactive tab labels and the current breadcrumb sat at gray-500
   on the tinted page background (4.34:1). */
.tabs .tab { color: var(--gray-600); }
.tabs .tab:hover { color: var(--gray-900); }
.breadcrumb > span:last-child { color: var(--gray-600); }

/* --- TIP CARD CONTRAST ---
   Only the amber card failed (4.42:1). The privacy card is dark with
   light text, so a blanket dark-text rule would have hidden it. */
.tip-card.support { color: var(--warning-800); }
