/* ═══════════════════════════════════════════════════════
   Banks CRM — Admin Panel Unified Stylesheet
   Inspired by Touchmaster admin, refined for fintech
   ═══════════════════════════════════════════════════════ */

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

:root {
  /* Brand */
  --primary:        #73bf4f;
  --primary-dark:   #5a9a3c;
  --primary-light:  #eef8e8;
  --primary-glow:   rgba(115,191,79,.18);

  /* Sidebar */
  --sidebar-bg:     #1a0a3d;
  --sidebar-hover:  #2d1660;
  --sidebar-active: #73bf4f;
  --sidebar-text:   #c4b5d8;
  --sidebar-muted:  #6b4f8a;

  /* UI */
  --bg:             #f1f5f9;
  --surface:        #ffffff;
  --surface-2:      #f8fafc;
  --border:         #e2e8f0;
  --border-light:   #f1f5f9;

  /* Text */
  --text:           #1a0a3d;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;

  /* Status */
  --success:        #059669;
  --success-light:  #d1fae5;
  --warning:        #d97706;
  --warning-light:  #fef3c7;
  --danger:         #dc2626;
  --danger-light:   #fee2e2;
  --info:           #0284c7;
  --info-light:     #e0f2fe;

  /* Layout */
  --sidebar-w:      250px;
  --topbar-h:       60px;
  --radius:         10px;
  --radius-sm:      6px;
  --shadow:         0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:      0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:      0 10px 40px rgba(0,0,0,.12);

  --font: 'DM Sans', sans-serif;
  --mono: 'DM Mono', monospace;
}

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.5; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
button { cursor: pointer; font-family: var(--font); }

