/* ══════════════════════════════════════════════════════════
   Booking SaaS – RonDesignLab Inspired UI System
   Light Theme · Soft Contrast · Premium Feel
   ══════════════════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  /* Surfaces */
  --bg-main: #F6F8FC;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-hover: #F1F5F9;
  --bg-input: #F8FAFC;
  --bg-sidebar: #FFFFFF;

  /* Text */
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --text-dim: #CBD5E1;

  /* Accent (Brand) */
  --accent: #6366F1;
  --accent-hover: #4F46E5;
  --accent-soft: rgba(99, 102, 241, 0.10);
  --accent-glow: rgba(99, 102, 241, 0.18);
  --accent-text: #4F46E5;

  /* Status */
  --success: #16A34A;
  --success-soft: rgba(22, 163, 74, 0.08);
  --danger: #DC2626;
  --danger-soft: rgba(220, 38, 38, 0.08);
  --warning: #D97706;
  --warning-soft: rgba(217, 119, 6, 0.08);
  --info: #2563EB;
  --info-soft: rgba(37, 99, 235, 0.08);

  /* Shadows — soft, no harsh edges */
  --shadow-xs: 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.12);
  --shadow-float: 0 20px 50px rgba(15, 23, 42, 0.14);

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-full: 9999px;
  --r-sidebar: 0 18px 18px 0;

  /* Spacing */
  --sp-micro: 4px;
  --sp-tight: 8px;
  --sp-default: 12px;
  --sp-comfortable: 16px;
  --sp-section: 24px;
  --sp-large: 32px;
  --sp-page: 48px;

  /* Layout */
  --sidebar-width: 240px;
  --sidebar-collapsed: 72px;

  /* Motion — 120-180ms only */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 150ms;
  --transition: all var(--duration) var(--ease);

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* ── Reset ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.has-top-nav {
  display: block;
}

body.no-nav {
  display: flex;
  justify-content: center;
  align-items: center;
}

a {
  color: var(--accent-text);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

/* Typography scale */
h1 {
  font-size: 1.714rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

/* 24px */
h2 {
  font-size: 1.286rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

/* 18px */
h3 {
  font-size: 1.143rem;
  font-weight: 600;
}

/* 16px */

/* ══════════════════════════════════════════════════════════
   SIDEBAR V2 (Direction Theme)
   ══════════════════════════════════════════════════════════ */
:root {
  --sidebar-v2-bg: #111C24;
  --sidebar-v2-text: #94A3B8;
  --sidebar-v2-hover: rgba(255, 255, 255, 0.05);
  --sidebar-v2-active: rgba(255, 255, 255, 0.08);
  --sidebar-v2-accent: #22C55E;
}

body.has-sidebar-v2 {
  background: var(--bg-main);
}

.sidebar-v2 {
  position: fixed;
  top: 16px;
  bottom: 16px;
  left: 16px;
  width: 260px;
  background: var(--sidebar-v2-bg);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
  overflow: visible;
}

.sidebar-v2.collapsed {
  width: 88px;
  /* Besarkan sikit dari 80px supaya tak nampak sesak */
}

/* Header / Logo Area */
.sidebar-header {
  padding: 24px 0;
  /* Buang padding kiri kanan kontena */
  display: flex;
  align-items: center;
  position: relative;
  overflow: visible;
  /* Tukar ke visible supaya butang tak kena crop */
  gap: 0;
  /* Guna margin-right pada icon utk jarak */
}

.sidebar-v2.collapsed .sidebar-header {
  padding: 24px 0;
}

.business-switcher {
  display: flex;
  align-items: center;
  cursor: pointer;
  border-radius: 12px;
  width: 100%;
  padding-left: 24px;
  /* Icon 40px @ 24px -> Center 44px */
  overflow: visible;
}

.logo-icon-v2 {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--sidebar-v2-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-right: 12px;
  overflow: hidden;
}

.sidebar-v2.collapsed .logo-icon-v2 {
  margin-right: 12px;
  /* Kekalkan margin sbb nak elak jumping */
}

.logo-text-wrapper-v2 {
  flex: 1;
  overflow: hidden;
  opacity: 1;
  width: 150px;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-v2.collapsed .logo-text-wrapper-v2 {
  opacity: 0;
  width: 0;
  pointer-events: none;
  display: none;
}

.logo-text-v2 {
  font-weight: 700;
  color: #fff;
  font-size: 1.1rem;
  white-space: nowrap;
}

.sidebar-toggle-btn {
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sidebar-v2-accent);
  color: white;
  border: 4px solid var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 110;
  transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
  box-shadow: var(--shadow-sm);
}

.sidebar-toggle-btn:hover {
  background: #16a34a;
  transform: translateY(-50%) scale(1.1);
}

.sidebar-toggle-btn:active {
  transform: translateY(-50%) scale(0.9);
}

.sidebar-v2.collapsed .sidebar-toggle-btn {
  transform: translateY(-50%) rotate(180deg);
}

.biz-switch-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #fff;
  opacity: 0.5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 4px;
  border-radius: 6px;
  margin-left: auto;
}

.biz-switch-btn svg {
  display: block;
}

.biz-switch-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.biz-switch-btn:active {
  transform: scale(0.95);
}

/* Sidebar Submenu Slider (Change Profile) */
.sidebar-submenu {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s cubic-bezier(0.2, 0, 0, 1), margin-bottom 0.3s cubic-bezier(0.2, 0, 0, 1);
  background: var(--sidebar-v2-bg);
  width: 100%;
}

.sidebar-submenu.active {
  max-height: 80px;
  margin-bottom: 12px;
}

.sidebar-submenu .biz-actions {
  padding: 0 24px;
  background: transparent;
}

.sidebar-submenu .biz-actions .btn {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.1);
  width: 100%;
  font-size: 0.85rem;
}

.sidebar-submenu .biz-actions .btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-v2.collapsed .sidebar-submenu {
  display: none !important;
}


.sidebar-nav-v2 {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  /* Buang padding 12px sblm ni sbb kacau alignment */
}

/* Custom scrollbar for sidebar nav */
.sidebar-nav-v2::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav-v2::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav-v2::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.nav-section-v2 {
  margin-bottom: 24px;
}

.nav-item-v2 {
  display: flex;
  align-items: center;
  padding: 4px 24px;
  /* Match everything else (24px) */
  margin-bottom: 4px;
  border-radius: 12px;
  color: var(--sidebar-v2-text);
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  width: 100%;
}

@media (hover: hover) {
  .nav-item-v2:hover {
    background: transparent;
    color: #fff;
  }

  .nav-item-v2:hover .nav-icon-v2 {
    background: var(--sidebar-v2-hover);
    border-radius: 12px;
  }
}

.nav-item-v2.active {
  background: transparent;
  color: #fff;
}

.nav-item-v2.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 32px;
  background-color: #ef4444;
  border-radius: 0 4px 4px 0;
}

