/* ==========================================================================
   SPOTFLOW ADMIN DASHBOARD STYLESHEET
   Built Mobile-First for 320px, 375px, 430px, 768px, 1024px, 1280px, 1440px, 1920px+
   Adheres strictly to Spotflow Brand Guidelines
   Font System: Sora (Headlines/Metrics) + Inter (Tables/Forms)
   Color System: Spot Navy (#040454) Sidebar, Royal Blue (#1444EA) Active States,
   Cloud Blue (#F4F7FC) Canvas, Pure White Cards.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Sora:wght@500;600;700;800&display=swap');

:root {
  --spot-navy: #040454;
  --royal-blue: #1444EA;
  --flow-blue: #0F72FA;
  --sky-cyan: #0EB2FC;
  --flow-violet: #5246E5;

  --ink: #101336;
  --slate-grey: #667085;
  --soft-grey: #E7ECF5;
  --cloud-blue: #F4F7FC;
  --pure-white: #FFFFFF;

  --success-green: #12A66A;
  --error-red: #D92D20;
  --warning-amber: #F59E0B;

  --gradient-primary: linear-gradient(135deg, #5246E5 0%, #1444EA 48%, #0EB2FC 100%);
  --gradient-flow: linear-gradient(90deg, #1444EA 0%, #0F72FA 55%, #0EB2FC 100%);

  --font-headline: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(4, 4, 84, 0.04);
  --shadow-md: 0 8px 24px rgba(4, 4, 84, 0.08);
  --shadow-lg: 0 16px 40px rgba(4, 4, 84, 0.12);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--cloud-blue);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  body { flex-direction: row; }
}

[hidden] {
  display: none !important;
}

/* Sidebar Navigation (Mobile-First Top Header / Drawer) */
.admin-sidebar {
  width: 100%;
  background: var(--spot-navy);
  color: white;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 100;
}

@media (min-width: 1024px) {
  .admin-sidebar {
    width: 260px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
  }
}

.sidebar-header {
  padding: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gradient-primary);
  display: grid;
  place-items: center;
  color: white;
  flex-shrink: 0;
}

.admin-logo-text {
  font-family: var(--font-headline);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: white;
}

.admin-logo-text span {
  color: var(--sky-cyan);
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  overflow-x: auto;
}

@media (min-width: 1024px) {
  .sidebar-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-y: auto;
    flex: 1;
  }
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  color: #94A3B8;
  text-decoration: none;
  font-family: var(--font-headline);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-item:hover {
  color: white;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: white;
  background: var(--royal-blue);
  box-shadow: 0 4px 14px rgba(20, 68, 234, 0.35);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: none;
}

@media (min-width: 1024px) {
  .sidebar-footer { display: block; }
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
}

/* Main Dashboard Canvas */
.admin-main {
  flex: 1;
  padding: clamp(1rem, 2.5vw, 2rem);
  width: 100%;
}

@media (min-width: 1024px) {
  .admin-main { margin-left: 260px; }
}

.top-bar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 600px) {
  .top-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.page-title {
  font-family: var(--font-headline);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 800;
  color: var(--spot-navy);
}

.top-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Admin Buttons */
.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 42px;
  padding: 0.5rem 1.15rem;
  font-family: var(--font-headline);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-admin-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 14px rgba(20, 68, 234, 0.25);
}

.btn-admin-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(20, 68, 234, 0.35);
}

.btn-admin-outline {
  background: white;
  color: var(--spot-navy);
  border: 1px solid var(--soft-grey);
}

.btn-admin-outline:hover {
  border-color: var(--royal-blue);
  color: var(--royal-blue);
}

/* Dashboard Metric Cards (Mobile First Stacked) */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-card {
  background: var(--pure-white);
  border: 1px solid var(--soft-grey);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--slate-grey);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-family: var(--font-headline);
  font-size: clamp(1.6rem, 2.5vw, 2.25rem);
  font-weight: 800;
  color: var(--spot-navy);
  margin-bottom: 0.25rem;
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--success-green);
  font-weight: 600;
}

/* Content Panels */
.content-panel {
  background: var(--pure-white);
  border: 1px solid var(--soft-grey);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 2rem;
}

.panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--soft-grey);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 600px) {
  .panel-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.panel-title {
  font-family: var(--font-headline);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--spot-navy);
}

.filter-bar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.admin-input, .admin-select {
  height: 40px;
  padding: 0 0.85rem;
  border: 1px solid var(--soft-grey);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
}

.admin-input:focus, .admin-select:focus {
  border-color: var(--royal-blue);
}

/* Responsive Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.admin-table th {
  background: #F8FAFC;
  padding: 0.85rem 1.25rem;
  font-family: var(--font-headline);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--slate-grey);
  text-transform: uppercase;
  border-bottom: 1px solid var(--soft-grey);
}

.admin-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--soft-grey);
  color: var(--ink);
  word-break: break-word;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-flex;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-confirmed { background: rgba(18, 166, 106, 0.12); color: var(--success-green); }
.badge-pending { background: rgba(245, 158, 11, 0.12); color: var(--warning-amber); }
.badge-cancelled { background: rgba(217, 45, 32, 0.12); color: var(--error-red); }

/* Login Modal Overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--spot-navy);
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* Modals Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(4, 4, 84, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease;
  overflow-y: auto;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-card {
  background: var(--pure-white);
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  box-shadow: 0 20px 60px rgba(4, 4, 84, 0.25);
  border: 1px solid var(--soft-grey);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--slate-grey);
}
