/* ============================================================
   JORIKEN HUB ECOSYSTEM — GLOBAL DESIGN SYSTEM
   ============================================================ */

/* ── CSS VARIABLES ─────────────────────────────────────── */
/* Joriken Hub flag palette: black / red #D40101 / green #025D04 / white.
   Semantic aliases (use these in new code); the legacy --hub-* names are
   kept as the engine so every existing rule re-themes instantly. */
:root {
  --jrk-red: #D40101;          /* primary — flag red */
  --jrk-red-deep: #A40000;
  --jrk-green: #0A7D34;        /* success — flag green family */
  --jrk-black: #0A0A0C;        /* flag black */
  --jrk-white: #FCFCFC;

  --hub-blue: #D40101;
  --hub-blue-light: #F04A4A;
  --hub-blue-dark: #A40000;
  --hub-green: #0A7D34;
  --hub-red: #DC2626;
  --hub-accent: #A40000;
  --hub-purple: #334155;

  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.08);
  --transition: all 0.2s ease;
  --radius: 12px;
}

html.dark {
  /* brighter flag tones for dark surfaces (AA contrast) */
  --hub-blue: #F25C5C;
  --hub-blue-light: #FF8A8A;
  --hub-blue-dark: #D40101;
  --hub-green: #2FBF6B;
  --hub-red: #F87171;
  --hub-accent: #FF9D9D;
  --hub-purple: #94A3B8;

  --bg: #0A0A0C;
  --surface: #111827;
  --surface-2: #1f2937;
  --border: #1f2937;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.5), 0 4px 16px rgba(0,0,0,0.4);
}

/* ── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── ANIMATIONS ────────────────────────────────────────── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 0 rgba(212,1,1,0.4);} 50%{box-shadow:0 0 0 8px rgba(212,1,1,0);} }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { from{background-position:-200% center} to{background-position:200% center} }

.fade-in { animation: fadeInUp 0.5s ease both; }
.fade-in-delay-1 { animation-delay: 0.08s; }
.fade-in-delay-2 { animation-delay: 0.16s; }
.fade-in-delay-3 { animation-delay: 0.24s; }
.hidden { display: none !important; }

/* ── UTILITY ───────────────────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.text-muted { color: var(--text-muted); }
.text-subtle { color: var(--text-subtle); }
.text-sm { font-size: 13px; }
.text-center { text-align: center; }
.mb-24 { margin-bottom: 24px; }
.mt-24 { margin-top: 24px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── UTILITY BAR ───────────────────────────────────────── */
.util-bar {
  height: 36px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  font-size: 12px; color: var(--text-muted); font-weight: 600;
  position: sticky; top: 0; z-index: 100;
}
.util-bar-right { display: flex; align-items: center; gap: 12px; }
.util-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; font-size: 12px; font-weight: 700;
  color: var(--text-muted); cursor: pointer; padding: 4px 10px;
  border-radius: 6px; transition: var(--transition); text-decoration: none;
}
.util-btn svg { width: 14px; height: 14px; }
.util-btn:hover { color: var(--hub-blue); background: rgba(212,1,1,0.06); }

