/* ─────────────────────────────────────────────────────────────
   ShineAuto — Main Stylesheet (Fully Responsive)
   ─────────────────────────────────────────────────────────────── */

/* ── CSS VARIABLES ── */
:root {
  --primary:       #0f172a;
  --primary-light: #e8f0fe;
  --accent:        #06b6d4;
  --accent-dark:   #0891b2;
  --accent-muted:  #e0f7fa;
  --accent-light:  #f0fdff;
  --gradient:      linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  --white:         #ffffff;
  --gray-50:       #f8fafc;
  --gray-100:      #f1f5f9;
  --gray-200:      #e2e8f0;
  --gray-300:      #cbd5e1;
  --gray-400:      #94a3b8;
  --gray-500:      #64748b;
  --gray-600:      #475569;
  --gray-700:      #334155;
  --gray-800:      #1e293b;
  --gray-900:      #0f172a;
  --border:        #e2e8f0;
  --danger:        #ef4444;
  --warning:       #f59e0b;
  --success:       #22c55e;
  --shadow:        0 1px 4px rgba(15,23,42,.07),0 2px 8px rgba(15,23,42,.04);
  --shadow-md:     0 4px 16px rgba(15,23,42,.10),0 1px 4px rgba(15,23,42,.06);
  --shadow-lg:     0 12px 32px rgba(15,23,42,.14),0 3px 8px rgba(15,23,42,.06);
  --shadow-glass:  0 8px 32px rgba(15,23,42,.18);
  --radius:        12px;
  --radius-sm:     8px;
  --topbar-h:      56px;
  --sidebar-w:     240px;
  --font-body:     'Inter', system-ui, sans-serif;
  --font-head:     'Plus Jakarta Sans', system-ui, sans-serif;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-body); background: var(--gray-50); color: var(--gray-800); font-size: 15px; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1,h2,h3,h4,h5,h6 { margin: 0 0 .5rem; line-height: 1.25; }