.nav-item-v2.active .nav-icon-v2 {
  background: var(--sidebar-v2-active);
  border-radius: 12px;
}

.sidebar-v2.collapsed .nav-item-v2 {
  padding: 4px 24px;
  /* Icons stay absolutely fixed */
}

.nav-icon-v2 {
  width: 40px;
  height: 40px;
  /* Lebar icon zone 40px supaya sebaris dgn Logo (40px) */
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  color: currentColor;
  margin-right: 12px;
  /* Match Logo margin (12px) */
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-v2.collapsed .nav-icon-v2 {
  margin-right: 12px;
}

.nav-icon-v2 svg {
  width: 20px;
  height: 20px;
}

.nav-label-v2 {
  font-weight: 500;
  font-size: 0.95rem;
  opacity: 1;
  width: 140px;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.sidebar-v2.collapsed .nav-label-v2 {
  opacity: 0;
  width: 0;
}

/* User Footer area */
.sidebar-footer-v3 {
  padding: 16px;
  margin-top: auto;
  position: relative;
}

.user-profile-v3 {
  background: #f8f8fb;
  border-radius: 20px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  overflow: visible;
  width: 100%;
}

.user-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-v2.collapsed .user-profile-v3 {
  padding: 16px 8px;
  border-radius: 16px;
  cursor: pointer;
}

.sidebar-v2.collapsed .user-header {
  align-items: center;
  justify-content: center;
}

.sidebar-v2.collapsed .desktop-user-actions,
.desktop-user-actions {
  display: none;
}

.footer-action-btn {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.05);
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.footer-action-btn:hover {
  background: #f1f5f9;
  color: #1a1a24;
}

.user-avatar-v3 {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e2dcf2;
  color: #6c5ce7;
  font-weight: bold;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0, 1);
  flex-shrink: 0;
}

.sidebar-v2.collapsed .user-avatar-v3 {
  width: 40px;
  height: 40px;
  margin-bottom: 0;
  font-size: 1.2rem;
}

.status-dot-v3 {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #10b981;
  border: 2px solid #fff;
  border-radius: 50%;
  z-index: 2;
  display: none;
  /* Just a placeholder */
}

.user-details-v3 {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0, 1);
  width: 100%;
  overflow: hidden;
  opacity: 1;
  max-height: 100px;
}

.user-name-v3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a24;
  margin-bottom: 4px;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  width: 100%;
}

.user-role-v3 {
  color: #a4b0be;
  font-size: 0.75rem;
  text-align: center;
}

.logout-btn-v3 {
  position: absolute;
  right: 12px;
  top: 12px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #a4b0be;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.logout-btn-v3:hover {
  color: #ef4444;
}

.sidebar-v2.collapsed .user-details-v3 {
  opacity: 0;
  max-height: 0;
  margin-top: 0;
  pointer-events: none;
}

.sidebar-v2.collapsed .logout-btn-v3 {
  display: none;
}

/* User Dropdown */
.user-dropdown-v3 {
  display: none;
  position: absolute;
  top: -80px;
  right: 16px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  width: 140px;
  overflow: hidden;
  z-index: 100;
  border: 1px solid #f1f2f6;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.user-dropdown-v3.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.sidebar-v2.collapsed .user-dropdown-v3 {
  right: -130px;
  top: 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 0.85rem;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  transition: background 0.2s;
}

.user-dropdown-item:hover {
  background: #f8f8fb;
}