/* ── NAVBAR ────────────────────────────────────────────── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 36px; z-index: 90;
  box-shadow: 0 1px 0 var(--border);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; gap: 24px;
}
.nav-brand { display: flex; align-items: center; gap: 12px; }
.nav-logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--hub-blue), var(--hub-blue-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900; color: white;
  font-family: 'Outfit', sans-serif;
  border: 2px solid rgba(212,1,1,0.3);
  flex-shrink: 0;
}
.nav-brand-text h1, .nav-brand-text .nav-brand-name { font-family: 'Outfit',sans-serif; font-size: 18px; font-weight: 900; line-height: 1.1; display: block; }
.nav-brand-text span { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-link {
  font-size: 13px; font-weight: 700; color: var(--text-muted);
  padding: 8px 14px; border-radius: 8px; transition: var(--transition);
  text-decoration: none; display: flex; align-items: center; gap: 6px;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--hub-blue); background: rgba(212,1,1,0.08); }
.nav-user-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 99px; padding: 6px 14px 6px 6px;
  cursor: pointer; transition: var(--transition);
}
.nav-user-chip:hover { border-color: var(--hub-blue); }
.nav-mobile-toggle {
  display: none; flex-direction: column; gap: 4px; background: none; border: none;
  padding: 8px; border-radius: 8px; cursor: pointer; margin-left: auto;
}
.nav-mobile-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 1px; display: block; transition: var(--transition); }
@media(max-width:768px){ .nav-mobile-toggle { display: flex; } .nav-links { display: none; } .nav-brand-text h1 { font-size: 15px; } }

/* ── HERO ──────────────────────────────────────────────── */
.hero {
  min-height: 420px; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center;
  padding: 80px 24px; position: relative; overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hero h1, .hero h2 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 900; margin-bottom: 16px; line-height: 1.1;
}
.hero h2 span { color: var(--hub-blue); }
.hero-sub { font-size: 17px; color: var(--text-muted); max-width: 620px; margin: 0 auto 32px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(212,1,1,0.06); border: 1px solid rgba(212,1,1,0.15);
  border-radius: 99px; padding: 6px 16px; font-size: 12px;
  font-weight: 700; color: var(--hub-blue); margin-bottom: 24px;
  letter-spacing: 0.02em;
}
.hero-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--hub-green); }

/* ── STATS BAR ─────────────────────────────────────────── */
.stats-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 0;
  padding: 0;
}
.stat-item {
  flex: 1; min-width: 140px; padding: 20px 24px; text-align: center;
  border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }
.stat-number { font-family: 'Outfit',sans-serif; font-size: 28px; font-weight: 900; color: var(--hub-blue); }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-top: 2px; }

/* ── SECTIONS ──────────────────────────────────────────── */
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.section-header { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--hub-blue); margin-bottom: 12px; display: block; }
.section-title { font-family: 'Outfit',sans-serif; font-size: clamp(24px,3vw,36px); font-weight: 900; line-height: 1.2; }
.section-sub { font-size: 15px; color: var(--text-muted); margin-top: 12px; }

/* ── GRIDS ─────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
@media(max-width:1100px){ .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media(max-width:900px){ .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-2 { grid-template-columns: 1fr; } }
@media(max-width:600px){ .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 14px; } }

/* ── CARDS ─────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow);
}
.card-hover { transition: var(--transition); }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* ── DIRECTORATE CARDS ─────────────────────────────────── */
.dir-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px; display: flex; flex-direction: column;
  transition: var(--transition); text-decoration: none !important; color: var(--text);
}
.dir-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.dir-card-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.dir-card-title { font-family: 'Outfit',sans-serif; font-size: 16px; font-weight: 800; }
.dir-card-count { font-size: 12px; color: var(--text-muted); font-weight: 700; }
.dir-card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.dir-card-arrow { color: var(--hub-blue); transition: var(--transition); }
.dir-card:hover .dir-card-arrow { transform: translateX(4px); }

