/* ================================================================
   FrontPay ERP – Admin Panel Stylesheet
   ================================================================ */

:root {
  --primary:       #1a56db;
  --primary-dark:  #1340b0;
  --primary-light: #ebf0ff;
  --sidebar-bg:    #0f172a;
  --sidebar-w:     260px;
  --topbar-h:      64px;
  --success:       #0d9488;
  --danger:        #e02424;
  --warning:       #d97706;
  --info:          #0891b2;
  --purple:        #7c3aed;
  --text:          #111827;
  --muted:         #6b7280;
  --border:        #e5e7eb;
  --bg:            #f3f4f6;
  --card:          #ffffff;
  --radius:        10px;
  --shadow:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:     0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
}

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

html { font-size: 14px; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* ── Scrollbar ────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .25s ease, width .25s ease;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  height: var(--topbar-h);
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #1a56db, #7c3aed);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff;
  flex-shrink: 0;
}

.brand-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.3px;
}

.brand-sub {
  font-size: .65rem;
  color: rgba(255,255,255,.4);
  font-weight: 400;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0 20px;
}

.sidebar-scroll::-webkit-scrollbar { width: 3px; }

.nav-group-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 16px 20px 6px;
  display: block;
}

.nav-item { display: block; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  margin: 1px 8px;
  border-radius: 8px;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 500;
  transition: all .15s;
  position: relative;
  white-space: nowrap;
}

.nav-link:hover {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
}

.nav-link.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(26,86,219,.4);
}

.nav-link .nav-icon {
  width: 20px;
  text-align: center;
  font-size: .95rem;
  flex-shrink: 0;
}

.nav-link .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 12px 8px;
  flex-shrink: 0;
}

/* ================================================================
   MAIN CONTENT
   ================================================================ */
.main-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .25s ease;
}

/* ── Topbar ───────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 100;
  box-shadow: var(--shadow);
}

.topbar-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.btn-sidebar-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: all .15s;
}

.btn-sidebar-toggle:hover { background: var(--bg); color: var(--text); }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  font-size: .78rem;
  color: var(--muted);
  margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: '/';
  color: var(--border);
}

.breadcrumb-item a { color: var(--primary); text-decoration: none; }
.breadcrumb-item.active { color: var(--text); font-weight: 500; }

/* Admin info */
.admin-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: default;
}

.admin-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.admin-name { font-size: .78rem; font-weight: 600; color: var(--text); }
.admin-role { font-size: .65rem; color: var(--muted); }

.live-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #059669;
  font-size: .7rem;
  font-weight: 600;
}

.live-dot {
  width: 6px; height: 6px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* ── Page content ─────────────────────────────────── */
.page-content { padding: 24px; flex: 1; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}

.page-title { font-size: 1.25rem; font-weight: 700; color: var(--text); margin: 0; }
.page-subtitle { font-size: .78rem; color: var(--muted); margin: 3px 0 0; }

/* ================================================================
   STAT CARDS
   ================================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.stat-card.blue::before   { background: linear-gradient(90deg, #1a56db, #3b82f6); }
.stat-card.green::before  { background: linear-gradient(90deg, #0d9488, #10b981); }
.stat-card.orange::before { background: linear-gradient(90deg, #d97706, #f59e0b); }
.stat-card.purple::before { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.stat-card.red::before    { background: linear-gradient(90deg, #e02424, #f87171); }
.stat-card.cyan::before   { background: linear-gradient(90deg, #0891b2, #06b6d4); }

.stat-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
}

.stat-icon.blue   { background: #eff6ff; color: #1a56db; }
.stat-icon.green  { background: #f0fdf4; color: #0d9488; }
.stat-icon.orange { background: #fffbeb; color: #d97706; }
.stat-icon.purple { background: #faf5ff; color: #7c3aed; }
.stat-icon.red    { background: #fef2f2; color: #e02424; }
.stat-icon.cyan   { background: #ecfeff; color: #0891b2; }

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -.5px;
}

.stat-label {
  font-size: .75rem;
  color: var(--muted);
  font-weight: 500;
}

.stat-change {
  font-size: .72rem;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up   { color: #059669; }
.stat-change.down { color: var(--danger); }

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title i { color: var(--primary); }

.card-body { padding: 20px; }
.card-body-flush { padding: 0; }
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ================================================================
   TABLES
   ================================================================ */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.erp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

.erp-table thead tr {
  background: #f8fafc;
  border-bottom: 2px solid var(--border);
}

.erp-table thead th {
  padding: 12px 16px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  white-space: nowrap;
  text-align: left;
}

.erp-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background .1s;
}