.user-dropdown-item-settings {
  color: #4a4a5a;
  border-bottom: 1px solid #f1f2f6;
}

.user-dropdown-item-logout {
  color: #ef4444;
}

/* ══════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════ */
.main-content {
  flex: 1;
  margin-top: 0;
  padding: var(--sp-section) var(--sp-page);
  min-height: 100vh;
  margin-left: calc(260px + 32px);
  /* 260px width + 16px left + 16px padding */
  transition: margin-left 0.3s cubic-bezier(0.2, 0, 0, 1);
}

body.has-sidebar-v2 .main-content {
  padding-top: 16px;
}

/* If you need collapsed state logic via child elements or JS logic, this selector handles the side-shift */
.sidebar-v2.collapsed~.main-content {
  margin-left: calc(88px + 32px);
}

body.no-nav .main-content {
  margin-top: 0;
  margin-left: 0;
  padding: 0;
  width: 100%;
}

/* ── Page Header ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--sp-section);
  gap: var(--sp-comfortable);
}

.page-header h1 {
  font-size: 1.714rem;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: var(--sp-micro);
}

.header-actions {
  display: flex;
  gap: var(--sp-tight);
  align-items: center;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════ */

/* Surface Card */
.card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* Floating Card (for modals, auth) */
.card-float {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  padding: var(--sp-section);
  box-shadow: var(--shadow-lg);
}

/* ══════════════════════════════════════════════════════════
   BUTTONS
   Primary = soft accent bg + colored text
   Danger = red text, not red background
   ══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font);
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.btn-primary:hover {
  background: var(--accent-glow);
  transform: translateY(-1px);
}

.btn-solid {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25);
}

.btn-solid:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--bg-hover);
  color: var(--text-secondary);
}

.btn-outline:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Danger = red text, not red background */
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-danger:hover {
  background: rgba(220, 38, 38, 0.12);
}

.btn-success {
  background: var(--success-soft);
  color: var(--success);
}

.btn-success:hover {
  background: rgba(22, 163, 74, 0.12);
}

.btn-full {
  width: 100%;
}

.btn-large {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: var(--r-lg);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: var(--r-sm);
}

.btn-pill-outline {
  background: white;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  border-radius: 9999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.btn-pill-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-pill-black {
  background: #0f172a;
  color: white;
  border-radius: 9999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid #0f172a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-pill-black:hover {
  background: #1e293b;
}

/* Specific filter styles for V3 design */
.filters-bar-v3 {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  margin-bottom: 24px;
}

.form-input-v3 {
  height: 40px;
  border: 1px solid #e2e8f0;
  background: white;
  border-radius: 9999px !important;
  font-size: 0.85rem;
  padding: 0 16px;
  color: #0f172a;
  transition: all 0.2s;
  appearance: none;
  box-sizing: border-box;
}

/* Fix select appearance */
select.form-input-v3 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748B' d='m12 15l-4.243-4.242l1.415-1.414L12 12.172l2.828-2.828l1.415 1.414L12 15.001Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-input-v3:focus {
  border-color: var(--accent) !important;
  outline: none;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15) !important;
}

.search-v3 {
  width: 100%;
  padding-left: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  border-radius: 9999px !important;
}

/* Redesigned Table Wrapper */
.table-wrapper-v3 {
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.data-table-v3 {
  width: 100%;
  border-collapse: collapse;
}

.data-table-v3 th,
.data-table-v3 td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

.data-table-v3 th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 600;
  background-color: #f8fafc;
}

.data-table-v3 tr:last-child td {
  border-bottom: none;
}

.badge-pill-gray {
  background: #f1f5f9;
  color: #64748b;
  padding: 4px 14px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-block;
}

.badge-pill-success {
  background: #dcfce7;
  color: #16a34a;
  padding: 4px 14px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-block;
  border: none;
  cursor: pointer;
}

.badge-pill-disabled {
  background: #f1f5f9;
  color: #94a3b8;
  padding: 4px 14px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-block;
  border: none;
  cursor: pointer;
}

.action-link {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s;
}

.action-link:hover {
  color: #0f172a;
}

/* ══════════════════════════════════════════════════════════
   FORMS / INPUTS
   Height 44px, radius 12px, no borders, soft accent glow focus
   ══════════════════════════════════════════════════════════ */
.form-group {
  margin-bottom: var(--sp-comfortable);
}

.form-group label {
  display: block;
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="tel"],
input[type="search"],
select,
textarea {
  width: 100%;
  height: 44px;
  padding: 10px var(--sp-comfortable);
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid transparent;
  /* Ensure border exists for focus state */
  border-radius: 9999px;
  font-family: var(--font);
  font-size: 0.88rem;
  transition: var(--transition);
  outline: none;
  box-sizing: border-box;
}

input[type="search"],
.search-v3,
.search-input {
  padding-left: 38px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: 12px center !important;
}

textarea,
textarea.form-input,
textarea.form-input-v3 {
  height: auto;
  min-height: 80px;
  max-width: 100%;
  resize: vertical;
  /* Changed from none to vertical for better UX */
  border-radius: var(--r-md) !important;
  /* Keep textarea as rounded rect to prevent distorted sides */
}