/* ── BUTTONS ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 24px; border-radius: 10px; font-weight: 700; font-size: 14px;
  border: 1.5px solid transparent; cursor: pointer; transition: var(--transition);
  text-decoration: none; white-space: nowrap; font-family: 'Inter', sans-serif;
}
.btn:focus-visible { outline: 3px solid var(--hub-blue); outline-offset: 2px; }
.btn-primary { background: var(--hub-blue); color: white; border-color: var(--hub-blue); }
.btn-primary:hover { background: var(--hub-blue-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(212,1,1,0.3); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--hub-blue); color: var(--hub-blue); background: rgba(212,1,1,0.04); }
.btn-accent { background: var(--hub-accent); color: white; border-color: var(--hub-accent); }
.btn-accent:hover { background: #d97706; transform: translateY(-1px); }
.btn-success { background: var(--hub-green); color: white; border-color: var(--hub-green); }
.btn-success:hover { background: #067A2E; transform: translateY(-1px); }
.btn-danger { background: var(--hub-red); color: white; border-color: var(--hub-red); }
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 14px 32px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }

/* ── FORMS ─────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.form-label span { color: var(--hub-red); }
.form-input {
  width: 100%; padding: 12px 14px; background: var(--surface);
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; color: var(--text); transition: var(--transition);
  outline: none; appearance: none;
}
.form-input:focus { border-color: var(--hub-blue); box-shadow: 0 0 0 3px rgba(212,1,1,0.1); }
textarea.form-input { min-height: 120px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media(max-width:560px){ .form-row { grid-template-columns: 1fr; } }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.input-icon-wrap { position: relative; }
.input-icon-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.input-icon-wrap .form-input { padding-left: 44px; }
.input-eye { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 16px; color: var(--text-muted); }
.check-label { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; }
.check-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--hub-blue); }
.filter-btn { padding: 8px 18px; border-radius: 99px; border: 1.5px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 700; color: var(--text-muted); cursor: pointer; transition: var(--transition); }
.filter-btn:hover { border-color: var(--hub-blue); color: var(--hub-blue); }
.filter-btn.active { background: var(--hub-blue); color: white; border-color: var(--hub-blue); }

/* ── SEARCH ────────────────────────────────────────────── */
.search-wrap { position: relative; }
.search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--text-muted); z-index: 1; }
.search-input {
  width: 100%; padding: 16px 20px 16px 52px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 14px; font-size: 15px; color: var(--text);
  outline: none; transition: var(--transition); box-shadow: var(--shadow);
}
.search-input:focus { border-color: var(--hub-blue); box-shadow: 0 0 0 4px rgba(212,1,1,0.1), var(--shadow); }
.search-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  max-height: 360px; overflow-y: auto; z-index: 200; display: none;
  animation: slideDown 0.15s ease;
}
.search-dropdown.open { display: block; }
.search-result {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  cursor: pointer; transition: var(--transition); text-decoration: none; color: var(--text);
}
.search-result:hover { background: var(--surface-2); }
.search-result-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.search-result-name { font-weight: 700; font-size: 13px; }
.search-result-dir { font-size: 11px; color: var(--text-muted); }

/* ── APP LAYOUT (Sidebar + Main) ───────────────────────── */
.app-layout { display: flex; min-height: calc(100vh - 100px); }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border); padding: 20px 12px;
  position: sticky; top: 100px; height: calc(100vh - 100px);
  overflow-y: auto;
}
@media(max-width:768px){
  /* sidebar becomes a horizontal, scrollable tab strip so every tab stays
     reachable on phones and narrow windows (admin + ISP consoles alike) */
  .app-layout { flex-direction: column; }
  .sidebar {
    display: flex; flex-direction: row; align-items: center; gap: 14px;
    width: 100%; height: auto; position: static;
    overflow-x: auto; overflow-y: hidden;
    padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--border);
    -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  }
  .sidebar-section {
    display: flex; flex-direction: row; align-items: center; gap: 6px;
    margin: 0; flex: 0 0 auto;
  }
  .sidebar-section + .sidebar-section { border-left: 1px solid var(--border); padding-left: 14px; }
  .sidebar-label { display: none; }
  .sidebar-link { white-space: nowrap; padding: 8px 14px; border-radius: 99px; margin: 0; }
  /* info/session cards don't belong in a tab strip */
  .sidebar-section > div:not(.sidebar-label) { display: none; }
}
.main-content { flex: 1; min-width: 0; padding: 32px; }
@media(max-width:768px){ .main-content { padding: 16px; } }
.sidebar-section { margin-bottom: 24px; }
.sidebar-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-subtle); padding: 0 12px 8px; display: block; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--text-muted);
  transition: var(--transition); cursor: pointer; text-decoration: none;
  border: none; background: none; width: 100%;
}
.sidebar-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-link:hover { background: var(--surface-2); color: var(--text); }
.sidebar-link.active { background: rgba(212,1,1,0.08); color: var(--hub-blue); font-weight: 700; }

