/* ===================================================
   SAHAFRIC — LeatherConnect Nigeria
   Brand Design System
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ── SAHAFRIC Brand Colours (Official Brand Guidelines v1.0) ── */
  --sahafric-navy:    #03060A;   /* Midnight — primary background */
  --sahafric-orange:  #FF6900;   /* SAHAFRIC Orange — primary accent */
  --sahafric-amber:   #FCB900;   /* Amber — secondary accent */
  --sahafric-green:   #1DB954;   /* Growth Green */
  --sahafric-gold:    #FCB900;   /* Alias for amber */
  --sahafric-red:     #E53935;   /* Danger/error */
  --sahafric-charcoal:#212529;   /* Charcoal — dark surfaces */

  /* UI Tones */
  --bg-body:          #F7F5F2;
  --bg-card:          #FFFFFF;
  --bg-sidebar:       #03060A;   /* Midnight */
  --bg-sidebar-hover: #1A1F26;
  --bg-dark:          #03060A;
  --text-primary:     #03060A;
  --text-secondary:   #4A5568;
  --text-muted:       #718096;
  --text-sidebar:     #A0AEC0;
  --border-light:     #E8E4DF;
  --border-medium:    #CBD5E0;

  /* Status */
  --success:    #1DB954;
  --success-bg: #E6F9ED;
  --warning:    #FCB900;
  --warning-bg: #FFFBEB;
  --danger:     #E53935;
  --danger-bg:  #FDECEA;
  --info:       #FF6900;
  --info-bg:    #FFF2E8;

  /* Spacing */
  --sidebar-w: 260px;
  --topbar-h:  64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.14);
  --shadow-card:0 2px 8px rgba(26,62,110,.08);
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--bg-body); color: var(--text-primary); line-height: 1.6; }
a { color: var(--sahafric-navy); text-decoration: none; }
a:hover { color: var(--sahafric-red); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ─── Typography ─── */
h1,h2,h3,h4,h5,h6 { font-family: 'Outfit', sans-serif; font-weight: 700; color: var(--sahafric-navy); line-height: 1.3; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.text-sm  { font-size: .85rem; }
.text-xs  { font-size: .75rem; }
.text-lg  { font-size: 1.1rem; }
.text-xl  { font-size: 1.3rem; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

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

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh;
  z-index: 1000; transition: transform .3s ease;
  overflow: hidden;
}
.sidebar-brand {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-brand img { width: 38px; height: 38px; object-fit: contain; border-radius: 8px; }
.sidebar-brand-name { font-family: 'Outfit', sans-serif; font-size: 1.1rem; color: #fff; font-weight: 700; }
.sidebar-brand-sub  { font-size: .68rem; color: var(--text-sidebar); letter-spacing: .05em; text-transform: uppercase; }

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

.nav-section-label {
  font-size: .65rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.3); padding: 12px 24px 6px;
}
.nav-item { position: relative; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 24px; color: var(--text-sidebar);
  font-size: .88rem; font-weight: 400; transition: all .2s;
  border-left: 3px solid transparent;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active {
  background: rgba(255,255,255,.1); color: #fff;
  border-left-color: var(--sahafric-amber);
}
.nav-link i { width: 18px; text-align: center; font-size: .95rem; opacity: .8; }
.nav-badge {
  margin-left: auto; background: var(--sahafric-red);
  color: #fff; font-size: .65rem; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
}
.nav-has-sub .nav-link::after { content: '\f107'; font-family: 'Font Awesome 6 Free'; font-weight: 900; margin-left: auto; font-size: .75rem; opacity: .5; transition: transform .2s; }
.nav-has-sub.open .nav-link::after { transform: rotate(180deg); }
.nav-sub { display: none; background: rgba(0,0,0,.2); }
.nav-sub.open { display: block; }
.nav-sub .nav-link { padding-left: 54px; font-size: .84rem; }

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--sahafric-amber); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; flex-shrink: 0;
}
.sidebar-user-name  { font-size: .85rem; color: #fff; font-weight: 500; }
.sidebar-user-role  { font-size: .7rem; color: var(--text-sidebar); }
.sidebar-logout {
  margin-left: auto; color: var(--text-sidebar);
  font-size: .85rem; transition: color .2s;
}
.sidebar-logout:hover { color: var(--sahafric-red); }

/* ─── TOPBAR ─── */
.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h); background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; padding: 0 28px;
  gap: 16px; z-index: 900; box-shadow: var(--shadow-sm);
  overflow: visible;
}
.topbar-toggle {
  display: none; background: none; border: none; cursor: pointer;
  font-size: 1.2rem; color: var(--text-secondary);
}
.topbar-breadcrumb { flex: 1; }
.topbar-breadcrumb h4 { font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.topbar-breadcrumb small { font-size: .75rem; color: var(--text-muted); }

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

/* Notification Bell */
.notif-bell {
  position: relative; cursor: pointer;
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-body); border: 1px solid var(--border-light);
  color: var(--text-secondary); font-size: 1rem; transition: all .2s;
}
.notif-bell:hover { background: var(--info-bg); color: var(--sahafric-navy); }
.notif-count {
  position: absolute; top: -4px; right: -4px;
  background: var(--sahafric-red); color: #fff;
  font-size: .6rem; font-weight: 700; min-width: 18px; height: 18px;
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid var(--bg-card);
}
.notif-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 360px; background: var(--bg-card);
  border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); z-index: 999; display: none;
}
.notif-dropdown.open { display: block; animation: fadeDown .2s ease; }
.notif-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.notif-header h6 { font-family: 'Inter', sans-serif; font-size: .9rem; font-weight: 600; }
.notif-list { max-height: 340px; overflow-y: auto; }
.notif-item {
  display: flex; gap: 12px; padding: 12px 18px;
  border-bottom: 1px solid var(--border-light); cursor: pointer;
  transition: background .15s;
}
.notif-item:hover { background: var(--bg-body); }
.notif-item.unread { background: var(--info-bg); }
.notif-item.unread:hover { background: #c8d8f0; }
.notif-icon {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .85rem;
}
.notif-icon.blue   { background: var(--info-bg); color: var(--sahafric-navy); }
.notif-icon.green  { background: var(--success-bg); color: var(--success); }
.notif-icon.red    { background: var(--danger-bg); color: var(--danger); }
.notif-icon.amber  { background: var(--warning-bg); color: var(--warning); }
.notif-body strong { font-size: .84rem; display: block; color: var(--text-primary); }
.notif-body p      { font-size: .78rem; color: var(--text-secondary); margin: 2px 0; line-height: 1.4; }
.notif-body small  { font-size: .7rem; color: var(--text-muted); }
.notif-footer {
  padding: 10px 18px; text-align: center;
  border-top: 1px solid var(--border-light);
}
.notif-footer a { font-size: .82rem; color: var(--sahafric-navy); font-weight: 500; }

/* User menu */
.user-menu-btn {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 6px 10px; border-radius: var(--radius-md);
  border: 1px solid var(--border-light); background: var(--bg-body);
  transition: all .2s;
}
.user-menu-btn:hover { background: var(--border-light); }
.user-menu-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--sahafric-navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700;
}
.user-menu-name { font-size: .82rem; font-weight: 500; }