.form-input:focus,
input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15) !important;
  border-color: var(--accent) !important;
  background-color: var(--bg-surface);
}

.form-input::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-default);
}

.help-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ══════════════════════════════════════════════════════════
   STATS
   ══════════════════════════════════════════════════════════ */
.stats-grid {
  margin-bottom: var(--sp-section);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-comfortable);
  margin-bottom: var(--sp-section);
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--sp-tight);
}

.stat-value {
  font-size: 1.857rem;
  /* 26px */
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.stat-icon {
  font-size: 1.4rem;
  margin-bottom: var(--sp-tight);
}

/* ══════════════════════════════════════════════════════════
   TABLES — Rows behave like cards, no grid lines
   ══════════════════════════════════════════════════════════ */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 var(--sp-tight);
}

.data-table th {
  text-align: left;
  padding: var(--sp-default) var(--sp-comfortable);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: none;
}

.data-table td {
  padding: var(--sp-comfortable);
  font-size: 0.88rem;
  background: var(--bg-card);
  vertical-align: middle;
}

/* Rounded rows */
.data-table td:first-child {
  border-radius: var(--r-md) 0 0 var(--r-md);
}

.data-table td:last-child {
  border-radius: 0 var(--r-md) var(--r-md) 0;
}

.data-table tr:hover td {
  background: var(--bg-hover);
}

/* ══════════════════════════════════════════════════════════
   STATUS BADGES
   ══════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-micro) 10px;
  border-radius: var(--r-full);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-confirmed {
  background: var(--info-soft);
  color: var(--info);
}

.badge-completed {
  background: var(--success-soft);
  color: var(--success);
}

.badge-cancelled {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-no_show {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-pending {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-paid {
  background: var(--success-soft);
  color: var(--success);
}

.badge-refunded {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-active {
  background: var(--success-soft);
  color: var(--success);
}

.badge-inactive {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ══════════════════════════════════════════════════════════
   FILTERS
   ══════════════════════════════════════════════════════════ */
.filters-bar {
  display: flex;
  gap: var(--sp-default);
  margin-bottom: var(--sp-section);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  gap: var(--sp-default);
  flex-wrap: wrap;
}

.search-input {
  max-width: 320px;
}

/* ══════════════════════════════════════════════════════════
   MODALS — floating card, scale fade
   ══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--duration) var(--ease);
}

.modal {
  background: var(--bg-surface);
  border-radius: var(--r-xl);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-float);
  animation: scaleUp var(--duration) var(--ease);
}

@media (max-width: 768px) {
  .modal-overlay {
    align-items: flex-end;
  }

  .modal {
    width: 100%;
    max-width: none;
    border-radius: 24px 24px 0 0;
    animation: slideUp var(--duration) var(--ease);
    margin: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* Handle small devices */
  @keyframes slideUp {
    from {
      transform: translateY(100%);
    }

    to {
      transform: translateY(0);
    }
  }
}


.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--sp-section);
  border-bottom: 1px solid var(--bg-hover);
}

.modal-header h2 {
  font-size: 1.143rem;
}

.modal-close {
  background: var(--bg-hover);
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.modal-body {
  padding: var(--sp-section);
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: var(--sp-comfortable);
  margin-top: var(--sp-tight);
  border-top: 1px solid var(--bg-hover);
}

/* ══════════════════════════════════════════════════════════
   LOADING
   ══════════════════════════════════════════════════════════ */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-page) var(--sp-section);
  color: var(--text-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--bg-hover);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: var(--sp-default);
}

/* ══════════════════════════════════════════════════════════
   AUTH PAGES
   ══════════════════════════════════════════════════════════ */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--sp-section);
  width: 100%;
  background: linear-gradient(135deg, #F6F8FC 0%, #EEF2FF 50%, #F6F8FC 100%);
}

.auth-card {
  background: var(--bg-surface);
  border-radius: var(--r-xl);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-morph {
  width: 80px;
  height: auto;
  margin-bottom: 20px;
  transition: transform 0.6s var(--ease);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--sp-large);
}

.auth-header h1 {
  margin-top: 10px;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-top: 6px;
}

.auth-content-morph {
  transition: all 0.4s var(--ease);
  position: relative;
}

/* HTMX Swapping Animations */
.htmx-swapping .auth-content-morph {
  opacity: 0;
  transform: translateY(10px) scale(0.98);
}

.htmx-added .auth-content-morph {
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
}

.auth-content-morph {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.3s ease-out, transform 0.4s var(--ease);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--bg-hover);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.auth-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════
   TOASTS
   ══════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 320px;
  max-width: 420px;
  padding: 16px 20px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  animation: toastSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.hide {
  animation: toastSlideOut 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateX(40px) scale(0.9);
  }
}

.toast-success {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  border-bottom: 2px solid #dcfce7;
}

.toast-success .toast-icon-wrapper {
  color: #16a34a;
  background: #dcfce7;
}

.toast-error {
  background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
  border-bottom: 2px solid #fee2e2;
}

.toast-error .toast-icon-wrapper {
  color: #dc2626;
  background: #fee2e2;
}

.toast-info {
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
  border-bottom: 2px solid #dbeafe;
}

