/*--------------------------------------------------------------
# Admin Design System — Unified Primitives
# Issues #31, #33: Unify admin design language + simplify core pages
# Uses spinlab-design.css tokens (--sl-dark, --sl-gold, --sl-cream)
# Tablet-first (768px+), 44px minimum touch targets
--------------------------------------------------------------*/

/* ── Admin Page Header ── */
.adm-page-header {
  background: linear-gradient(135deg, var(--sl-navy, #061a32) 0%, var(--sl-dark, #003d1d) 100%);
  border-radius: var(--sl-radius, 12px);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0, 61, 29, .18);
}
.adm-page-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.adm-page-header-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, .12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--sl-gold, #dfc884);
  flex-shrink: 0;
}
.adm-page-header h4,
.adm-page-header h5 {
  color: #fff;
  margin: 0;
  font-weight: 800;
  font-size: 16px;
}
.adm-page-header .adm-subtitle {
  color: rgba(255, 255, 255, .65);
  font-size: 12px;
  margin-top: 2px;
}

/* ── Admin Card ── */
.adm-card {
  border: 1px solid #e2e8f0;
  border-radius: var(--sl-radius, 12px);
  background: #fff;
  box-shadow: var(--sl-shadow, 0 2px 12px rgba(0, 61, 29, .08));
  overflow: hidden;
}
.adm-card-head {
  padding: 13px 18px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.adm-card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--sl-navy, #061a32);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.adm-card-title i {
  color: var(--sl-dark, #003d1d);
  font-size: 15px;
}
.adm-card-body {
  padding: 16px 18px;
}

/* ── Admin Filter Bar ── */
.adm-filter-bar {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--sl-radius, 12px);
  padding: 14px 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .04);
}
.adm-filter-label {
  font-size: 11px;
  font-weight: 700;
  color: #5a6781;
  text-transform: uppercase;
  letter-spacing: .3px;
  margin-bottom: 4px;
}
.adm-filter-bar .form-select,
.adm-filter-bar .form-control {
  min-height: 44px;
  border-radius: var(--sl-radius-sm, 8px);
  font-size: 14px;
  font-weight: 600;
}