/* ── PROGRESS & BADGES ─────────────────────────────────── */
.progress-bar { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--hub-blue), var(--hub-blue-light)); border-radius: 99px; transition: width 0.6s ease; }
.status {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: capitalize;
}
.status-active, .status-paid, .status-done { background: rgba(2,93,4,0.12); color: #067A2E; }
.status-pending { background: rgba(164,0,0,0.12); color: #d97706; }
.status-review { background: rgba(51,65,85,0.12); color: #7c3aed; }
.status-cancelled, .status-rejected { background: rgba(239,68,68,0.1); color: #dc2626; }
.status-confirmed { background: rgba(212,1,1,0.1); color: var(--hub-blue); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; font-size: 11px; font-weight: 800; }
.badge-blue { background: rgba(212,1,1,0.1); color: var(--hub-blue); }
.badge-red { background: rgba(239,68,68,0.1); color: var(--hub-red); }
.badge-green { background: rgba(2,93,4,0.1); color: var(--hub-green); }

/* ── STEPS ─────────────────────────────────────────────── */
.steps { display: flex; align-items: center; justify-content: center; margin-bottom: 32px; gap: 0; }
.step-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.step-circle { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: var(--text-muted); transition: var(--transition); }
.step-item.active .step-circle { border-color: var(--hub-blue); background: var(--hub-blue); color: white; }
.step-item.done .step-circle { border-color: var(--hub-green); background: var(--hub-green); color: white; }
.step-label { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.step-item.active .step-label { color: var(--hub-blue); }
.step-line { flex: 1; max-width: 60px; height: 2px; background: var(--border); }

/* ── MODALS ────────────────────────────────────────────── */
.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: 24px;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border-radius: 20px; padding: 32px;
  width: 100%; max-width: 540px; box-shadow: var(--shadow-lg);
  animation: slideDown 0.2s ease;
  max-height: 90vh; overflow-y: auto;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-family: 'Outfit',sans-serif; font-size: 20px; font-weight: 900; }
.modal-close { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); }
.modal-close svg { width: 16px; height: 16px; }
.modal-close:hover { background: rgba(239,68,68,0.1); color: var(--hub-red); border-color: var(--hub-red); }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── TABLE ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead tr { background: var(--surface-2); }
th { padding: 12px 16px; text-align: left; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }

/* ── FILE DROPZONE ─────────────────────────────────────── */
.file-dropzone {
  border: 2px dashed var(--border); border-radius: 14px; padding: 40px 24px;
  text-align: center; cursor: pointer; transition: var(--transition);
  color: var(--text-muted); background: var(--surface-2);
}
.file-dropzone svg { width: 40px; height: 40px; margin: 0 auto 12px; opacity: 0.6; }
.file-dropzone:hover, .file-dropzone.drag-over { border-color: var(--hub-blue); background: rgba(212,1,1,0.04); color: var(--hub-blue); }

/* ── CREDIT CARD PREVIEW ───────────────────────────────── */
.credit-card {
  background: linear-gradient(135deg, #1C0708, #D40101, #A40000);
  border-radius: 16px; padding: 24px; margin-bottom: 24px;
  color: white; position: relative; overflow: hidden;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
}
.credit-card::before { content: ''; position: absolute; top: -30px; right: -30px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,0.06); }
.credit-card::after { content: ''; position: absolute; bottom: -40px; right: 40px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,0.04); }
.card-chip { width: 40px; height: 32px; background: linear-gradient(135deg, #A40000, #d97706); border-radius: 6px; margin-bottom: 24px; }
.card-number { font-family: 'Outfit',sans-serif; font-size: 20px; font-weight: 700; letter-spacing: 0.15em; margin-bottom: 20px; position: relative; z-index: 1; }
.card-row { display: flex; justify-content: space-between; align-items: flex-end; position: relative; z-index: 1; }
.card-label { font-size: 10px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }
.card-value { font-size: 14px; font-weight: 700; }

/* ── RING CHART ────────────────────────────────────────── */
.ring-chart { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.ring-chart svg { transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--border); }
.ring-fill { fill: none; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.ring-label { position: absolute; text-align: center; }
.ring-pct { font-family: 'Outfit',sans-serif; font-weight: 900; display: block; }
.ring-sub { font-size: 10px; color: var(--text-muted); font-weight: 600; }

/* ── AVATAR ────────────────────────────────────────────── */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--hub-blue), var(--hub-blue-dark));
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 12px; border-radius: 8px; }

/* ── TOAST NOTIFICATIONS ───────────────────────────────── */
.toast-wrap { position: fixed; bottom: 88px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 20px; box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
  font-size: 13px; font-weight: 600;
}
.toast-success { border-left: 4px solid var(--hub-green); }
.toast-error { border-left: 4px solid var(--hub-red); }
.toast-info { border-left: 4px solid var(--hub-blue); }
.toast-warn { border-left: 4px solid var(--hub-accent); }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-close { margin-left: auto; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 0 0 8px; flex-shrink: 0; }

/* ── FOOTER ────────────────────────────────────────────── */
.footer { background: #0f172a; color: rgba(255,255,255,0.7); padding: 60px 24px 24px; }
.footer-grid { max-width: 1280px; margin: 0 auto 40px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
@media(max-width:900px){ .footer-grid { grid-template-columns: 1fr 1fr; } }
@media(max-width:560px){ .footer-grid { grid-template-columns: 1fr; } }
.footer-brand h3 { font-family: 'Outfit',sans-serif; font-size: 18px; font-weight: 900; color: white; margin-bottom: 12px; }
.footer-brand p { font-size: 13px; line-height: 1.7; }
.footer-col h4 { font-size: 13px; font-weight: 800; color: white; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.08em; }
.footer-col a { display: block; font-size: 13px; color: rgba(255,255,255,0.6); margin-bottom: 8px; transition: var(--transition); }
.footer-col a:hover { color: white; }
.footer-bottom { max-width: 1280px; margin: 0 auto; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.1); display: flex; justify-content: space-between; font-size: 12px; flex-wrap: wrap; gap: 8px; }
.footer-bottom a { color: rgba(255,255,255,0.5); transition: var(--transition); }
.footer-bottom a:hover { color: white; }

/* ── COUNTER NUMBER ANIMATION ──────────────────────────── */
[data-count] { transition: none; }

/* ── DARK MODE TOGGLE ──────────────────────────────────── */
html.dark .stats-bar, html.dark .navbar, html.dark .util-bar { background: var(--surface); }
html.dark .hero-mesh { background-color: #0f172a; background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px); }

/* ── DIRECTORATE GRID (index.html) ─────────────────────── */
.dir-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}
@media(max-width:1100px){ .dir-grid { grid-template-columns: repeat(3,1fr); } }
@media(max-width:700px){ .dir-grid { grid-template-columns: repeat(2,1fr); } }
@media(max-width:460px){ .dir-grid { grid-template-columns: 1fr; } }

/* ── SERVICE HIGHLIGHT CARD (featured services) ─────────── */
.service-highlight-card {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px;
  transition: var(--transition);
}
.service-highlight-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--hub-blue-light); }

/* ── SERVICES GRID (services.html) ──────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media(max-width:1100px){ .services-grid { grid-template-columns: repeat(2,1fr); } }
@media(max-width:600px){ .services-grid { grid-template-columns: 1fr; } }

/* ── SERVICE CARD ───────────────────────────────────────── */
.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--hub-blue);
}