.toast-info .toast-icon-wrapper {
  color: #2563eb;
  background: #dbeafe;
}

.toast-warning {
  background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
  border-bottom: 2px solid #fef3c7;
}

.toast-warning .toast-icon-wrapper {
  color: #d97706;
  background: #fef3c7;
}

.toast-icon-wrapper {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 2px;
}

.toast-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
}

.toast-message {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════
   CALENDAR — rounded booking pills, soft color tags
   ══════════════════════════════════════════════════════════ */
.calendar-container {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  padding: var(--sp-section);
  min-height: 500px;
  box-shadow: var(--shadow-sm);
}

.cal-month-label {
  font-weight: 600;
  font-size: 1.1rem;
  min-width: 180px;
  text-align: center;
  color: var(--text-primary);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--sp-micro);
}

.cal-header {
  padding: 10px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cal-day {
  min-height: 100px;
  padding: var(--sp-tight);
  background: var(--bg-main);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: var(--transition);
}

.cal-day:hover {
  background: var(--bg-hover);
}

.cal-day.today {
  box-shadow: inset 0 0 0 2px var(--accent);
  background: var(--accent-soft);
}

.cal-day.other-month {
  opacity: 0.3;
}

.cal-date {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: var(--sp-micro);
  color: var(--text-primary);
}

/* Rounded booking pills */
.cal-event {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  color: var(--accent-text);
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════
   REPORTS
   ══════════════════════════════════════════════════════════ */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: var(--sp-section);
}

.report-card h3 {
  margin-bottom: var(--sp-comfortable);
  padding-bottom: var(--sp-default);
  border-bottom: 1px solid var(--bg-hover);
  color: var(--text-primary);
}

/* ══════════════════════════════════════════════════════════
   SETTINGS
   ══════════════════════════════════════════════════════════ */
.settings-grid {
  max-width: 100%;
}

/* ── Settings Tabs / Panes ── */
.st-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 32px;
  overflow-x: auto;
}

.st-tab {
  padding: 12px 4px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.st-tab:hover {
  color: #111827;
}

.st-tab.active {
  color: #111827;
  border-bottom-color: #111827;
}

.st-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.st-pane.active {
  display: block;
}

.st-section {
  margin-bottom: 40px;
}

.st-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 16px 0;
  padding-bottom: 16px;
  border-bottom: 1px solid #f3f4f6;
}

.st-row {
  display: flex;
  flex-direction: row;
  padding: 24px 0;
  border-bottom: 1px solid #f3f4f6;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.st-row:last-child {
  border-bottom: none;
}

.st-row-label {
  width: 200px;
  font-weight: 600;
  font-size: 14px;
  color: #111827;
  flex-shrink: 0;
}

.st-row-content {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #4b5563;
  font-size: 14px;
  flex: 0 0 auto;
}

.st-row-action {
  flex-shrink: 0;
}

/* Constrain inputs/selects inside settings rows — override global width:100% */
.st-input,
.st-row-content select,
.st-row-content input[type="text"],
.st-row-content input[type="email"],
.st-row-content input[type="tel"],
.st-row-content input[type="password"],
.st-row-content input[type="number"],
.st-row-content input[type="url"] {
  width: 320px !important;
  max-width: 320px !important;
  min-width: 0;
  height: 42px;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  transition: border 0.2s;
  background: #fff;
  box-sizing: border-box;
}

.st-input:focus,
.st-row-content select:focus,
.st-row-content input:focus {
  border-color: #6366f1 !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

.st-row-content textarea.st-input {
  width: 320px !important;
  max-width: 320px !important;
  height: auto !important;
  border-radius: 8px !important;
}

.st-pane .btn {
  width: auto !important;
}

.st-save-bar {
  position: sticky;
  bottom: 0;
  padding: 16px 24px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  z-index: 10;
  border-radius: 0 0 12px 12px;
  margin: 0 -24px -24px -24px;
  box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
}

@media (max-width:640px) {
  .st-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .st-row-label {
    width: 100%;
  }

  .st-row-content {
    width: 100%;
  }

  .st-row-content select,
  .st-row-content input,
  .st-input {
    width: 100% !important;
    max-width: 100% !important;
  }
}

.copy-input-group {
  display: flex;
  gap: var(--sp-tight);
}

.copy-input-group input {
  flex: 1;
}

.public-link-section {
  padding: var(--sp-tight) 0;
}

.public-link-section label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--sp-tight);
  color: var(--text-primary);
}

/* ══════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: var(--sp-page) var(--sp-section);
  color: var(--text-secondary);
}

.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: var(--sp-comfortable);
  opacity: 0.4;
}

.empty-state h3 {
  margin-bottom: var(--sp-tight);
  color: var(--text-primary);
}

/* ══════════════════════════════════════════════════════════
   ANIMATIONS — 120-180ms only
   ══════════════════════════════════════════════════════════ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ══════════════════════════════════════════════════════════
   IMAGE UPLOAD ZONE
   ══════════════════════════════════════════════════════════ */
