/* ==========================================================================
   etsBookings 2.0 — Admin Panel Design System & Styles (Standard Sleek Sizing)
   Designed for Elwira Rudecka (przewodnik-wieden.pl / elwiratravel.at)
   Standard web admin dashboard proportions (Vercel / Stripe / Tailwind-inspired).
   ========================================================================== */

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

:root {
  /* ── Typography Scale (Standard Admin Proportions) ── */
  --font-admin: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  
  --text-base: 14px;        /* Standard admin dashboard base font */
  --text-min: 12px;         /* Minimum label / table header font */
  --text-sm: 13px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 20px;
  --text-3xl: 24px;
  
  --lh-tight: 1.25;
  --lh-normal: 1.45;
  
  /* ── Spacing Scale (4px Grid) ── */
  --space-1: 4px;
  --space-2: 6px;
  --space-3: 8px;
  --space-4: 12px;
  --space-5: 16px;
  --space-6: 24px;
  --space-8: 32px;
  
  /* ── Metric Tokens ── */
  --touch-target: 36px;     /* Standard admin button/input height */
  --table-row-height: 44px; /* Standard table row height */
  
  /* ── Surface & Base Colors ── */
  --bg-page: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --bg-hover: #E2E8F0;
  
  --color-text-main: #0F172A;
  --color-text-muted: #475569;
  --color-text-inverse: #FFFFFF;
  
  --color-border-subtle: #E2E8F0;
  --color-border: #CBD5E1;
  --color-border-strong: #94A3B8;
  
  /* ── Brand Colors ── */
  --color-b2c: #FF1E00;
  --color-b2b: #D97706;
  --color-primary: #0F172A;
  --color-primary-hover: #1E293B;
  
  /* ── Status Colors ── */
  --status-inquiry-bg: #F3E8FF;
  --status-inquiry-text: #6B21A8;
  
  --status-pending-approval-bg: #FEF3C7;
  --status-pending-approval-text: #92400E;
  
  --status-pending-payment-bg: #FFEDD5;
  --status-pending-payment-text: #C2410C;
  
  --status-payment-expired-bg: #F3F4F6;
  --status-payment-expired-text: #4B5563;
  
  --status-paid-bg: #DCFCE7;
  --status-paid-text: #166534;
  
  --status-completed-bg: #D1FAE5;
  --status-completed-text: #065F46;
  
  --status-cancelled-bg: #FEE2E2;
  --status-cancelled-text: #991B1B;
  
  --status-refunded-bg: #E5E7EB;
  --status-refunded-text: #374151;
  
  --status-failed-bg: #FCE7F3;
  --status-failed-text: #9D174D;

  /* ── Radii & Shadows ── */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-pill: 9999px;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 10px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 20px rgba(15, 23, 42, 0.1);
  --shadow-drawer: -4px 0 20px rgba(15, 23, 42, 0.12);

  --transition-fast: 120ms ease;
  --transition-normal: 180ms ease;
}

/* ── Reset & Base Styles ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-admin);
  font-size: var(--text-base);
  line-height: var(--lh-normal);
  color: var(--color-text-main);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Admin Layout Grid ── */
.admin-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Desktop Sidebar */
.admin-sidebar {
  width: 240px;
  background: var(--bg-surface);
  border-right: 1px solid var(--color-border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.admin-sidebar-header {
  padding: var(--space-4) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
}

.admin-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 800;
  font-size: 18px;
  color: var(--color-text-main);
  text-decoration: none;
}

.admin-logo span {
  color: var(--color-b2c);
}

.admin-logo-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  margin-left: auto;
}

.admin-nav {
  padding: var(--space-3) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex: 1;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  padding: var(--space-3) var(--space-3) var(--space-1);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px var(--space-3);
  min-height: 36px;
  border-radius: var(--radius-md);
  color: var(--color-text-main);
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
  transition: background var(--transition-fast), color var(--transition-fast);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-hover);
}

.nav-item.active {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.nav-item.active svg {
  stroke: var(--color-text-inverse);
}

.nav-badge {
  margin-left: auto;
  background: var(--color-b2c);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

.admin-sidebar-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border-subtle);
  background: var(--bg-subtle);
  font-size: 13px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--color-b2c);
  color: white;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 700;
  font-size: 13.5px;
}

.user-role {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Main Content Area */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-bottom: 60px;
}

@media (min-width: 769px) {
  .admin-main {
    padding-bottom: var(--space-6);
  }
}

/* Header Bar */
.admin-topbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--color-border-subtle);
  padding: var(--space-3) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-title h1 {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: var(--lh-tight);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Page Content View Containers */
.page-view {
  display: none;
  padding: var(--space-5);
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.page-view.active {
  display: block;
}

/* ── Mobile Navigation Bar ── */
.mobile-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-surface);
  border-top: 1px solid var(--color-border);
  z-index: 50;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  border: none;
  background: transparent;
  cursor: pointer;
}

.mobile-nav-item.active {
  color: var(--color-b2c);
}

.mobile-nav-item.active svg {
  stroke: var(--color-b2c);
}

@media (min-width: 769px) {
  .mobile-nav {
    display: none;
  }
}

@media (max-width: 768px) {
  .admin-sidebar {
    display: none;
  }
  .page-view {
    padding: var(--space-3);
  }
  .topbar-title h1 {
    font-size: 17px;
  }
}

/* ── UI Components & Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  font-family: var(--font-admin);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--color-text-main);
  border-color: var(--color-border-strong);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-danger {
  background: #DC2626;
  color: white;
  border-color: #DC2626;
}

.btn-danger:hover {
  background: #B91C1C;
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-main);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--bg-hover);
}

.btn-b2c {
  background: var(--color-b2c);
  color: white;
}

.btn-b2b {
  background: var(--color-b2b);
  color: white;
}

.btn-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Form Elements */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-main);
}