/* ── Login ───────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a0a3d 0%, #2d1660 50%, #1a0a3d 100%);
  position: relative;
  overflow: hidden;
}
.login-wrap::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(115,191,79,.15) 0%, transparent 70%);
  top: -100px; left: -100px;
}
.login-wrap::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(115,191,79,.1) 0%, transparent 70%);
  bottom: -50px; right: -50px;
}
.login-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo .logo-icon {
  width: 56px; height: 56px;
  background: var(--primary);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 24px;
  color: #fff;
}
.login-logo h1 { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.login-logo p  { color: var(--text-muted); font-size: .875rem; margin-top: 4px; }

/* ── Admin Layout ────────────────────────────────────── */
.admin-wrap { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .3s ease;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.sidebar-logo .logo-box {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-logo .logo-text { font-size: .95rem; font-weight: 700; color: #fff; }
.sidebar-logo .logo-sub  { font-size: .7rem; color: var(--sidebar-muted); margin-top: 2px; }

.sidebar-bank-badge {
  margin: 12px 16px;
  background: rgba(115,191,79,.15);
  border: 1px solid rgba(115,191,79,.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: #93c5fd;
}
.sidebar-bank-badge i { color: var(--primary); }

.sidebar-nav { padding: 8px 0; flex: 1; }
.nav-section {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  padding: 12px 20px 4px;
  margin-top: 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--sidebar-text);
  font-size: .875rem;
  font-weight: 400;
  transition: all .2s;
  position: relative;
}
.nav-item i { width: 18px; text-align: center; font-size: .9rem; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active {
  background: rgba(115,191,79,.2);
  color: #93c5fd;
  font-weight: 500;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-avatar {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: .8rem; font-weight: 500; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: .7rem; color: var(--sidebar-muted); }
.sidebar-logout { color: var(--sidebar-text); transition: color .2s; }
.sidebar-logout:hover { color: var(--danger); }

/* Main */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* Language switcher */
.lang-switcher { display:flex; gap:2px; background:var(--surface-2); border:1px solid var(--border); border-radius:6px; padding:2px; }
.lang-btn { padding:3px 9px; border-radius:4px; font-size:.75rem; font-weight:600; color:var(--text-muted); text-decoration:none; transition:all .15s; letter-spacing:.04em; }
.lang-btn:hover { color:var(--text); background:var(--bg); }
.lang-btn-active { background:var(--primary); color:#fff !important; }
.topbar-icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.topbar-icon-btn:hover { background: var(--bg); color: var(--text); }
.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .2s;
}
.topbar-user:hover { background: var(--bg); }
.topbar-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 600;
  color: #fff;
}
.mobile-menu-btn {
  display: none;
  width: 36px; height: 36px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  align-items: center;
  justify-content: center;
}

/* Page */
.page-body { padding: 24px; flex: 1; }
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h2 { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb .sep { color: var(--border); }

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

/* ── Stat cards ──────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow);
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: var(--primary-light); color: var(--primary); }
.stat-icon.green  { background: var(--success-light);  color: var(--success); }
.stat-icon.yellow { background: var(--warning-light);  color: var(--warning); }
.stat-icon.red    { background: var(--danger-light);   color: var(--danger); }
.stat-icon.teal   { background: #ccfbf1; color: #059669; }
.stat-label  { font-size: .78rem; color: var(--text-muted); margin-bottom: 4px; }
.stat-value  { font-size: 1.6rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-change { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── Table ───────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--surface-2);
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: .875rem;
  color: var(--text);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }

/* ── Badges / status ─────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-active    { background: var(--success-light); color: var(--success); }
.badge-inactive  { background: var(--border);        color: var(--text-muted); }
.badge-pending   { background: var(--warning-light); color: var(--warning); }
.badge-expired   { background: var(--danger-light);  color: var(--danger); }
.badge-blocked   { background: #fce7f3;              color: #be185d; }
.badge-approved  { background: var(--success-light); color: var(--success); }
.badge-rejected  { background: var(--danger-light);  color: var(--danger); }
.badge-revoked   { background: #f3e8ff;              color: #7c3aed; }
.badge-superadmin{ background: #fef3c7; color: #92400e; }
.badge-admin     { background: var(--primary-light); color: var(--primary); }
.badge-operator  { background: var(--border);        color: var(--text-muted); }
.badge-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all .2s;
  white-space: nowrap;
}
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-dark); }
.btn-secondary{ background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-danger:hover  { background: #b91c1c; }
.btn-success  { background: var(--success); color: #fff; }
.btn-success:hover { background: #047857; }
.btn-warning  { background: var(--warning); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-icon { padding: 7px 9px; }

/* Action buttons in tables */
.actions { display: flex; gap: 4px; }
.action-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  color: var(--text-muted);
  transition: all .2s;
}
.action-btn:hover        { background: var(--bg); color: var(--text); }
.action-btn.edit:hover   { color: var(--primary); border-color: var(--primary); }
.action-btn.delete:hover { color: var(--danger); border-color: var(--danger); }
.action-btn.view:hover   { color: var(--info); border-color: var(--info); }
.action-btn.approve:hover{ color: var(--success); border-color: var(--success); }

.request-type-btn {
  display: flex; align-items: center; gap: 16px;
  width: 100%; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s;
}
.request-type-btn:hover {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(115,191,79,.15);
}
.request-type-btn i { font-size: 1.4rem; width: 28px; flex-shrink: 0; }

/* ── Forms ───────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.form-label .req { color: var(--danger); }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-control.is-invalid { border-color: var(--danger); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Tabs ────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid var(--border); gap: 2px; margin-bottom: 24px; overflow-x: auto; }
.tab {
  padding: 10px 18px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all .2s;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
.modal-lg { max-width: 760px; }
.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-close {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body   { padding: 20px; overflow-y: auto; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ── Filters / search bar ────────────────────────────── */
.filters-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filters-bar .form-control { width: auto; min-width: 160px; }
.search-box { position: relative; }
.search-box i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: .85rem; }
.search-box .form-control { padding-left: 32px; }

/* ── Pagination ──────────────────────────────────────── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.pagination-info {
  font-size: .85rem;
  color: var(--text-muted);
}
.pagination-info strong { color: var(--text); }
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.perpage-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  color: var(--text-muted);
}
.perpage-select {
  font-size: .85rem;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  height: 30px;
}
.perpage-select:focus { outline: none; border-color: var(--primary); }
.pagination {
  display: flex;
  align-items: center;
  gap: 3px;
}
.page-btn {
  min-width: 32px; height: 32px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  color: var(--text-muted);
  transition: all .15s;
  text-decoration: none;
  cursor: pointer;
}
.page-btn:hover { background: var(--bg); color: var(--text); border-color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Alerts ──────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.alert-success { background: var(--success-light); color: #065f46; }
.alert-error   { background: var(--danger-light);  color: #991b1b; }
.alert-danger  { background: var(--danger-light);  color: #991b1b; }
.alert-warning { background: var(--warning-light); color: #92400e; }
.alert-info    { background: var(--info-light);    color: #075985; }

/* ── Empty state ─────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; opacity: .3; display: block; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }

/* ── Detail info lists ───────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.info-item {}
.info-label { font-size: .75rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.info-value { font-size: .875rem; color: var(--text); }
.info-value code {
  font-family: var(--mono);
  font-size: .8rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
}
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── Timeline (activity) ─────────────────────────────── */
.timeline { list-style: none; }
.timeline-item {
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 16px; top: 32px; bottom: 0;
  width: 1px;
  background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  flex-shrink: 0;
}
.timeline-content { flex: 1; }
.timeline-text  { font-size: .85rem; }
.timeline-time  { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }

/* ── Responsive ──────────────────────────────────────── */


/* ── Utility ─────────────────────────────────────────── */
.text-muted   { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-sm      { font-size: .8rem; }
.fw-600       { font-weight: 600; }
.mt-0  { margin-top: 0; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.d-flex     { display: flex; }
.align-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.ml-auto { margin-left: auto; }
.w-100  { width: 100%; }

/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Topbar user dropdown ────────────────────────────── */
.readonly-badge {
  font-size: .75rem;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 5px;
}

.topbar-user-wrap { position: relative; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  transition: background .15s;
}
.topbar-user:hover { background: var(--bg); }

.topbar-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}
.topbar-user-name { font-size: .85rem; font-weight: 600; color: var(--text); }
.topbar-user-role { font-size: .7rem;  color: var(--text-muted); }

.topbar-chevron {
  font-size: .65rem;
  color: var(--text-muted);
  transition: transform .2s;
}
.topbar-user-wrap.open .topbar-chevron { transform: rotate(180deg); }

/* Dropdown panel */
.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 200;
  overflow: hidden;
  animation: dropdownIn .15s ease;
}
@keyframes dropdownIn {
  from { opacity:0; transform: translateY(-6px); }
  to   { opacity:1; transform: translateY(0); }
}

.user-dropdown-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--surface-2);
}
.user-dropdown-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #73bf4f, #511eb8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}
.user-dropdown-name  { font-size: .875rem; font-weight: 600; color: var(--text); }
.user-dropdown-email { font-size: .75rem;  color: var(--text-muted); margin-top: 1px; word-break: break-all; }

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: .875rem;
  color: var(--text);
  text-decoration: none;
  transition: background .12s;
}
.user-dropdown-item:hover { background: var(--surface-2); }
.user-dropdown-item i     { width: 16px; color: var(--text-muted); }
.user-dropdown-item:hover i { color: var(--primary); }