.img-upload-zone {
  position: relative;
  border-radius: var(--r-lg);
  background: var(--bg-input);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.img-upload-zone:hover {
  background: var(--bg-hover);
}

.upload-zone-circle {
  width: 100px;
  height: 100px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  border-radius: 50% !important;
  padding: 0 !important;
  margin-left: auto;
  margin-right: auto;
}

.upload-zone-circle .img-upload-preview {
  border-radius: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-zone-landscape {
  width: 100%;
  height: 180px;
  min-height: 180px !important;
  border-radius: var(--r-lg);
}

.upload-zone-landscape .img-upload-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-upload-zone.dragging {
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.img-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.img-upload-icon {
  font-size: 2rem;
  opacity: 0.4;
}

.img-upload-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.img-upload-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Preview state */
.img-upload-zone.has-preview {
  padding: 0;
  min-height: 180px;
}

.img-upload-preview {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--r-lg);
}

.img-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 150ms var(--ease);
  border-radius: var(--r-lg);
}

.img-upload-zone.has-preview:hover .img-upload-overlay {
  opacity: 1;
}

.img-upload-overlay-text {
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 16px;
  border-radius: var(--r-full);
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-collapsed);
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    width: var(--sidebar-width);
  }

  .main-content {
    margin-left: 0;
    padding: 20px var(--sp-comfortable);
  }

  .page-header {
    flex-direction: column;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .filters-bar {
    flex-direction: column;
    gap: 12px !important;
  }

  .filters-bar>div {
    width: 100% !important;
  }

  .filter-group {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 12px !important;
  }

  .filters-bar .form-input,
  .filters-bar select,
  .filters-bar input {
    height: 42px !important;
    width: 100% !important;
    border: 1.5px solid #cbd5e1 !important;
  }

  .reports-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 28px 20px;
  }
}

/* HTMX loading indicator */
.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: inline-block;
}

.htmx-request.htmx-indicator {
  display: inline-block;
}

/* ── Staff Dropdown ── */
.staff-dropdown {
  position: relative;
}

.staff-dropdown-trigger {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.staff-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 220px;
  overflow-y: auto;
  margin-top: 4px;
}

.staff-dropdown-item:last-child {
  border-bottom: none;
}

/* ── Layout Helpers ── */
.hide-on-desktop {
  display: none;
}

