/* ============ LocalFox Design System ============ */
:root {
  --orange: #F97316; --orange-dark: #EA580C; --orange-soft: #FFF1E6;
  --ink: #111827; --ink-2: #1F2937; --accent: #2563EB;
  --bg: #F8FAFC; --card: #FFFFFF; --border: #E8EDF4;
  --text: #111827; --muted: #64748B; --muted-2: #94A3B8;
  --green: #10B981; --red: #EF4444; --amber: #F59E0B;
  --r: 20px; --r-sm: 12px;
  --shadow: 0 1px 2px rgba(17,24,39,.04), 0 8px 24px -12px rgba(17,24,39,.10);
  --shadow-lg: 0 24px 60px -20px rgba(17,24,39,.18);
  --grad: linear-gradient(135deg, #F97316, #FB923C);
  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body: 'Figtree', sans-serif;
}
* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }
body { font-family:var(--font-body); background:var(--bg); color:var(--text); font-size:15px; line-height:1.55; -webkit-font-smoothing:antialiased; }
h1,h2,h3,h4 { font-family:var(--font-display); font-weight:700; letter-spacing:-.02em; }
a { color:inherit; text-decoration:none; }
::selection { background:var(--orange); color:#fff; }
::-webkit-scrollbar { width:10px; height:10px; }
::-webkit-scrollbar-thumb { background:#CBD5E1; border-radius:8px; border:2px solid var(--bg); }

/* ---- Buttons ---- */
.btn { display:inline-flex; align-items:center; gap:8px; padding:10px 20px; border-radius:999px; border:none; cursor:pointer; font-family:var(--font-body); font-weight:600; font-size:14px; transition:transform .18s ease, box-shadow .18s ease, background-color .18s ease, opacity .18s; white-space:nowrap; }
.btn:active { transform:scale(.97); }
.btn-primary { background:var(--grad); color:#fff; box-shadow:0 8px 20px -8px rgba(249,115,22,.55); }
.btn-primary:hover { transform:translateY(-2px); box-shadow:0 14px 28px -8px rgba(249,115,22,.6); }
.btn-dark { background:var(--ink); color:#fff; }
.btn-dark:hover { background:#000; transform:translateY(-2px); }
.btn-ghost { background:transparent; color:var(--text); border:1.5px solid var(--border); }
.btn-ghost:hover { border-color:var(--orange); color:var(--orange); background:var(--orange-soft); }
.btn-soft { background:var(--orange-soft); color:var(--orange-dark); }
.btn-soft:hover { background:#FFE4CC; }
.btn-danger { background:#FEE2E2; color:var(--red); }
.btn-danger:hover { background:var(--red); color:#fff; }
.btn-sm { padding:7px 14px; font-size:13px; }
.btn-lg { padding:14px 30px; font-size:16px; }
.btn[disabled] { opacity:.55; cursor:not-allowed; }
.btn .fa-spinner { animation:spin 1s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ---- Cards ---- */
.card { background:var(--card); border:1px solid var(--border); border-radius:var(--r); box-shadow:var(--shadow); padding:24px; transition:box-shadow .25s ease, transform .25s ease; }
.card-hover:hover { transform:translateY(-3px); box-shadow:var(--shadow-lg); }
.card-title { font-size:16px; margin-bottom:4px; display:flex; align-items:center; gap:10px; }
.card-sub { color:var(--muted); font-size:13px; }

/* ---- App shell ---- */
.app { display:flex; min-height:100vh; }
.sidebar { width:256px; background:var(--ink); color:#CBD5E1; position:fixed; inset:0 auto 0 0; display:flex; flex-direction:column; z-index:60; transition:transform .3s ease; }
.sidebar-brand { display:flex; align-items:center; gap:11px; padding:22px 22px 18px; color:#fff; font-family:var(--font-display); font-weight:800; font-size:19px; }
.sidebar-brand img { width:34px; height:34px; }
.sidebar-nav { flex:1; overflow-y:auto; padding:8px 14px 20px; }
.nav-label { font-size:10.5px; text-transform:uppercase; letter-spacing:.12em; color:#64748B; padding:16px 10px 7px; font-weight:700; }
.nav-item { display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius:12px; font-size:14px; font-weight:500; color:#9CA3AF; margin-bottom:2px; transition:background .18s, color .18s, transform .18s; }
.nav-item i { width:19px; text-align:center; font-size:15px; }
.nav-item:hover { background:rgba(255,255,255,.06); color:#fff; transform:translateX(3px); }
.nav-item.active { background:linear-gradient(135deg, rgba(249,115,22,.22), rgba(249,115,22,.08)); color:#FDBA74; }
.nav-item.active i { color:var(--orange); }
.sidebar-foot { padding:14px; border-top:1px solid rgba(255,255,255,.07); }
.plan-chip { background:rgba(249,115,22,.14); border:1px solid rgba(249,115,22,.3); border-radius:14px; padding:12px 14px; font-size:12.5px; color:#FDBA74; }
.plan-chip strong { color:#fff; display:block; font-size:13.5px; }

.main { flex:1; margin-left:256px; min-width:0; }
.topbar { position:sticky; top:0; z-index:50; display:flex; align-items:center; gap:16px; padding:14px 32px; background:rgba(248,250,252,.8); backdrop-filter:blur(16px); border-bottom:1px solid var(--border); }
.topbar h1 { font-size:20px; }
.topbar-right { margin-left:auto; display:flex; align-items:center; gap:12px; }
.icon-btn { position:relative; width:40px; height:40px; border-radius:12px; border:1px solid var(--border); background:#fff; color:var(--muted); display:grid; place-items:center; cursor:pointer; transition:all .18s; }
.icon-btn:hover { color:var(--orange); border-color:var(--orange); }
.icon-btn .dot { position:absolute; top:9px; right:10px; width:8px; height:8px; background:var(--red); border-radius:50%; border:2px solid #fff; }
.avatar { width:38px; height:38px; border-radius:12px; background:var(--grad); color:#fff; display:grid; place-items:center; font-weight:700; font-size:14px; cursor:pointer; }
.content { padding:28px 32px 60px; max-width:1400px; }

/* ---- Dropdowns ---- */
.dropdown { position:relative; }
.dropdown-menu { position:absolute; right:0; top:calc(100% + 10px); min-width:230px; background:#fff; border:1px solid var(--border); border-radius:16px; box-shadow:var(--shadow-lg); padding:8px; opacity:0; visibility:hidden; transform:translateY(-6px); transition:all .2s ease; z-index:80; }
.dropdown.open .dropdown-menu { opacity:1; visibility:visible; transform:translateY(0); }
.dropdown-menu a, .dropdown-menu .dd-item { display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:10px; font-size:13.5px; color:var(--text); cursor:pointer; transition:background .15s; }
.dropdown-menu a:hover, .dd-item:hover { background:var(--bg); }
.notif-menu { width:340px; max-height:420px; overflow-y:auto; }
.notif-item { padding:11px 12px; border-radius:12px; display:flex; gap:11px; cursor:pointer; }
.notif-item:hover { background:var(--bg); }
.notif-item.unread { background:var(--orange-soft); }
.notif-icon { width:36px; height:36px; border-radius:10px; flex-shrink:0; display:grid; place-items:center; background:var(--orange-soft); color:var(--orange); font-size:14px; }
.notif-item h5 { font-size:13px; font-family:var(--font-body); }
.notif-item p { font-size:12px; color:var(--muted); }
.notif-item time { font-size:11px; color:var(--muted-2); }

/* ---- Stats ---- */
.stat-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(230px,1fr)); gap:18px; }
.stat-card { position:relative; overflow:hidden; }
.stat-card .stat-icon { width:44px; height:44px; border-radius:14px; display:grid; place-items:center; font-size:17px; margin-bottom:14px; background:var(--orange-soft); color:var(--orange); }
.stat-card .stat-icon.blue { background:#EFF6FF; color:var(--accent); }
.stat-card .stat-icon.green { background:#ECFDF5; color:var(--green); }
.stat-card .stat-icon.amber { background:#FFFBEB; color:var(--amber); }
.stat-value { font-size:28px; font-weight:800; font-family:var(--font-display); letter-spacing:-.03em; }
.stat-label { color:var(--muted); font-size:13px; margin-top:2px; }
.stat-trend { font-size:12.5px; font-weight:700; margin-top:8px; display:inline-flex; align-items:center; gap:5px; padding:3px 9px; border-radius:99px; }
.trend-up { background:#ECFDF5; color:var(--green); }
.trend-down { background:#FEF2F2; color:var(--red); }

/* ---- Forms ---- */
.form-group { margin-bottom:18px; }
.form-label { display:block; font-size:13px; font-weight:600; margin-bottom:7px; color:var(--ink-2); }
.form-control { width:100%; padding:11px 15px; border:1.5px solid var(--border); border-radius:13px; font-family:var(--font-body); font-size:14px; background:#fff; color:var(--text); transition:border-color .18s, box-shadow .18s; }
.form-control:focus { outline:none; border-color:var(--orange); box-shadow:0 0 0 4px rgba(249,115,22,.12); }
textarea.form-control { resize:vertical; min-height:100px; }
select.form-control { appearance:none; background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right:38px; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.form-hint { font-size:12px; color:var(--muted); margin-top:5px; }

/* ---- Tables ---- */
.table-wrap { overflow-x:auto; }
table.lf-table { width:100%; border-collapse:collapse; }
.lf-table th { text-align:left; font-size:11.5px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); padding:12px 14px; border-bottom:1px solid var(--border); font-weight:700; }
.lf-table td { padding:14px; border-bottom:1px solid var(--border); font-size:14px; vertical-align:middle; }
.lf-table tr:last-child td { border-bottom:none; }
.lf-table tbody tr { transition:background .15s; }
.lf-table tbody tr:hover { background:#FAFBFD; }

/* ---- Badges ---- */
.badge { display:inline-flex; align-items:center; gap:6px; padding:4px 11px; border-radius:99px; font-size:12px; font-weight:700; }
.badge-green { background:#ECFDF5; color:#059669; }
.badge-red { background:#FEF2F2; color:var(--red); }
.badge-amber { background:#FFFBEB; color:#B45309; }
.badge-blue { background:#EFF6FF; color:var(--accent); }
.badge-gray { background:#F1F5F9; color:var(--muted); }
.badge-orange { background:var(--orange-soft); color:var(--orange-dark); }

/* ---- Stars ---- */
.stars { color:#F59E0B; font-size:13px; letter-spacing:1px; }
.stars .off { color:#E2E8F0; }

/* ---- Modal ---- */
.lf-modal-overlay { position:fixed; inset:0; background:rgba(17,24,39,.5); backdrop-filter:blur(6px); z-index:100; display:none; align-items:flex-start; justify-content:center; padding:6vh 20px; overflow-y:auto; }
.lf-modal-overlay.show { display:flex; animation:fadeIn .2s ease; }
.lf-modal { background:#fff; border-radius:22px; box-shadow:var(--shadow-lg); width:100%; max-width:560px; padding:28px; animation:popIn .25s cubic-bezier(.2,.9,.3,1.2); }
.lf-modal.wide { max-width:760px; }
.lf-modal-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
.lf-modal-head h3 { font-size:18px; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
@keyframes popIn { from{opacity:0; transform:scale(.94) translateY(12px)} to{opacity:1; transform:none} }

/* ---- Skeleton ---- */
.skeleton { background:linear-gradient(90deg, #EEF2F7 25%, #F8FAFC 50%, #EEF2F7 75%); background-size:200% 100%; animation:shimmer 1.4s infinite; border-radius:10px; }
@keyframes shimmer { to { background-position:-200% 0; } }
.sk-line { height:14px; margin-bottom:10px; }
.sk-card { height:120px; border-radius:var(--r); }

/* ---- Empty state ---- */
.empty-state { text-align:center; padding:56px 20px; }
.empty-state .es-icon { width:76px; height:76px; margin:0 auto 18px; border-radius:24px; background:var(--orange-soft); color:var(--orange); display:grid; place-items:center; font-size:30px; }
.empty-state h3 { font-size:18px; margin-bottom:6px; }
.empty-state p { color:var(--muted); font-size:14px; max-width:360px; margin:0 auto 20px; }

/* ---- Tabs ---- */
.tabs { display:flex; gap:6px; background:#EEF2F7; padding:5px; border-radius:14px; width:fit-content; flex-wrap:wrap; }
.tab { padding:8px 18px; border-radius:10px; font-size:13.5px; font-weight:600; color:var(--muted); cursor:pointer; transition:all .18s; border:none; background:transparent; font-family:var(--font-body); }
.tab:hover { color:var(--text); }
.tab.active { background:#fff; color:var(--text); box-shadow:0 2px 8px rgba(17,24,39,.08); }

/* ---- Page header ---- */
.page-head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:24px; flex-wrap:wrap; }
.page-head h2 { font-size:24px; }
.page-head p { color:var(--muted); font-size:14px; margin-top:3px; }

/* ---- Misc ---- */
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.grid-3 { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.flex { display:flex; align-items:center; gap:12px; }
.flex-between { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.mt-1{margin-top:8px} .mt-2{margin-top:16px} .mt-3{margin-top:24px} .mb-2{margin-bottom:16px} .mb-3{margin-bottom:24px}
.text-muted { color:var(--muted); } .text-sm { font-size:13px; }
.progress { height:8px; background:#EEF2F7; border-radius:99px; overflow:hidden; }
.progress-bar { height:100%; background:var(--grad); border-radius:99px; transition:width 1s cubic-bezier(.2,.9,.3,1); }
.score-ring { position:relative; width:120px; height:120px; }
.score-ring svg { transform:rotate(-90deg); }
.score-ring .score-num { position:absolute; inset:0; display:grid; place-items:center; font-family:var(--font-display); font-weight:800; font-size:26px; }
.animate-in { opacity:0; transform:translateY(16px); animation:riseIn .55s cubic-bezier(.2,.9,.3,1) forwards; }
@keyframes riseIn { to { opacity:1; transform:none; } }
.mobile-menu-btn { display:none; }
.switch { width:48px; height:26px; background:var(--border); border-radius:99px; position:relative; cursor:pointer; transition:background .2s; display:inline-block; flex-shrink:0; }
.switch.on { background:var(--orange); }
.switch::after { content:''; position:absolute; width:20px; height:20px; background:#fff; border-radius:50%; top:3px; left:3px; transition:left .2s; box-shadow:0 2px 5px rgba(0,0,0,.2); }
.switch.on::after { left:25px; }
.sidebar-overlay { display:none; }

/* ---- Auth pages ---- */
.auth-wrap { min-height:100vh; display:grid; grid-template-columns:1fr 1fr; }
.auth-side { background:var(--ink); color:#fff; padding:60px; display:flex; flex-direction:column; justify-content:space-between; position:relative; overflow:hidden; }
.auth-side::before { content:''; position:absolute; width:500px; height:500px; border-radius:50%; background:radial-gradient(circle, rgba(249,115,22,.25), transparent 70%); top:-150px; right:-150px; }
.auth-side h2 { font-size:34px; line-height:1.2; margin-top:24px; }
.auth-side p { color:#9CA3AF; margin-top:14px; font-size:15px; max-width:400px; }
.auth-form-wrap { display:flex; align-items:center; justify-content:center; padding:40px; }
.auth-card { width:100%; max-width:420px; }
.auth-card h1 { font-size:26px; margin-bottom:6px; }
.auth-card > p { color:var(--muted); margin-bottom:28px; font-size:14px; }
.auth-quote { background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.1); border-radius:18px; padding:22px; backdrop-filter:blur(10px); position:relative; z-index:1; }
.auth-quote p { color:#E5E7EB; font-size:14.5px; margin:0; }
.auth-quote .q-by { display:flex; align-items:center; gap:10px; margin-top:14px; font-size:13px; color:#9CA3AF; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns:1fr 1fr; }
  .auth-wrap { grid-template-columns:1fr; } .auth-side { display:none; }
}
@media (max-width: 768px) {
  .sidebar { transform:translateX(-100%); }
  .sidebar.open { transform:none; }
  .sidebar-overlay.show { display:block; position:fixed; inset:0; background:rgba(17,24,39,.45); z-index:55; }
  .main { margin-left:0; }
  .mobile-menu-btn { display:grid; }
  .content { padding:20px 16px 50px; }
  .topbar { padding:12px 16px; }
  .grid-2, .grid-3, .form-row { grid-template-columns:1fr; }
}
