/* =============================================================
   CS Manager  |  assets/css/app.css
   COMPLETE CLEAN VERSION - works on mobile AND desktop
   ============================================================= */

/* -- CSS Variables ------------------------------------------- */
:root {
  --primary:     #4361ee;
  --primary-dk:  #3251d4;
  --danger:      #ef476f;
  --success:     #16a34a;
  --warning:     #d97706;
  --info:        #0891b2;
  --bg:          #f4f6fb;
  --card:        #ffffff;
  --sidebar-bg:  #1e293b;
  --sidebar-w:   260px;
  --topbar-h:    56px;
  --text:        #1a1a2e;
  --muted:       #6b7280;
  --border:      #e5e7f0;
  --radius:      12px;
  --shadow:      0 2px 8px rgba(0,0,0,.08);
}

/* -- Reset --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dk); }
img { max-width: 100%; }

/* =============================================================
   TOPBAR  - fixed, always on top of everything
   ============================================================= */
.csm-topbar {
  width: 100%;
  left: 0;
  right: 0;
  position: fixed;
  top: 0;
  height: var(--topbar-h);
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
  z-index: 1030;                    /* Bootstrap modal is 1050, topbar below that */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
}

/* Hamburger button - visible on mobile only */
.csm-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}
.csm-toggle-btn:hover { background: var(--bg); }

.csm-brand {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  flex: 1;
  text-align: center;
}

/* Topbar centre - business name display */

.csm-brand-link {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.csm-brand-link:hover { color: #3451d1; }
.csm-topbar-sep {
  color: #cbd5e1;
  font-size: .7rem;
  margin: 0 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.csm-topbar-biz-name {
  font-size: .78rem;
  font-weight: 700;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  line-height: 1;
}
.csm-topbar-centre {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  gap: 2px;
}

.csm-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.csm-role-badge {
  font-size: .68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  background: #eef0ff;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}

.csm-topbar-logout {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--danger);
  font-size: 1.2rem;
  padding: 4px 6px;
  border-radius: 6px;
  text-decoration: none;
}
.csm-topbar-logout:hover { background: #fff0f3; color: var(--danger); }

/* =============================================================
   OVERLAY  - dark backdrop on mobile when sidebar is open
   ============================================================= */
.csm-overlay {
  display: none;
  position: fixed;
  top: 0; bottom: 0;
  background: rgba(0,0,0,.55);
  z-index: 1025;                    /* below topbar (1030), above content */
}
.csm-overlay.show { display: block; }

/* =============================================================
   SIDEBAR
   MOBILE  : hidden off left, slides in as full-height drawer
   DESKTOP : always visible fixed left panel, below topbar
   ============================================================= */
.csm-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 85vw;
  max-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* MOBILE: hidden off-screen */
  transform: translateX(-100%);
  transition: transform .28s ease;
  z-index: 1028;                    /* above overlay (1025), below topbar (1030) on desktop */
                                    /* But on MOBILE it should be ABOVE topbar - handled via open class */
}
/* When open on mobile: slide in */
.csm-sidebar.open {
  transform: translateX(0);
}

/* Sidebar user header */
.csm-sidebar-head {
  padding: 20px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  background: rgba(0,0,0,.15);
}
.csm-sidebar-head .csm-avatar i {
  font-size: 2.4rem;
  color: #93c5fd;
}
.csm-sidebar-head .csm-uname {
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}
.csm-sidebar-head .csm-urole {
  font-size: .75rem;
  color: rgba(255,255,255,.5);
}

/* Sidebar nav scroll area */
.csm-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 0 20px;
  -webkit-overflow-scrolling: touch;
}
.csm-sidebar-nav::-webkit-scrollbar { width: 3px; }
.csm-sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); }