/* ── Mobile Layout Adjustments ── */
@media (max-width: 768px) {
  .sidebar-v2 {
    left: -100%;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0;
    margin: 0;
    top: 0;
    bottom: 0;
    transition: left 0.3s cubic-bezier(0.2, 0, 0, 1);
    overflow-y: auto !important;
    overflow-x: hidden !important;
    pointer-events: auto !important;
  }

  .sidebar-v2.mobile-open {
    left: 0;
    box-shadow: 100vw 0 0 rgba(0, 0, 0, 0.5);
    /* Faux backdrop */
  }

  .sidebar-v2.collapsed {
    width: 100% !important;
  }

  .sidebar-toggle-btn {
    display: none;
  }

  .hide-on-desktop {
    display: flex;
  }

  .mobile-header {
    height: 60px;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    padding: 0 16px;
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 90;
  }

  .mobile-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0;
    margin-left: 24px;
    margin-right: 12px;
    width: 40px;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .sidebar-header .business-switcher {
    padding-left: 0;
  }

  .mobile-close-btn:hover {
    color: var(--text-primary);
  }

  .mobile-menu-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Redesign Owner Profile for Mobile (Column layout for nested actions) */
  .sidebar-v2 .user-profile-v3,
  .sidebar-v2.collapsed .user-profile-v3 {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    border-radius: 16px;
    justify-content: flex-start;
  }

  .sidebar-v2 .user-profile-v3 .user-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    margin-bottom: 0;
  }

  .sidebar-v2 .user-avatar-v3,
  .sidebar-v2.collapsed .user-avatar-v3 {
    width: 64px;
    height: 64px;
    margin-bottom: 0;
    margin-right: 16px;
    font-size: 1.5rem;
    flex-shrink: 0;
  }

  .sidebar-v2 .user-details-v3,
  .sidebar-v2.collapsed .user-details-v3 {
    align-items: flex-start;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 1 !important;
    max-height: 100px !important;
    pointer-events: auto !important;
    margin-top: 0 !important;
    min-width: 0;
  }

  .sidebar-v2 .user-name-v3,
  .sidebar-v2.collapsed .user-name-v3 {
    text-align: left;
    font-size: 1.1rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
  }

  .sidebar-v2 .user-role-v3,
  .sidebar-v2.collapsed .user-role-v3 {
    text-align: left;
    font-size: 0.9rem;
  }

  .sidebar-v2 .logout-btn-v3,
  .sidebar-v2.collapsed .logout-btn-v3 {
    display: flex !important;
    position: static !important;
    margin-left: auto;
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border: none;
    border-radius: 10px;
    padding: 8px;
    flex-shrink: 0;
  }

  .sidebar-v2 .logout-btn-v3:active {
    background: #ef4444;
    color: white;
  }



  /* Fix user dropdown going off-screen on mobile */
  .user-dropdown-v3 {
    top: auto !important;
    bottom: 90px !important;
    right: 16px !important;
  }

  /* Mobile User Icons */
  .mobile-user-icons {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: 12px;
  }

  .mobile-icon-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: white;
    color: var(--text-primary);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
  }

  .mobile-icon-action:active {
    transform: scale(0.92);
    background: #f1f5f9;
  }

  .mobile-icon-action.logout {
    color: var(--danger);
    border-color: var(--danger-soft);
  }

  .mobile-icon-action svg {
    width: 20px;
    height: 20px;
  }

  .mobile-logo {
    font-weight: 700;
    font-size: 1.1rem;
    margin-left: 12px;
    color: var(--text-primary);
  }

  /* Force show labels on mobile regardless of collapsed state */
  .sidebar-v2 .nav-label-v2 {
    opacity: 1 !important;
    display: block !important;
    width: auto !important;
  }

  /* ── Disable Hover Effects on Mobile ── */
  .nav-item-v2:hover {
    background: transparent !important;
    color: var(--sidebar-v2-text) !important;
  }

  .nav-item-v2.active:hover {
    background: transparent !important;
    color: #fff !important;
  }

  .nav-item-v2.active:hover .nav-icon-v2 {
    background: var(--sidebar-v2-active) !important;
  }

  .biz-switch-btn:hover {
    opacity: 0.5 !important;
    background: transparent !important;
    transform: none !important;
  }

  .sidebar-toggle-btn:hover {
    background: var(--sidebar-v2-accent) !important;
    transform: none !important;
  }

  .settings-btn-v3:hover {
    color: #a4b0be !important;
  }

  .user-dropdown-item:hover {
    background: transparent !important;
  }

  .user-avatar-v3:hover,
  .user-profile-v3:hover,
  .user-avatar-v3,
  .user-profile-v3 {
    background: #f8f8fb !important;
    transform: none !important;
    transition: none !important;
    cursor: default !important;
    box-shadow: none !important;
  }

  .settings-btn-v3 {
    cursor: pointer !important;
    /* Keep this clickable */
  }

  .mobile-close-btn:hover {
    color: var(--text-muted) !important;
  }

  .sidebar-v2.collapsed .nav-label-v2,
  .sidebar-v2.collapsed .logo-text-wrapper-v2,
  .sidebar-v2.collapsed .user-details-v3 {
    opacity: 1 !important;
    width: auto !important;
    display: flex !important;
    pointer-events: auto !important;
  }

  /* Prevent padding shrinkage on profile */
  .sidebar-v2.collapsed .user-profile-v3 {
    padding: 16px !important;
  }

  .sidebar-v2.collapsed .nav-icon-v2,
  .sidebar-v2.collapsed .logo-icon-v2 {
    margin-right: 12px !important;
  }

  /* Increase base text size for mobile (+4px total from desktop base) */
  html {
    font-size: 18px !important;
  }

  .main-content,
  body.has-sidebar-v2 .sidebar-v2.collapsed~.main-content {
    margin-left: 0 !important;
    margin-top: 60px;
    padding: 16px;
  }

  /* ── Products & Services Page Mobile Overrides ── */
  .page-header {
    flex-direction: column !important;
    gap: 16px !important;
  }

  #services-header-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 12px !important;
  }

  #services-header-actions .btn {
    width: 100%;
    margin: 0;
    justify-content: center;
    padding: 10px;
  }

  #services-header-actions .btn:nth-child(3),
  #services-header-actions .btn-pill-black {
    grid-column: span 2;
  }

  #services-filters {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 12px !important;
  }

  #services-filters .filter-col {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Sync heights and appearance */
  .form-input-v3,
  .custom-select-trigger {
    height: 42px !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
    border: 1.5px solid #cbd5e1 !important;
  }

  .custom-select-wrapper {
    width: 100% !important;
  }

  #services-filters .filter-search-col {
    grid-column: span 2;
    width: 100% !important;
    min-width: 0 !important;
  }

  .hide-on-mobile {
    display: none !important;
  }

  .table-wrapper-v3 {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-top: 12px;
  }

  .mobile-products-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px;
    width: 100%;
  }

  .product-mobile-card {
    width: 100% !important;
    box-sizing: border-box;
  }
}

/* ── Products Page Utilities ── */
.form-row {
  display: flex;
  gap: 16px;
}

.form-row>.form-group {
  flex: 1;
}

.filters-bar {
  margin-bottom: 20px;
}

.filters-bar .form-input {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  font-size: 0.875rem;
}

.search-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  padding-left: 36px !important;
  border-radius: 9999px !important;
}

/* ── Media Library ── */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.media-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--duration) var(--ease);
  display: flex;
  flex-direction: column;
}

.media-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.media-preview {
  aspect-ratio: 1/1;
  background: var(--bg-soft);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.media-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-preview .file-icon {
  font-size: 3rem;
  color: var(--text-muted);
}

.media-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}

.media-card:hover .media-actions {
  opacity: 1;
}

.media-info {
  padding: 12px;
  font-size: 0.85rem;
}

