/* =========================================================
   SRS OA - Somali Regional State Office Automation System
   Main Stylesheet v1.0
   ========================================================= */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Dancing+Script:wght@600;700&display=swap');

/* ---- CSS Variables ---- */
:root {
  --primary:        #1a4380;
  --primary-dark:   #0f2d5e;
  --primary-light:  #2563eb;
  --accent:         #0ea5e9;
  --accent-light:   #38bdf8;
  --secondary:      #6366f1;
  --success:        #10b981;
  --warning:        #f59e0b;
  --danger:         #ef4444;
  --info:           #3b82f6;

  --sidebar-bg:     #0f1f3d;
  --sidebar-width:  260px;
  --sidebar-collapsed: 70px;
  --topbar-height:  64px;

  --body-bg:        #f0f4f9;
  --card-bg:        #ffffff;
  --border:         #e2e8f0;
  --border-light:   #f1f5f9;

  --text-dark:      #0f172a;
  --text-main:      #1e293b;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;

  --shadow-sm:      0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:         0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-md:      0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --shadow-lg:      0 20px 25px -5px rgba(0,0,0,.10), 0 10px 10px -5px rgba(0,0,0,.04);
  --shadow-xl:      0 25px 50px -12px rgba(0,0,0,.20);

  --radius-sm:      6px;
  --radius:         10px;
  --radius-md:      14px;
  --radius-lg:      20px;
  --radius-xl:      28px;
  --radius-full:    9999px;

  --transition:     all .2s ease;
  --transition-slow:all .35s ease;
}

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

html { scroll-behavior: smooth; font-size: 15px; }

body {
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--body-bg);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
ul { list-style: none; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f1f3d 0%, #1a4380 40%, #0ea5e9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.04) 0%, transparent 70%);
  top: -200px; right: -200px;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14,165,233,.15) 0%, transparent 70%);
  bottom: -150px; left: -150px;
}

.login-grid {
  display: grid;
  grid-template-columns: 1fr 480px;
  max-width: 1000px;
  width: 100%;
  gap: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
}

.login-branding {
  background: linear-gradient(180deg, rgba(255,255,255,.08) 0%, rgba(255,255,255,.03) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.12);
  border-right: none;
  padding: 60px 50px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 50px;
}

.login-logo-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: white;
  box-shadow: 0 8px 24px rgba(14,165,233,.4);
}

.login-logo-text h1 { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.login-logo-text p  { font-size: 11px; opacity: .7; text-transform: uppercase; letter-spacing: 1.5px; margin-top: 2px; }

.login-headline h2 {
  font-size: 36px; font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.5px;
  margin-bottom: 18px;
}
.login-headline p {
  font-size: 15px;
  opacity: .75;
  line-height: 1.7;
}

.login-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 50px;
}

.login-stat {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
}
.login-stat .num { font-size: 28px; font-weight: 800; color: #38bdf8; }
.login-stat .lbl { font-size: 11px; opacity: .65; margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }

.login-card {
  background: white;
  padding: 60px 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-card-header { margin-bottom: 36px; }
.login-card-header h3 { font-size: 26px; font-weight: 800; color: var(--text-dark); }
.login-card-header p  { color: var(--text-muted); font-size: 14px; margin-top: 6px; }

.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.input-wrap {
  position: relative;
}
.input-wrap .input-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 16px;
  pointer-events: none;
}
.input-wrap .form-control {
  padding-left: 42px;
}
.input-wrap .toggle-pw {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 0; font-size: 15px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  background: #fafafa;
  transition: var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary-light);
  background: white;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,.12); }

select.form-control { appearance: none; cursor: pointer; }

.form-text { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.invalid-feedback { font-size: 12px; color: var(--danger); margin-top: 5px; display: none; }
.is-invalid ~ .invalid-feedback { display: block; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white;
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,.45);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--primary-light);
  border: 1.5px solid var(--primary-light);
}
.btn-outline:hover { background: var(--primary-light); color: white; }

