/* ============================================================
   CLMS – Contract Labour Management System
   Design System & Global Styles
   Cochin Shipyard Ltd.
   ============================================================ */

:root {
  /* Brand Colors */
  --primary:       #1a3c6e;
  --primary-light: #2457a3;
  --primary-dark:  #0f2347;
  --accent:        #f0a500;
  --accent-light:  #ffc332;
  --danger:        #d63031;
  --danger-light:  #ff7675;
  --success:       #00b894;
  --success-light: #55efc4;
  --warning:       #e17055;
  --warning-light: #fab1a0;
  --info:          #0984e3;
  --info-light:    #74b9ff;

  /* Neutrals */
  --bg:            #f0f2f5;
  --surface:       #ffffff;
  --border:        #dde1e7;
  --text-primary:  #1c2b4a;
  --text-secondary:#5a6a85;
  --text-muted:    #8a9ab5;
  --sidebar-bg:    #1a3c6e;
  --sidebar-text:  rgba(255,255,255,0.75);
  --sidebar-active:#ffffff;
  --topbar-bg:     #ffffff;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow:    0 2px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.14);

  /* Radius */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;

  /* Sidebar */
  --sidebar-w:  240px;
  --topbar-h:   62px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Login Page ── */
#login-page {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, #0f2347 0%, #1a3c6e 50%, #2457a3 100%);
}
.login-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px;
  color: white;
}
.login-left .brand-logo {
  width: 80px; height: 80px;
  background: var(--accent);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
  font-size: 36px;
}
.login-left h1 { font-size: 32px; font-weight: 700; margin-bottom: 8px; }
.login-left p  { font-size: 16px; opacity: 0.75; text-align: center; max-width: 340px; }
.login-badges  { display: flex; gap: 12px; margin-top: 32px; }
.login-badge   {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 8px 16px; border-radius: 20px;
  font-size: 12px; color: rgba(255,255,255,0.8);
}
.login-right {
  width: 440px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
}
.login-card { width: 100%; }
.login-card h2 { font-size: 24px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.login-card .subtitle { color: var(--text-secondary); margin-bottom: 32px; font-size: 13px; }
.login-role-tabs { display: flex; gap: 8px; margin-bottom: 28px; }
.role-tab {
  flex: 1; padding: 8px; text-align: center;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 12px; font-weight: 500; color: var(--text-secondary);
  transition: all .2s;
}
.role-tab.active {
  border-color: var(--primary); background: var(--primary); color: white;
}
.otp-sent { display: none; }
.otp-timer { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

/* ── App Shell ── */
#app { display: none; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  z-index: 200;
  transition: width .3s;
  overflow: hidden;
}
.sidebar.collapsed { width: 64px; }
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  min-height: var(--topbar-h);
  overflow: hidden;
}
.sidebar-brand .brand-icon {
  width: 32px; height: 32px; min-width: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--primary-dark);
}
.sidebar-brand .brand-name {
  font-size: 15px; font-weight: 700; color: white;
  white-space: nowrap; overflow: hidden;
  line-height: 1.2;
}
.sidebar-brand .brand-sub {
  font-size: 10px; color: rgba(255,255,255,0.5);
  white-space: nowrap;
}
.sidebar nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: 1px;
  color: rgba(255,255,255,0.35);
  padding: 16px 20px 6px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity .3s;
}
.sidebar.collapsed .nav-section-label { opacity: 0; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  cursor: pointer;
  border-radius: 0;
  transition: all .2s;
  white-space: nowrap;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-item.active {
  background: rgba(255,255,255,0.15);
  color: white;
  border-right: 3px solid var(--accent);
}
.nav-item .nav-icon {
  width: 20px; min-width: 20px;
  font-size: 16px; text-align: center;
}
.nav-item .nav-label { font-size: 13px; font-weight: 500; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--accent); color: var(--primary-dark);
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px;
  min-width: 18px; text-align: center;
}
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .2s;
  overflow: hidden;
}
.sidebar-user:hover { background: rgba(255,255,255,0.1); }
.sidebar-user .avatar {
  width: 32px; height: 32px; min-width: 32px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--primary-dark);
}
.sidebar-user .user-info .user-name {
  font-size: 12px; font-weight: 600; color: white; white-space: nowrap;
}
.sidebar-user .user-info .user-role {
  font-size: 10px; color: rgba(255,255,255,0.5); white-space: nowrap;
}