p { margin: 0 0 .75rem; }
.text-muted { color: var(--gray-400); }
.required { color: var(--danger); }
.separator { height: 1px; background: var(--gray-100); margin: 1.25rem 0; }
.mt-3 { margin-top: 1rem; }
.mb-3 { margin-bottom: 1rem; }
.gap-1 { gap: .5rem; }
.d-flex { display: flex; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.opacity-50 { opacity: .5; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.fw-600 { font-weight: 600; }

/* ── ANIMATIONS ── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes skeleton-wave { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes pulse-green { 0%,100% { box-shadow: 0 0 0 3px rgba(34,197,94,.25); } 50% { box-shadow: 0 0 0 7px rgba(34,197,94,.08); } }
@keyframes btn-ripple { to { transform: scale(3); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

.animate-in    { animation: fadeInUp .35s cubic-bezier(.22,.68,0,1.2) both; }
.animate-fade  { animation: fadeIn .3s ease both; }
.animate-slide { animation: slideInRight .3s ease both; }
.stagger-1 { animation-delay: .05s; }
.stagger-2 { animation-delay: .10s; }
.stagger-3 { animation-delay: .15s; }
.stagger-4 { animation-delay: .20s; }
.stagger-5 { animation-delay: .25s; }

/* ── LAYOUT ── */
.content-wrapper { flex: 1; display: flex; flex-direction: column; }
.layout-with-sidebar { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.main-content { flex: 1; min-width: 0; max-width: calc(100vw - var(--sidebar-w)); padding: 1.75rem 2rem; overflow-x: hidden; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.page-title { font-family: var(--font-head); font-size: 1.45rem; font-weight: 800; color: var(--gray-900); }
.page-subtitle { font-size: .85rem; color: var(--gray-500); margin-top: .2rem; }
.page-header .btn, .page-header form, .page-header > * { flex-shrink: 0; }

/* ── TOPBAR ── */
.topbar { position: sticky; top: 0; z-index: 200; height: var(--topbar-h); background: var(--primary); display: flex; align-items: center; box-shadow: 0 2px 12px rgba(0,0,0,.22); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0 1rem; gap: .75rem; }
.topbar-brand { display: flex; align-items: center; gap: .5rem; font-family: var(--font-head); font-size: 1.1rem; font-weight: 800; color: white; text-decoration: none; letter-spacing: -.02em; flex-shrink: 0; }
.topbar-brand:hover { text-decoration: none; }
.brand-icon { color: var(--accent); font-size: 1.2rem; }
.topbar-left  { display: flex; align-items: center; gap: .75rem; }
.topbar-right { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.topbar-link  { color: rgba(255,255,255,.75); font-size: .875rem; text-decoration: none; transition: color .15s; }
.topbar-link:hover { color: white; text-decoration: none; }
.topbar-user  { color: rgba(255,255,255,.8); font-size: .85rem; font-weight: 600; }
.topbar-logout{ font-size: .82rem; }
.hamburger { display: none; flex-direction: column; gap: 4.5px; background: none; border: none; cursor: pointer; padding: .45rem; }
.hamburger span { display: block; width: 22px; height: 2px; background: white; border-radius: 2px; transition: all .25s; }
.notif-bell { position: relative; color: rgba(255,255,255,.75); font-size: 1.15rem; text-decoration: none; }
.notif-dot { position: absolute; top: -4px; right: -4px; background: var(--danger); color: white; font-size: .62rem; font-weight: 700; width: 17px; height: 17px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--primary); }
.topbar.simple { background: white; border-bottom: 1px solid var(--border); }
.topbar.simple .topbar-brand { color: var(--gray-900); }

/* ── SIDEBAR ── */
.sidebar { width: var(--sidebar-w); background: white; border-right: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { padding: 1.25rem 1rem 1rem; border-bottom: 1px solid var(--gray-100); }
.sidebar-avatar { width: 42px; height: 42px; background: var(--gradient); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: 1rem; margin-bottom: .5rem; }
.user-name { font-weight: 700; font-size: .9rem; color: var(--gray-900); }
.user-role { font-size: .74rem; color: var(--gray-500); text-transform: capitalize; }
.sidebar-nav { padding: .5rem 0; flex: 1; }
.sidebar-nav li a { display: flex; align-items: center; gap: .65rem; padding: .58rem 1rem; font-size: .875rem; color: var(--gray-700); text-decoration: none; border-radius: 0; transition: background .15s, color .15s; position: relative; }
.sidebar-nav li a:hover { background: var(--gray-50); color: var(--gray-900); text-decoration: none; }
.sidebar-nav li a.active { background: var(--accent-muted); color: var(--accent-dark); font-weight: 600; }
.sidebar-nav li a.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); border-radius: 0 3px 3px 0; }
.nav-icon { font-size: 1rem; width: 1.15rem; text-align: center; flex-shrink: 0; }
.nav-group-label { display: block; padding: .9rem 1rem .3rem; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--gray-400); }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 140; backdrop-filter: blur(2px); }

/* ── STATS GRID ── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.35rem; box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s; animation: fadeInUp .4s ease both; display: flex; align-items: center; gap: .85rem; }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon { width: 42px; height: 42px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.stat-icon.green { background: #dcfce7; }
.stat-icon.blue  { background: #dbeafe; }
.stat-icon.red   { background: #fee2e2; }
.stat-icon.yellow{ background: #fef9c3; }
.stat-label { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--gray-400); margin-bottom: .35rem; }
.stat-value { font-family: var(--font-head); font-size: 1.85rem; font-weight: 800; color: var(--gray-900); line-height: 1; }
.stat-sub   { font-size: .78rem; color: var(--gray-500); margin-top: .4rem; }
.stat-trend { font-size: .78rem; font-weight: 700; }
.stat-trend.up   { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ── CARDS ── */
.card { background: white; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 1.25rem; transition: box-shadow .2s; }
.card:last-child { margin-bottom: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.25rem; border-bottom: 1px solid var(--gray-100); background: var(--gray-50); gap: .75rem; flex-wrap: wrap; }
.card-title { font-family: var(--font-head); font-size: .95rem; font-weight: 700; color: var(--gray-800); }
.card-body { padding: 1.25rem; }
.card-footer { padding: .85rem 1.25rem; border-top: 1px solid var(--gray-100); background: var(--gray-50); }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1.15rem; border-radius: var(--radius-sm); font-size: .875rem; font-weight: 600; cursor: pointer; border: 1.5px solid transparent; transition: all .18s; text-decoration: none; white-space: nowrap; font-family: var(--font-body); line-height: 1.4; flex-shrink: 0; position: relative; overflow: hidden; user-select: none; }
.btn:hover { text-decoration: none; }
.btn-primary   { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: #1e293b; }
.btn-accent    { background: var(--accent); color: white; border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border-color: var(--gray-200); }
.btn-secondary:hover { background: var(--gray-200); color: var(--gray-900); }
.btn-success   { background: #16a34a; color: white; }
.btn-success:hover { background: #15803d; }
.btn-warning   { background: #d97706; color: white; }
.btn-warning:hover { background: #b45309; }
.btn-danger    { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-outline-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger); color: white; }
.btn-lg { padding: .7rem 1.45rem; font-size: .95rem; }
.btn-sm { padding: .35rem .8rem; font-size: .8rem; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-anim:not(:disabled):active { transform: scale(.97); }
.btn-anim::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.22); border-radius: inherit; opacity: 0; transition: opacity .25s; }
.btn-anim:hover::after { opacity: 1; }
.btn-block { width: 100%; }

/* ── FORMS ── */
.form-group  { margin-bottom: 1rem; }
.form-label  { display: block; font-size: .82rem; font-weight: 700; color: var(--gray-700); margin-bottom: .4rem; letter-spacing: .01em; }
.form-control { width: 100%; padding: .55rem .85rem; border: 1.5px solid var(--gray-300); border-radius: var(--radius-sm); font-size: .9rem; font-family: var(--font-body); background: white; color: var(--gray-800); transition: border-color .15s, box-shadow .15s; outline: none; }
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(6,182,212,.14); }
.form-control:disabled, .form-control[readonly] { background: var(--gray-50); cursor: not-allowed; color: var(--gray-500); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-hint  { font-size: .78rem; color: var(--gray-500); margin-top: .3rem; }
.form-check { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.form-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; padding: .22rem .65rem; border-radius: 99px; font-size: .74rem; font-weight: 700; line-height: 1.4; white-space: nowrap; letter-spacing: .01em; }
.badge-primary   { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1e40af; }
.badge-accent    { background: var(--accent-muted); color: var(--accent-dark); }
.badge-success   { background: #dcfce7; color: #15803d; }
.badge-warning   { background: #fef9c3; color: #a16207; }
.badge-danger    { background: #fee2e2; color: #dc2626; }
.badge-info      { background: #e0e7ff; color: #4338ca; }
.badge-secondary { background: var(--gray-100); color: var(--gray-600); }
.badge-navy      { background: var(--primary); color: white; }

/* ── TABLES ── */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; min-width: 480px; }
thead th { background: var(--gray-50); padding: .75rem 1rem; text-align: left; font-size: .71rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--gray-500); border-bottom: 2px solid var(--border); white-space: nowrap; font-family: var(--font-body); }
tbody td { padding: .85rem 1rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f8fbff; }
.table-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }

/* ── ALERTS ── */
.alert { padding: .9rem 1.1rem; border-radius: var(--radius-sm); font-size: .875rem; margin-bottom: .75rem; border: 1px solid transparent; display: flex; align-items: flex-start; gap: .5rem; animation: fadeInUp .3s ease; }
.alert-success { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.alert-danger   { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.alert-warning  { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.alert-info     { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.global-flash   { margin: 1rem; border-radius: var(--radius); }

/* ── MODALS ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 1000; align-items: center; justify-content: center; padding: 1rem; backdrop-filter: blur(5px); }
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }
.modal { background: var(--white); border-radius: var(--radius); max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 60px rgba(15,23,42,.22); animation: fadeInUp .25s cubic-bezier(.22,.68,0,1.2); }
.modal-lg { max-width: 780px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--border); background: var(--gray-50); border-radius: var(--radius) var(--radius) 0 0; }
.modal-title { font-family: var(--font-head); font-size: 1rem; font-weight: 700; color: var(--gray-900); }
.modal-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--gray-400); line-height: 1; border-radius: 6px; padding: .15rem .35rem; transition: all .15s; }
.modal-close:hover { color: var(--gray-800); background: var(--gray-200); }
.modal-body { padding: 1.35rem; }
.modal-footer { padding: .9rem 1.3rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: .5rem; background: var(--gray-50); border-radius: 0 0 var(--radius) var(--radius); }

/* ── TABS ── */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab-btn { background: none; border: none; padding: .75rem 1.15rem; font-size: .875rem; font-weight: 600; color: var(--gray-500); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -2px; white-space: nowrap; transition: .15s; font-family: var(--font-body); }
.tab-btn:hover { color: var(--gray-900); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .2s ease; }
.tabs-wrapper { overflow: visible; }

/* ── HERO ── */
.hero { background: var(--gradient); color: white; padding: 5rem 1rem 5.5rem; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(6,182,212,.2), transparent); pointer-events: none; }
.hero-content { max-width: 720px; margin: 0 auto; position: relative; z-index: 1; }
.hero h1 { font-family: var(--font-head); font-size: clamp(1.8rem, 4.5vw, 3.1rem); font-weight: 900; margin-bottom: 1.1rem; letter-spacing: -.04em; animation: fadeInUp .5s ease both; }
.hero p { font-size: 1.1rem; opacity: .82; margin-bottom: 2.5rem; animation: fadeInUp .5s .1s ease both; }
.hero-badge { display: inline-flex; align-items: center; gap: .5rem; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 99px; padding: .38rem .95rem; font-size: .82rem; font-weight: 600; margin-bottom: 1.5rem; animation: fadeIn .5s ease; }
.hero-search { display: flex; align-items: center; background: white; border-radius: 99px; padding: .4rem .5rem .4rem 1.35rem; gap: .5rem; box-shadow: 0 8px 32px rgba(0,0,0,.2); max-width: 580px; margin: 0 auto 1rem; animation: fadeInUp .5s .2s ease both; }
.hero-search span { font-size: 1.1rem; }
.hero-search input { border: none; outline: none; flex: 1; font-size: .95rem; color: var(--gray-800); background: transparent; padding: .3rem 0; font-family: var(--font-body); min-width: 0; }
.hero-stats { display: flex; justify-content: center; gap: 2.5rem; margin-top: 2.5rem; flex-wrap: wrap; }
.hero-stat-value { font-family: var(--font-head); font-size: 1.8rem; font-weight: 900; color: var(--accent); }
.hero-stat-label { font-size: .8rem; opacity: .65; }

/* ── SERVICE TYPES ── */
.service-types { padding: 4rem 1rem; background: var(--white); }
.section-title { text-align: center; font-family: var(--font-head); font-size: clamp(1.3rem, 2.5vw, 1.8rem); font-weight: 800; color: var(--gray-900); margin-bottom: .5rem; }
.section-subtitle { text-align: center; color: var(--gray-500); font-size: .95rem; margin-bottom: 2.5rem; }
.service-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; max-width: 860px; margin: 0 auto; }
.service-type-card { position: relative; border: 2px solid var(--border); border-radius: var(--radius); padding: 2.5rem 1.75rem; text-align: center; transition: all .25s; cursor: pointer; }
.service-type-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.service-type-card.primary-service { border-color: var(--accent); background: linear-gradient(135deg, #f0fdff, var(--accent-muted)); }
.service-icon-big { font-size: 3.5rem; margin-bottom: 1.25rem; }
.service-type-card h3 { font-family: var(--font-head); font-size: 1.25rem; font-weight: 800; margin-bottom: .5rem; color: var(--gray-900); }
.service-type-card p { font-size: .9rem; color: var(--gray-600); }
.recommended { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--gradient); color: white; font-size: .72rem; font-weight: 700; padding: .2rem .75rem; border-radius: 99px; white-space: nowrap; }

/* ── PROVIDER GRID ── */
.provider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.provider-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: all .22s; box-shadow: var(--shadow); }
.provider-card:hover { box-shadow: 0 14px 32px rgba(15,23,42,.11); transform: translateY(-3px); border-color: var(--accent); }
.provider-card-img { height: 170px; background: linear-gradient(135deg, var(--gray-100), var(--gray-200)); display: flex; align-items: center; justify-content: center; font-size: 3.5rem; overflow: hidden; position: relative; }
.provider-card-img img { width: 100%; height: 100%; object-fit: cover; }
.provider-distance-badge { position: absolute; top: .6rem; right: .6rem; background: var(--primary); color: white; font-size: .72rem; font-weight: 700; padding: .2rem .6rem; border-radius: 99px; }
.provider-card-body { padding: 1.1rem; }
.provider-name { font-family: var(--font-head); font-size: 1rem; font-weight: 700; margin-bottom: .25rem; color: var(--gray-900); }
.provider-address { font-size: .82rem; color: var(--gray-500); margin-bottom: .4rem; }
.provider-rating { display: flex; align-items: center; gap: .35rem; font-size: .875rem; color: var(--gray-700); }
.stars { color: #f59e0b; }
.provider-price { font-family: var(--font-head); font-weight: 700; color: var(--accent); font-size: .95rem; }
.provider-tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.provider-actions { display: flex; gap: .5rem; margin-top: .85rem; }
.provider-actions .btn { flex: 1; min-width: 0; }

/* Online/offline badge on provider cards */
.partner-status-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; padding: .18rem .55rem; border-radius: 99px; }
.partner-online  { background: #dcfce7; color: #15803d; }
.partner-offline { background: #fee2e2; color: #dc2626; }
.partner-online::before  { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; animation: pulse-green 2s infinite; }
.partner-offline::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #ef4444; }

/* ── SLOTS ── */
.slots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: .5rem; }
.slot-btn { padding: .55rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: .82rem; font-weight: 600; cursor: pointer; background: var(--white); transition: all .15s; color: var(--gray-700); text-align: center; font-family: var(--font-body); }
.slot-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.slot-btn.selected { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 2px 8px rgba(15,23,42,.2); }
.slot-btn.slot-blocked { background: var(--gray-100); color: var(--gray-400); cursor: not-allowed; text-decoration: line-through; }
.slot-btn.slot-booked  { background: #fff1f2; color: var(--danger); cursor: not-allowed; }
.slot-btn:disabled { cursor: not-allowed; opacity: .6; }

/* ── AUTH PAGES ── */
.auth-page { min-height: calc(100vh - var(--topbar-h)); display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; background: var(--gradient); }
.auth-card { background: rgba(255,255,255,.98); border-radius: 18px; padding: 2.75rem; width: 100%; max-width: 440px; box-shadow: 0 30px 60px rgba(15,23,42,.25); animation: fadeInUp .4s cubic-bezier(.22,.68,0,1.2); }
.auth-logo { text-align: center; margin-bottom: 1.75rem; }
.logo-mark { font-size: 2.75rem; margin-bottom: .5rem; }
.logo-name { font-family: var(--font-head); font-size: 1.4rem; font-weight: 900; color: var(--primary); letter-spacing: -.03em; }
.logo-tagline { font-size: .82rem; color: var(--gray-400); margin-top: .25rem; }
.auth-title { font-family: var(--font-head); font-size: 1.45rem; font-weight: 800; text-align: center; margin-bottom: .3rem; color: var(--gray-900); }
.auth-subtitle { color: var(--gray-500); font-size: .875rem; text-align: center; margin-bottom: 1.75rem; }
.auth-footer { text-align: center; font-size: .875rem; color: var(--gray-500); margin-top: 1.25rem; }
.auth-divider { text-align: center; color: var(--gray-400); font-size: .82rem; margin: 1rem 0; position: relative; }
.auth-divider::before, .auth-divider::after { content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--border); }
.auth-divider::before { left: 0; } .auth-divider::after { right: 0; }

/* ── CHART ── */
.chart-container { display: flex; align-items: flex-end; gap: .4rem; height: 160px; padding: .5rem; background: var(--gray-50); border-radius: var(--radius-sm); overflow-x: auto; }
.chart-bar { flex: 1; min-width: 28px; background: linear-gradient(180deg, var(--accent), #0891B2); border-radius: 5px 5px 0 0; position: relative; cursor: pointer; transition: opacity .15s; min-height: 4px; }
.chart-bar:hover { opacity: .8; }
.chart-tooltip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--primary); color: white; font-size: .72rem; padding: .3rem .6rem; border-radius: 5px; white-space: nowrap; z-index: 10; }
.chart-bar:hover .chart-tooltip { display: block; }

/* ── PROGRESS BAR ── */
.progress { height: 6px; background: var(--gray-200); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent), #6366f1); border-radius: 99px; transition: width .6s ease; }

/* ── TICKETS ── */
.ticket-thread { padding: 1rem 1.25rem; display: grid; gap: .75rem; max-height: 400px; overflow-y: auto; background: var(--gray-50); }
.ticket-message { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem; }
.ticket-message.staff { background: #eff6ff; border-color: #bfdbfe; }
.ticket-message-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .35rem; gap: .5rem; flex-wrap: wrap; }
.ticket-sender { font-weight: 700; font-size: .85rem; }
.ticket-time { font-size: .75rem; color: var(--gray-400); }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 4rem 1.5rem; color: var(--gray-500); animation: fadeIn .3s ease; }
.empty-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: .3; }
.empty-state h3 { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; margin-bottom: .5rem; color: var(--gray-600); }
.empty-state p { font-size: .875rem; }

/* ── FILTER BAR ── */
.filter-bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .85rem 1rem; box-shadow: var(--shadow); }

/* ── SEARCH BAR ── */
.search-bar { position: relative; flex: 1; min-width: 140px; }
.search-bar .search-icon { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); font-size: .9rem; color: var(--gray-400); pointer-events: none; }
.search-bar .form-control { padding-left: 2.4rem; }

/* City search autocomplete */
.city-search-wrap { position: relative; }
.city-autocomplete { position: absolute; top: 100%; left: 0; right: 0; background: white; border: 1.5px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); z-index: 300; max-height: 220px; overflow-y: auto; display: none; }
.city-autocomplete.open { display: block; animation: fadeInUp .15s ease; }
.city-autocomplete-item { padding: .6rem .9rem; font-size: .875rem; cursor: pointer; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); transition: background .12s; }
.city-autocomplete-item:last-child { border-bottom: none; }
.city-autocomplete-item:hover, .city-autocomplete-item.active { background: var(--accent-light); color: var(--accent-dark); }
.city-autocomplete-item small { display: block; font-size: .74rem; color: var(--gray-400); }

/* ── QR DISPLAY ── */
.qr-display { padding: 1.25rem; background: white; display: flex; align-items: center; justify-content: center; }
.qr-display img { max-width: 180px; max-height: 180px; object-fit: contain; }

/* ── TOGGLE SWITCH ── */
.toggle-switch { display: flex; align-items: center; gap: .75rem; cursor: pointer; user-select: none; }
.toggle-switch input { display: none; }
.toggle-track { width: 42px; height: 24px; background: var(--gray-300); border-radius: 99px; position: relative; transition: background .2s; flex-shrink: 0; }
.toggle-track::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; background: white; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle-switch input:checked + .toggle-track { background: var(--success); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(18px); }

/* ── BOOKING DETAIL ROWS ── */
.bk-detail-row { display: flex; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--gray-100); align-items: flex-start; }
.bk-detail-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-400); min-width: 90px; padding-top: .15rem; }