/* ─── MAIN CONTENT ─── */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 28px;
  min-height: calc(100vh - var(--topbar-h));
  width: calc(100% - var(--sidebar-w));
  box-sizing: border-box;
  transition: margin-left .3s, width .3s;
  background: var(--bg-body);
}

/* ─── CARDS ─── */
.card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border-light); box-shadow: var(--shadow-card);
  overflow: hidden;
}
.card-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card);
}
.card-header h5 { font-family: 'Inter', sans-serif; font-size: .95rem; font-weight: 600; color: var(--text-primary); }
.card-body { padding: 24px; }
.card-footer { padding: 14px 24px; border-top: 1px solid var(--border-light); background: var(--bg-body); }

/* Stat Cards */
.stat-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border-light); padding: 20px 24px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-card); transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-icon {
  width: 52px; height: 52px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.stat-icon.navy  { background: var(--info-bg);    color: var(--sahafric-navy); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.amber { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red   { background: var(--danger-bg);  color: var(--danger); }
.stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 1.7rem; font-weight: 700; color: var(--text-primary); line-height: 1.1; font-family: 'Inter', sans-serif; }
.stat-sub   { font-size: .75rem; color: var(--text-secondary); margin-top: 2px; }
.stat-trend { font-size: .75rem; font-weight: 600; }
.stat-trend.up   { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ─── TABLES ─── */
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-family: 'Inter', sans-serif; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted);
  padding: 12px 16px; border-bottom: 2px solid var(--border-light);
  background: var(--bg-body); white-space: nowrap; text-align: left;
}
.data-table td {
  padding: 13px 16px; border-bottom: 1px solid var(--border-light);
  font-size: .875rem; color: var(--text-primary); vertical-align: middle;
}
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: #FAFAF8; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ─── FORMS ─── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: .82rem; font-weight: 500;
  color: var(--text-primary); margin-bottom: 6px;
}
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%; padding: 10px 14px; font-size: .875rem; font-family: 'Inter', sans-serif;
  border: 1.5px solid var(--border-light); border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text-primary);
  transition: border-color .2s, box-shadow .2s; outline: none;
}
.form-control:focus {
  border-color: var(--sahafric-navy);
  box-shadow: 0 0 0 3px rgba(26,62,110,.1);
}
.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-valid   { border-color: var(--success); }
.form-text    { font-size: .76rem; color: var(--text-muted); margin-top: 4px; }
.invalid-feedback { font-size: .76rem; color: var(--danger); margin-top: 4px; }
.valid-feedback   { font-size: .76rem; color: var(--success); margin-top: 4px; }