.csm-nav-group {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,.3);
  padding: 16px 16px 4px;
}
.csm-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: .87rem;
  color: rgba(255,255,255,.72);
  border-left: 3px solid transparent;
  transition: all .15s ease;
}
.csm-nav-link i { font-size: 1rem; flex-shrink: 0; }
.csm-nav-link:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
  border-left-color: rgba(255,255,255,.4);
}
.csm-nav-link.active {
  background: rgba(67,97,238,.25);
  color: #fff;
  font-weight: 600;
  border-left-color: var(--primary);
}
.csm-nav-link.nav-danger { color: #fca5a5; }
.csm-nav-link.nav-danger:hover { background: rgba(239,71,111,.15); border-left-color: #f87171; }

/* =============================================================
   MAIN CONTENT AREA
   ============================================================= */
.csm-main {
  padding-top: var(--topbar-h);
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* =============================================================
   DESKTOP  >= 768px
   ============================================================= */
@media (min-width: 768px) {

  /* Sidebar: always visible, positioned below topbar */
  .csm-sidebar {
    transform: translateX(0) !important;  /* always show */
    top: var(--topbar-h);                 /* start below topbar */
    z-index: 200;                         /* well below topbar on desktop */
    width: var(--sidebar-w);
  }

  /* Hide hamburger on desktop */
  .csm-toggle-btn { display: none !important; }

  /* Hide overlay on desktop */
  .csm-overlay { display: none !important; }

  /* Push main content right of sidebar */
  .csm-main {
    margin-left: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w));
    max-width: calc(100% - var(--sidebar-w));
  }
}

/* =============================================================
   PAGE WRAPPER / CONTENT
   ============================================================= */
.csm-content {
  width: 100%;
  max-width: 100%;
  padding: 8px 8px 80px;
  box-sizing: border-box;
  overflow-x: hidden;
}
@media (min-width: 576px) { .csm-content { padding: 12px 12px 60px; } }
@media (min-width: 768px) { .csm-content { padding: 20px 20px 40px; } }

.csm-page-title {
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--text);
}

/* =============================================================
   CARDS
   ============================================================= */
.csm-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.csm-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  flex-wrap: wrap;
}
.csm-card-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =============================================================
   STAT CARDS
   ============================================================= */
.csm-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (min-width: 576px) { .csm-stat-grid { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 992px) { .csm-stat-grid { grid-template-columns: repeat(4,1fr); } }

.csm-stat {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px;
}
/* csm-stat-card: same as csm-stat - used in dashboards with border-left accent */
.csm-stat-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 14px 14px 14px 18px;
  position: relative;
  overflow: hidden;
}
.csm-stat-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  margin-bottom: 10px;
}
.csm-stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.csm-stat-label {
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 4px;
}

/* =============================================================
   FORMS
   ============================================================= */
.csm-form-group { margin-bottom: 14px; }
.csm-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text);
}
.csm-input {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.csm-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,97,238,.12);
}
.csm-input-wrap { position: relative; }
.csm-input-wrap .csm-input { padding-right: 44px; }
.csm-input-eye {
  position: absolute;
  top: 50%; right: 12px;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  user-select: none;
}
select.csm-input { padding-right: 32px; }
textarea.csm-input { resize: vertical; min-height: 80px; }

/* Bootstrap form-control override to match our style */
.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  color: var(--text);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,97,238,.12);
}

/* =============================================================
   BUTTONS
   ============================================================= */