/* ── SERVICE ICON BOX ───────────────────────────────────── */
.service-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

/* ── DIR PILL (directorate tag on service cards) ─────────── */
.dir-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
}

/* ── BADGE ──────────────────────────────────────────────── */
.badge { display:inline-flex; align-items:center; justify-content:center; padding:2px 8px; border-radius:99px; font-size:11px; font-weight:800; }
.badge-blue { background:rgba(212,1,1,0.12); color:var(--hub-blue); }
.badge-green { background:rgba(2,93,4,0.12); color:var(--hub-green); }
.badge-red { background:rgba(239,68,68,0.12); color:var(--hub-red); }
.badge-amber { background:rgba(164,0,0,0.12); color:#A40000; }
.badge-purple { background:rgba(51,65,85,0.12); color:var(--hub-purple); }

/* ── METRIC CARD (dashboard) ────────────────────────────── */
.metric-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px;
  transition: var(--transition);
}
.metric-card:hover { box-shadow: var(--shadow); }
.metric-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }

/* ── STATUS BADGES ──────────────────────────────────────── */
.status-active  { background:rgba(2,93,4,0.12); color:#067A2E; padding:4px 10px; border-radius:99px; font-size:11px; font-weight:800; display:inline-flex; align-items:center; gap:4px; }
.status-pending { background:rgba(164,0,0,0.12); color:#A40000;  padding:4px 10px; border-radius:99px; font-size:11px; font-weight:800; display:inline-flex; align-items:center; gap:4px; }
.status-review  { background:rgba(99,102,241,0.12); color:#4f46e5;  padding:4px 10px; border-radius:99px; font-size:11px; font-weight:800; display:inline-flex; align-items:center; gap:4px; }
.status-cancelled { background:rgba(239,68,68,0.12); color:#b91c1c; padding:4px 10px; border-radius:99px; font-size:11px; font-weight:800; display:inline-flex; align-items:center; gap:4px; }
.status-confirmed { background:rgba(212,1,1,0.12); color:var(--hub-blue); padding:4px 10px; border-radius:99px; font-size:11px; font-weight:800; display:inline-flex; align-items:center; gap:4px; }

/* ── PROGRESS BAR ───────────────────────────────────────── */
.progress-track { background:var(--border); border-radius:99px; height:8px; overflow:hidden; }
.progress-fill  { height:100%; border-radius:99px; transition:width 0.6s ease; background:linear-gradient(90deg, var(--hub-blue), var(--hub-blue-light)); }

/* ── MILESTONE ──────────────────────────────────────────── */
.milestone { display:flex; gap:12px; padding:10px 0; border-bottom:1px solid var(--border); align-items:center; font-size:13px; }
.milestone:last-child { border-bottom:none; }
.milestone-dot { width:20px; height:20px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:10px; flex-shrink:0; }

/* ── FILE DROPZONE ──────────────────────────────────────── */
.file-dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 32px; text-align: center; cursor: pointer;
  transition: var(--transition); color: var(--text-muted);
}
.file-dropzone:hover, .file-dropzone.drag-over { border-color: var(--hub-blue); background: rgba(212,1,1,0.04); }
.file-dropzone svg { width: 40px; height: 40px; color: var(--text-subtle); margin: 0 auto 12px; }
.file-dropzone p { font-size: 14px; }

/* ── FORM STYLES ────────────────────────────────────────── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media(max-width:600px){ .form-row { grid-template-columns: 1fr; } }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.form-label span { color: var(--hub-red); }
.form-input {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 14px; transition: var(--transition);
  outline: none;
}
.form-input:focus { border-color: var(--hub-blue); box-shadow: 0 0 0 3px rgba(212,1,1,0.12); }
textarea.form-input { min-height: 110px; resize: vertical; }
.check-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }

/* ── DIVIDER ────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── TRUNCATE ───────────────────────────────────────────── */
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── CARD HOVER ─────────────────────────────────────────── */
.card-hover { transition: var(--transition); }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

html, body { max-width: 100%; overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }
.main-content, .card, .tpl-card, .plan-card { min-width: 0; }
/* ── RESPONSIVE TWEAKS ─────────────────────────────────── */
@media(max-width:900px){
  .dashboard-grid, .pay-layout, .req-layout { grid-template-columns: 1fr !important; }
}
@media(max-width:768px){
  .hero { padding: 48px 20px; }
  .section { padding: 48px 0; }
  .main-content { padding: 14px; }
  .stats-bar { display: none; }
  .util-bar-left { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr !important; }
  .modal { max-width: calc(100vw - 16px) !important; width: 100% !important; padding: 18px 14px !important; }
  .toast-container, #toast-container { right: 10px; left: 10px; max-width: calc(100vw - 20px); }
  .kh-wa-fab { width: 46px !important; height: 46px !important; font-size: 22px !important; bottom: 14px !important; right: 14px !important; }
}
@media(max-width:560px){
  .footer-grid { grid-template-columns: 1fr !important; }
  .tpl-grid, .plan-grid, .tpl-loc-grid { grid-template-columns: 1fr !important; }
  .invoice-item { flex-wrap: wrap; }
  .ws-tabs, .pay-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .ws-tab, .pay-tab { white-space: nowrap; }
}
.hero { position: relative; overflow: hidden; background: linear-gradient(160deg, #0A0A0C 0%, #1C0708 55%, #0F172A 100%); color: #ffffff; }
.hero-sub { color: rgba(255,255,255,0.86); max-width: 680px; margin: 0 auto 28px; font-size: 16px; line-height: 1.65; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px; border: 1px solid rgba(255,255,255,0.22); background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.92); font-size: 12px; font-weight: 700; margin-bottom: 18px; }
.dir-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
@media(max-width:1100px){ .dir-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media(max-width:768px){ .dir-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media(max-width:480px){ .dir-grid { grid-template-columns: 1fr; } }
.service-highlight-card { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px; display: flex; align-items: flex-start; gap: 14px; transition: var(--transition); }
.service-highlight-card:hover { border-color: var(--hub-blue); box-shadow: var(--shadow); }
.why-card { text-align: center; padding: 28px 22px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); transition: var(--transition); }
.why-card:hover { border-color: var(--hub-blue); box-shadow: var(--shadow); }
.why-icon { width: 58px; height: 58px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; font-size: 22px; }
.cta-section { background: linear-gradient(135deg, #D40101, #1C0708); padding: 72px 24px; text-align: center; color: #ffffff; }
.cta-section h2, .cta-section p { color: #ffffff; }
.kh-wa-fab { position: fixed; bottom: 22px; right: 22px; width: 54px; height: 54px; border-radius: 50%; background: #25d366; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 9999; transition: transform .2s ease, box-shadow .2s ease; text-decoration: none; }
.kh-wa-fab:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,.3); color: #fff; }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── MOBILE HAMBURGER DRAWER & AUTO-INSTALL POPUP ──────── */
.nav-mobile-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-mobile-toggle.open span:nth-child(2) { opacity: 0; }
.nav-mobile-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.kh-mobile-backdrop {
  position: fixed; inset: 0; background: rgba(10, 10, 12, 0.55);
  z-index: 1090; opacity: 0; pointer-events: none; transition: opacity 0.22s ease;
}
.kh-mobile-backdrop.open { opacity: 1; pointer-events: auto; }

.kh-mobile-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(310px, 86vw);
  background: var(--surface); border-left: 1px solid var(--border);
  z-index: 1100; transform: translateX(100%); transition: transform 0.24s ease;
  display: flex; flex-direction: column; box-shadow: -12px 0 32px rgba(0, 0, 0, 0.22);
}
.kh-mobile-drawer.open { transform: translateX(0); }
.kh-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border); font-size: 15px;
}
.kh-drawer-close {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  width: 34px; height: 34px; font-size: 20px; line-height: 1; cursor: pointer; color: var(--text);
}
.kh-drawer-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.kh-drawer-link {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text);
  text-decoration: none; transition: background 0.15s ease;
}
.kh-drawer-link:hover, .kh-drawer-link.active { background: rgba(212, 1, 1, 0.09); color: var(--hub-blue); font-weight: 700; }
.kh-drawer-foot {
  padding: 12px 16px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: space-between;
}

.kh-install-banner {
  position: fixed; left: 12px; right: 12px; bottom: 14px; max-width: 460px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--hub-blue);
  border-radius: 14px; padding: 12px 14px; box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
  display: flex; align-items: center; gap: 10px; z-index: 9998; flex-wrap: wrap;
  transform: translateY(130%); transition: transform 0.26s ease;
}
.kh-install-banner.open { transform: translateY(0); }
.kh-install-icon { width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0; object-fit: cover; }
.kh-install-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kh-install-copy strong { font-size: 13.5px; color: var(--text); }
.kh-install-copy span { font-size: 11.5px; color: var(--text-muted); line-height: 1.35; }
.kh-install-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.kh-install-close {
  background: none; border: none; font-size: 20px; line-height: 1; padding: 4px 6px;
  color: var(--text-muted); cursor: pointer;
}

@media(max-width:768px){
  .util-bar { height: auto; min-height: 34px; padding: 6px 14px; font-size: 11.5px; gap: 8px; }
  .util-bar > div:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
  .util-bar > div:first-child span:nth-of-type(n+2),
  .util-bar > div:first-child i:nth-of-type(n+2) { display: none; }
  .container { padding: 0 14px; }
  .navbar .nav-inner { height: 60px; padding: 0 14px; }
  .nav-brand img { width: 36px !important; height: 36px !important; }
  .nav-brand-name { font-size: 15px; }
  .main-content { padding: 14px 12px 84px; }
  .sidebar { scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
}
@media(max-width:600px){
  .li-row { grid-template-columns: 1fr 1fr !important; }
  .li-row .li-name { grid-column: 1 / -1; }
}

/* ── ACCESSIBILITY: REDUCED MOTION + KEYBOARD FOCUS ───── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
  }
  .fade-in { animation: none !important; opacity: 1 !important; transform: none !important; }
}
:focus-visible { outline: 3px solid var(--hub-blue); outline-offset: 2px; border-radius: 4px; }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible {
  outline: 3px solid var(--hub-blue); outline-offset: 2px;
}

/* ── SCREEN-READER-ONLY TEXT ────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ── ANDROID APK APP-MODE SKIN (Hides all website chrome) ─ */
html.kh-app-mode body { background: #F5F7FA !important; }
html.kh-app-mode .util-bar,
html.kh-app-mode .navbar,
html.kh-app-mode .footer,
html.kh-app-mode .kh-wa-fab,
html.kh-app-mode #kh-install-banner,
html.kh-app-mode aside.sidebar,
html.kh-app-mode .kh-drawer,
html.kh-app-mode .kh-drawer-backdrop,
html.kh-app-mode .auth-left { display: none !important; }

html.kh-app-mode .app-layout,
html.kh-app-mode .auth-split {
  display: block !important;
  min-height: auto !important;
  padding: 0 !important;
}
html.kh-app-mode .main-content,
html.kh-app-mode .auth-right {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 12px 12px 24px !important;
}
html.kh-app-mode .card,
html.kh-app-mode .service-card,
html.kh-app-mode .kpi-card,
html.kh-app-mode .plan-card,
html.kh-app-mode .summary-card,
html.kh-app-mode .auth-card {
  border-radius: 16px !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05) !important;
  padding: 16px !important;
}
html.kh-app-mode .modal-overlay { align-items: flex-end !important; padding: 0 !important; }
html.kh-app-mode .modal {
  border-radius: 20px 20px 0 0 !important;
  max-height: 92vh !important;
  width: 100% !important;
  max-width: 100% !important;
}