/* ── Topbar ── */
.topbar {
  position: fixed; top: 0;
  left: var(--sidebar-w); right: 0;
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px;
  gap: 16px;
  z-index: 100;
  transition: left .3s;
  box-shadow: var(--shadow-sm);
}
.topbar.sidebar-collapsed { left: 64px; }
.topbar-toggle {
  width: 36px; height: 36px;
  border: none; background: none; cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text-secondary);
  transition: background .2s;
}
.topbar-toggle:hover { background: var(--bg); }
.topbar-breadcrumb { flex: 1; }
.topbar-breadcrumb .page-title {
  font-size: 16px; font-weight: 600; color: var(--text-primary);
}
.topbar-breadcrumb .page-sub {
  font-size: 12px; color: var(--text-muted);
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
  position: relative;
  width: 36px; height: 36px;
  border: none; background: none; cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text-secondary);
  transition: background .2s;
}
.topbar-btn:hover { background: var(--bg); color: var(--primary); }
.topbar-btn .badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--danger); color: white;
  font-size: 9px; font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background .2s;
}
.topbar-user:hover { background: var(--bg); }
.topbar-user .t-avatar {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white;
}
.topbar-user .t-name {
  font-size: 13px; font-weight: 500; color: var(--text-primary);
}
.topbar-user .t-role {
  font-size: 11px; color: var(--text-muted);
}

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 24px;
  transition: margin-left .3s;
  min-height: calc(100vh - var(--topbar-h));
}
.main-content.sidebar-collapsed { margin-left: 64px; }

/* ── Screens ── */
.screen { display: none; }
.screen.active { display: block; }

