/* ================================================================
   EasySlot — Admin Panel Stylesheet
   ================================================================
   All admin styles are scoped inside .admin-panel so they never
   conflict with the public booking-page styles (styles.css).

   Shared tokens (--accent, --bg-surface, etc.) are defined once
   globally in styles.css and reused here.
   ================================================================ */

/* ================================================================
   ADMIN WRAPPER — isolates admin layout from booking UI
   ================================================================ */
.admin-panel {
  display: none;           /* hidden until admin logs in          */
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-base, #F8FAFC);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-primary, #0F172A);
}
.admin-panel.active { display: flex; }

/* ================================================================
   ADMIN HEADER
   ================================================================ */
.admin-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--bg-surface, #fff);
  border-bottom: 1px solid var(--border, #E2E8F0);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  gap: 16px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent, #2563EB);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.admin-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.admin-brand-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary, #0F172A);
  letter-spacing: -0.3px;
}
.admin-brand-tag {
  font-size: 11px;
  color: var(--text-muted, #94A3B8);
}

.admin-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Admin header badge */
.admin-role-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(37,99,235,.1);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent, #2563EB);
}

/* Small icon button */
.admin-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--text-secondary, #475569);
  font-size: 15px;
  transition: background .18s, color .18s;
  cursor: pointer;
  border: none;
  background: none;
}
.admin-icon-btn:hover { background: var(--bg-surface-2, #F1F5F9); color: var(--text-primary, #0F172A); }
.admin-icon-btn:focus-visible { outline: 2px solid var(--accent, #2563EB); outline-offset: 2px; }

/* Logout button */
.admin-logout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border, #E2E8F0);
  background: transparent;
  color: var(--text-secondary, #475569);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
}
.admin-logout-btn:hover { background: #FEF2F2; border-color: #DC2626; color: #DC2626; }

/* ================================================================
   ADMIN MAIN CONTENT AREA
   ================================================================ */
.admin-main {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 32px 48px;
}

/* ================================================================
   ADMIN PAGES (SPA) — shown/hidden by admin.js router
   ================================================================ */
.admin-page              { display: none; }
.admin-page.active       { display: block; animation: adminFadeIn .2s ease; }

@keyframes adminFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   PAGE HEADER ROW
   ================================================================ */
.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.admin-page-header > div {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.admin-page-title-block { display: flex; flex-direction: column; gap: 2px; }

.admin-page-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary, #0F172A);
  letter-spacing: -0.5px;
}
.admin-page-subtitle {
  font-size: 13px;
  color: var(--text-secondary, #475569);
  margin-top: 2px;
}
.admin-page-date {
  font-size: 13px;
  color: var(--text-muted, #94A3B8);
  align-self: flex-start;
  margin-top: 6px;
  white-space: nowrap;
}

/* Back button */
.admin-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: none;
  color: var(--text-secondary, #475569);
  flex-shrink: 0;
  margin-top: 3px;
  cursor: pointer;
  transition: background .18s, color .18s;
}
.admin-back-btn:hover { background: var(--bg-surface-2, #F1F5F9); color: var(--text-primary, #0F172A); }

.admin-header-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ================================================================
   BUTTONS (admin-scoped)
   ================================================================ */
.a-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  height: 40px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  transition: all .18s;
  white-space: nowrap;
  line-height: 1;
  flex-shrink: 0;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.a-btn:active { transform: scale(0.97); }
.a-btn:focus-visible { outline: 2px solid var(--accent, #2563EB); outline-offset: 2px; }

.a-btn-primary {
  background: var(--accent, #2563EB);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,.35);
}
.a-btn-primary:hover { background: var(--accent-hover, #1D4ED8); transform: translateY(-1px); }

.a-btn-outline {
  background: transparent;
  color: var(--accent, #2563EB);
  border: 1.5px solid var(--accent, #2563EB);
}
.a-btn-outline:hover { background: rgba(37,99,235,.06); }

.a-btn-ghost {
  background: transparent;
  color: var(--text-secondary, #475569);
  border: 1.5px solid var(--border, #E2E8F0);
}
.a-btn-ghost:hover { background: var(--bg-surface-2, #F1F5F9); color: var(--text-primary, #0F172A); }

.a-btn-danger  { background: #DC2626; color: #fff; }
.a-btn-danger:hover  { background: #B91C1C; transform: translateY(-1px); }
.a-btn-success { background: #059669; color: #fff; }
.a-btn-success:hover { background: #047857; transform: translateY(-1px); }

.a-btn-sm { height: 32px; padding: 0 12px; font-size: 11px; }
.a-btn-lg { height: 48px; padding: 0 32px; font-size: 16px; }
.a-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* Inline table action buttons */
.a-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-secondary, #475569);
  transition: all .18s;
}
.a-action-btn:hover          { background: var(--bg-surface-2, #F1F5F9); }
.a-action-btn.edit:hover     { color: var(--accent, #2563EB); background: #EFF6FF; }
.a-action-btn.delete:hover   { color: #DC2626; background: #FEF2F2; }
.a-action-btn.complete:hover { color: #059669; background: #ECFDF5; }
.a-action-btn.invoice:hover  { color: #D97706; background: #FFFBEB; }
.a-action-btn.view:hover     { color: #7C3AED; background: #F5F3FF; }
.a-action-group { display: flex; gap: 4px; align-items: center; }

/* ================================================================
   SECTION LABEL
   ================================================================ */
.admin-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted, #94A3B8);
  margin: 32px 0 16px;
}

/* ================================================================
   FORMS (admin-scoped)
   ================================================================ */
.a-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.a-form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.a-form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #475569);
}
.a-form-input,
.a-form-select {
  width: 100%;
  padding: 0 16px;
  height: 42px;
  border: 1.5px solid var(--border, #E2E8F0);
  border-radius: 10px;
  background: var(--bg-surface, #fff);
  color: var(--text-primary, #0F172A);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  appearance: none;
  transition: border-color .18s, box-shadow .18s;
}
.a-form-input:focus,
.a-form-select:focus {
  border-color: var(--accent, #2563EB);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.a-form-input::placeholder { color: var(--text-muted, #94A3B8); }
.a-form-textarea {
  height: auto;
  min-height: 88px;
  padding: 12px 16px;
  resize: vertical;
  line-height: 1.5;
}
.a-form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394A3B8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.a-form-hint  { font-size: 11px; color: var(--text-muted, #94A3B8); }
.a-form-error { font-size: 11px; color: #DC2626; margin-top: 2px; }
.a-form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary, #475569);
}
.a-form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent, #2563EB);
  cursor: pointer;
}

/* Search bar */
.a-search-wrap { position: relative; margin-bottom: 20px; }
.a-search-wrap > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted, #94A3B8);
  font-size: 14px;
}
.a-search-bar {
  width: 100%;
  max-width: 400px;
  padding: 0 16px 0 40px;
  height: 42px;
  border: 1.5px solid var(--border, #E2E8F0);
  border-radius: 999px;
  background: var(--bg-surface, #fff);
  color: var(--text-primary, #0F172A);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.a-search-bar:focus {
  border-color: var(--accent, #2563EB);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* Filter bar */
.a-filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.a-filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.a-filter-group label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted, #94A3B8);
}
.a-filter-group select,
.a-filter-group input[type="date"] {
  height: 36px;
  padding: 0 12px;
  border: 1.5px solid var(--border, #E2E8F0);
  border-radius: 6px;
  background: var(--bg-surface, #fff);
  color: var(--text-primary, #0F172A);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}
.a-filter-group select:focus,
.a-filter-group input[type="date"]:focus { border-color: var(--accent, #2563EB); }

/* ================================================================
   CARDS
   ================================================================ */
.a-card {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  overflow: hidden;
  transition: background .3s, border-color .3s;
}
.a-card + .a-card { margin-top: 20px; }
.a-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border, #E2E8F0);
}
.a-card-header h3 { font-size: 16px; font-weight: 600; }
.a-card-body { padding: 24px; }

/* Empty state */
.a-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-muted, #94A3B8);
  gap: 12px;
  text-align: center;
}
.a-empty > i { font-size: 40px; opacity: .3; }
.a-empty > p { font-size: 13px; }
.a-empty-card {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background: var(--bg-surface, #fff);
  border: 2px dashed var(--border, #E2E8F0);
  border-radius: 20px;
  text-align: center;
  gap: 16px;
  color: var(--text-muted, #94A3B8);
}
.a-empty-card > i { font-size: 44px; opacity: .25; }
.a-empty-card h3 { color: var(--text-secondary, #475569); font-size: 18px; }
.a-empty-card p  { font-size: 13px; max-width: 300px; }

/* ================================================================
   TABLES
   ================================================================ */
.a-table-card { padding: 0; }
.a-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.a-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.a-table thead tr {
  background: var(--bg-surface-2, #F1F5F9);
  border-bottom: 1.5px solid var(--border, #E2E8F0);
}
.a-table th {
  padding: 12px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted, #94A3B8);
  white-space: nowrap;
}
.a-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border, #E2E8F0);
  color: var(--text-primary, #0F172A);
  vertical-align: middle;
}
.a-table tr:last-child td { border-bottom: none; }
.a-table tbody tr:hover { background: var(--bg-surface-2, #F1F5F9); }
.a-table-empty {
  text-align: center;
  padding: 48px !important;
  color: var(--text-muted, #94A3B8);
}
.a-table-empty i { display: block; font-size: 32px; margin-bottom: 12px; opacity: .3; }

/* Cell with avatar */
.a-cell-avatar-row { display: flex; align-items: center; gap: 12px; }
.a-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent, #2563EB);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.a-cell-name { font-weight: 600; }
.a-cell-sub  { font-size: 11px; color: var(--text-muted, #94A3B8); margin-top: 1px; }

/* ================================================================
   BADGES
   ================================================================ */
.a-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.a-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.a-badge-success { background: #ECFDF5; color: #059669; }
.a-badge-warning { background: #FFFBEB; color: #D97706; }
.a-badge-danger  { background: #FEF2F2; color: #DC2626; }
.a-badge-info    { background: #EFF6FF; color: #2563EB; }
.a-badge-gray    { background: #F8FAFC; color: #64748B; }
.a-badge-purple  { background: #F5F3FF; color: #7C3AED; }

/* ================================================================
   STATS ROW (Dashboard)
   ================================================================ */
.a-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
.a-stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: box-shadow .18s, transform .18s;
}
.a-stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); transform: translateY(-2px); }
.a-stat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}
.a-stat-value { font-size: 24px; font-weight: 800; color: var(--text-primary, #0F172A); line-height: 1; }
.a-stat-label { font-size: 11px; color: var(--text-muted, #94A3B8); font-weight: 500; margin-top: 2px; }

/* ================================================================
   9-BOX NAV GRID (Dashboard)
   ================================================================ */
.a-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.a-nav-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  cursor: pointer;
  transition: all .18s;
  position: relative;
  overflow: hidden;
}
.a-nav-box:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  transform: translateY(-3px);
  border-color: var(--accent, #2563EB);
}
.a-nav-box:focus-visible { outline: 2px solid var(--accent, #2563EB); outline-offset: 2px; }
.a-nav-box-icon {
  width: 52px; height: 52px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: #fff;
  flex-shrink: 0;
}
.a-nav-box-body { flex: 1; min-width: 0; }
.a-nav-box-body h3 {
  font-size: 15px; font-weight: 700;
  color: var(--text-primary, #0F172A);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.a-nav-box-body p {
  font-size: 11px; color: var(--text-muted, #94A3B8);
  margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.a-nav-box-arrow {
  color: var(--text-muted, #94A3B8);
  font-size: 13px;
  transition: transform .18s, color .18s;
}
.a-nav-box:hover .a-nav-box-arrow { transform: translateX(4px); color: var(--accent, #2563EB); }

/* ================================================================
   STAFF CARDS
   ================================================================ */
.a-staff-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.a-staff-card {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 16px;
  overflow: hidden;
  transition: box-shadow .18s, transform .18s;
}
.a-staff-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); transform: translateY(-2px); }
.a-staff-card-top {
  padding: 24px;
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; text-align: center;
  background: var(--bg-surface-2, #F1F5F9);
  border-bottom: 1px solid var(--border, #E2E8F0);
}
.a-staff-big-avatar {
  width: 72px; height: 72px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800; color: #fff;
}
.a-staff-name  { font-size: 16px; font-weight: 700; }
.a-staff-role  { font-size: 11px; color: var(--text-muted, #94A3B8); }
.a-staff-card-body {
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.a-staff-info-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-secondary, #475569);
}
.a-staff-info-row i { width: 16px; text-align: center; color: var(--text-muted, #94A3B8); font-size: 11px; }
.a-staff-card-footer {
  display: flex; gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border, #E2E8F0);
  background: var(--bg-surface-2, #F1F5F9);
}
.a-staff-card-footer .a-btn { flex: 1; }

/* Calendar status pill */
.a-cal-status {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px; font-weight: 500;
}
.a-cal-status.connected    { background: #ECFDF5; color: #059669; }
.a-cal-status.disconnected { background: #FFFBEB; color: #D97706; }

/* ================================================================
   SCHEDULE — DAYS GRID
   ================================================================ */
.a-schedule-selector {
  padding: 20px 24px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.a-days-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 24px; }
.a-day-card {
  background: var(--bg-surface, #fff);
  border: 1.5px solid var(--border, #E2E8F0);
  border-radius: 16px; overflow: hidden;
  transition: border-color .18s;
}
.a-day-card.active { border-color: var(--accent, #2563EB); }
.a-day-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-surface-2, #F1F5F9);
  border-bottom: 1px solid var(--border, #E2E8F0);
}
.a-day-name { font-size: 15px; font-weight: 700; }
.a-day-card-body { padding: 14px 20px; display: flex; flex-direction: column; gap: 12px; }
.a-day-card-body.disabled { opacity: .4; pointer-events: none; }

/* Toggle switch */
.a-toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.a-toggle input { opacity: 0; width: 0; height: 0; }
.a-toggle-slider {
  position: absolute; inset: 0;
  background: var(--bg-surface-3, #E2E8F0);
  border-radius: 999px;
  cursor: pointer;
  transition: background .18s;
}
.a-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .18s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.a-toggle input:checked + .a-toggle-slider { background: var(--accent, #2563EB); }
.a-toggle input:checked + .a-toggle-slider::before { transform: translateX(20px); }

/* ================================================================
   SETTINGS PAGE
   ================================================================ */
.a-settings-layout { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.a-settings-card { display: flex; flex-direction: column; }
.a-settings-footer {
  grid-column: 1 / -1;
  display: flex; justify-content: flex-end; gap: 16px; padding-top: 16px;
}
.a-theme-picker, .a-lang-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.a-theme-opt, .a-lang-opt {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px;
  border: 2px solid var(--border, #E2E8F0);
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary, #475569);
  cursor: pointer; transition: all .18s;
  background: none; font-family: inherit;
}
.a-theme-opt:hover, .a-lang-opt:hover { border-color: var(--accent, #2563EB); color: var(--accent, #2563EB); }
.a-theme-opt.active, .a-lang-opt.active {
  border-color: var(--accent, #2563EB);
  background: rgba(37,99,235,.08);
  color: var(--accent, #2563EB);
}
.a-color-swatches { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.a-color-swatch {
  width: 30px; height: 30px;
  border-radius: 999px; cursor: pointer;
  border: 3px solid transparent;
  transition: all .18s;
}
.a-color-swatch:hover { transform: scale(1.2); }
.a-color-swatch.active { border-color: var(--text-primary, #0F172A); transform: scale(1.15); }

/* ================================================================
   ANALYTICS
   ================================================================ */
.a-analytics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
.a-analytics-card {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 16px;
  padding: 20px 24px;
}
.a-analytics-card-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.a-analytics-card-header h3 { font-size: 13px; font-weight: 600; color: var(--text-secondary, #475569); }
.a-analytics-card-header i  { font-size: 18px; color: var(--accent, #2563EB); }
.a-analytics-value { font-size: 30px; font-weight: 800; color: var(--text-primary, #0F172A); line-height: 1; margin-bottom: 6px; }
.a-analytics-sub   { font-size: 11px; color: var(--text-muted, #94A3B8); }
.a-trend-pos { color: #059669; font-size: 11px; font-weight: 600; }
.a-trend-neg { color: #DC2626; font-size: 11px; font-weight: 600; }

/* Simple bar chart */
.a-chart-wrap { min-height: 200px; padding: 24px; display: flex; align-items: flex-end; gap: 8px; overflow-x: auto; }
.a-chart-col  { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; min-width: 32px; }
.a-chart-bar  {
  width: 100%; max-width: 48px;
  background: var(--accent, #2563EB);
  border-radius: 6px 6px 0 0;
  transition: height .4s ease;
  min-height: 4px; opacity: .85;
}
.a-chart-bar:hover { opacity: 1; }
.a-chart-label { font-size: 10px; color: var(--text-muted, #94A3B8); text-align: center; font-weight: 500; }
.a-chart-val   { font-size: 10px; color: var(--text-secondary, #475569); font-weight: 700; }
.a-chart-empty { width: 100%; text-align: center; color: var(--text-muted, #94A3B8); font-size: 13px; align-self: center; }

/* Horizontal bar chart */
.a-hbar-row { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.a-hbar-label { min-width: 120px; font-size: 13px; color: var(--text-secondary, #475569); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-hbar-track { flex: 1; height: 10px; background: var(--bg-surface-3, #E2E8F0); border-radius: 999px; overflow: hidden; }
.a-hbar-fill  { height: 100%; background: var(--accent, #2563EB); border-radius: 999px; transition: width .5s ease; }
.a-hbar-count { min-width: 30px; text-align: right; font-size: 13px; font-weight: 700; }

/* ================================================================
   GOOGLE SHEETS CONNECTION
   ================================================================ */
.a-gs-status-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px;
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 16px;
}
.a-gs-status-row + .a-gs-status-row { margin-top: 12px; }
.a-gs-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: #ECFDF5; color: #059669;
  display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0;
}
.a-gs-info { flex: 1; min-width: 0; }
.a-gs-name { font-size: 14px; font-weight: 600; }
.a-gs-tab  { font-size: 11px; color: var(--text-muted, #94A3B8); margin-top: 1px; }

/* Connection banner (Services page) */
.a-conn-banner {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 24px;
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.a-conn-banner-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: #EA4335; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.a-conn-banner-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.a-conn-banner-text strong { font-size: 15px; font-weight: 600; }
.a-conn-banner-text span   { font-size: 13px; color: var(--text-muted, #94A3B8); }

/* ================================================================
   INVOICE PRINT TEMPLATE (hidden, for PDF download)
   ================================================================ */
#adminInvoicePrint { position: fixed; top: -9999px; left: -9999px; }

/* ================================================================
   TOAST — scoped z-index for admin panel
   ================================================================ */
.admin-panel .a-toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 1100;
  display: flex; flex-direction: column; gap: 12px;
  pointer-events: none;
  max-width: 360px; width: 100%;
}
.a-toast {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 20px;
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,.12);
  pointer-events: all;
  animation: aToastIn .25s ease forwards;
}
.a-toast.out { animation: aToastOut .2s ease forwards; }
@keyframes aToastIn  { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }
@keyframes aToastOut { from { opacity:1; transform:translateX(0); } to { opacity:0; transform:translateX(20px); } }
.a-toast-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.a-toast-title { font-size: 13px; font-weight: 700; }
.a-toast-msg   { font-size: 11px; color: var(--text-secondary, #475569); margin-top: 2px; }
.a-toast.success { border-left: 3px solid #059669; } .a-toast.success .a-toast-icon { color: #059669; }
.a-toast.error   { border-left: 3px solid #DC2626; } .a-toast.error   .a-toast-icon { color: #DC2626; }
.a-toast.warning { border-left: 3px solid #D97706; } .a-toast.warning .a-toast-icon { color: #D97706; }
.a-toast.info    { border-left: 3px solid var(--accent,#2563EB); } .a-toast.info .a-toast-icon { color: var(--accent,#2563EB); }

/* ================================================================
   MODAL (admin-scoped)
   ================================================================ */
.a-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 600;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .18s;
}
.a-modal-backdrop.open { opacity: 1; }
.a-modal-backdrop.hidden { display: none; }
.a-modal {
  background: var(--bg-surface, #fff);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,.16);
  width: 100%; max-width: 560px; max-height: 90vh;
  display: flex; flex-direction: column;
  transform: translateY(20px) scale(.97);
  transition: transform .18s;
  overflow: hidden;
}
.a-modal-backdrop.open .a-modal { transform: translateY(0) scale(1); }
.a-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border, #E2E8F0); flex-shrink: 0;
}
.a-modal-title { font-size: 18px; font-weight: 700; }
.a-modal-close {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 6px;
  color: var(--text-muted, #94A3B8); font-size: 16px;
  cursor: pointer; border: none; background: none;
  transition: all .18s;
}
.a-modal-close:hover { background: var(--bg-surface-2, #F1F5F9); color: var(--text-primary, #0F172A); }
.a-modal-body {
  padding: 24px; overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 20px;
}
.a-modal-footer {
  display: flex; gap: 12px; justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border, #E2E8F0); flex-shrink: 0; flex-wrap: wrap;
}

/* ================================================================
   INFO BOX
   ================================================================ */
.a-info-box {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 20px;
  background: #EFF6FF;
  border: 1px solid rgba(37,99,235,.2);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-secondary, #475569);
}
.a-info-box i { color: var(--accent, #2563EB); margin-top: 1px; flex-shrink: 0; }

/* ================================================================
   SPINNER
   ================================================================ */
.a-spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border, #E2E8F0);
  border-top-color: var(--accent, #2563EB);
  border-radius: 50%;
  animation: aSpin .7s linear infinite;
}
@keyframes aSpin { to { transform: rotate(360deg); } }

/* ================================================================
   DARK MODE OVERRIDES — admin panel
   ================================================================ */
[data-theme="dark"] .admin-panel {
  background: #0F172A;
}
[data-theme="dark"] .admin-header {
  background: #1E293B;
  border-color: #334155;
}
[data-theme="dark"] .a-card,
[data-theme="dark"] .a-stat-card,
[data-theme="dark"] .a-nav-box,
[data-theme="dark"] .a-staff-card,
[data-theme="dark"] .a-analytics-card,
[data-theme="dark"] .a-modal {
  background: #1E293B;
  border-color: #334155;
}
[data-theme="dark"] .a-form-input,
[data-theme="dark"] .a-form-select,
[data-theme="dark"] .a-search-bar,
[data-theme="dark"] .a-filter-group select,
[data-theme="dark"] .a-filter-group input[type="date"] {
  background: #263146;
  border-color: #334155;
  color: #F1F5F9;
  color-scheme: dark;
}
[data-theme="dark"] .a-form-input::placeholder,
[data-theme="dark"] .a-search-bar::placeholder { color: #64748B; }
[data-theme="dark"] .a-table thead tr { background: #263146; }
[data-theme="dark"] .a-table tbody tr:hover { background: #263146; }
[data-theme="dark"] .a-filter-bar,
[data-theme="dark"] .a-conn-banner,
[data-theme="dark"] .a-gs-status-row,
[data-theme="dark"] .a-toast {
  background: #1E293B;
  border-color: #334155;
}
[data-theme="dark"] .a-staff-card-top,
[data-theme="dark"] .a-day-card-header,
[data-theme="dark"] .a-staff-card-footer { background: #263146; }
[data-theme="dark"] .a-modal-backdrop.open { background: rgba(0,0,0,.7); }
[data-theme="dark"] .a-days-grid .a-form-input,
[data-theme="dark"] .a-days-grid .a-form-select { background: #263146; }

/* ================================================================
   RESPONSIVE — Admin Panel
   ================================================================ */
@media (max-width: 1024px) {
  .admin-main { padding: 24px; }
  .a-stats-row { grid-template-columns: repeat(2, 1fr); }
  .a-nav-grid  { grid-template-columns: repeat(2, 1fr); }
  .a-analytics-grid { grid-template-columns: repeat(2, 1fr); }
  .a-staff-grid { grid-template-columns: repeat(2, 1fr); }
  .a-settings-layout { grid-template-columns: 1fr; }
  .a-days-grid { grid-template-columns: 1fr; }
  .a-form-row  { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .admin-main { padding: 16px; }
  .admin-header { padding: 0 16px; }
  .a-stats-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .a-nav-grid  { grid-template-columns: 1fr; gap: 12px; }
  .a-analytics-grid { grid-template-columns: 1fr 1fr; }
  .a-staff-grid { grid-template-columns: 1fr; }
  .a-settings-footer { flex-direction: column; }
  .a-settings-footer .a-btn { width: 100%; }
  .admin-panel .a-toast-container { bottom: 16px; right: 16px; left: 16px; max-width: 100%; }
  .a-modal { border-radius: 16px 16px 0 0; align-self: flex-end; max-width: 100%; }
  .a-modal-backdrop { align-items: flex-end; padding: 0; }
  .a-admin-page-header { flex-direction: column; align-items: stretch; }
}