.form-control {
  min-height: var(--touch-target);
  padding: 0 10px;
  font-family: var(--font-admin);
  font-size: 13.5px;
  color: var(--color-text-main);
  background: var(--bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  width: 100%;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

textarea.form-control {
  padding: 8px 10px;
  min-height: 80px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
}

/* Helper text */
.field-help {
  font-size: 12.5px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.status-badge svg {
  width: 12px;
  height: 12px;
}

.status-inquiry { background: var(--status-inquiry-bg); color: var(--status-inquiry-text); }
.status-pending_approval { background: var(--status-pending-approval-bg); color: var(--status-pending-approval-text); }
.status-pending_payment { background: var(--status-pending-payment-bg); color: var(--status-pending-payment-text); }
.status-payment_expired { background: var(--status-payment-expired-bg); color: var(--status-payment-expired-text); }
.status-paid { background: var(--status-paid-bg); color: var(--status-paid-text); }
.status-completed { background: var(--status-completed-bg); color: var(--status-completed-text); }
.status-cancelled { background: var(--status-cancelled-bg); color: var(--status-cancelled-text); }
.status-refunded { background: var(--status-refunded-bg); color: var(--status-refunded-text); }
.status-failed { background: var(--status-failed-bg); color: var(--status-failed-text); }

/* Market Badge */
.market-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.market-b2c { background: #FEE2E2; color: #991B1B; }
.market-b2b { background: #FEF3C7; color: #92400E; }
.market-dual { background: #E0E7FF; color: #3730A3; }

/* Data Tables */
.table-container {
  background: var(--bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.data-table th {
  background: var(--bg-subtle);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

.data-table td {
  padding: 10px 14px;
  min-height: var(--table-row-height);
  border-bottom: 1px solid var(--color-border-subtle);
  vertical-align: middle;
}

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

.data-table tr:hover {
  background: #F8FAFC;
}

/* ── Screen Specific Layouts ── */

/* A-0 Dziś Dashboard */
.today-dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.action-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--status-pending-approval-text);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  box-shadow: var(--shadow-sm);
}

.action-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.action-card-title {
  font-size: 15px;
  font-weight: 700;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 12px;
}

.timeline-slot {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-primary);
  font-size: 13.5px;
}

.timeline-slot.break {
  background: #F1F5F9;
  border-left: 3px solid #94A3B8;
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 12.5px;
}

.timeline-time {
  font-weight: 700;
  font-size: 13px;
  min-width: 80px;
}

.timeline-info {
  flex: 1;
}

.stats-sentence-block {
  background: var(--bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--color-text-main);
}

/* A-1 Kalendarz (Modernized 2-Tier Toolbar & 640px Grid) */
.calendar-toolbar-box {
  background: var(--bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.calendar-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.segmented-control {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
}

.segmented-control button {
  padding: 6px 14px;
  border: none;
  background: transparent;
  font-family: var(--font-admin);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.segmented-control button.active {
  background: var(--bg-surface);
  color: var(--color-text-main);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: auto 1fr;
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 640px; /* Mandatory min height 640px */
  box-shadow: var(--shadow-sm);
}

.calendar-day-head {
  background: var(--bg-subtle);
  padding: 10px 4px;
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.calendar-day-cell {
  background: var(--bg-surface);
  min-height: 105px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
  text-decoration: none;
  color: inherit;
  position: relative;
}

.calendar-day-cell:hover {
  background: #F1F5F9;
  box-shadow: inset 0 0 0 1.5px var(--color-primary);
  z-index: 2;
}

.calendar-day-num {
  font-weight: 700;
  font-size: 13px;
  color: var(--color-text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar-day-cell.today {
  background: #FEF2F2;
}

.calendar-day-cell.today .calendar-day-num {
  color: var(--color-b2c);
  font-weight: 800;
}

.calendar-pill {
  padding: 5px 7px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.buffer-bar {
  background: #E2E8F0;
  border-left: 3px solid #94A3B8;
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  border-radius: 3px;
}

/* A-4 Receipt / Paragon Evaluation Screen */
.receipt-card {
  background: var(--bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-4);
}

.receipt-section {
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border-subtle);
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-2) 0;
  font-size: 13.5px;
}

.receipt-table th, .receipt-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-subtle);
}

.price-lock-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.countdown-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: var(--space-2);
  margin: var(--space-2) 0;
}

.countdown-btn {
  min-height: 34px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.countdown-btn.active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: white;
}

/* ── Side Panels / Drawers ── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 100;
  display: none;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.drawer-backdrop.active {
  display: block;
  opacity: 1;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  z-index: 101;
  box-shadow: var(--shadow-drawer);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
}

.drawer-backdrop.active .drawer-panel {
  transform: translateX(0);
}

.drawer-header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-header h2 {
  font-size: 16px;
  font-weight: 700;
}

.drawer-body {
  padding: var(--space-4);
  overflow-y: auto;
  flex: 1;
}

.drawer-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border);
  background: var(--bg-subtle);
  display: flex;
  gap: var(--space-2);
}

/* ── Modals ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  display: none;
}

.modal-backdrop.active {
  display: flex;
}

.modal-box {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.modal-header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  padding: var(--space-4);
  font-size: 13.5px;
  line-height: 1.45;
}

.modal-footer {
  padding: var(--space-3) var(--space-4);
  background: var(--bg-subtle);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}