.erp-table tbody tr:hover { background: #f8fafc; }
.erp-table tbody tr:last-child { border-bottom: none; }

.erp-table tbody td {
  padding: 13px 16px;
  color: var(--text);
  vertical-align: middle;
}

.erp-table tbody td.muted { color: var(--muted); }

/* Row index */
.row-num {
  width: 36px; height: 36px;
  background: var(--bg);
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
}

/* User cell */
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.user-name  { font-weight: 600; font-size: .82rem; line-height: 1.2; }
.user-sub   { font-size: .72rem; color: var(--muted); }

/* Amount */
.amount-positive { color: #059669; font-weight: 700; }
.amount-negative { color: var(--danger); font-weight: 700; }
.amount-neutral  { font-weight: 600; }

/* Code */
.order-code {
  font-family: 'Courier New', monospace;
  font-size: .75rem;
  background: #f3f4f6;
  padding: 3px 7px;
  border-radius: 5px;
  color: var(--primary);
  border: 1px solid var(--border);
}

/* ================================================================
   BADGES / STATUS
   ================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .7;
}

.badge-success   { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.badge-danger    { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-warning   { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.badge-info      { background: #ecfeff; color: #0891b2; border: 1px solid #a5f3fc; }
.badge-purple    { background: #faf5ff; color: #7c3aed; border: 1px solid #ddd6fe; }
.badge-gray      { background: #f9fafb; color: #6b7280; border: 1px solid #e5e7eb; }
.badge-primary   { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-dark      { background: #1f2937; color: #fff; border: 1px solid #374151; }

/* Role badges */
.role-admin    { background: #1f2937; color: #fff; }
.role-agent    { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.role-customer { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ================================================================
   PAGINATION
   ================================================================ */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pagination-info { font-size: .78rem; color: var(--muted); }
.pagination-info strong { color: var(--text); }

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: .78rem;
  font-weight: 500;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
  gap: 4px;
}

.page-link:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.page-link.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
}

.page-link.disabled {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
  line-height: 1;
}

.btn-sm { padding: 6px 12px; font-size: .75rem; }
.btn-xs { padding: 4px 8px; font-size: .7rem; border-radius: 6px; }
.btn-icon { padding: 7px; }

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

.btn-success { background: #059669; color: #fff; border-color: #059669; }
.btn-success:hover { background: #047857; color: #fff; }

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

.btn-warning { background: #d97706; color: #fff; border-color: #d97706; }
.btn-warning:hover { background: #b45309; color: #fff; }

.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); border-color: #9ca3af; }

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

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

.btn-outline-success { background: #fff; border-color: #059669; color: #059669; }
.btn-outline-success:hover { background: #059669; color: #fff; }

.btn-ghost { background: none; border: none; color: var(--muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

/* ================================================================
   FORMS
   ================================================================ */
.form-label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

.form-control, .form-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .82rem;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}

.form-control.sm, .form-select.sm { padding: 6px 10px; font-size: .78rem; }

.input-group {
  display: flex;
}

.input-group .form-control {
  border-radius: 8px 0 0 8px;
  flex: 1;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 8px 8px 0;
  background: var(--bg);
  font-size: .82rem;
  color: var(--muted);
}

.form-search {
  position: relative;
}

.form-search .form-control {
  padding-left: 36px;
}

.form-search .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: .9rem;
}

/* ================================================================
   FILTERS BAR
   ================================================================ */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  flex-wrap: wrap;
}

.filters-bar .filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filters-bar label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.filters-bar .form-control,
.filters-bar .form-select { width: auto; min-width: 120px; }

.filters-bar .ms-auto { margin-left: auto; }

/* ================================================================
   ALERTS
   ================================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .82rem;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-danger   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning  { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info     { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* ================================================================
   MODALS
   ================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all .2s;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  transform: scale(.95);
  transition: transform .2s;
  overflow: hidden;
}

.modal-overlay.show .modal-box { transform: scale(1); }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.modal-head-title {
  font-size: .95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body { padding: 22px; }
.modal-foot {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #fafafa;
}

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

.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(26,86,219,.3) 0%, transparent 70%);
  top: -100px; right: -100px;
  border-radius: 50%;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(124,58,237,.2) 0%, transparent 70%);
  bottom: -50px; left: -50px;
  border-radius: 50%;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px rgba(0,0,0,.3);
  position: relative;
  z-index: 1;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.login-logo-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, #1a56db, #7c3aed);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #fff;
}

.login-logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.5px;
}

/* ================================================================
   DROPDOWN
   ================================================================ */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute;
  right: 0; top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  min-width: 160px;
  z-index: 200;
  padding: 4px;
  display: none;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: .8rem;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background .1s;
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ================================================================
   UTILITY
   ================================================================ */
.text-primary  { color: var(--primary) !important; }
.text-success  { color: #059669 !important; }
.text-danger   { color: var(--danger) !important; }
.text-warning  { color: var(--warning) !important; }
.text-muted    { color: var(--muted) !important; }
.text-purple   { color: var(--purple) !important; }
.fw-600        { font-weight: 600; }
.fw-700        { font-weight: 700; }
.fs-sm         { font-size: .78rem; }
.fs-xs         { font-size: .7rem; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.d-flex { display: flex; }
.d-grid { display: grid; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.ms-auto { margin-left: auto; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.me-1 { margin-right: 4px; } .me-2 { margin-right: 8px; }
.p-0 { padding: 0; } .p-3 { padding: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.border-bottom { border-bottom: 1px solid var(--border); }
.flex-grow-1 { flex: 1; min-width: 0; }
.fw-semibold { font-weight: 600; }
.w-100 { width: 100%; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.nowrap { white-space: nowrap; }

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state i { font-size: 3rem; margin-bottom: 12px; opacity: .3; }
.empty-state p { font-size: .85rem; }

/* Toast */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #1f2937;
  color: #fff;
  border-radius: 10px;
  font-size: .82rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
  animation: slideIn .25s ease;
  min-width: 240px;
  max-width: 340px;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* Sidebar collapsed */
.sidebar-collapsed .sidebar { width: 64px; }
.sidebar-collapsed .sidebar .brand-text,
.sidebar-collapsed .sidebar .brand-sub,
.sidebar-collapsed .sidebar .nav-group-label,
.sidebar-collapsed .sidebar .nav-link span,
.sidebar-collapsed .sidebar .nav-badge { display: none; }
.sidebar-collapsed .sidebar .nav-link { justify-content: center; padding: 10px; margin: 2px 8px; }
.sidebar-collapsed .sidebar .sidebar-brand { justify-content: center; padding: 0 14px; }
.sidebar-collapsed .main-wrap { margin-left: 64px; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w);
    box-shadow: 4px 0 20px rgba(0,0,0,.3);
  }

  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1039; display: none; }
  .sidebar.mobile-open ~ .sidebar-overlay { display: block; }

  .main-wrap { margin-left: 0 !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 16px; }
  .filters-bar { flex-direction: column; align-items: stretch; }
  .pagination-wrap { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px; }
}