/* ── Cards & Surfaces ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ── KPI Widgets ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: flex-start; gap: 16px;
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.kpi-card.primary::before { background: var(--primary); }
.kpi-card.success::before { background: var(--success); }
.kpi-card.warning::before { background: var(--warning); }
.kpi-card.danger::before  { background: var(--danger);  }
.kpi-card.info::before    { background: var(--info);    }
.kpi-card.accent::before  { background: var(--accent);  }
.kpi-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.kpi-card.primary .kpi-icon { background: rgba(26,60,110,0.1); color: var(--primary); }
.kpi-card.success .kpi-icon { background: rgba(0,184,148,0.1); color: var(--success); }
.kpi-card.warning .kpi-icon { background: rgba(225,112,85,0.1); color: var(--warning); }
.kpi-card.danger  .kpi-icon { background: rgba(214,48,49,0.1);  color: var(--danger);  }
.kpi-card.info    .kpi-icon { background: rgba(9,132,227,0.1);   color: var(--info);    }
.kpi-card.accent  .kpi-icon { background: rgba(240,165,0,0.1);   color: var(--accent);  }
.kpi-value { font-size: 28px; font-weight: 700; line-height: 1.1; }
.kpi-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.kpi-trend { font-size: 11px; margin-top: 6px; }
.kpi-trend.up   { color: var(--success); }
.kpi-trend.down { color: var(--danger);  }

/* ── Page Layout ── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap; gap: 12px;
}
.page-header h2 { font-size: 20px; font-weight: 700; }
.page-header p  { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.action-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ── Grid helpers ── */
.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: repeat(4,1fr); gap: 16px; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; transition: all .2s;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent  { background: var(--accent); color: var(--primary-dark); }
.btn-accent:hover { background: var(--accent-light); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { opacity: .9; }
.btn-danger  { background: var(--danger); color: white; }
.btn-danger:hover { opacity: .9; }
.btn-warning { background: var(--warning); color: white; }
.btn-outline {
  background: transparent; border: 1.5px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: rgba(26,60,110,0.04); }
.btn-ghost  {
  background: transparent; color: var(--text-secondary); border: none;
}
.btn-ghost:hover { background: var(--bg); color: var(--primary); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-primary);
  background: white;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,60,110,0.1);
}
.form-control::placeholder { color: var(--text-muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.input-group { position: relative; }
.input-group .form-control { padding-left: 38px; }
.input-group .input-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 14px;
}
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 11px; color: var(--danger); margin-top: 4px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a6a85' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Tables ── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
table {
  width: 100%; border-collapse: collapse;
  background: white;
}
thead tr { background: #f8f9fb; }
th {
  padding: 11px 14px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  text-align: left; white-space: nowrap;
}
td {
  padding: 12px 14px;
  font-size: 13px; color: var(--text-primary);
  border-bottom: 1px solid #f0f2f5;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfc; }
.table-actions { display: flex; gap: 4px; }

/* ── Badges / Pills ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-success { background: rgba(0,184,148,0.1); color: var(--success); }
.badge-danger  { background: rgba(214,48,49,0.1); color: var(--danger); }
.badge-warning { background: rgba(225,112,85,0.1); color: var(--warning); }
.badge-info    { background: rgba(9,132,227,0.1);  color: var(--info); }
.badge-primary { background: rgba(26,60,110,0.1);  color: var(--primary); }
.badge-accent  { background: rgba(240,165,0,0.1);  color: #b37a00; }
.badge-gray    { background: #f0f2f5; color: var(--text-secondary); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── Steps / Wizard ── */
.steps {
  display: flex; align-items: center; margin-bottom: 32px;
}
.step-item {
  display: flex; flex-direction: column; align-items: center; flex: 1;
  position: relative;
}
.step-item:not(:last-child)::after {
  content: ''; position: absolute;
  top: 15px; left: 50%; right: -50%;
  height: 2px; background: var(--border);
  z-index: 0;
}
.step-item.done:not(:last-child)::after { background: var(--success); }
.step-item.active:not(:last-child)::after { background: var(--primary-light); }
.step-circle {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: var(--border); color: var(--text-muted);
  position: relative; z-index: 1;
  border: 2px solid var(--border);
}
.step-item.active .step-circle {
  background: var(--primary); color: white; border-color: var(--primary);
}
.step-item.done .step-circle {
  background: var(--success); color: white; border-color: var(--success);
}
.step-label {
  font-size: 11px; margin-top: 6px; color: var(--text-muted); text-align: center;
  max-width: 80px; font-weight: 500;
}
.step-item.active .step-label { color: var(--primary); font-weight: 600; }
.step-item.done .step-label  { color: var(--success); }

/* ── Tabs ── */
.tabs { border-bottom: 2px solid var(--border); display: flex; gap: 4px; margin-bottom: 20px; }
.tab-btn {
  padding: 10px 18px; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); cursor: pointer;
  border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all .2s; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab-btn:hover { color: var(--primary); background: rgba(26,60,110,0.04); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Alerts / Banners ── */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  margin-bottom: 16px; font-size: 13px;
}
.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: rgba(0,184,148,0.08); border: 1px solid rgba(0,184,148,0.25); color: #007561; }
.alert-danger  { background: rgba(214,48,49,0.08); border: 1px solid rgba(214,48,49,0.25); color: #a32222; }
.alert-warning { background: rgba(225,112,85,0.08); border: 1px solid rgba(225,112,85,0.3);  color: #a04020; }
.alert-info    { background: rgba(9,132,227,0.08);  border: 1px solid rgba(9,132,227,0.25);  color: #0660a0; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: none; align-items: center; justify-content: center;
  z-index: 999; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
}
.modal-lg { max-width: 800px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: var(--bg); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-secondary);
}
.modal-close:hover { background: var(--border); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  background: #fafbfc; border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── Profile card ── */
.profile-header {
  display: flex; align-items: center; gap: 20px;
  padding: 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius) var(--radius) 0 0; color: white;
}
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: var(--primary-dark);
  border: 3px solid rgba(255,255,255,0.4);
  flex-shrink: 0;
}
.profile-name { font-size: 20px; font-weight: 700; }
.profile-sub  { font-size: 13px; opacity: 0.75; margin-top: 2px; }
.profile-badges { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.profile-badge {
  padding: 3px 10px; border-radius: 12px;
  background: rgba(255,255,255,0.2);
  font-size: 11px; font-weight: 500;
}

/* ── Timeline ── */
.timeline { padding-left: 20px; }
.timeline-item {
  position: relative; padding: 0 0 20px 24px;
  border-left: 2px solid var(--border);
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -6px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); border: 2px solid white;
}
.timeline-dot.success { background: var(--success); }
.timeline-dot.danger  { background: var(--danger); }
.timeline-dot.warning { background: var(--warning); }
.timeline-title { font-size: 13px; font-weight: 600; }
.timeline-time  { font-size: 11px; color: var(--text-muted); }
.timeline-desc  { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ── Progress ── */
.progress {
  height: 8px; background: var(--border);
  border-radius: 4px; overflow: hidden;
}
.progress-bar {
  height: 100%; border-radius: 4px;
  background: var(--primary); transition: width .5s;
}
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger  { background: var(--danger); }

/* ── Donut / Stat ring ── */
.stat-ring-wrapper { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.stat-ring-center { position: absolute; text-align: center; }

/* ── Chart containers ── */
.chart-container { position: relative; }

/* ── Notification panel ── */
.notification-panel {
  position: absolute; top: 48px; right: 0;
  width: 340px; background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 500;
  display: none;
}
.notification-panel.open { display: block; }
.notif-header {
  padding: 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.notif-item {
  display: flex; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid #f5f5f7;
  cursor: pointer; transition: background .15s;
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: rgba(26,60,110,0.03); }
.notif-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.notif-msg { font-size: 12px; color: var(--text-primary); line-height: 1.5; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── QR Code mockup ── */
.qr-mock {
  width: 100px; height: 100px;
  background: repeating-conic-gradient(#000 0deg 90deg, #fff 90deg 180deg) 0 0 / 10px 10px;
  border: 4px solid white;
  box-shadow: 0 0 0 1px #ccc;
}

/* ── Document cards ── */
.doc-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg);
  cursor: pointer; transition: border-color .2s;
}
.doc-card:hover { border-color: var(--primary); }
.doc-icon {
  width: 40px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.doc-info .doc-name { font-size: 13px; font-weight: 500; }
.doc-info .doc-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Upload Zone ── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px; text-align: center;
  cursor: pointer; transition: all .2s;
  background: var(--bg);
}
.upload-zone:hover { border-color: var(--primary); background: rgba(26,60,110,0.03); }
.upload-zone .upload-icon { font-size: 36px; margin-bottom: 10px; color: var(--text-muted); }
.upload-zone p { font-size: 13px; color: var(--text-secondary); }
.upload-zone span { color: var(--primary); font-weight: 600; cursor: pointer; }

/* ── Search ── */
.search-box {
  position: relative; display: flex; align-items: center;
}
.search-box .form-control { padding-left: 36px; }
.search-box .search-icon {
  position: absolute; left: 11px; font-size: 14px; color: var(--text-muted);
}

/* ── Pass card print preview ── */
.pass-card {
  width: 320px; border: 2px solid var(--primary);
  border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow);
}
.pass-card-header {
  background: var(--primary); color: white;
  padding: 12px 16px; text-align: center;
}
.pass-card-header .pass-logo { font-size: 11px; opacity: 0.7; }
.pass-card-header .pass-title { font-size: 14px; font-weight: 700; margin-top: 2px; }
.pass-card-body { padding: 16px; display: flex; gap: 16px; }
.pass-photo {
  width: 64px; height: 80px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; flex-shrink: 0;
}
.pass-info .pass-name { font-size: 15px; font-weight: 700; }
.pass-info .pass-detail { font-size: 11px; color: var(--text-secondary); margin-top: 3px; }
.pass-card-footer {
  background: var(--bg); padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border);
}
.pass-validity { font-size: 11px; }
.pass-validity strong { display: block; font-size: 13px; color: var(--primary); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .sidebar { width: 64px; }
  .sidebar-brand .brand-name,
  .sidebar-brand .brand-sub,
  .nav-item .nav-label,
  .nav-item .nav-badge,
  .nav-section-label,
  .sidebar-user .user-info { display: none; }
  .topbar { left: 64px; }
  .main-content { margin-left: 64px; padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .login-left { display: none; }
  .login-right { width: 100%; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .steps { flex-direction: column; gap: 16px; }
  .step-item::after { display: none; }
}

/* ── Utilities ── */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary  { color: var(--primary); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-warning  { color: var(--warning); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.spacer { flex: 1; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
