:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --sidebar: #0f172a;
  --sidebar-text: #cbd5e1;
  --primary: #2563eb;
  --success: #059669;
  --danger: #dc2626;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }
.error-text { color: var(--danger); font-size: 12px; margin-top: 8px; }

/* Login */
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); padding: 20px; }
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 14px; padding: 30px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.brand-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--primary); background: #eff6ff; padding: 4px 10px; border-radius: 999px; margin-bottom: 10px; }
.login-card h1 { margin: 4px 0 8px; font-size: 22px; }
.login-card label { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; font-weight: 500; }
.hint-box { margin-top: 16px; padding: 10px; background: #f8fafc; border-radius: 8px; font-size: 12px; color: var(--muted); }

/* Layout */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 230px; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; padding: 18px 14px; flex-shrink: 0; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.logo-dot { width: 12px; height: 12px; border-radius: 4px; background: #38bdf8; box-shadow: 0 0 12px #38bdf8; }
.brand-title { color: #fff; font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 11px; color: #94a3b8; }
.nav-list { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; flex: 1; }
.nav-item { text-align: left; background: transparent; border: 0; color: var(--sidebar-text); padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.user-badge { font-size: 12px; color: #e2e8f0; }

.main-content { flex: 1; padding: 20px 26px; overflow-x: hidden; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.topbar h2 { margin: 0; font-size: 19px; }
.pill { font-size: 12px; padding: 5px 12px; border-radius: 999px; background: #e2e8f0; color: #334155; font-weight: 600; }
.pill.ok { background: #dcfce7; color: #166534; }
.pill.warn { background: #fef3c7; color: #92400e; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.card h3 { margin: 0 0 12px; font-size: 15px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.subhead { margin: 16px 0 8px; font-size: 13px; color: var(--muted); }

/* Forms */
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 7px; font-size: 13px; font-family: inherit; background: #fff; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 500; color: #334155; }
.span-2 { grid-column: span 2; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form input { width: 160px; }

.btn { border: 0; border-radius: 7px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; background: #e2e8f0; color: #0f172a; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.success { background: var(--success); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid #cbd5e1; color: #334155; }
.sidebar .btn.ghost { border-color: rgba(255,255,255,.2); color: #cbd5e1; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.full { width: 100%; margin-top: 10px; }

.export-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.filter-bar { display: flex; gap: 8px; align-items: center; }
.filter-bar select { width: 160px; }

/* Tables & Lists */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
.thumb-row { display: flex; gap: 4px; flex-wrap: wrap; }
.thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.status-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-leased { background: #dbeafe; color: #1e40af; }
.status-review { background: #ede9fe; color: #5b21b6; }
.status-approved { background: #dcfce7; color: #166534; }
.status-failed { background: #fee2e2; color: #991b1b; }

.style-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.style-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: #fafcff; display: flex; flex-direction: column; gap: 8px; }
.style-card-top { display: flex; justify-content: space-between; align-items: center; }
.code-chip { font-family: monospace; font-size: 11px; background: #e2e8f0; padding: 2px 6px; border-radius: 4px; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi-box { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi-val { font-size: 22px; font-weight: 700; margin: 4px 0; }

.mini-list { display: flex; flex-direction: column; gap: 8px; }
.mini-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; font-size: 12px; }
.toast { position: fixed; right: 20px; bottom: 20px; background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; box-shadow: 0 10px 25px rgba(0,0,0,.2); z-index: 999; }
