/* BizCard By Gest - Global Styles + Full Responsive */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@400;600;700&family=Cinzel:wght@400;600;700&display=swap');

:root {
  --primary: #1a1a2e;
  --accent: #e94560;
  --gold: #c9a84c;
  --gold-light: #e8c97a;
  --gold-shine: #f5e6b8;
  --silver: #a8b2c0;
  --silver-light: #d4dbe5;
  --dark-blue: #0a0e1a;
  --navy: #0d1b3e;
  --glass: rgba(255,255,255,0.08);
  --glass-border: rgba(255,255,255,0.15);
  --sidebar-w: 260px;

  /* Login luxury palette */
  --login-bg1: #060810;
  --login-bg2: #0a0e1a;
  --login-bg3: #0d1b3e;
  --login-gold: #c9a84c;
  --login-gold2: #e8c97a;
  --login-silver: #a8b2c0;
  --login-card-bg: rgba(10,14,26,0.85);
  --login-card-border: rgba(201,168,76,0.25);
}

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

html { font-size: 16px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #0f0f1a;
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #1a1a2e; }
::-webkit-scrollbar-thumb { background: #e94560; border-radius: 3px; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}
@keyframes slideInRight {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}
@keyframes spin { to { transform: rotate(360deg); } }

.animate-fade-in   { animation: fadeIn       0.5s ease-out both; }
.animate-slide-in  { animation: slideInRight 0.4s ease-out both; }
.animate-slide-up  { animation: slideUp      0.4s ease-out both; }
.animate-float     { animation: float 3s ease-in-out infinite; }
.fa-spin           { animation: spin 1s linear infinite; }

/* ===== GLASS MORPHISM ===== */
.glass {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
}

/* ===== GRADIENT TEXT ===== */
.gradient-text {
  background: linear-gradient(135deg, #e94560, #f5c842);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #e94560, #c73652);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-primary:hover  { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(233,69,96,0.4); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(255,255,255,0.08);
  color: white;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-secondary:hover  { background: rgba(255,255,255,0.15); transform: translateY(-1px); }
.btn-secondary:active { transform: translateY(0); }

/* ===== INPUTS ===== */
.input-field {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: white;
  font-size: 16px; /* 16px prevents iOS zoom */
  transition: all 0.3s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.input-field::placeholder { color: rgba(255,255,255,0.35); }
.input-field:focus {
  border-color: #e94560;
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px rgba(233,69,96,0.15);
}
select.input-field { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea.input-field { resize: vertical; min-height: 80px; }

.input-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 6px;
}

/* ===== CARDS ===== */
.card-surface {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.3s ease;
}
.card-surface:hover { border-color: rgba(233,69,96,0.3); background: rgba(255,255,255,0.06); }

/* ===== LAYOUT WRAPPER ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: linear-gradient(180deg, #0d0d1a 0%, #1a1a2e 100%);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  overflow-y: auto;
  transition: transform 0.3s ease;
}
.sidebar-logo {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.sidebar-nav { padding: 12px 10px; flex: 1; }
.sidebar-nav a, .sidebar-nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  margin-bottom: 3px;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-nav a:hover, .sidebar-nav button:hover,
.sidebar-nav a.active,  .sidebar-nav button.active {
  background: rgba(233,69,96,0.12);
  color: #e94560;
}
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
}
.sidebar-user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e94560, #f5c842);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}

/* ===== MOBILE TOP BAR ===== */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(90deg, #0d0d1a, #1a1a2e);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 300;
}
.mobile-topbar-logo {
  display: flex; align-items: center; gap: 10px;
}
.hamburger-btn {
  background: none; border: none; color: white; cursor: pointer;
  padding: 8px; border-radius: 8px; font-size: 18px;
  -webkit-tap-highlight-color: transparent;
}
.hamburger-btn:active { background: rgba(255,255,255,0.08); }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 190;
  backdrop-filter: blur(4px);
}
.sidebar-overlay.visible { display: block; }

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  padding: 32px;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-success { background: rgba(34,197,94,0.15);  color: #22c55e; }
.badge-warning { background: rgba(245,200,66,0.15); color: #f5c842; }
.badge-danger  { background: rgba(233,69,96,0.15);  color: #e94560; }
.badge-info    { background: rgba(99,179,237,0.15); color: #63b3ed; }

/* ===== STAT CARDS ===== */
.stat-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; padding: 20px;
  transition: all 0.3s ease;
}
.stat-card:hover { transform: translateY(-3px); border-color: rgba(233,69,96,0.3); }
.stat-number { font-size: 32px; font-weight: 800; line-height: 1; }
.stat-label  { font-size: 12px; color: rgba(255,255,255,0.45); font-weight: 500; margin-top: 4px; }

/* ===== TOGGLE ===== */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: rgba(255,255,255,0.1); border-radius: 24px; transition: 0.3s;
}
.toggle-slider:before {
  position: absolute; content: '';
  height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: 0.3s;
}
input:checked + .toggle-slider { background: #e94560; }
input:checked + .toggle-slider:before { transform: translateX(20px); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}
.modal-box {
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px; padding: 28px;
  width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto;
  animation: fadeIn 0.3s ease;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed; bottom: 20px; right: 16px;
  z-index: 9999; display: flex; flex-direction: column; gap: 10px;
  max-width: calc(100vw - 32px);
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 500;
  min-width: 260px; max-width: 340px;
  animation: slideInRight 0.3s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.toast-success { background: #052e16; border: 1px solid rgba(34,197,94,0.3);  color: #22c55e; }
.toast-error   { background: #1f0d0d; border: 1px solid rgba(233,69,96,0.3);  color: #e94560; }
.toast-info    { background: #0d1f2d; border: 1px solid rgba(99,179,237,0.3); color: #63b3ed; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 16px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.data-table th {
  padding: 12px 14px; text-align: left;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: rgba(255,255,255,0.4); border-bottom: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 14px; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 14px;
}
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 24px; gap: 12px; flex-wrap: wrap;
}
.section-header h1 { font-size: 26px; font-weight: 800; }
.section-header p  { color: rgba(255,255,255,0.4); font-size: 14px; margin-top: 4px; }

/* ===== TWO-COL EDITOR LAYOUT ===== */
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}
.editor-preview { position: sticky; top: 20px; }

/* ===== FORM GRID ===== */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

/* ===== SOCIAL GRID ===== */
.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

/* ===== THEME GRID ===== */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

/* ===== APPOINTMENT SLOTS ===== */
.slots-list { display: flex; flex-direction: column; gap: 10px; }
.slot-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03); border-radius: 10px;
  flex-wrap: wrap;
}
.slot-day { width: 90px; font-size: 14px; font-weight: 600; flex-shrink: 0; }
.slot-times { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.slot-times input { width: 100px; }
.slot-dur  { width: 120px; }

/* ===== PUBLIC CARD PAGE ===== */
.public-card-wrapper {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center;
  padding: 32px 16px 48px;
}

/* ===== BOTTOM NAVIGATION (mobile only) ===== */
.mobile-bottomnav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 62px;
  background: rgba(13,13,26,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.08);
  z-index: 300;
  flex-direction: row;
  align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottomnav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 4px;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.2px;
}
.bottomnav-btn i {
  font-size: 18px;
  transition: transform 0.2s ease;
}
.bottomnav-btn.active {
  color: #e94560;
}
.bottomnav-btn.active i {
  transform: translateY(-1px);
}
.bottomnav-btn:active {
  background: rgba(233,69,96,0.08);
}
/* Logout button in bottom nav */
.bottomnav-logout {
  color: rgba(233,69,96,0.6);
  border-left: 1px solid rgba(255,255,255,0.05);
}
.bottomnav-logout:hover, .bottomnav-logout:active {
  color: #e94560;
  background: rgba(233,69,96,0.08);
}

/* ===== LOGIN PAGE — LUXURY DARK ===== */
.login-bg {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(13,27,62,0.9) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(201,168,76,0.08) 0%, transparent 55%),
    linear-gradient(160deg, #060810 0%, #0a0e1a 45%, #0d1520 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

/* Particelle decorative oro */
.login-bg::before {
  content: '';
  position: fixed;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(201,168,76,0.06) 0%, transparent 65%);
  pointer-events: none;
}
.login-bg::after {
  content: '';
  position: fixed;
  bottom: -150px; left: -150px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(13,27,62,0.7) 0%, transparent 65%);
  pointer-events: none;
}

/* Linee decorative sfondo */
.login-lines {
  position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0;
}
.login-lines::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  width: 1px; height: 100%;
  background: linear-gradient(to bottom, transparent 0%, rgba(201,168,76,0.15) 30%, rgba(201,168,76,0.08) 70%, transparent 100%);
}

/* Card form login */
.login-card {
  background: var(--login-card-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--login-card-border);
  border-radius: 24px;
  box-shadow:
    0 0 0 1px rgba(201,168,76,0.08),
    0 32px 80px rgba(0,0,0,0.7),
    0 4px 20px rgba(201,168,76,0.06);
}

/* Logo brand luxury */
.brand-logo-box {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #c9a84c 0%, #e8c97a 50%, #c9a84c 100%);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(201,168,76,0.4), 0 0 40px rgba(201,168,76,0.15);
  flex-shrink: 0;
}

/* Tab buttons stile luxury */
.login-tab-wrap {
  display: flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.1);
  border-radius: 12px;
  padding: 4px;
}
.login-tab-active {
  background: linear-gradient(135deg, #c9a84c, #e8c97a) !important;
  color: #060810 !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(201,168,76,0.35);
}
.login-tab-inactive {
  background: none !important;
  color: rgba(255,255,255,0.4) !important;
  font-weight: 500 !important;
}

/* Input con focus oro */
.input-field-gold {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 10px;
  color: white;
  font-size: 16px;
  transition: all 0.3s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  font-family: 'Inter', sans-serif;
}
.input-field-gold::placeholder { color: rgba(168,178,192,0.5); }
.input-field-gold:focus {
  border-color: rgba(201,168,76,0.6);
  background: rgba(201,168,76,0.04);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
}

/* Bottone primario oro */
.btn-gold {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, #b8943a 0%, #c9a84c 40%, #e8c97a 70%, #c9a84c 100%);
  background-size: 200% auto;
  color: #060810;
  border: none; border-radius: 12px;
  font-weight: 700; font-size: 15px;
  cursor: pointer;
  transition: all 0.4s ease;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 18px rgba(201,168,76,0.35);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-gold:hover {
  background-position: right center;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(201,168,76,0.5);
}
.btn-gold:active { transform: translateY(0); }
.btn-gold:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Separatore oro */
.gold-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.3), transparent);
  margin: 20px 0;
}

/* Etichetta input */
.input-label-silver {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--login-silver);
  margin-bottom: 7px;
}

/* Animazione shimmer sul logo */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
.brand-shimmer {
  background: linear-gradient(90deg, #c9a84c 0%, #f5e6b8 40%, #c9a84c 60%, #e8c97a 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* Stelle/particelle decorative */
@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.4); }
}
.star-dot {
  position: fixed; border-radius: 50%;
  background: rgba(201,168,76,0.6);
  animation: twinkle 2s ease-in-out infinite;
  pointer-events: none; z-index: 0;
}