.btn-secondary { background: #f1f5f9; color: var(--text-main); }
.btn-secondary:hover { background: #e2e8f0; }

.btn-success { background: var(--success); color: white; box-shadow: 0 4px 14px rgba(16,185,129,.3); }
.btn-warning { background: var(--warning); color: white; box-shadow: 0 4px 14px rgba(245,158,11,.3); }
.btn-danger  { background: var(--danger);  color: white; box-shadow: 0 4px 14px rgba(239,68,68,.3); }
.btn-info    { background: var(--info);    color: white; box-shadow: 0 4px 14px rgba(59,130,246,.3); }

.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { padding: 15px 32px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-sm); }
.btn-icon-sm { width: 30px; height: 30px; padding: 0; font-size: 13px; border-radius: 6px; }

.btn:disabled { opacity: .6; cursor: not-allowed; transform: none !important; }

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 1000;
  transition: var(--transition-slow);
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  height: var(--topbar-height);
  overflow: hidden;
}

.sidebar-brand-icon {
  width: 38px; height: 38px;
  min-width: 38px;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  box-shadow: 0 4px 12px rgba(14,165,233,.35);
}

.sidebar-brand-text { overflow: hidden; }
.sidebar-brand-text .name {
  font-size: 16px; font-weight: 800;
  color: white; white-space: nowrap;
  letter-spacing: -.3px;
}
.sidebar-brand-text .sub {
  font-size: 10px; color: rgba(255,255,255,.45);
  text-transform: uppercase; letter-spacing: 1px;
  white-space: nowrap;
}

.sidebar-user {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.sidebar-user-avatar {
  width: 38px; height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: white;
  border: 2px solid rgba(255,255,255,.15);
}

.sidebar-user-info { overflow: hidden; }
.sidebar-user-info .user-name {
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,.92);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-info .user-role {
  font-size: 11px; color: rgba(255,255,255,.45);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

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

.nav-section {
  padding: 16px 18px 6px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,.3);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .nav-section { opacity: 0; }

.nav-item {
  padding: 2px 10px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,.55);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}

.nav-link:hover {
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.9);
}
.nav-link.active {
  background: linear-gradient(135deg, rgba(37,99,235,.35), rgba(14,165,233,.25));
  color: white;
  border: 1px solid rgba(255,255,255,.1);
}
.nav-link.active .nav-icon { color: var(--accent-light); }

.nav-icon {
  font-size: 17px;
  width: 20px;
  min-width: 20px;
  text-align: center;
}

.nav-text { overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

.nav-submenu {
  padding-left: 20px;
  overflow: hidden;
  max-height: 0;
  transition: max-height .3s ease;
}
.nav-submenu.open { max-height: 500px; }
.nav-submenu .nav-link {
  font-size: 12.5px;
  padding: 8px 12px;
  color: rgba(255,255,255,.45);
}
.nav-submenu .nav-link:hover { color: rgba(255,255,255,.8); }
.nav-submenu .nav-link.active { color: white; background: rgba(255,255,255,.08); }

.nav-link .chevron {
  margin-left: auto;
  font-size: 12px;
  transition: transform .25s;
}
.nav-link[aria-expanded="true"] .chevron { transform: rotate(90deg); }

.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.sidebar-footer .nav-link { color: rgba(255,255,255,.45); font-size: 13px; }

/* ---- MAIN CONTENT ---- */
.main-content {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-slow);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.main-content.expanded { margin-left: var(--sidebar-collapsed); }

/* ---- TOP BAR ---- */
.topbar {
  height: var(--topbar-height);
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: var(--shadow-sm);
}

.topbar-toggle {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  flex-shrink: 0;
}
.topbar-toggle:hover { background: var(--body-bg); color: var(--primary); border-color: var(--primary); }

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.topbar-breadcrumb .sep { color: var(--border); }
.topbar-breadcrumb .current { color: var(--text-main); font-weight: 600; }

.topbar-search {
  flex: 1;
  max-width: 360px;
  margin-left: auto;
  position: relative;
}
.topbar-search input {
  width: 100%;
  padding: 9px 16px 9px 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-main);
  background: var(--body-bg);
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}
.topbar-search input:focus {
  border-color: var(--primary-light);
  background: white;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.topbar-search .search-icon {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 14px;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: 8px; }

.topbar-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: white;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 16px;
}
.topbar-btn:hover { background: var(--body-bg); color: var(--primary); border-color: var(--primary); }
.topbar-btn .badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  width: 17px; height: 17px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid white;
}

.topbar-divider { width: 1px; height: 28px; background: var(--border); }