/* ── Admin Buttons ── */
.adm-btn-primary {
  background: var(--sl-dark, #003d1d);
  color: var(--sl-gold, #dfc884);
  border: none;
  border-radius: var(--sl-radius-sm, 8px);
  font-weight: 700;
  min-height: 44px;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--sl-transition, all .2s ease);
}
.adm-btn-primary:hover {
  background: var(--sl-mid, #335638);
  color: var(--sl-gold-hover, #e8d48e);
}

.adm-btn-secondary {
  background: transparent;
  color: var(--sl-dark, #003d1d);
  border: 1.5px solid var(--sl-dark, #003d1d);
  border-radius: var(--sl-radius-sm, 8px);
  font-weight: 600;
  min-height: 44px;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--sl-transition, all .2s ease);
}
.adm-btn-secondary:hover {
  background: var(--sl-dark, #003d1d);
  color: var(--sl-gold, #dfc884);
}

/* ── Admin Status Badges ── */
.adm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.adm-badge-success { background: rgba(22, 163, 74, .12); color: #166534; }
.adm-badge-warning { background: rgba(217, 119, 6, .12); color: #92400e; }
.adm-badge-danger  { background: rgba(220, 38, 38, .12); color: #991b1b; }
.adm-badge-info    { background: rgba(37, 99, 235, .12); color: #1e40af; }
.adm-badge-muted   { background: rgba(107, 114, 128, .12); color: #4b5563; }

/* ── Status Filter Pills (Issue #33 - Bookings) ── */
.adm-pill-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.adm-pill-filters::-webkit-scrollbar { display: none; }
.adm-pill {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--sl-transition, all .2s ease);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.adm-pill:active { transform: scale(.96); }
.adm-pill.active {
  background: var(--sl-dark, #003d1d);
  color: var(--sl-gold, #dfc884);
  border-color: var(--sl-dark, #003d1d);
}
.adm-pill .adm-pill-count {
  background: rgba(0, 0, 0, .12);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
}
.adm-pill.active .adm-pill-count {
  background: rgba(255, 255, 255, .2);
}

/* ── Admin Table ── */
.adm-table th {
  font-size: 11px;
  font-weight: 700;
  color: #5a6781;
  text-transform: uppercase;
  letter-spacing: .3px;
  padding: 10px 12px;
  background: var(--sl-cream, #fcf5e5);
  border-bottom: 2px solid #e8e0d0;
  white-space: nowrap;
}
.adm-table td {
  padding: 12px;
  font-size: 14px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
}
.adm-table tbody tr:hover {
  background: rgba(0, 61, 29, .03);
}
.adm-table tbody tr {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ── Admin Modal ── */
.adm-modal .modal-content {
  border-radius: var(--sl-radius, 12px);
  border: none;
  overflow: hidden;
  box-shadow: var(--sl-shadow-lg, 0 8px 32px rgba(0, 61, 29, .12));
}
.adm-modal .modal-header {
  background: var(--sl-dark, #003d1d);
  color: #fff;
  padding: 14px 20px;
  border-bottom: none;
}
.adm-modal .modal-header .modal-title {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.adm-modal .modal-header .btn-close-white {
  filter: brightness(10);
}
.adm-modal .modal-body {
  padding: 20px;
}
.adm-modal .modal-footer {
  border-top: 1px solid #e8e0d0;
  padding: 12px 20px;
  gap: 8px;
  flex-wrap: wrap;
}
.adm-modal .modal-footer .btn {
  min-height: 44px;
  border-radius: var(--sl-radius-sm, 8px);
}

/* ── Detail Field ── */
.adm-detail-field {
  padding: 10px 12px;
  background: var(--sl-cream, #fcf5e5);
  border-radius: var(--sl-radius-sm, 8px);
  border: 1px solid #e8e0d0;
}
.adm-detail-label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .3px;
  margin-bottom: 3px;
}
.adm-detail-value {
  font-weight: 700;
  color: var(--sl-navy, #061a32);
  font-size: 14px;
}

/* ── Quick Actions Grid (Issue #32 - Dashboard) ── */
.adm-quick-actions {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.adm-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 12px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--sl-radius, 12px);
  cursor: pointer;
  text-decoration: none;
  color: var(--sl-navy, #061a32);
  transition: var(--sl-transition, all .2s ease);
  min-height: 100px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.adm-quick-action:hover {
  border-color: var(--sl-dark, #003d1d);
  box-shadow: var(--sl-shadow, 0 2px 12px rgba(0, 61, 29, .08));
  color: var(--sl-dark, #003d1d);
  transform: translateY(-2px);
  text-decoration: none;
}
.adm-quick-action:active {
  transform: scale(.96);
  box-shadow: none;
}
.adm-quick-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.adm-quick-action-label {
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}

/* Quick action icon variants */
.adm-qa-pos .adm-quick-action-icon      { background: rgba(22, 163, 74, .1); color: #16a34a; }
.adm-qa-schedule .adm-quick-action-icon  { background: rgba(37, 99, 235, .1); color: #2563eb; }
.adm-qa-kitchen .adm-quick-action-icon   { background: rgba(234, 88, 12, .1); color: #ea580c; }
.adm-qa-bookings .adm-quick-action-icon  { background: rgba(79, 70, 229, .1); color: #4f46e5; }
.adm-qa-customers .adm-quick-action-icon { background: rgba(217, 119, 6, .1); color: #d97706; }

/* ── Keyboard Shortcut Hint ── */
.adm-kbd {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(0, 0, 0, .06);
  color: #6b7280;
  font-family: monospace;
  margin-top: 4px;
}

/* ── Touch Target Enforcement ── */
.adm-touch-target {
  min-height: 44px;
  min-width: 44px;
}

/* ── Override NiceAdmin header to match brand ── */
.header {
  border-bottom: 1px solid rgba(0, 61, 29, .08) !important;
}
.header .logo span {
  color: var(--sl-dark, #003d1d) !important;
  font-weight: 800 !important;
}

/* ── Override NiceAdmin sidebar active state ── */
.sidebar .nav-link.active {
  background: var(--sl-dark, #003d1d) !important;
  color: var(--sl-gold, #dfc884) !important;
}
.sidebar .nav-link.active i {
  color: var(--sl-gold, #dfc884) !important;
}
.sidebar .nav-content a.active {
  color: var(--sl-dark, #003d1d) !important;
  font-weight: 700 !important;
}
.sidebar .nav-content a.active i {
  color: var(--sl-dark, #003d1d) !important;
}

/* ── Sidebar touch target fixes (iOS tap reliability) ── */
.sidebar-nav .nav-link,
.sidebar-nav .nav-content a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-nav .nav-content a {
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* ── Override NiceAdmin form focus ── */
.form-select:focus,
.form-control:focus {
  border-color: var(--sl-gold, #dfc884) !important;
  box-shadow: 0 0 0 3px rgba(223, 200, 132, .2) !important;
}

/* ── Responsive: tablet breakpoints ── */
@media (max-width: 1024px) {
  .adm-table td,
  .adm-table th {
    padding: 10px 8px;
    font-size: 13px;
  }
  .adm-quick-actions {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 767px) {
  .adm-quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  .adm-page-header {
    padding: 12px 16px;
  }
  .adm-page-header h4,
  .adm-page-header h5 {
    font-size: 15px;
  }
}

/* ================================================================
   SCHEDULE GRID IMPROVEMENTS
================================================================ */

/* Hide phone numbers in schedule events for privacy */
.fc-event .sch-phone { display: none; }

/* Bigger, more readable event text */
.fc .fc-timeline-event {
  min-height: 60px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
  padding: 4px 6px !important;
}

/* Event content layout */
.fc .fc-event-main {
  padding: 2px 4px !important;
  overflow: hidden !important;
}

/* Bold customer name */
.fc .sch-name {
  font-weight: 700 !important;
  font-size: 13px !important;
  color: #fff !important;
  display: block !important;
  margin-bottom: 2px !important;
}

/* Price tag */
.fc .sch-price {
  font-size: 11px !important;
  opacity: .85 !important;
}

/* Status colors - more distinct */
.fc .sch-ev-paid {
  background: var(--sl-dark, #003d1d) !important;
  border-color: var(--sl-dark, #003d1d) !important;
}
.fc .sch-ev-unpaid {
  background: #d97706 !important;
  border-color: #d97706 !important;
}
.fc .sch-ev-block {
  background: #6b7280 !important;
  border-color: #6b7280 !important;
  opacity: .7 !important;
}
.fc .sch-ev-class {
  background: #7c3aed !important;
  border-color: #7c3aed !important;
}
.fc .sch-ev-tournament {
  background: #0284c7 !important;
  border-color: #0284c7 !important;
}

/* Court name column - wider and clearer */
.fc .fc-timeline-slot-label,
.fc .fc-resource-cell {
  font-weight: 600 !important;
  font-size: 13px !important;
  white-space: nowrap !important;
}

/* Current time indicator - more visible */
.fc .fc-timeline-now-indicator-line {
  border-color: #dc2626 !important;
  border-width: 2px !important;
  z-index: 10 !important;
}

/* Scroll to current time on load */
.fc .fc-timeline-header-row th {
  min-width: 60px !important;
}

/* Legend pills - compact */
.sch-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
}
.sch-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sch-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* i18n no-flicker: hide sidebar translatable labels until locale JSON is applied */
[data-i18n-pending] #sidebar [data-i18n] {
  visibility: hidden;
}

/* Responsive: on tablet, make timeline scrollable */
@media (max-width: 1200px) {
  .fc .fc-timeline-slot-label {
    font-size: 11px !important;
    min-width: 50px !important;
  }
  .fc .fc-timeline-event {
    min-height: 50px !important;
    font-size: 11px !important;
  }
}

/* Schedule tooltip: preserve newlines for readable booking info */
.admin-schedule-tooltip .tooltip-inner {
  white-space: pre-line;
  text-align: left;
  max-width: 280px;
}