.csm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .15s, transform .1s, background .15s;
  line-height: 1.4;
}
.csm-btn:active { transform: scale(.97); }
.csm-btn-primary { background: var(--primary); color: #fff; }
.csm-btn-primary:hover { background: var(--primary-dk); color: #fff; }
.csm-btn-success { background: var(--success); color: #fff; }
.csm-btn-success:hover { background: #15803d; color: #fff; }
.csm-btn-danger  { background: var(--danger); color: #fff; }
.csm-btn-danger:hover  { background: #d4003e; color: #fff; }
.csm-btn-warning { background: var(--warning); color: #fff; }
.csm-btn-info    { background: var(--info); color: #fff; }
.csm-btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.csm-btn-outline:hover { background: var(--bg); color: var(--text); }
.csm-btn-sm { padding: 5px 12px; font-size: .78rem; border-radius: 6px; }
.csm-btn-full { width: 100%; }

/* =============================================================
   TABLES
   ============================================================= */
.csm-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.csm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.csm-table th {
  background: #f8fafc;
  padding: 10px 12px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.csm-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.csm-table tr:last-child td { border-bottom: none; }
.csm-table tbody tr:hover td { background: #f8fafc; }

/* =============================================================
   BADGES
   ============================================================= */
.csm-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.badge-success, .badge-approved, .badge-active   { background: #dcfce7; color: #166534; }
.badge-danger,  .badge-rejected, .badge-failed    { background: #fee2e2; color: #991b1b; }
.badge-warning, .badge-pending,  .badge-locked    { background: #fef3c7; color: #92400e; }
.badge-info                                       { background: #dbeafe; color: #1e40af; }
.badge-inactive, .badge-secondary                 { background: #f3f4f6; color: var(--muted); }

/* =============================================================
   ALERTS
   ============================================================= */
.csm-alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: .88rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: none;
}
.csm-alert-success { background: #dcfce7; color: #166534; }
.csm-alert-danger  { background: #fee2e2; color: #991b1b; }
.csm-alert-warning { background: #fef3c7; color: #92400e; }
.csm-alert-info    { background: #dbeafe; color: #1e40af; }
/* Bootstrap alert overrides */
.alert-success { background: #dcfce7; color: #166534; border: none; border-radius: 8px; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: none; border-radius: 8px; }
.alert-warning { background: #fef3c7; color: #92400e; border: none; border-radius: 8px; }
.alert-info    { background: #dbeafe; color: #1e40af; border: none; border-radius: 8px; }

/* =============================================================
   AUTH PAGES  (login, forgot password, signup)
   ============================================================= */
.csm-auth-wrap {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.csm-auth-box {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
  padding: 36px 28px;
  width: 100%;
  max-width: 420px;
}
.csm-auth-logo { text-align: center; margin-bottom: 28px; }
.csm-auth-logo .csm-logo-icon {
  width: 64px; height: 64px;
  background: var(--primary);
  border-radius: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2rem; color: #fff; margin-bottom: 12px;
}
.csm-auth-logo h1 { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.csm-auth-logo p  { font-size: .82rem; color: var(--muted); margin-top: 4px; }

/* =============================================================
   TOGGLE SWITCH
   ============================================================= */
.csm-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.csm-switch input[type="checkbox"] {
  position: relative;
  width: 44px; height: 24px;
  appearance: none; -webkit-appearance: none;
  background: #d1d5db;
  border-radius: 12px;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
  outline: none;
}
.csm-switch input[type="checkbox"]:checked { background: var(--primary); }
.csm-switch input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: left .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.csm-switch input[type="checkbox"]:checked::after { left: 23px; }

/* =============================================================
   DIVIDER
   ============================================================= */
.csm-divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* =============================================================
   UTILITY HELPERS
   ============================================================= */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger)  !important; }
.text-warning { color: var(--warning) !important; }
.text-muted   { color: var(--muted)   !important; }
.fw-bold      { font-weight: 700 !important; }
.fw-600       { font-weight: 600 !important; }
.text-center  { text-align: center !important; }
.text-right   { text-align: right  !important; }
.w-100        { width: 100% !important; }
.d-flex       { display: flex !important; }
.align-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.gap-2        { gap: 8px !important; }
.gap-3        { gap: 12px !important; }
.mt-1         { margin-top: 8px !important; }
.mt-2         { margin-top: 16px !important; }
.mt-3         { margin-top: 24px !important; }
.mb-1         { margin-bottom: 8px !important; }
.mb-2         { margin-bottom: 16px !important; }
.mb-3         { margin-bottom: 24px !important; }
.p-0          { padding: 0 !important; }
.no-print     { }

/* =============================================================
   PRINT
   ============================================================= */
@media print {
  .csm-topbar,
  .csm-sidebar,
  .csm-overlay,
  .no-print { display: none !important; }
  .csm-main {
    margin-left: 0 !important;
    padding-top: 0 !important;
  }
  body { background: #fff; }
}
/* =============================================================
   ALIASES & MISSING CLASSES  - added to fix UI inconsistencies
   Many PHP files use these class names
   ============================================================= */

/* Form aliases (csm-form-label = csm-label, csm-form-control = csm-input) */
.csm-form-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text);
}
.csm-form-control {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.csm-form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,97,238,.12);
}
select.csm-form-control  { padding-right: 32px; }
textarea.csm-form-control { resize: vertical; min-height: 80px; }

/* Input group */
.csm-input-group {
  display: flex;
  align-items: stretch;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--border);
}
.csm-input-group .csm-form-control,
.csm-input-group .csm-input {
  border: none;
  border-radius: 0;
  flex: 1;
  box-shadow: none;
}
.csm-input-group .csm-form-control:focus,
.csm-input-group .csm-input:focus {
  box-shadow: none;
  border: none;
}
.csm-input-addon {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #f4f6fb;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 600;
  border-left: 1.5px solid var(--border);
  white-space: nowrap;
}
.csm-input-addon:first-child {
  border-left: none;
  border-right: 1.5px solid var(--border);
}

/* Button aliases */
.btn-csm-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  background: var(--primary);
  color: #fff;
  transition: background .15s, transform .1s;
  line-height: 1.4;
}
.btn-csm-primary:hover  { background: var(--primary-dk); color: #fff; }
.btn-csm-primary:active { transform: scale(.97); }
.btn-csm-full { width: 100%; }

/* Page header (used in some pages instead of csm-page-title) */
.csm-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.csm-page-header .csm-page-title { margin-bottom: 0; }

/* Flash messages */
.csm-flash {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: .88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.csm-flash-success { background: #dcfce7; color: #166534; border-left: 4px solid #16a34a; }
.csm-flash-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.csm-flash-warning { background: #fef3c7; color: #92400e; border-left: 4px solid #d97706; }
.csm-flash-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }

/* Badge variants with csm- prefix */
.csm-badge-success  { background: #dcfce7; color: #166534; padding: 3px 9px; border-radius: 20px; font-size: .7rem; font-weight: 700; text-transform: uppercase; display: inline-block; white-space: nowrap; }
.csm-badge-danger   { background: #fee2e2; color: #991b1b; padding: 3px 9px; border-radius: 20px; font-size: .7rem; font-weight: 700; text-transform: uppercase; display: inline-block; white-space: nowrap; }
.csm-badge-warning  { background: #fef3c7; color: #92400e; padding: 3px 9px; border-radius: 20px; font-size: .7rem; font-weight: 700; text-transform: uppercase; display: inline-block; white-space: nowrap; }
.csm-badge-info     { background: #dbeafe; color: #1e40af; padding: 3px 9px; border-radius: 20px; font-size: .7rem; font-weight: 700; text-transform: uppercase; display: inline-block; white-space: nowrap; }
.csm-badge-pending  { background: #fef3c7; color: #92400e; padding: 3px 9px; border-radius: 20px; font-size: .7rem; font-weight: 700; text-transform: uppercase; display: inline-block; white-space: nowrap; }
.csm-badge-inactive { background: #f3f4f6; color: #6b7280; padding: 3px 9px; border-radius: 20px; font-size: .7rem; font-weight: 700; text-transform: uppercase; display: inline-block; white-space: nowrap; }
.csm-badge-locked   { background: #fee2e2; color: #991b1b; padding: 3px 9px; border-radius: 20px; font-size: .7rem; font-weight: 700; text-transform: uppercase; display: inline-block; white-space: nowrap; }
.csm-badge-failed   { background: #fee2e2; color: #991b1b; padding: 3px 9px; border-radius: 20px; font-size: .7rem; font-weight: 700; text-transform: uppercase; display: inline-block; white-space: nowrap; }

/* Tabs */
.csm-tabs {
  display: flex;
  gap: 4px;
  background: #f4f6fb;
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.csm-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-size: .84rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
  text-decoration: none;
  transition: all .15s;
  flex-shrink: 0;
}
.csm-tab:hover  { background: #fff; color: var(--text); }
.csm-tab.active { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,.1); }

/* Empty state */
.csm-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.csm-empty-state i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
  opacity: .4;
}
.csm-empty-state p { font-size: .9rem; margin: 0; }

/* Auth page variants */
.csm-auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.csm-auth-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
  padding: 36px 28px;
  width: 100%;
  max-width: 420px;
}

/* Countdown timer */
.csm-countdown {
  font-size: .82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Expense / Income balance card fix - ensure text is always visible */
.csm-balance-card {
  background: linear-gradient(135deg, #4361ee, #3a0ca3);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
}
.csm-balance-card .bal-label  { font-size: .75rem; opacity: .8; text-transform: uppercase; letter-spacing: .04em; }
.csm-balance-card .bal-amount { font-size: 2rem; font-weight: 900; letter-spacing: -.02em; margin: 6px 0 2px; }
.csm-balance-card .bal-sub    { font-size: .72rem; opacity: .7; }

/* Mobile responsive table fix */
@media (max-width: 576px) {
  .csm-table th, .csm-table td { padding: 8px 6px; font-size: .78rem; }
  .csm-card { padding: 14px; }
  .csm-stat-grid { gap: 8px; }
}