/* ============================================================
   SABRINA TATTOO — Premium Rustic Theme
   Fineline • Botânica
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Palette */
  --gold:        #C4A265;
  --gold-light:  #d4b87a;
  --gold-dark:   #9e7e47;
  --gold-muted:  #d4c5a9;
  --cream:       #FAF6F0;
  --cream-dark:  #F0EAE0;
  --parchment:   #EDE7DB;
  --ink:         #1a1a1a;
  --ink-soft:    #2c2c2c;
  --ink-muted:   #4a4a4a;
  --warm-gray:   #8B8178;
  --border:      #d4c5a9;
  --border-light:#e8dece;

  /* Success/Warning/Error */
  --success:     #4a7c59;
  --success-bg:  #e8f0eb;
  --warning:     #b8860b;
  --warning-bg:  #fef8e8;
  --error:       #8b3a3a;
  --error-bg:    #fdf0f0;
  --info:        #3a5f8b;
  --info-bg:     #eef3f9;

  /* Fonts */
  --font-display: 'Playfair Display', 'Georgia', serif;
  --font-elegant: 'Cormorant Garamond', 'Georgia', serif;
  --font-body:    'Inter', -apple-system, sans-serif;

  /* Sizing */
  --radius:      16px;
  --radius-sm:   10px;
  --radius-lg:   24px;
  --shadow:      0 4px 20px rgba(26,26,26,.08);
  --shadow-lg:   0 8px 32px rgba(26,26,26,.12);
  --shadow-gold: 0 4px 16px rgba(196,162,101,.15);
}

/* ============ BASE ============ */
* { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink-soft);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* Subtle pattern overlay */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c4a265' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  letter-spacing: -0.02em;
}

/* ============ HEADER (Public) ============ */
.sabrina-header {
  background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 50%, #0d0d0d 100%);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.sabrina-header .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sabrina-header .logo-link {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: #fff;
}
.sabrina-header .logo-link img {
  max-height: 52px; object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(196,162,101,.3));
}
.sabrina-header .brand-text {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 500;
  color: var(--gold-light);
  letter-spacing: 3px;
  text-transform: uppercase;
}
.sabrina-header .cart-badge {
  background: rgba(196,162,101,.15);
  border: 1px solid rgba(196,162,101,.3);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--gold-light);
  font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}

/* ============ CARDS ============ */
.s-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.s-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.4;
}
.s-card h2 {
  font-size: 1.3rem;
  margin: 0 0 4px;
  color: var(--ink);
}
.s-card .subtitle {
  font-family: var(--font-elegant);
  font-size: 15px;
  color: var(--warm-gray);
  font-style: italic;
  margin: 0 0 18px;
}