.user-dropdown-logout       { color: var(--danger); }
.user-dropdown-logout i     { color: var(--danger); }
.user-dropdown-logout:hover { background: #fef2f2; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE OVERHAUL — Mobile-first additions
   ═══════════════════════════════════════════════════════ */

/* ── Sidebar overlay (mobile backdrop) ───────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}
.sidebar-overlay.open { display: block; }

/* ── Sidebar close button (mobile) ───────────────────── */
.sidebar-close-btn {
  display: none;
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  border: none;
  background: rgba(255,255,255,.1);
  color: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  z-index: 1;
}

/* ── Page header: stack on small screens ─────────────── */
@media (max-width: 768px) {
  /* Show sidebar close btn on mobile */
  .sidebar-close-btn { display: flex; }

  /* Topbar */
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar-user-info { display: none; }        /* hide name/role text in topbar */
  .topbar-chevron   { display: none; }

  /* Page body padding */
  .page-body { padding: 14px; }

  /* Page header wraps naturally, buttons stack */
  .page-header { gap: 10px; }
  .page-header > div:last-child { width: 100%; }
  .page-header > div:last-child,
  .page-header > a:last-child   { display: flex; flex-wrap: wrap; gap: 8px; }

  /* Card header wraps — filter form stacks */
  .card-header {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
  }
  .card-header form {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px !important;
  }
  .card-header form .form-control,
  .card-header form select { width: 100% !important; min-width: 0 !important; }
  .card-header form .search-box { flex: 1; min-width: 140px; }

  /* Tables: horizontal scroll on small screens */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 520px; }

  /* Stat grid: 2 col on mobile */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
  .stat-card  { padding: 14px; gap: 10px; }
  .stat-value { font-size: 1.35rem; }

  /* Dashboard 2-col grid → 1 col */
  div[style*="grid-template-columns:1fr 1fr"] {
    display: block !important;
  }
  div[style*="grid-template-columns:1fr 1fr"] > .card {
    margin-bottom: 16px;
  }

  /* Modal full-screen on mobile */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal, .modal-lg {
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: 92vh;
  }

  /* Form rows → single column */
  .form-row, .form-row-3 { grid-template-columns: 1fr; }

  /* Pagination bar stacks */
  .pagination-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .pagination-controls { width: 100%; justify-content: space-between; }

  /* Buttons in page header */
  .btn { font-size: .82rem; padding: 7px 12px; }
  .btn i { font-size: .85rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; gap: 8px; }
  .topbar-title { font-size: .9rem; }
  .page-header h2 { font-size: 1.1rem; }

  /* Action buttons: only show icons, no gap overflow */
  .actions { gap: 3px; }
  .action-btn { width: 28px; height: 28px; font-size: .75rem; }

  /* Badge text size */
  .badge { font-size: .68rem; padding: 2px 7px; }

  /* Table cells tighter */
  tbody td { padding: 9px 10px; font-size: .82rem; }
  thead th  { padding: 8px 10px; font-size: .7rem; }
}

/* ── Import modal specific styles ────────────────────── */
.import-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: var(--surface-2);
  position: relative;
}
.import-zone:hover,
.import-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.import-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.import-zone-icon {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 8px;
}
.import-zone-text { font-size: .875rem; color: var(--text-muted); }
.import-zone-text strong { color: var(--text); display: block; margin-bottom: 4px; }
.import-zone.has-file { border-color: var(--success); background: var(--success-light); }
.import-zone.has-file .import-zone-icon { color: var(--success); }

.import-sample-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.import-sample-box > div { font-size: .85rem; color: var(--text-muted); }
.import-sample-box strong { display: block; color: var(--text); margin-bottom: 2px; font-size: .9rem; }

.import-result {
  margin-top: 14px;
  font-size: .85rem;
  display: none;
}
.import-result.show { display: block; }
.import-result-ok  { color: var(--success); }
.import-result-err { color: var(--danger); }
.import-errors {
  max-height: 140px;
  overflow-y: auto;
  margin-top: 8px;
  font-size: .8rem;
  background: var(--danger-light);
  color: #991b1b;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.import-errors li { margin-bottom: 3px; }