/* ── PHOTO GALLERY ── */
.photo-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .65rem; }
.photo-thumb { border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1; cursor: pointer; position: relative; background: var(--gray-100); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.photo-thumb:hover img { transform: scale(1.06); }

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE — Mobile & Tablet
   ─────────────────────────────────────────────────────────────── */

/* ── TABLET (≤ 1024px) ── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .main-content { padding: 1.5rem; }
}

/* ── SMALL TABLET / LARGE MOBILE (≤ 768px) ── */
@media (max-width: 768px) {
  /* Sidebar becomes off-canvas slide-in */
  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: -100%;
    bottom: 0;
    width: 80vw;
    max-width: 280px;
    z-index: 150;
    transition: left .28s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,.18);
  }
  .sidebar.open { left: 0; }
  .sidebar-overlay.open { display: block; animation: fadeIn .2s ease; }
  .hamburger { display: flex; }
  .layout-with-sidebar { min-height: auto; }
  .main-content {
    max-width: 100vw;
    padding: 1rem;
  }

  /* Tables — shrink fonts and padding */
  table { min-width: 380px; font-size: .82rem; }
  thead th { padding: .6rem .7rem; }
  tbody td { padding: .65rem .7rem; }

  /* Stats grid — 2 columns */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .stat-value { font-size: 1.45rem; }

  /* Cards */
  .card-body { padding: 1rem; }
  .card-header { padding: .8rem 1rem; }

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

  /* Hero adjustments */
  .hero { padding: 3.5rem 1rem 4rem; }
  .hero-stats { gap: 1.5rem; }
  .hero-stat-value { font-size: 1.4rem; }
  .hero-search { max-width: 100%; }

  /* Service type grid */
  .service-type-grid { grid-template-columns: 1fr; max-width: 440px; }
  .service-type-card { padding: 1.5rem 1.25rem; }

  /* Provider grid — single column on small screens */
  .provider-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .85rem; }

  /* Page header — stack vertically */
  .page-header { flex-direction: column; align-items: flex-start; gap: .5rem; margin-bottom: 1rem; }
  .page-title { font-size: 1.2rem; }
  .page-subtitle { font-size: .8rem; }

  /* Modals */
  .modal { max-height: 95vh; border-radius: var(--radius) var(--radius) 0 0; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-lg { max-width: 100%; }

  /* Auth card */
  .auth-card { padding: 2rem 1.5rem; }

  /* Filter bar */
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .btn { width: 100%; justify-content: center; }
}