/* ============ BUTTONS ============ */
.btn-gold {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all .25s;
  box-shadow: var(--shadow-gold);
  text-decoration: none;
}
.btn-gold:hover { 
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(196,162,101,.25);
}
.btn-dark {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px;
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all .25s;
  text-decoration: none;
}
.btn-dark:hover { background: #333; }
.btn-outline-gold {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px;
  background: transparent;
  color: var(--gold-dark);
  border: 1px solid var(--gold-muted);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all .25s;
  text-decoration: none;
}
.btn-outline-gold:hover { background: rgba(196,162,101,.08); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ============ FORM FIELDS ============ */
.s-field {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  background: #fff;
  color: var(--ink-soft);
  transition: border-color .2s, box-shadow .2s;
}
.s-field:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(196,162,101,.15);
}
.s-field::placeholder { color: var(--warm-gray); }

.s-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

/* ============ SERVICE SELECTOR ============ */
.service-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.service-grid input[type="radio"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.service-option {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 18px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: #fff;
  cursor: pointer;
  transition: all .25s;
  min-height: 80px;
}
.service-option:hover {
  border-color: var(--gold-muted);
  box-shadow: var(--shadow-gold);
}
.service-option .svc-icon {
  font-size: 20px;
  margin-bottom: 6px;
}
.service-option .svc-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.2;
}
.service-option .svc-detail {
  font-size: 11px;
  color: var(--warm-gray);
  margin-top: 4px;
}
.service-grid input:checked + .service-option {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  box-shadow: 0 4px 16px rgba(26,26,26,.15);
}
.service-grid input:checked + .service-option .svc-name { color: var(--gold-light); }
.service-grid input:checked + .service-option .svc-detail { color: rgba(255,255,255,.7); }
.service-grid input:checked + .service-option .svc-icon { filter: brightness(1.5); }

@media (max-width: 640px) {
  .service-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============ TIME SLOTS ============ */
.slots-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.slot {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.slot.free {
  background: var(--success-bg);
  border-color: #b5d4be;
  color: var(--success);
}
.slot.free:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74,124,89,.15);
}
.slot.pending {
  background: var(--warning-bg);
  border-color: #e8d694;
  color: var(--warning);
}
.slot.confirmed {
  background: var(--info-bg);
  border-color: #a3c1e0;
  color: var(--info);
}
.slot.blocked {
  background: #f0ede8;
  border-color: var(--border);
  color: var(--warm-gray);
}
.slot.disabled {
  cursor: not-allowed;
  opacity: .6;
}
.slot.ring {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
}

@media (max-width: 640px) {
  .slots-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============ CHIPS ============ */
.s-chip {
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.s-chip-dark  { background: var(--ink); color: var(--gold-light); }
.s-chip-green { background: var(--success-bg); color: var(--success); }
.s-chip-blue  { background: var(--info-bg); color: var(--info); }
.s-chip-amber { background: var(--warning-bg); color: var(--warning); }
.s-chip-gray  { background: #f0ede8; color: var(--warm-gray); }

/* ============ STATUS BADGES ============ */
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.badge-confirmed { background: var(--success-bg); color: var(--success); }
.badge-pending   { background: var(--warning-bg); color: var(--warning); }
.badge-canceled  { background: var(--error-bg); color: var(--error); }

/* ============ ALERTS ============ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #b5d4be; }
.alert-error   { background: var(--error-bg); color: var(--error); border: 1px solid #dbb5b5; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid #e8d694; }
.alert-info    { background: var(--info-bg); color: var(--info); border: 1px solid #a3c1e0; }

/* ============ STAT CARDS ============ */
.stat-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
}
.stat-card .stat-label {
  font-size: 12px;
  color: var(--warm-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}
.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  margin-top: 4px;
}

/* ============ TABLES ============ */
.s-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.s-table thead { background: var(--parchment); }
.s-table th {
  padding: 12px 16px;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.s-table td {
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
}
.s-table tbody tr:hover { background: rgba(196,162,101,.04); }

/* ============ ADMIN HEADER ============ */
.admin-header {
  background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 50%, #0d0d0d 100%);
  border-bottom: 2px solid var(--gold);
  color: #fff;
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.admin-header .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.admin-header .nav-link {
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all .2s;
  letter-spacing: 0.3px;
}
.admin-header .nav-link:hover,
.admin-header .nav-link.active {
  color: var(--gold-light);
  background: rgba(196,162,101,.1);
}
.admin-header .nav-link-danger {
  color: #ff6b6b;
}
.admin-header .nav-link-danger:hover {
  background: rgba(255,107,107,.1);
}

/* ============ ADMIN SIDEBAR (Mobile) ============ */
.admin-sidebar {
  background: linear-gradient(180deg, #0d0d0d 0%, #1a1a1a 100%);
  border-right: 2px solid var(--gold);
}
.admin-sidebar .sidebar-link {
  display: block;
  padding: 12px 20px;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: 14px;
  transition: all .2s;
  border-left: 3px solid transparent;
}
.admin-sidebar .sidebar-link:hover,
.admin-sidebar .sidebar-link.active {
  color: var(--gold-light);
  background: rgba(196,162,101,.08);
  border-left-color: var(--gold);
}

/* ============ PIX MODAL ============ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.modal-backdrop.show { display: flex; }
.modal-content {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 95%;
  max-width: 420px;
  border-top: 3px solid var(--gold);
  box-shadow: var(--shadow-lg);
}
.modal-content h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0 0 16px;
}

/* ============ FLOATING WHATSAPP ============ */
.wa-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9998;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37,211,102,.35);
  transition: transform .2s;
  text-decoration: none;
}
.wa-float:hover { transform: scale(1.08); }
.wa-float i { font-size: 30px; color: #fff; }

/* ============ DECORATIVE DIVIDER ============ */
.ornament {
  text-align: center;
  color: var(--gold-muted);
  font-size: 18px;
  letter-spacing: 8px;
  margin: 20px 0;
  opacity: 0.5;
}

/* ============ FINANCIAL ============ */
.finance-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.finance-income {
  border-left: 4px solid var(--success);
}
.finance-expense {
  border-left: 4px solid var(--error);
}
.finance-balance {
  border-left: 4px solid var(--gold);
}

/* ============ TRANSITIONS ============ */
.fade-in {
  animation: fadeIn .4s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ PRINT ============ */
@media print {
  .sabrina-header, .admin-header, .wa-float, .no-print { display: none !important; }
  body { background: #fff; }
  body::before { display: none; }
}

/* ============ DATE PICKER  PREMIUM SABRINA STYLE ============ */
input[type="date"].s-field,
input[type="date"].date-picker {
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23C4A265' viewBox='0 0 16 16'%3E%3Cpath d='M11 6.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1zm-3 0a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1A.5.5 0 0 1 8 7.5v-1zm-5 3a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1zm3 0a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1z'/%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E%3C/svg%3E") no-repeat right 14px center;
  background-size: 16px;
  color-scheme: light;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
}
input[type="date"].s-field:focus,
input[type="date"].date-picker:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(196,162,101,.15);
}
input[type="date"].s-field::-webkit-calendar-picker-indicator,
input[type="date"].date-picker::-webkit-calendar-picker-indicator {
  opacity: 0;
  cursor: pointer;
  position: absolute;
  right: 0;
  width: 42px;
  height: 100%;
}
/* Wrapper precisa ser relative para o indicator overlay */
.date-wrap { position: relative; }

/* ============ BADGE/STATUS  LIVRE E PENDENTE MELHORADOS ============ */
.badge-confirmed {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #b5d4be;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.badge-confirmed::before { content: ""; font-size: 8px; color: var(--success); }

.badge-pending {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid #e8d694;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  animation: pulse-amber 2s infinite;
}
.badge-pending::before { content: ""; font-size: 8px; color: var(--warning); }

.badge-canceled {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid #dbb5b5;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.badge-canceled::before { content: ""; font-size: 8px; color: var(--error); }

@keyframes pulse-amber {
  0%, 100% { opacity: 1; }
  50%       { opacity: .75; }
}

/* ============ SLOT  LIVRE MAIS VISÍVEL ============ */
.slot.free {
  background: linear-gradient(135deg, #e8f5ec 0%, #d4edda 100%);
  border: 1.5px solid #85c99a;
  color: var(--success);
  font-weight: 700;
  letter-spacing: 0.3px;
}
.slot.free::after {
  content: " ";
  font-size: 11px;
  opacity: .7;
}
.slot.free:hover {
  background: linear-gradient(135deg, #d4edda 0%, #b8dfc5 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(74,124,89,.2);
}
.slot.pending {
  background: linear-gradient(135deg, #fef8e8 0%, #fdf0cc 100%);
  border: 1.5px solid #e8d694;
  color: var(--warning);
  font-weight: 600;
  font-style: italic;
}
.slot.ring {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(196,162,101,.15), 0 4px 16px rgba(196,162,101,.20);
}

/* ============ MONEY MASK VISUAL ============ */
.money-mask {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}
.money-mask:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(196,162,101,.15);
}

/* ============ AJAX LOADING INDICATOR ============ */
.slots-loading { opacity: .5; pointer-events: none; transition: opacity .3s; }

/* ============ PIX LOADING ============ */
.pix-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 12px;
  color: var(--warm-gray);
  text-align: center;
}

.pix-spinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 3px solid rgba(196,162,101,.2);
  border-top-color: var(--gold);
  animation: pix-spin .9s linear infinite;
}

@keyframes pix-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============================================================
   PREMIUM MOBILE RESPONSIVE — SMARTPHONE-FIRST
   ============================================================ */

/* ── Touch targets & global mobile polish ── */
@media (max-width: 768px) {
  /* Base spacing & typography */
  body { font-size: 15px; }
  h1 { font-size: 1.4rem !important; }
  h2 { font-size: 1.15rem !important; }
  h3 { font-size: 1rem !important; }

  /* Stat cards — compact on mobile */
  .stat-card { padding: 14px; }
  .stat-card .stat-value { font-size: 1.5rem; }
  .stat-card .stat-label { font-size: 11px; }

  /* Cards — less padding on mobile */
  .s-card { padding: 16px; border-radius: var(--radius); }
  .s-card h2 { font-size: 1.1rem; }

  /* Buttons — minimum 44px touch target */
  .btn-gold, .btn-dark, .btn-outline-gold {
    min-height: 44px;
    padding: 12px 20px;
    font-size: 14px;
    width: 100%;
    justify-content: center;
  }
  .btn-sm { min-height: 40px; padding: 10px 16px; font-size: 13px; }

  /* Form fields — larger touch targets */
  .s-field {
    min-height: 44px;
    font-size: 16px; /* prevents iOS zoom on focus */
    padding: 12px 14px;
  }
  select.s-field { font-size: 16px; }
  .s-label { font-size: 13px; margin-bottom: 6px; }

  /* Tables — mobile-friendly */
  .s-table { font-size: 13px; }
  .s-table th { padding: 10px 12px; font-size: 11px; letter-spacing: 0.3px; }
  .s-table td { padding: 10px 12px; }

  /* Chips & badges inline on mobile */
  .s-chip { padding: 5px 10px; font-size: 11px; }
  .badge { padding: 4px 10px; font-size: 11px; }

  /* Alert boxes */
  .alert { padding: 12px 14px; font-size: 13px; }

  /* Modal fixes for mobile */
  .modal-content { padding: 20px; width: 95%; max-width: 100%; margin: 16px; border-radius: var(--radius); }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-content { border-radius: var(--radius-lg) var(--radius-lg) 0 0; margin: 0; max-height: 90vh; overflow-y: auto; }

  /* WhatsApp fab — slightly smaller on mobile */
  .wa-float { width: 52px; height: 52px; right: 14px; bottom: 14px; }
  .wa-float i { font-size: 26px; }

  /* Finance cards — compact */
  .finance-card { padding: 16px; }

  /* Main content padding */
  main.max-w-6xl, main.max-w-5xl, main.max-w-4xl {
    padding-left: 14px !important;
    padding-right: 14px !important;
    padding-top: 16px !important;
  }

  /* Grids — all multi-column grids stack */
  .fin-grid, .fin-charts, .fin-charts2, .fin-grid3 {
    grid-template-columns: 1fr !important;
  }

  /* KPI cards grid — 2 columns on mobile for compactness */
  [style*="repeat(auto-fit,minmax(200px"] { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  [style*="repeat(auto-fit,minmax(180px"] { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  [style*="repeat(auto-fit,minmax(170px"] { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  [style*="repeat(auto-fit,minmax(160px"] { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }

  /* Chart containers — limit height on mobile for better proportions */
  canvas { max-height: 200px; }
}

/* ── Extra small devices (< 400px like iPhone SE) ── */
@media (max-width: 400px) {
  h1 { font-size: 1.25rem !important; }
  .stat-card .stat-value { font-size: 1.3rem; }

  /* KPI cards single column for very small screens */
  [style*="repeat(auto-fit,minmax(200px"] { grid-template-columns: 1fr !important; }
  [style*="repeat(auto-fit,minmax(180px"] { grid-template-columns: 1fr !important; }
  [style*="repeat(auto-fit,minmax(170px"] { grid-template-columns: 1fr !important; }
  [style*="repeat(auto-fit,minmax(160px"] { grid-template-columns: 1fr !important; }

  .btn-gold, .btn-dark, .btn-outline-gold { padding: 12px 16px; font-size: 13px; }
}

/* ── Chart.js responsive legend on mobile ── */
@media (max-width: 640px) {
  .slots-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .slot { padding: 12px 8px; font-size: 13px; }

  /* Table horizontal scroll wrapper */
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -14px; padding: 0 14px; }
}

/* ── Smooth mobile scroll & native feel ── */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices — use active instead */
  .btn-gold:hover, .btn-dark:hover, .btn-outline-gold:hover { transform: none; }
  .btn-gold:active { transform: scale(0.97); opacity: 0.9; }
  .btn-dark:active { transform: scale(0.97); opacity: 0.9; }
  .btn-outline-gold:active { transform: scale(0.97); opacity: 0.9; }
  .slot.free:hover { transform: none; }
  .slot.free:active { transform: scale(0.95); }

  /* Smooth scrolling for all scroll containers */
  * { -webkit-overflow-scrolling: touch; }

  /* Better tap highlighting */
  a, button, .slot, .service-option { -webkit-tap-highlight-color: rgba(196,162,101,.15); }

  /* Prevent text selection on interactive elements */
  .sidebar-link, .btn-gold, .btn-dark, .slot, .service-option {
    -webkit-user-select: none; user-select: none;
  }

  /* Checkbox/radio larger target */
  input[type="checkbox"], input[type="radio"] {
    width: 20px; height: 20px;
    min-width: 20px; min-height: 20px;
  }
}

/* ── Utility: scroll-hint for tables (visual indicator) ── */
.table-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.table-scroll-wrap::after {
  content: '';
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 30px;
  background: linear-gradient(to left, rgba(250,246,240,.9), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}
.table-scroll-wrap.has-scroll::after { opacity: 1; }

/* ── Pull-to-feel native iOS/Android overscroll ── */
@supports (-webkit-touch-callout: none) {
  body { overscroll-behavior-y: contain; }
}

/* ── Mobile-specific financial page improvements ── */
@media (max-width: 768px) {
  /* Tabs: full-width scrollable */
  [style*="border-bottom:2px solid var(--border-light)"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
    gap: 0 !important;
  }
  [style*="border-bottom:2px solid var(--border-light)"] > a {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 10px 16px !important;
    font-size: 13px !important;
  }

  /* Delete/action buttons — maintain inline */
  .btn-danger-sm { min-height: 36px; min-width: 36px; padding: 6px 10px; }

  /* Progress bars — thicker for mobile visibility */
  [style*="height:5px;background:#eee"],
  [style*="height:6px;background:#eee"] {
    height: 8px !important;
  }
}