select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M6 8L0 0h12z' fill='%23888'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea.form-control { resize: vertical; min-height: 100px; }
.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group-text {
  padding: 10px 14px; background: var(--bg-body); border: 1.5px solid var(--border-light);
  border-left: none; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .85rem; color: var(--text-muted);
}
.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; accent-color: var(--sahafric-navy); cursor: pointer;
}

/* File Upload */
.file-upload-area {
  border: 2px dashed var(--border-medium); border-radius: var(--radius-md);
  padding: 32px 24px; text-align: center; cursor: pointer;
  transition: all .2s; background: var(--bg-body);
}
.file-upload-area:hover, .file-upload-area.drag-over {
  border-color: var(--sahafric-navy); background: var(--info-bg);
}
.file-upload-area i { font-size: 2rem; color: var(--text-muted); margin-bottom: 10px; }
.file-upload-area p { font-size: .85rem; color: var(--text-secondary); }
.file-upload-area .browse-link { color: var(--sahafric-navy); font-weight: 600; }
.file-list { margin-top: 12px; }
.file-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--bg-body); border-radius: var(--radius-sm);
  border: 1px solid var(--border-light); margin-bottom: 6px;
}
.file-item .file-name { flex: 1; font-size: .82rem; }
.file-item .file-size { font-size: .75rem; color: var(--text-muted); }
.file-item .file-remove { color: var(--danger); cursor: pointer; font-size: .85rem; }
.file-item .file-icon { color: var(--sahafric-navy); }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px; font-size: .875rem; font-weight: 500;
  font-family: 'Inter', sans-serif; border: 1.5px solid transparent;
  border-radius: var(--radius-sm); cursor: pointer; transition: all .2s;
  line-height: 1.4; text-align: center; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm  { padding: 6px 14px; font-size: .8rem; }
.btn-lg  { padding: 12px 28px; font-size: .95rem; }
.btn-block { width: 100%; justify-content: center; }

