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

/* ====================================================================
   Gaming Zone Management System – Global Stylesheet
   Professional dark/light theme, sidebar layout, components
   ==================================================================== */

/* ── CSS Variables ─────────────────────────────────────────────────── */
:root {
  /* Crystal brand palette */
  --crystal-teal:   #0F9B8E;
  --crystal-navy:   #0D1B2A;
  --crystal-gold:   #C4961F;
  --crystal-border: #D8D3CC;
  --crystal-hover:  #E8F5F3;
  --sidebar-divider:#D8D3CC;

  /* brand */
  --primary:        #3b82f6;
  --primary-dark:   #2563eb;
  --primary-light:  #dbeafe;
  --accent:         #f59e0b;

  /* semantic */
  --success:        #10b981;
  --success-light:  #d1fae5;
  --warning:        #f59e0b;
  --warning-light:  #fef3c7;
  --danger:         #ef4444;
  --danger-light:   #fee2e2;
  --purple:         #8b5cf6;
  --purple-light:   #ede9fe;
  --gray:           #6b7280;
  --gray-light:     #f3f4f6;

  /* layout – light */
  --sidebar-bg:     #FFFFFF;
  --sidebar-text:   #475569;
  --sidebar-active: #0F9B8E;
  --sidebar-hover:  #E8F5F3;
  --sidebar-width:  250px;

  --header-bg:      #ffffff;
  --header-border:  #e5e7eb;
  --header-height:  64px;

  --page-bg:        #f8fafc;
  --card-bg:        #ffffff;
  --card-border:    #e5e7eb;
  --card-shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --card-shadow-hover: 0 4px 12px rgba(0,0,0,.12);

  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;

  --input-bg:       #ffffff;
  --input-border:   #d1d5db;
  --input-focus:    #3b82f6;

  --table-head:     #f8fafc;
  --table-border:   #e5e7eb;
  --table-hover:    #f8fafc;

  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --transition: .18s ease;
}

[data-theme="dark"] {
  --crystal-border: #1e293b;
  --crystal-hover:  #162236;
  --sidebar-divider:#1e293b;
  --sidebar-bg:     #0D1B2A;
  --sidebar-text:   #94a3b8;
  --sidebar-hover:  #162236;
  --header-bg:      #0f172a;
  --header-border:  #1e293b;
  --page-bg:        #020617;
  --card-bg:        #0f172a;
  --card-border:    #1e293b;
  --card-shadow:    0 1px 3px rgba(0,0,0,.4);
  --card-shadow-hover: 0 4px 12px rgba(0,0,0,.5);
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;
  --input-bg:       #1e293b;
  --input-border:   #334155;
  --table-head:     #1e293b;
  --table-border:   #1e293b;
  --table-hover:    #1e293b;
  --primary-light:  #1e3a5f;
  --success-light:  #064e3b;
  --warning-light:  #451a03;
  --danger-light:   #450a0a;
  --purple-light:   #2e1065;
  --gray-light:     #1e293b;
}

/* ── Reset & Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--page-bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  transition: background var(--transition), color var(--transition);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }
ul { list-style: none; }

/* ── Layout ────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-divider);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: width var(--transition), background var(--transition), border-color var(--transition);
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--sidebar-divider); border-radius: 2px; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--sidebar-divider);
  flex-shrink: 0;
}
.sidebar-logo .logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--crystal-teal), #0D7A6E);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.sidebar-logo .logo-text { color: var(--text-primary); }
.sidebar-logo .logo-text .brand { font-size: 15px; font-weight: 700; line-height: 1.2; }
.sidebar-logo .logo-text .brand-accent { color: var(--crystal-teal); }
.sidebar-logo .logo-text .tagline { font-size: 10px; color: var(--text-muted); }

.sidebar-nav {
  padding: 12px 0;
  flex: 1;
}
.nav-section-label {
  padding: 12px 20px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
  position: relative;
}
.nav-item:hover { background: var(--sidebar-hover); color: var(--crystal-teal); text-decoration: none; }
.nav-item.active {
  background: rgba(15,155,142,.12);
  color: var(--crystal-teal);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--crystal-teal);
  border-radius: 0 3px 3px 0;
}
.nav-item .nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--crystal-teal);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  flex-shrink: 0;
}
.nav-item .nav-badge.nav-badge-danger {
  background: var(--danger);
}
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--sidebar-divider);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
}
.sidebar-user .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--crystal-teal), #0D7A6E);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.sidebar-user .user-info .user-name { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.sidebar-user .user-info .user-role { font-size: 11px; color: var(--text-muted); }

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

/* ── Header ────────────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: var(--header-bg);
  border-bottom: 2px solid var(--crystal-teal);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 90;
  transition: background var(--transition), border-color var(--transition);
}
.header-left { flex: 1; }
.header-breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.header-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.header-right { display: flex; align-items: center; gap: 12px; }
.header-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-lg);
  padding: 7px 14px;
  font-size: 13px; color: var(--text-secondary);
  min-width: 220px;
}
.header-search input {
  border: none; outline: none; background: transparent;
  color: var(--text-primary); font-size: 13px; flex: 1;
}
.icon-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-secondary);
  transition: all var(--transition); position: relative;
}
.icon-btn:hover { background: var(--gray-light); color: var(--text-primary); }
.icon-btn .badge-dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--danger); border-radius: 50%;
  border: 2px solid var(--card-bg);
}
.header-user {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
}
.header-user:hover { background: var(--gray-light); }
.header-user .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--crystal-teal), #0D7A6E);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 11px;
}
.theme-toggle {
  width: 38px; height: 38px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer;
  transition: all var(--transition);
}
.theme-toggle:hover { background: var(--gray-light); }

/* ── Content ───────────────────────────────────────────────────────── */
.content {
  padding: 24px;
  flex: 1;
}
.page-title {
  font-size: 22px; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.page-subtitle {
  font-size: 13.5px; color: var(--text-muted);
  margin-bottom: 24px;
}

/* ── Grid helpers ──────────────────────────────────────────────────── */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; }
.mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ── Cards ─────────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--transition), transform var(--transition), background var(--transition), border-color var(--transition);
  overflow: hidden;
}
.card:hover { box-shadow: var(--card-shadow-hover); }
.card-body { padding: 20px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
}
.card-header-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--card-border);
  background: var(--gray-light);
  font-size: 12.5px;
}

