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

:root {
  --green: #1a7f3c;
  --green-dark: #155f2d;
  --green-light: #22a14e;
  --amber: #f59e0b;
  --amber-dark: #d97706;
  --red: #ef4444;
  --blue: #3b82f6;
  --purple: #8b5cf6;
  --bg: #f0f4f0;
  --surface: #ffffff;
  --surface2: #f7faf7;
  --border: #d1e8d6;
  --text: #0f2218;
  --text-muted: #5a7a65;
  --sidebar-w: 260px;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(26,127,60,0.08);
  --shadow-lg: 0 8px 32px rgba(26,127,60,0.14);
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }

/* === TYPOGRAPHY === */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); font-weight: 700; }
h1 { font-size: 2.2rem; line-height: 1.2; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
a { color: var(--green); text-decoration: none; }

/* === LAYOUT === */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--text); color: #fff; position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; z-index: 100; transition: transform 0.3s; }
.main-content { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.page-content { padding: 28px 24px; max-width: 1400px; }

/* === SIDEBAR === */
.sidebar-brand { padding: 24px 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-brand h3 { font-family: var(--font-display); font-size: 1.2rem; color: #fff; display: flex; align-items: center; gap: 8px; }
.sidebar-brand .badge-plan { background: var(--amber); color: var(--text); font-size: 0.65rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; font-family: var(--font-body); }
.sidebar-nav { padding: 16px 12px; }
.nav-section-title { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,0.35); padding: 8px 8px 4px; margin-top: 8px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: rgba(255,255,255,0.72); font-size: 0.9rem; font-weight: 500; transition: all 0.15s; cursor: pointer; border: none; background: none; width: 100%; text-align: left; }
.nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-link.active { background: var(--green); color: #fff; }
.nav-link .icon { width: 18px; height: 18px; opacity: 0.8; flex-shrink: 0; }
.nav-link.active .icon { opacity: 1; }
/* Global icon size — prevents SVGs from rendering full-size */
svg.icon { width: 16px; height: 16px; flex-shrink: 0; vertical-align: middle; }
.btn svg.icon { width: 15px; height: 15px; }
.dropdown-item svg.icon { width: 15px; height: 15px; }
.empty-state svg { width: 48px !important; height: 48px !important; opacity: 0.35; display: block; margin: 0 auto 12px; }
.nav-badge { margin-left: auto; background: var(--amber); color: var(--text); font-size: 0.65rem; font-weight: 700; padding: 2px 7px; border-radius: 10px; }
.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,0.1); margin-top: auto; position: sticky; bottom: 0; background: var(--text); }

/* === TOPBAR === */
.topbar-left { display: flex; align-items: center; gap: 12px; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.topbar-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.user-pill { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 24px; padding: 6px 14px 6px 6px; cursor: pointer; }
.user-pill .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; }
.user-pill .name { font-size: 0.85rem; font-weight: 600; }
.role-chip { font-size: 0.7rem; background: var(--green); color: #fff; padding: 2px 8px; border-radius: 12px; font-weight: 600; }

/* === CARDS === */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-sm { padding: 14px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card-title { font-family: var(--font-display); font-size: 1rem; font-weight: 700; }

/* === STAT CARDS === */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--green); }
.stat-card.amber::before { background: var(--amber); }
.stat-card.red::before { background: var(--red); }
.stat-card.blue::before { background: var(--blue); }
.stat-card.purple::before { background: var(--purple); }
.stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-change { font-size: 0.75rem; font-weight: 600; margin-top: 8px; }
.stat-change.up { color: var(--green); }
.stat-change.down { color: var(--red); }

/* === TABLES === */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead { background: var(--surface2); }
th { padding: 11px 14px; text-align: left; font-weight: 700; font-family: var(--font-display); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }

/* === BADGES === */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.3px; white-space: nowrap; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f3f4f6; color: #374151; }
.badge-purple { background: #ede9fe; color: #5b21b6; }

/* === BUTTONS === */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 8px; font-weight: 600; font-size: 0.875rem; cursor: pointer; border: none; transition: all 0.15s; font-family: var(--font-body); white-space: nowrap; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 13px 28px; font-size: 1rem; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-amber { background: var(--amber); color: var(--text); }
.btn-amber:hover { background: var(--amber-dark); }
.btn-ghost { background: transparent; color: var(--green); border: 1px solid var(--green); }
.btn-ghost:hover { background: var(--green); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-icon { padding: 7px; border-radius: 6px; }

/* === FORMS === */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-control { width: 100%; padding: 10px 13px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 0.9rem; font-family: var(--font-body); background: var(--surface); color: var(--text); transition: border-color 0.15s; }
.form-control:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(26,127,60,0.1); }
.form-control::placeholder { color: #aaa; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%235a7a65'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 36px; }
textarea.form-control { min-height: 90px; resize: vertical; }

/* === MODAL === */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(4px); }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.25); animation: modalIn 0.25s ease; }
.modal-lg { max-width: 780px; }
@keyframes modalIn { from { transform: scale(0.92) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.modal-header { padding: 20px 24px 0; display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.modal-body { padding: 20px 24px 24px; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: 4px; }
.modal-close:hover { color: var(--text); background: var(--bg); }
.modal-footer { padding: 0 24px 20px; display: flex; gap: 10px; justify-content: flex-end; }

/* === TABS === */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn { padding: 9px 18px; font-size: 0.87rem; font-weight: 600; color: var(--text-muted); background: none; border: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.15s; font-family: var(--font-body); }
.tab-btn.active { color: var(--green); border-bottom-color: var(--green); }
.tab-btn:hover:not(.active) { color: var(--text); background: var(--bg); border-radius: 6px 6px 0 0; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* === ALERTS === */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 0.875rem; border-left: 4px solid; margin-bottom: 16px; }
.alert-success { background: #d1fae5; border-color: var(--green); color: #065f46; }
.alert-error { background: #fee2e2; border-color: var(--red); color: #991b1b; }
.alert-warning { background: #fef3c7; border-color: var(--amber); color: #92400e; }
.alert-info { background: #dbeafe; border-color: var(--blue); color: #1e40af; }

/* === SEARCH BAR === */
.search-bar { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1.5px solid var(--border); border-radius: 8px; padding: 6px 12px; }
.search-bar input { border: none; background: none; font-size: 0.875rem; width: 220px; font-family: var(--font-body); }
.search-bar input:focus { outline: none; }

/* === EMPTY STATE === */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state svg { width: 56px !important; height: 56px !important; margin-bottom: 12px; opacity: 0.4; }
.empty-state h4 { font-size: 1rem; margin-bottom: 6px; color: var(--text); }
.empty-state p { font-size: 0.875rem; }

/* === AVATAR === */
.avatar-circle { width: 36px; height: 36px; border-radius: 50%; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; font-family: var(--font-display); flex-shrink: 0; }
.avatar-circle.sm { width: 28px; height: 28px; font-size: 0.7rem; }
.avatar-circle.lg { width: 48px; height: 48px; font-size: 1rem; }

/* === PROGRESS BAR === */
.progress-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green); border-radius: 4px; transition: width 0.5s; }
.skill-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.skill-label { font-size: 0.8rem; width: 110px; color: var(--text-muted); flex-shrink: 0; }
.skill-bar .progress-bar { flex: 1; }
.skill-val { font-size: 0.8rem; font-weight: 700; width: 24px; text-align: right; }

/* === RATING STARS === */
.stars { display: flex; gap: 2px; }
.star { color: #d1d5db; font-size: 1rem; }
.star.filled { color: var(--amber); }

/* === CAMERA === */
.camera-container { border: 2px dashed var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface2); }
#camera-preview,#camera-preview-after { width: 100%; max-height: 240px; object-fit: cover; border-radius: 8px; background: #000; display: block; }
.camera-controls { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.captured-preview { width: 100%; border-radius: 8px; border: 2px solid var(--green); margin-top: 8px; }

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

/* === GRID LAYOUTS === */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }

/* === LOADER === */
.loader { display: flex; align-items: center; justify-content: center; padding: 32px; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--green); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === TOAST === */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 0.875rem; font-weight: 500; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-lg); animation: toastIn 0.3s ease; min-width: 260px; }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.toast.warning { background: var(--amber); color: var(--text); }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* === DROPDOWN === */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { position: absolute; top: calc(100% + 6px); right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 180px; z-index: 200; display: none; overflow: hidden; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 8px; padding: 9px 14px; font-size: 0.875rem; color: var(--text); cursor: pointer; transition: background 0.1s; }
.dropdown-item:hover { background: var(--bg); }
.dropdown-divider { height: 1px; background: var(--border); }

/* === SCROLL CUSTOM === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* === BOTTOM NAV (Mobile) === */
.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--border); z-index: 100; padding: 6px 0; }
.bottom-nav-items { display: flex; justify-content: space-around; }
.bnav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 12px; color: var(--text-muted); font-size: 0.65rem; font-weight: 600; cursor: pointer; border-radius: 8px; transition: color 0.15s; text-decoration: none; }
.bnav-item svg { width: 20px; height: 20px; }
.bnav-item.active { color: var(--green); }