.btn-primary { background: var(--sahafric-orange); color: #fff; border-color: var(--sahafric-orange); }
.btn-primary:hover { background: #E55E00; color: #fff; border-color: #E55E00; }

.btn-danger  { background: var(--sahafric-red); color: #fff; border-color: var(--sahafric-red); }
.btn-danger:hover  { background: #96271E; color: #fff; }

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #134116; color: #fff; }

.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover { background: #BF4500; color: #fff; }

.btn-outline-primary { background: transparent; color: var(--sahafric-orange); border-color: var(--sahafric-orange); }
.btn-outline-primary:hover { background: var(--sahafric-orange); color: #fff; }

.btn-outline-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger); color: #fff; }

.btn-light  { background: var(--bg-body); color: var(--text-primary); border-color: var(--border-light); }
.btn-light:hover { background: var(--border-light); }

.btn-ghost  { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-body); }

.btn-loading { position: relative; }
.btn-loading::after {
  content: ''; position: absolute; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .6s linear infinite;
  right: 12px; top: 50%; transform: translateY(-50%);
}

/* ─── BADGES ─── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; font-size: .72rem; font-weight: 600;
  border-radius: 20px; line-height: 1.4; letter-spacing: .02em;
}
.badge-navy    { background: var(--info-bg);    color: var(--sahafric-navy); }
.badge-green   { background: var(--success-bg); color: var(--success); }
.badge-red     { background: var(--danger-bg);  color: var(--danger); }
.badge-amber   { background: var(--warning-bg); color: var(--warning); }
.badge-gray    { background: #EEEBE5;            color: var(--text-secondary); }
.badge-gold    { background: #FFF8DC;            color: var(--sahafric-gold); }

/* ─── ALERTS ─── */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius-md);
  border-left: 4px solid; margin-bottom: 20px; font-size: .875rem;
}
.alert i { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-bg); border-color: var(--success);   color: var(--success); }
.alert-danger  { background: var(--danger-bg);  border-color: var(--danger);    color: var(--danger); }
.alert-warning { background: var(--warning-bg); border-color: var(--warning);   color: var(--warning); }
.alert-info    { background: var(--info-bg);    border-color: var(--sahafric-navy); color: var(--sahafric-navy); }

/* ─── MODALS ─── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; background: rgba(10,22,40,.55);
  align-items: center; justify-content: center;
  z-index: 2000; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box, .modal {
  background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 90%; max-width: 560px;
  max-height: 85vh; overflow-y: auto;
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-box.modal-lg, .modal.modal-lg { max-width: 780px; }
.modal-box.modal-xl, .modal.modal-xl { max-width: 980px; }
.modal-head, .modal-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h5, .modal-header h5 { font-family: 'Inter', sans-serif; font-size: .95rem; font-weight: 600; margin: 0; }
.modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-muted); }
.modal-close:hover { color: var(--danger); }
.modal-body   { padding: 24px; }
.modal-footer { padding: 14px 24px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 10px; }

/* ─── TABS ─── */
.tabs-nav { display: flex; border-bottom: 2px solid var(--border-light); margin-bottom: 24px; gap: 0; }
.tab-btn {
  padding: 10px 20px; font-size: .875rem; font-weight: 500;
  color: var(--text-muted); border: none; background: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all .2s; white-space: nowrap;
}
.tab-btn.active { color: var(--sahafric-navy); border-bottom-color: var(--sahafric-navy); }
.tab-btn:hover:not(.active) { color: var(--text-primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn .2s ease; }

/* ─── STEPPER ─── */
.stepper { display: flex; align-items: center; margin-bottom: 36px; }
.step {
  display: flex; align-items: center; flex: 1;
}
.step:last-child { flex: 0; }
.step-circle {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; border: 2px solid var(--border-medium);
  background: var(--bg-card); color: var(--text-muted); transition: all .3s;
}
.step.done   .step-circle { background: var(--success); border-color: var(--success); color: #fff; }
.step.active .step-circle { background: var(--sahafric-navy); border-color: var(--sahafric-navy); color: #fff; }
.step-line { flex: 1; height: 2px; background: var(--border-medium); margin: 0 8px; }
.step.done + .step .step-line,
.step.done   .step-line { background: var(--success); }
.step-label {
  font-size: .72rem; font-weight: 500; color: var(--text-muted);
  margin-top: 6px; white-space: nowrap; text-align: center;
}
.step.active .step-label { color: var(--sahafric-navy); }
.step.done   .step-label { color: var(--success); }
.step-wrap { display: flex; flex-direction: column; align-items: center; }

/* ─── PERMISSION MATRIX ─── */
.perm-matrix { border-collapse: collapse; width: 100%; }
.perm-matrix th, .perm-matrix td { padding: 9px 12px; font-size: .82rem; border-bottom: 1px solid var(--border-light); }
.perm-matrix th { background: var(--bg-body); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.perm-module-row td { background: var(--info-bg); font-weight: 600; color: var(--sahafric-navy); font-size: .8rem; }
.perm-check { width: 16px; height: 16px; accent-color: var(--sahafric-navy); cursor: pointer; }

/* ─── STATUS TIMELINE ─── */
.status-timeline { position: relative; padding-left: 28px; }
.status-timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border-light); }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot {
  position: absolute; left: -24px; top: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border-medium); background: var(--bg-card);
}
.timeline-dot.done   { background: var(--success); border-color: var(--success); }
.timeline-dot.active { background: var(--sahafric-navy); border-color: var(--sahafric-navy); }
.timeline-item h6 { font-family: 'Inter', sans-serif; font-size: .85rem; font-weight: 600; }
.timeline-item small { font-size: .75rem; color: var(--text-muted); }

/* ─── SEARCH BAR ─── */
.search-bar {
  display: flex; align-items: center; gap: 0;
  border: 1.5px solid var(--border-light); border-radius: var(--radius-sm);
  background: var(--bg-card); overflow: hidden;
}
.search-bar input {
  border: none; outline: none; padding: 9px 14px; flex: 1;
  font-size: .875rem; background: transparent; font-family: 'Inter', sans-serif;
}
.search-bar button {
  padding: 9px 14px; background: var(--sahafric-navy); border: none;
  color: #fff; cursor: pointer; font-size: .9rem;
}

/* ─── CHAT / MESSAGES ─── */
.chat-wrap { display: flex; height: 520px; border: 1px solid var(--border-light); border-radius: var(--radius-lg); overflow: hidden; }
.chat-sidebar { width: 280px; border-right: 1px solid var(--border-light); overflow-y: auto; background: var(--bg-body); }
.chat-main { flex: 1; display: flex; flex-direction: column; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-bubble { max-width: 72%; }
.chat-bubble.mine { align-self: flex-end; }
.chat-bubble.theirs { align-self: flex-start; }
.bubble-body {
  padding: 10px 14px; border-radius: var(--radius-md); font-size: .875rem;
  line-height: 1.5;
}
.chat-bubble.mine .bubble-body { background: var(--sahafric-navy); color: #fff; border-bottom-right-radius: 3px; }
.chat-bubble.theirs .bubble-body { background: var(--bg-body); border: 1px solid var(--border-light); border-bottom-left-radius: 3px; }
.bubble-meta { font-size: .7rem; color: var(--text-muted); margin-top: 3px; text-align: right; }
.chat-input { border-top: 1px solid var(--border-light); padding: 12px; display: flex; gap: 8px; }
.chat-input textarea { flex: 1; border: 1.5px solid var(--border-light); border-radius: var(--radius-sm); padding: 8px 12px; font-size: .875rem; font-family: 'Inter', sans-serif; resize: none; height: 40px; }

/* ─── AUTH PAGES ─── */
.auth-page {
  min-height: 100vh; display: flex; background: var(--bg-body);
}
.auth-left {
  flex: 1; background: var(--bg-sidebar); padding: 48px;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.auth-left::before {
  content: ''; position: absolute; inset: 0;
  background: url('/images/leather-texture.jpg') center/cover;
  opacity: .08;
}
.auth-left-content { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 48px; }
.auth-brand img { width: 50px; }
.auth-brand-name { font-family: 'Outfit', sans-serif; font-size: 1.5rem; color: #fff; }
.auth-headline { font-family: 'Outfit', sans-serif; font-size: 2.4rem; color: #fff; line-height: 1.25; margin-bottom: 20px; }
.auth-sub { font-size: .95rem; color: rgba(255,255,255,.65); line-height: 1.7; max-width: 380px; }
.auth-features { margin-top: 36px; display: flex; flex-direction: column; gap: 14px; }
.auth-feature-item { display: flex; align-items: center; gap: 12px; }
.auth-feature-icon { width: 36px; height: 36px; border-radius: 8px; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; color: var(--sahafric-amber); }
.auth-feature-text { font-size: .875rem; color: rgba(255,255,255,.75); }

.auth-right {
  width: 500px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; padding: 48px 40px; background: var(--bg-card);
}
.auth-form-wrap { width: 100%; max-width: 420px; }
.auth-logo-mobile { display: none; text-align: center; margin-bottom: 32px; }
.auth-title { font-size: 1.7rem; margin-bottom: 6px; }
.auth-subtitle { font-family: 'Inter', sans-serif; font-size: .9rem; color: var(--text-muted); margin-bottom: 30px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-light); }
.auth-divider span { font-size: .78rem; color: var(--text-muted); }
.auth-footer-link { text-align: center; margin-top: 20px; font-size: .84rem; color: var(--text-muted); }
.auth-footer-link a { color: var(--sahafric-navy); font-weight: 600; }

/* Password toggle */
.password-wrap { position: relative; }
.password-wrap .form-control { padding-right: 42px; }
.password-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  font-size: .9rem;
}

/* Step indicator mini */
.step-progress { display: flex; gap: 6px; margin-bottom: 24px; }
.step-dot { height: 4px; border-radius: 2px; flex: 1; background: var(--border-light); transition: background .3s; }
.step-dot.done, .step-dot.active { background: var(--sahafric-navy); }

/* ─── UTILITIES ─── */
.d-flex { display: flex; }
.d-none { display: none; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.flex-1 { flex: 1; }

/* ── Extra utilities ──────────────────────────── */
.justify-center { justify-content: center; }
.upload-group   { position: relative; }
.upload-input   { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.mb-0   { margin-bottom: 0; }
.mb-1   { margin-bottom: 6px; }
.mb-2   { margin-bottom: 12px; }
.mb-3   { margin-bottom: 18px; }
.mb-4   { margin-bottom: 24px; }
.mb-5   { margin-bottom: 32px; }
.mt-2   { margin-top: 12px; }
.mt-3   { margin-top: 18px; }
.mt-4   { margin-top: 24px; }
.p-0    { padding: 0; }
.pt-0   { padding-top: 0; }
.w-100  { width: 100%; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.rounded     { border-radius: var(--radius-md); }
.separator   { height: 1px; background: var(--border-light); margin: 16px 0; }
.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: 20px; }
.col-span-2 { grid-column: span 2; }

/* ─── ANIMATIONS ─── */
@keyframes fadeIn    { from { opacity:0; }                 to { opacity:1; } }
@keyframes fadeDown  { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
@keyframes spin      { to { transform: translateY(-50%) rotate(360deg); } }
@keyframes slideUp   { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulse     { 0%,100%{ opacity:1; } 50%{ opacity:.5; } }

.animate-fade    { animation: fadeIn .3s ease; }
.animate-slide   { animation: slideUp .3s ease; }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-body) 25%, var(--border-light) 50%, var(--bg-body) 75%);
  background-size: 200% 100%; animation: skeleton-wave 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-wave { 0%{ background-position: 200% 0; } 100%{ background-position: -200% 0; } }

/* Toastr overrides */
#toast-container > div { border-radius: var(--radius-md) !important; box-shadow: var(--shadow-md) !important; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar { left: 0; }
  .topbar-toggle { display: block; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .auth-left { display: none; }
  .auth-right { width: 100%; }
  .auth-logo-mobile { display: block; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .main-content { padding: 16px; }
  .notif-dropdown { width: 300px; right: -60px; }
  .chat-sidebar { display: none; }
}

/* ── USER PROFILE DROPDOWN ─────────────────────── */
.user-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; font-size: .84rem; color: var(--text-primary);
  text-decoration: none; transition: background .15s; cursor: pointer; width: 100%;
}
.user-dropdown-item:hover { background: var(--bg-body); color: var(--sahafric-navy); }
.user-dropdown-item i { width: 16px; text-align: center; color: var(--text-muted); flex-shrink: 0; }
.user-dropdown-item:hover i { color: var(--sahafric-navy); }

/* ── USER MENU WRAP — ensures dropdown escapes topbar clip ── */
#userMenuWrap { position: relative; }
#userMenuDropdown {
  position: fixed;
  width: 250px;
  z-index: 99999;
}

/* ── SELECT2 GLOBAL STYLING ─────────────────────── */
.select2-container .select2-selection--single {
  height: 42px !important;
  border: 1.5px solid var(--border-light) !important;
  border-radius: var(--radius-sm) !important;
  background: var(--bg-card) !important;
}
.select2-container .select2-selection--single .select2-selection__rendered {
  line-height: 40px !important;
  padding-left: 12px !important;
  font-family: 'Inter', sans-serif;
  font-size: .875rem;
  color: var(--text-primary);
}
.select2-container .select2-selection--single .select2-selection__arrow {
  height: 40px !important;
  right: 8px !important;
}
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--sahafric-navy) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(26,62,110,.1) !important;
}
.select2-dropdown {
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.12) !important;
  font-family: 'Inter', sans-serif;
  z-index: 99999 !important;
}
.select2-search--dropdown {
  padding: 8px !important;
}
.select2-search--dropdown .select2-search__field {
  border: 1.5px solid var(--border-light) !important;
  border-radius: 6px !important;
  padding: 8px 12px !important;
  font-size: .875rem !important;
  font-family: 'Inter', sans-serif;
  outline: none;
}
.select2-search--dropdown .select2-search__field:focus {
  border-color: var(--sahafric-navy) !important;
}
.select2-results__option {
  padding: 9px 14px !important;
  font-size: .875rem;
}
.select2-results__option--highlighted {
  background: var(--sahafric-navy) !important;
  color: #fff !important;
}
.select2-results__option--selected {
  background: var(--info-bg) !important;
  color: var(--sahafric-navy) !important;
  font-weight: 600;
}