.media-name {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.media-meta {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.btn-icon.danger {
  background: rgba(239, 68, 68, 0.9);
  color: white;
  padding: 6px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon.danger:hover {
  background: rgb(239, 68, 68);
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE OVERRIDES
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Tables - Mobile Friendly View */
  .bookings-compact-view thead {
    display: none;
  }

  .bookings-compact-view tr {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: var(--bg-surface);
    margin-bottom: var(--sp-comfortable);
    padding: 16px;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    gap: 12px;
  }

  .bookings-compact-view td {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    height: auto !important;
    box-shadow: none !important;
    display: block !important;
  }

  /* Hide unnecessary columns on mobile for bookings */
  .bookings-compact-view td:nth-child(2),
  /* Appointment */
  .bookings-compact-view td:nth-child(3),
  /* Staff */
  .bookings-compact-view td:nth-child(5) {
    /* Status */
    display: none !important;
  }

  .bookings-compact-view td:nth-child(1) {
    /* Customer */
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }

  .bookings-compact-view td:nth-child(4) {
    /* Date/Time */
    flex: 1;
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-secondary);
  }

  .bookings-compact-view td:last-child {
    /* Actions */
    flex-shrink: 0;
  }

  .bookings-compact-view .btn-sm {
    padding: 8px 12px;
  }

  /* Business Hours - Stack on mobile */
  .bh-row {
    flex-wrap: wrap !important;
    gap: 12px !important;
    align-items: flex-start !important;
    padding: 16px !important;
  }

  .bh-row>div:nth-child(2) {
    /* Day label */
    width: 100% !important;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary) !important;
  }

  .bh-row>label {
    /* Closed checkbox */
    order: 3;
    width: auto !important;
    margin: 0 !important;
    padding: 8px 0;
  }

  .bh-row>.bh-times {
    /* Start/End Times */
    order: 2;
    width: 100% !important;
    flex: none !important;
    justify-content: space-between;
  }

  .bh-times .form-input {
    flex: 1;
    min-width: 0;
  }

  /* Stack booking details in modal */
  #booking-details-content>div>div {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* Make sure modal header looks clean on mobile */
  .modal-header {
    padding: 16px 20px !important;
  }

  .modal-header h2 {
    font-size: 1.2rem !important;
  }

  /* Dashboard Table - Mobile Friendly View */
  .dash-compact-view {
    min-width: 100% !important;
  }

  .dash-compact-view thead {
    display: none;
  }

  .dash-compact-view tr {
    display: flex !important;
    flex-direction: column !important;
    /* Stack columns on very small screens */
    align-items: flex-start !important;
    padding: 16px 0;
    border-bottom: 1px solid #f1f2f6;
    gap: 12px;
    position: relative;
  }

  .dash-compact-view tbody tr:last-child {
    border-bottom: none;
  }

  .dash-compact-view td {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    height: auto !important;
    box-shadow: none !important;
    display: block !important;
    width: 100% !important;
  }

  .dash-compact-view td:nth-child(2) {
    /* Date & Time */
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex !important;
    gap: 8px;
    align-items: center;
  }

  .dash-compact-view td:nth-child(2) div {
    display: inline-block;
  }

  .dash-compact-view td:nth-child(3) {
    /* Status Badge */
    position: absolute;
    right: 0;
    top: 16px;
    width: auto !important;
  }

  .dash-compact-view td:last-child {
    /* Actions */
    margin-top: 4px;
  }

  .dash-compact-view .btn-sm {
    width: 100%;
    text-align: center;
  }

  /* Admin Calendar - Mobile Card View */
  .cal-header {
    display: none;
  }

  .cal-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px;
    margin: 0;
    max-height: 60vh;
    /* Fixed scrollable area for calendar cards */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }



  .cal-day {
    width: 100%;
    min-height: auto;
    border: 1px solid var(--border);
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    padding: 16px;
  }

  .cal-day.other-month {
    display: none;
    /* hide empty slots on mobile */
  }

  .cal-date {
    font-size: 1.2rem;
    font-weight: 700;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--bg-hover);
    margin-bottom: 16px;
  }

  .cal-event {
    font-size: 0.85rem;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
    font-weight: 600;
  }

  /* Make custom selects more apparent as buttons */
  .custom-select-trigger {
    border: 1.5px solid #cbd5e1 !important;
    background: white !important;
  }

  /* Edit Order modal mobile overrides */
  .edit-order-modal-inner {
    max-height: 88vh !important;
    border-radius: 24px 24px 0 0 !important;
  }

  .edit-order-footer {
    padding: 12px 20px !important;
  }

  /* Date/time inputs on mobile */
  input[type="date"],
  input[type="time"] {
    -webkit-appearance: none;
    appearance: none;
  }
}

/* ══════════════════════════════════════════════════════════
   EDIT ORDER MODAL STYLES
   ══════════════════════════════════════════════════════════ */

/* Spin animation for save button loading state */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Fade-in animation for newly added items */
@keyframes fadeItemIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Edit order item card */
.edit-order-item {
  animation: fadeItemIn 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Price input: hide browser number spinners for cleaner look */
.edit-item-price::-webkit-outer-spin-button,
.edit-item-price::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.edit-item-price[type="number"] {
  -moz-appearance: textfield;
}

/* Edit order modal: large desktop sees full two-column layout */
@media (min-width: 769px) {
  .edit-order-modal-inner {
    width: 92% !important;
  }
}