/* ── Stat cards ────────────────────────────────────────────────────── */
.stat-card { padding: 20px; }
.stat-label { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text-primary); line-height: 1; margin-bottom: 8px; }
.stat-sub { font-size: 12px; color: var(--text-muted); }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.stat-card.blue   .stat-icon { background: var(--primary-light); }
.stat-card.green  .stat-icon { background: var(--success-light); }
.stat-card.orange .stat-icon { background: var(--warning-light); }
.stat-card.red    .stat-icon { background: var(--danger-light); }
.stat-card.purple .stat-icon { background: var(--purple-light); }

/* Resource status cards */
.resource-card {
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 16px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.resource-card:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-1px); }
.resource-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.resource-card.status-available::before { background: var(--success); }
.resource-card.status-in-use::before    { background: var(--primary); }
.resource-card.status-overdue::before   { background: var(--danger); }
.resource-card.status-reserved::before  { background: var(--warning); }
.resource-card.status-maintenance::before { background: var(--gray); }
.resource-card.status-ending-soon::before { background: var(--warning); }

.resource-card .rc-header {
  display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px;
}
.resource-card .rc-id { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing:.04em; }
.resource-card .rc-name { font-size: 14px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.resource-card .rc-type { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.resource-card .rc-customer { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.resource-card .rc-meta { font-size: 11.5px; color: var(--text-secondary); }
.resource-card .rc-timer {
  font-size: 18px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin: 10px 0 4px;
}
.resource-card.status-available .rc-timer { color: var(--success); }
.resource-card.status-in-use .rc-timer    { color: var(--primary); }
.resource-card.status-overdue .rc-timer   { color: var(--danger); }
.resource-card.status-ending-soon .rc-timer { color: var(--warning); }
.resource-card .rc-actions {
  display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap;
}
.resource-card .rc-actions .btn-xs {
  font-size: 11px; padding: 4px 10px; border-radius: 6px;
}

/* ── Badges & Chips ────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
  white-space: nowrap;
}
.badge-sm { padding: 2px 8px; font-size: 10.5px; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.badge-available   { background: var(--success-light);  color: #065f46; }
.badge-in-use      { background: var(--primary-light);  color: #1e40af; }
.badge-overdue     { background: var(--danger-light);   color: #991b1b; }
.badge-reserved    { background: var(--warning-light);  color: #92400e; }
.badge-maintenance { background: var(--gray-light);     color: #374151; }
.badge-completed   { background: var(--success-light);  color: #065f46; }
.badge-cancelled   { background: var(--gray-light);     color: #374151; }
.badge-confirmed   { background: var(--primary-light);  color: #1e40af; }
.badge-ending-soon { background: var(--warning-light);  color: #92400e; }
.badge-walk-in  { background: #f3f4f6; color: #374151; }
.badge-gold     { background: #fef3c7; color: #92400e; }
.badge-premium  { background: var(--purple-light); color: #5b21b6; }
.badge-booking     { background: var(--primary-light); color: #1e40af; }
.badge-open-game   { background: var(--purple-light);  color: #5b21b6; }
.badge-playstation { background: #dbeafe; color: #1e40af; }
.badge-snooker     { background: #d1fae5; color: #065f46; }
.badge-billiard    { background: #fef3c7; color: #92400e; }
.badge-private-room { background: var(--purple-light); color: #5b21b6; }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600;
  border: none; cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: var(--primary);   color: white; }
.btn-primary:hover  { background: var(--primary-dark); }
.btn-success   { background: var(--success);   color: white; }
.btn-success:hover  { background: #059669; }
.btn-warning   { background: var(--warning);   color: white; }
.btn-warning:hover  { background: #d97706; }
.btn-danger    { background: var(--danger);    color: white; }
.btn-danger:hover   { background: #dc2626; }
.btn-purple    { background: var(--purple);    color: white; }
.btn-purple:hover   { background: #7c3aed; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
}
.btn-outline:hover { background: var(--gray-light); color: var(--text-primary); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--gray-light); }
.btn-sm { padding: 7px 14px; font-size: 12.5px; }
.btn-xs { padding: 4px 10px; font-size: 11.5px; border-radius: 5px; }
.btn-lg { padding: 12px 24px; font-size: 14.5px; }
.btn-icon { padding: 9px; }
.btn-icon.btn-sm { padding: 7px; }

/* ── Forms ─────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%;
  padding: 9px 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.form-control:disabled { opacity: .6; cursor: not-allowed; }
.form-text { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form-row-3 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr 1fr; }
.form-error { font-size: 11.5px; color: var(--danger); margin-top: 4px; }
.input-group { display: flex; }
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-addon {
  display: flex; align-items: center; padding: 9px 12px;
  background: var(--gray-light); border: 1px solid var(--input-border);
  font-size: 13px; color: var(--text-muted); font-weight: 600;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  border-right: none;
}
.input-addon + .form-control { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ── Tables ────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px;
}
thead th {
  background: var(--table-head);
  border-bottom: 1px solid var(--table-border);
  padding: 10px 14px;
  text-align: left;
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted);
  white-space: nowrap;
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--table-border);
  color: var(--text-primary);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--table-hover); }
.table-actions { display: flex; gap: 6px; }

/* ── Tabs ──────────────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 10px 18px;
  font-size: 13.5px; font-weight: 500;
  color: var(--text-muted);
  background: transparent; border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; gap: 6px;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-badge {
  background: var(--gray-light);
  color: var(--text-muted);
  font-size: 10.5px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px;
}
.tab-btn.active .tab-badge { background: var(--primary-light); color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Modals ────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--card-border);
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer; color: var(--text-muted);
  transition: all var(--transition);
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--card-border);
  background: var(--table-head);
}

/* ── Toasts ────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  padding: 14px 16px;
  min-width: 300px; max-width: 380px;
  transform: translateX(120%);
  transition: transform .3s ease;
}
.toast.show { transform: translateX(0); }
.toast-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.toast-title { font-size: 13.5px; font-weight: 700; margin-bottom: 2px; }
.toast-msg   { font-size: 12.5px; color: var(--text-muted); }
.toast-close { margin-left: auto; cursor: pointer; color: var(--text-muted); font-size: 14px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--success); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.error   .toast-icon { color: var(--danger); }
.toast.info    .toast-icon { color: var(--primary); }

/* ── Filter bar ────────────────────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}
.filter-bar .form-control { width: auto; min-width: 140px; }
.filter-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }

/* ── Section heading ───────────────────────────────────────────────── */
.section-heading {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-heading h2 { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.section-heading p  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Empty state ───────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.empty-state p  { font-size: 13px; }

/* ── Timeline / Calendar helpers ──────────────────────────────────── */
.calendar-grid {
  display: grid;
  grid-template-columns: 70px repeat(7, 1fr);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.cal-header-cell {
  background: var(--table-head);
  padding: 10px;
  text-align: center;
  font-size: 12px; font-weight: 600;
  border-right: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
}
.cal-time-cell {
  font-size: 11px; color: var(--text-muted);
  padding: 6px; text-align: right;
  border-right: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  vertical-align: top;
}
.cal-slot {
  border-right: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  min-height: 60px;
  position: relative;
  padding: 2px;
}
.cal-event {
  border-radius: 5px;
  padding: 4px 7px;
  font-size: 11px; font-weight: 600;
  cursor: pointer;
  margin-bottom: 2px;
  transition: opacity var(--transition);
  overflow: hidden;
}
.cal-event:hover { opacity: .85; }
.cal-event.ev-green  { background: var(--success); color: white; }
.cal-event.ev-blue   { background: var(--primary); color: white; }
.cal-event.ev-orange { background: var(--warning); color: white; }
.cal-event.ev-red    { background: var(--danger);  color: white; }
.cal-event.ev-gray   { background: var(--gray);    color: white; }
.cal-event.ev-purple { background: var(--purple);  color: white; }

/* ── Chart bars (pure CSS) ─────────────────────────────────────────── */
.chart-bar-wrapper { display: flex; align-items: flex-end; gap: 6px; height: 100px; }
.chart-bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chart-bar {
  width: 100%; border-radius: 4px 4px 0 0;
  min-height: 4px;
  background: linear-gradient(180deg, var(--primary), #60a5fa);
  transition: height .5s ease;
}
.chart-bar-label { font-size: 10px; color: var(--text-muted); text-align: center; }
.chart-bar-val   { font-size: 9px; color: var(--text-secondary); font-weight: 600; text-align: center; }

/* ── Progress ring / bar ───────────────────────────────────────────── */
.progress-bar-wrap { background: var(--gray-light); border-radius: 100px; overflow: hidden; height: 8px; }
.progress-bar-fill { height: 100%; border-radius: 100px; transition: width .5s ease; }
.progress-blue   { background: var(--primary); }
.progress-green  { background: var(--success); }
.progress-orange { background: var(--warning); }
.progress-red    { background: var(--danger); }

/* ── Invoice / Receipt ─────────────────────────────────────────────── */
.invoice-paper {
  background: white; color: #111;
  max-width: 480px; margin: 0 auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  overflow: hidden;
}
.invoice-header { background: #0f172a; color: white; padding: 28px 32px; }
.invoice-header .inv-brand { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.invoice-header .inv-sub   { font-size: 12px; opacity: .7; }
.invoice-body   { padding: 24px 32px; }
.invoice-line   { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed #e5e7eb; font-size: 13.5px; }
.invoice-line.total { font-weight: 800; font-size: 15px; border-bottom: 2px solid #111; }
.invoice-footer { padding: 16px 32px; background: #f8fafc; text-align: center; font-size: 12px; color: #6b7280; }

/* ── Login page ────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}
.login-side-left {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  flex-direction: column; text-align: center;
}
.login-side-right {
  width: 460px;
  background: var(--card-bg);
  display: flex; align-items: center; justify-content: center;
  padding: 48px;
}
.login-card { width: 100%; }
.login-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 32px;
}
.login-logo .logo-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.login-hero-title  { font-size: 32px; font-weight: 800; color: white; margin-bottom: 12px; }
.login-hero-sub    { font-size: 15px; color: #94a3b8; max-width: 380px; }
.login-feature-list { margin-top: 40px; list-style: none; display: flex; flex-direction: column; gap: 16px; }
.login-feature-list li { display: flex; align-items: center; gap: 12px; color: #cbd5e1; font-size: 14px; }
.login-feature-list li .feat-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}

/* ── Scrollbar ─────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #334155; }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  :root { --sidebar-width: 60px; }
  .sidebar-logo .logo-text,
  .nav-item .nav-label,
  .nav-section-label,
  .sidebar-user .user-info { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-item .nav-icon { width: 22px; height: 22px; font-size: 18px; }
  .sidebar-footer { padding: 12px 8px; }
  .sidebar-user { justify-content: center; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .login-side-left { display: none; }
  .login-side-right { width: 100%; }
}
@media (max-width: 600px) {
  :root { --sidebar-width: 0px; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); width: 250px; }
  .main-wrapper { margin-left: 0; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .content { padding: 14px; }
  .header-search { display: none; }
}

/* ── Utilities ─────────────────────────────────────────────────────── */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-primary-c { color: var(--primary); }
.text-muted   { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.rounded { border-radius: var(--radius); }
.rounded-sm { border-radius: var(--radius-sm); }
.separator { border: none; border-top: 1px solid var(--card-border); margin: 16px 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Price preview ─────────────────────────────────────────────────── */
.price-preview {
  background: linear-gradient(135deg, var(--primary-light), var(--purple-light));
  border: 1px solid rgba(59,130,246,.2);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.price-preview .pp-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.price-preview .pp-amount { font-size: 26px; font-weight: 800; color: var(--primary); }
.price-preview .pp-rate   { font-size: 12px; color: var(--text-muted); }

/* ── Countdown ring ────────────────────────────────────────────────── */
.countdown-ring { display: inline-block; position: relative; }
.countdown-ring svg { transform: rotate(-90deg); }
.countdown-ring .ring-value {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: var(--text-primary);
}

/* ── Notification dot ──────────────────────────────────────────────── */
.notif-dot {
  position: absolute; top: -4px; right: -4px;
  width: 10px; height: 10px;
  background: var(--danger); border-radius: 50%;
  border: 2px solid var(--card-bg);
}

/* Print styles */
@media print {
  .sidebar, .header, .no-print { display: none !important; }
  .main-wrapper { margin-left: 0; }
  .content { padding: 0; }
}