.topbar-user {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 10px;
  transition: var(--transition);
}
.topbar-user:hover { background: var(--body-bg); }
.topbar-user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white;
}
.topbar-user-info { display: flex; flex-direction: column; }
.topbar-user-info .name { font-size: 13px; font-weight: 600; color: var(--text-main); }
.topbar-user-info .role { font-size: 11px; color: var(--text-muted); }

/* ---- PAGE CONTENT ---- */
.page-content {
  padding: 28px;
  flex: 1;
  min-width: 0;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-header-left {}
.page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -.3px;
}
.page-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 4px;
}
.page-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  display: flex; align-items: center; gap: 10px;
}
.card-title .card-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.card-actions { display: flex; gap: 8px; align-items: center; }
.card-body { padding: 24px; }
.card-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-light);
  background: #fafbfc;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--text-muted);
}

/* ---- STAT CARDS ---- */
.stat-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card.blue::before   { background: linear-gradient(90deg, var(--primary-light), var(--accent)); }
.stat-card.green::before  { background: linear-gradient(90deg, var(--success), #34d399); }
.stat-card.orange::before { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.stat-card.red::before    { background: linear-gradient(90deg, var(--danger), #f87171); }
.stat-card.purple::before { background: linear-gradient(90deg, var(--secondary), #a78bfa); }
.stat-card.teal::before   { background: linear-gradient(90deg, var(--accent), #22d3ee); }

.stat-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.stat-card-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.stat-card-icon.blue   { background: rgba(37,99,235,.1);  color: var(--primary-light); }
.stat-card-icon.green  { background: rgba(16,185,129,.1); color: var(--success); }
.stat-card-icon.orange { background: rgba(245,158,11,.1); color: var(--warning); }
.stat-card-icon.red    { background: rgba(239,68,68,.1);  color: var(--danger); }
.stat-card-icon.purple { background: rgba(99,102,241,.1); color: var(--secondary); }
.stat-card-icon.teal   { background: rgba(14,165,233,.1); color: var(--accent); }

.stat-change {
  font-size: 12px; font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}
.stat-change.up   { background: rgba(16,185,129,.1); color: var(--success); }
.stat-change.down { background: rgba(239,68,68,.1);  color: var(--danger); }

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.stat-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-light);
  display: flex; align-items: center; gap: 6px;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-responsive { overflow-x: auto; border-radius: var(--radius-md); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table thead th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: #fafbff; }
.data-table td {
  padding: 13px 16px;
  color: var(--text-main);
  vertical-align: middle;
}
.data-table .td-user { display: flex; align-items: center; gap: 10px; }
.data-table .user-avatar-sm {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white;
  flex-shrink: 0;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-primary { background: rgba(37,99,235,.1);  color: var(--primary-light); }
.badge-success { background: rgba(16,185,129,.12); color: #059669; }
.badge-warning { background: rgba(245,158,11,.12); color: #d97706; }
.badge-danger  { background: rgba(239,68,68,.12);  color: #dc2626; }
.badge-info    { background: rgba(59,130,246,.1);  color: #2563eb; }
.badge-secondary{ background: rgba(99,102,241,.1); color: var(--secondary); }
.badge-muted   { background: #f1f5f9; color: var(--text-muted); }
.badge-dark    { background: #1e293b; color: white; }

.badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ============================================================
   PROGRESS
   ============================================================ */
.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s ease;
}
.progress-bar-fill.blue   { background: linear-gradient(90deg, var(--primary-light), var(--accent)); }
.progress-bar-fill.green  { background: linear-gradient(90deg, var(--success), #34d399); }
.progress-bar-fill.orange { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.progress-bar-fill.red    { background: linear-gradient(90deg, var(--danger), #f87171); }

/* ============================================================
   FILTERS & SEARCH
   ============================================================ */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
  background: #fafbfc;
}

.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-group label { font-size: 12px; color: var(--text-muted); font-weight: 500; white-space: nowrap; }

.filter-select, .filter-input {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-main);
  background: white;
  outline: none;
  transition: var(--transition);
  font-family: inherit;
  min-width: 120px;
}
.filter-select:focus, .filter-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}
.search-input-wrap input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  background: white;
}
.search-input-wrap input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.search-input-wrap .si { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-light); font-size: 14px; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; visibility: hidden;
  transition: var(--transition);
}
.modal-overlay.show { opacity: 1; visibility: visible; }

.modal-box {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  transform: translateY(-20px) scale(.97);
  transition: transform .25s ease, opacity .25s ease;
  overflow: hidden;
}
.modal-overlay.show .modal-box { transform: none; opacity: 1; }
.modal-box.modal-lg { max-width: 800px; }
.modal-box.modal-xl { max-width: 1000px; }
.modal-box.modal-sm { max-width: 420px; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h5 { font-size: 17px; font-weight: 700; color: var(--text-dark); }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: var(--transition);
}
.modal-close:hover { background: var(--body-bg); color: var(--danger); border-color: var(--danger); }

.modal-body { padding: 28px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  background: #fafbfc;
}

/* ============================================================
   NOTIFICATIONS DROPDOWN
   ============================================================ */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 999;
  display: none;
}
.notif-dropdown.show { display: block; }
.notif-dropdown-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px; font-weight: 700; color: var(--text-dark);
}
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
  cursor: pointer;
}
.notif-item:hover { background: #f8faff; }
.notif-item.unread { background: rgba(37,99,235,.03); }
.notif-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.notif-text .title { font-size: 13px; font-weight: 600; color: var(--text-main); }
.notif-text .desc  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.notif-text .time  { font-size: 11px; color: var(--text-light); margin-top: 4px; display: flex; align-items: center; gap: 4px; }

/* ============================================================
   TABS
   ============================================================ */
.tabs-nav {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  padding: 0;
  overflow-x: auto;
}
.tab-btn {
  padding: 10px 20px;
  border: none;
  background: none;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  font-family: inherit;
  border-radius: 6px 6px 0 0;
}
.tab-btn:hover { color: var(--primary-light); background: rgba(37,99,235,.04); }
.tab-btn.active { color: var(--primary-light); border-bottom-color: var(--primary-light); font-weight: 600; }

.tab-content { display: none; padding-top: 20px; }
.tab-content.active { display: block; }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 24px; }
.timeline-dot {
  position: absolute;
  left: -24px; top: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--border);
}
.timeline-dot.blue   { background: var(--primary-light); box-shadow: 0 0 0 2px rgba(37,99,235,.3); }
.timeline-dot.green  { background: var(--success); box-shadow: 0 0 0 2px rgba(16,185,129,.3); }
.timeline-dot.orange { background: var(--warning); box-shadow: 0 0 0 2px rgba(245,158,11,.3); }
.timeline-dot.red    { background: var(--danger);  box-shadow: 0 0 0 2px rgba(239,68,68,.3); }
.timeline-content { }
.timeline-time { font-size: 11px; color: var(--text-light); margin-bottom: 4px; }
.timeline-title { font-size: 13.5px; font-weight: 600; color: var(--text-main); }
.timeline-body { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   AVATARS GROUP
   ============================================================ */
.avatar-group { display: flex; }
.avatar-group .avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid white;
  margin-left: -8px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.avatar-group .avatar:first-child { margin-left: 0; }
.avatar-group .avatar.more {
  background: var(--body-bg);
  color: var(--text-muted);
  font-size: 10px;
  border-color: var(--border);
}

/* ============================================================
   FORMS & INPUTS
   ============================================================ */
.form-row { display: flex; gap: 20px; margin-bottom: 20px; }
.form-row > * { flex: 1; }

.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

textarea.form-control { resize: vertical; min-height: 100px; }
.input-group { display: flex; }
.input-group .form-control { border-radius: var(--radius) 0 0 var(--radius); }
.input-group .input-group-btn {
  border-radius: 0 var(--radius) var(--radius) 0;
  border-left: 0;
}
.input-group-text {
  padding: 12px 14px;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 14px; color: var(--text-muted);
  display: flex; align-items: center;
}

.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px; height: 16px; cursor: pointer;
  accent-color: var(--primary-light);
}
.form-check-label { font-size: 13.5px; color: var(--text-main); cursor: pointer; }

/* ============================================================
   FILE UPLOAD
   ============================================================ */
.file-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.file-upload-zone:hover,
.file-upload-zone.drag-over {
  border-color: var(--primary-light);
  background: rgba(37,99,235,.03);
}
.file-upload-icon { font-size: 36px; color: var(--text-light); margin-bottom: 12px; }
.file-upload-text { font-size: 14px; color: var(--text-muted); }
.file-upload-text strong { color: var(--primary-light); }
.file-upload-hint { font-size: 12px; color: var(--text-light); margin-top: 6px; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}
.page-item {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: var(--transition);
}
.page-item:hover { background: var(--body-bg); color: var(--primary-light); border-color: var(--border); }
.page-item.active { background: var(--primary-light); color: white; border-color: var(--primary-light); }
.page-item.disabled { opacity: .4; cursor: not-allowed; }

/* ============================================================
   ALERT / TOAST
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border-left: 4px solid;
  font-size: 13.5px;
}
.alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: rgba(16,185,129,.08); border-color: var(--success); color: #065f46; }
.alert-warning { background: rgba(245,158,11,.08); border-color: var(--warning); color: #92400e; }
.alert-danger  { background: rgba(239,68,68,.08);  border-color: var(--danger);  color: #991b1b; }
.alert-info    { background: rgba(59,130,246,.08);  border-color: var(--info);    color: #1e40af; }

.toast-container {
  position: fixed;
  bottom: 28px; right: 28px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  min-width: 320px;
}

.toast {
  background: #1e293b;
  color: white;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  transform: translateX(120%);
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
.toast.show { transform: translateX(0); }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast.success .toast-icon { color: #34d399; }
.toast.error   .toast-icon { color: #f87171; }
.toast.warning .toast-icon { color: #fbbf24; }
.toast.info    .toast-icon { color: #60a5fa; }
.toast-close {
  margin-left: auto;
  background: none; border: none; color: rgba(255,255,255,.5);
  cursor: pointer; font-size: 14px; padding: 0;
}

/* ============================================================
   CHARTS PLACEHOLDER
   ============================================================ */
.chart-container {
  position: relative;
  width: 100%;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 30px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 52px; color: var(--text-light); margin-bottom: 16px; }
.empty-state h4 { font-size: 16px; font-weight: 700; color: var(--text-main); margin-bottom: 8px; }
.empty-state p { font-size: 13.5px; max-width: 320px; margin: 0 auto 20px; }

/* ============================================================
   WORKFLOW STEPS
   ============================================================ */
.workflow-steps {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 8px 0;
}
.workflow-step {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.step-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: #f8fafc;
  border: 1.5px solid var(--border);
  min-width: 110px;
  text-align: center;
  transition: var(--transition);
}
.step-bubble.active { background: rgba(37,99,235,.07); border-color: var(--primary-light); }
.step-bubble.done   { background: rgba(16,185,129,.07); border-color: var(--success); }
.step-bubble.pending{ opacity: .5; }
.step-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text-muted);
}
.step-bubble.active .step-icon { background: var(--primary-light); color: white; }
.step-bubble.done   .step-icon { background: var(--success); color: white; }
.step-label { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.step-bubble.active .step-label { color: var(--primary-light); }
.step-bubble.done   .step-label { color: var(--success); }
.step-arrow { width: 32px; height: 2px; background: var(--border); flex-shrink: 0; }
.step-arrow.done { background: var(--success); }

/* ============================================================
   DETAIL VIEW
   ============================================================ */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.detail-item {}
.detail-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-light); margin-bottom: 6px; }
.detail-value { font-size: 14px; font-weight: 500; color: var(--text-main); }

/* ============================================================
   GRID UTILITIES
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }

/* ============================================================
   ROLE-SPECIFIC COLORS
   ============================================================ */
.role-super-admin { background: rgba(99,102,241,.1); color: #4f46e5; }
.role-bureau-admin { background: rgba(14,165,233,.1); color: #0369a1; }
.role-bureau-head  { background: rgba(16,185,129,.1); color: #065f46; }
.role-deputy       { background: rgba(245,158,11,.1); color: #b45309; }
.role-director     { background: rgba(239,68,68,.1);  color: #991b1b; }
.role-team-leader  { background: rgba(59,130,246,.1); color: #1e40af; }
.role-expert       { background: rgba(6,182,212,.1);  color: #0e7490; }
.role-finance      { background: rgba(168,85,247,.1); color: #7e22ce; }
.role-hr           { background: rgba(236,72,153,.1); color: #9d174d; }
.role-auditor      { background: rgba(20,184,166,.1); color: #0f766e; }

/* ============================================================
   PRIORITY BADGES
   ============================================================ */
.priority-urgent { background: rgba(239,68,68,.12);   color: #dc2626; border: 1px solid rgba(239,68,68,.2); }
.priority-normal { background: rgba(59,130,246,.1);   color: #2563eb; border: 1px solid rgba(59,130,246,.2); }
.priority-low    { background: rgba(100,116,139,.1);  color: #475569; border: 1px solid rgba(100,116,139,.2); }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   UTILITIES
   ============================================================ */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; } .mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 20px; } .mb-6 { margin-bottom: 24px; }
.p-0 { padding: 0; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.w-100 { width: 100%; }
.overflow-hidden { overflow: hidden; }
.cursor-pointer { cursor: pointer; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rounded-full { border-radius: var(--radius-full); }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.hidden { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .login-grid { grid-template-columns: 1fr; }
  .login-branding { display: none; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .page-content { padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; gap: 0; }
  .topbar-search { display: none; }
  .login-card { padding: 40px 28px; }
  .stat-value { font-size: 26px; }
}

@media (max-width: 480px) {
  .page-header { flex-direction: column; }
  .filters-bar { flex-direction: column; align-items: stretch; }
}

/* ============================================================
   LOADING / SKELETON
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, #f0f4f9 25%, #e2e8f0 50%, #f0f4f9 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

.animate-fade-up { animation: fadeInUp .4s ease both; }
.animate-fade    { animation: fadeIn .3s ease both; }
.animate-spin    { animation: spin 1s linear infinite; }

.stagger-1 { animation-delay: .05s; }
.stagger-2 { animation-delay: .10s; }
.stagger-3 { animation-delay: .15s; }
.stagger-4 { animation-delay: .20s; }
.stagger-5 { animation-delay: .25s; }
.stagger-6 { animation-delay: .30s; }

/* ============================================================
   SPECIFIC PAGE STYLES
   ============================================================ */

/* Bureau card */
.bureau-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: white;
  transition: var(--transition);
  cursor: pointer;
}
.bureau-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.bureau-card-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  padding: 24px;
  position: relative; overflow: hidden;
}
.bureau-card-header::before {
  content: '';
  position: absolute;
  right: -20px; top: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.bureau-card-icon { font-size: 32px; color: rgba(255,255,255,.9); margin-bottom: 10px; }
.bureau-card-name { font-size: 16px; font-weight: 700; color: white; }
.bureau-card-body { padding: 20px; }
.bureau-meta { display: flex; gap: 20px; font-size: 12px; color: var(--text-muted); }
.bureau-meta-item { display: flex; align-items: center; gap: 5px; }

/* Performance ring */
.perf-ring { position: relative; width: 80px; height: 80px; }
.perf-ring svg { transform: rotate(-90deg); }
.perf-ring .ring-bg { fill: none; stroke: #e2e8f0; stroke-width: 6; }
.perf-ring .ring-fill { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.perf-ring .ring-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: var(--text-dark);
}

/* KPI card */
.kpi-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border);
}
.kpi-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.kpi-target { font-size: 11px; color: var(--text-light); }
.kpi-value { font-size: 26px; font-weight: 800; color: var(--text-dark); }
.kpi-name { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Letter thread */
.letter-thread { border-left: 3px solid var(--border); padding-left: 20px; }
.letter-thread-item {
  position: relative;
  padding-bottom: 20px;
}
.letter-thread-item::before {
  content: '';
  position: absolute;
  left: -26px; top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 2px solid white;
  box-shadow: 0 0 0 2px rgba(37,99,235,.3);
}
.letter-ref {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  background: rgba(37,99,235,.1);
  color: var(--primary-light);
  padding: 2px 8px; border-radius: 4px;
  margin-bottom: 6px; letter-spacing: .3px;
}

/* ---- Electronic Signatures ---- */
.signature-script {
  font-family: 'Dancing Script', cursive;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1;
  white-space: nowrap;
}
.signature-block {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.signature-block-text { line-height: 1.35; }
.signature-block-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-dark);
}
.signature-block-title {
  font-size: 11px;
  color: var(--text-muted);
}
.signature-block-when {
  font-size: 10.5px;
  color: var(--text-light);
  margin-top: 1px;
}

/* Print */
@media print {
  .sidebar, .topbar, .page-header-actions { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .card { border: 1px solid #ccc; box-shadow: none; }
}