/* ===== CARD CARDS (admin) ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

/* ===== APPOINTMENT LIST ===== */
.appt-list { display: flex; flex-direction: column; gap: 10px; }
.appt-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px; flex-wrap: wrap;
}
.appt-date-badge {
  width: 50px; height: 50px; border-radius: 12px;
  background: linear-gradient(135deg, #e94560, #1a1a2e);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* ── Tablet (≤ 1024px) ─────────────────────────────────────── */
@media (max-width: 1024px) {
  .editor-grid {
    grid-template-columns: 1fr;
  }
  .editor-preview {
    position: static;
    display: flex; flex-direction: column; align-items: center;
  }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .main-content { padding: 24px 20px; }
}

/* ── Mobile (≤ 768px) ──────────────────────────────────────── */
@media (max-width: 768px) {

  /* Show mobile topbar, hide sidebar by default */
  .mobile-topbar { display: flex; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); animation: slideInLeft 0.3s ease; }
  .main-content {
    margin-left: 0;
    padding: 76px 14px 82px; /* top: topbar, bottom: bottomnav */
  }

  /* Show bottom nav */
  .mobile-bottomnav { display: flex; }

  /* Section header stack */
  .section-header { flex-direction: column; align-items: flex-start; }
  .section-header > div:last-child { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }

  /* Stats */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-number { font-size: 26px; }

  /* Forms */
  .form-grid-2 { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .span-3 { grid-column: span 1; }

  /* Modal */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box {
    border-radius: 20px 20px 0 0;
    max-height: 85vh;
    padding: 24px 18px;
  }

  /* Buttons full width in actions */
  .action-bar { flex-direction: column; }
  .action-bar .btn-primary,
  .action-bar .btn-secondary { width: 100%; justify-content: center; }

  /* Toast */
  .toast-container { left: 12px; right: 12px; bottom: 72px; } /* above bottom nav */
  .toast { min-width: 0; width: 100%; max-width: 100%; }

  /* Table → scrollable */
  .table-wrap { border-radius: 12px; }

  /* Slot rows */
  .slot-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .slot-day { width: auto; }
  .slot-times { width: 100%; }
  .slot-times input { flex: 1; min-width: 80px; width: auto; }
  .slot-dur  { width: 100%; }

  /* Appointment rows */
  .appt-row { flex-direction: column; align-items: flex-start; }

  /* Public card */
  .public-card-wrapper { padding: 20px 12px 40px; }

  /* Theme grid */
  .theme-grid { grid-template-columns: repeat(2, 1fr); }

  /* Social grid */
  .social-grid { grid-template-columns: 1fr; }
  
  /* Cards grid */
  .cards-grid { grid-template-columns: 1fr; }

  /* Login */
  .login-bg { align-items: flex-start; padding-top: 40px; }

  /* Card surface less padding on mobile */
  .card-surface { padding: 16px; }
}

/* ── Small mobile (≤ 480px) ────────────────────────────────── */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card  { padding: 14px; }
  .stat-number { font-size: 22px; }

  .btn-primary, .btn-secondary { font-size: 13px; padding: 11px 16px; }

  .section-header h1 { font-size: 22px; }

  .modal-box { padding: 20px 14px; }

  .input-field { padding: 11px 13px; }

  .card-surface { padding: 14px; border-radius: 12px; }

  /* QR section */
  .qr-share-grid { grid-template-columns: 1fr !important; }

  /* Bottom nav label smaller */
  .bottomnav-btn { font-size: 9px; }
  .bottomnav-btn i { font-size: 17px; }
}