/* ── MOBILE (≤ 480px) ── */
@media (max-width: 480px) {
  body { font-size: 14px; }
  .main-content { padding: .75rem; }

  /* Topbar — show only essential elements */
  .topbar-user { display: none; }
  .topbar-link.hide-mobile { display: none; }

  /* Stats — 2 col, smaller */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .stat-card { padding: .85rem .75rem; gap: .5rem; }
  .stat-value { font-size: 1.25rem; }
  .stat-label { font-size: .68rem; }

  /* Buttons — smaller on mobile */
  .btn { padding: .5rem .9rem; font-size: .82rem; }
  .btn-lg { padding: .65rem 1.15rem; font-size: .88rem; }
  .btn-sm { padding: .3rem .65rem; font-size: .76rem; }

  /* Table actions — stack them */
  .table-actions { flex-direction: column; gap: .25rem; }
  .table-actions .btn { width: 100%; font-size: .76rem; }

  /* Tabs — horizontally scrollable */
  .tab-btn { padding: .6rem .85rem; font-size: .82rem; }

  /* Slots grid — fewer columns */
  .slots-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: .4rem; }
  .slot-btn { font-size: .78rem; padding: .45rem; }

  /* Provider grid — single column */
  .provider-grid { grid-template-columns: 1fr; }

  /* Modal footer — stack buttons */
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; justify-content: center; }

  /* Card body padding */
  .card-body { padding: .85rem; }
  .card-header { padding: .7rem .85rem; }

  /* Revenue grid fix */
  .rev-grid,
  [style*="grid-template-columns:2fr 1fr"] { grid-template-columns: 1fr !important; }
}

/* ── EXTRA SMALL (≤ 360px) ── */
@media (max-width: 360px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 1.1rem; }
  .auth-card { padding: 1.5rem 1rem; }
}

/* ── Print ── */
@media print {
  .sidebar, .topbar, .page-header .btn, .modal-overlay { display: none !important; }
  .main-content { max-width: 100%; padding: 0; }
  .layout-with-sidebar { display: block; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