/* === SECTION HEADER === */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.section-title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; }
.section-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }

/* === BOOKING CARD (Public) === */
.public-page { min-height: 100vh; background: #fff; }
.hero { background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%); color: #fff; padding: 80px 24px; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: 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='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }
.hero-content { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }
.hero h1 { font-size: 2.8rem; font-weight: 800; margin-bottom: 14px; }
.hero p { font-size: 1.15rem; opacity: 0.9; margin-bottom: 28px; }
.public-container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* === SLOT PICKER === */
.slots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px,1fr)); gap: 8px; }
.slot-btn { padding: 8px 4px; border: 1.5px solid var(--border); border-radius: 8px; text-align: center; cursor: pointer; font-size: 0.78rem; font-weight: 600; transition: all 0.15s; background: var(--surface); }
.slot-btn:hover:not(.booked) { border-color: var(--green); color: var(--green); }
.slot-btn.selected { background: var(--green); border-color: var(--green); color: #fff; }
.slot-btn.booked { background: var(--bg); color: var(--text-muted); cursor: not-allowed; opacity: 0.6; }

/* === MOBILE RESPONSIVE === */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .bottom-nav { display: block; }
  .page-content { padding: 16px; padding-bottom: 80px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 1.6rem; }
  .hero h1 { font-size: 1.9rem; }
  table { font-size: 0.8rem; }
  th, td { padding: 9px 10px; }
  .topbar { padding: 0 16px; }
}

/* === ICON SIZE FIXES (belt-and-suspenders) === */
.modal-close svg { width: 20px !important; height: 20px !important; }
.modal-close { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; }
.sidebar-footer svg.icon { width: 16px !important; height: 16px !important; }
.att-card svg.icon { width: 14px; height: 14px; }
/* Skill bar overrides */
.skill-label { min-width: 90px; font-size: .78rem; color: var(--text-muted); font-weight: 600; }
.skill-val { min-width: 28px; text-align: right; font-size: .82rem; font-weight: 700; color: var(--text); }
