/* ============================================================
   VPoS Shared Styles
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0a0c10;
  --surface:  #111318;
  --surface2: #181b22;
  --surface3: #1e2230;
  --border:   rgba(255,255,255,0.07);
  --border2:  rgba(255,255,255,0.13);
  --text:     #f0f2f7;
  --muted:    #8892a4;
  --accent:   #4f8ef7;
  --green:    #34d399;
  --amber:    #fbbf24;
  --red:      #f87171;
  --cyan:     #22d3ee;
  --purple:   #a78bfa;
}

body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* Layout */
.app-shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 220px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.page-content { padding: 24px; flex: 1; }

/* Sidebar */
.sidebar-logo { padding: 20px 16px 12px; font-size: 1.5rem; font-weight: 800; color: var(--accent); letter-spacing: -1px; font-family: 'Space Mono', monospace; }
.sidebar-logo span { color: var(--text); }
.sidebar-version { margin: 0 12px 12px; padding: 4px 10px; border-radius: 20px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; display: inline-block; }
.sidebar-version.demo { background: rgba(251,191,36,0.15); color: var(--amber); }
.sidebar-version.full { background: rgba(79,142,247,0.15); color: var(--accent); }
.sidebar-nav { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--muted); text-decoration: none; transition: all 0.15s; }
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: rgba(79,142,247,0.12); color: var(--accent); font-weight: 600; }
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.card-sub { font-size: 12px; color: var(--muted); }

/* Stat cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.stat-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.stat-trend { font-size: 11px; margin-top: 6px; font-weight: 600; }
.stat-trend.up { color: var(--green); }
.stat-trend.down { color: var(--red); }

/* Tables */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 16px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface2); }
td { padding: 12px 16px; font-size: 13.5px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface2); }

/* Buttons */
.btn { padding: 9px 18px; border-radius: 9px; font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; border: none; transition: all 0.15s; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #3a7ef0; }
.btn-success { background: var(--green); color: #0a0c10; }
.btn-danger  { background: rgba(248,113,113,0.12); color: var(--red); border: 1px solid rgba(248,113,113,0.25); }
.btn-danger:hover { background: rgba(248,113,113,0.2); }
.btn-ghost  { background: transparent; color: var(--muted); border: 1px solid var(--border2); }
.btn-ghost:hover { color: var(--text); background: var(--surface3); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 8px; }

/* Badges */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.badge-green  { background: rgba(52,211,153,0.12); color: var(--green); }
.badge-amber  { background: rgba(251,191,36,0.12); color: var(--amber); }
.badge-red    { background: rgba(248,113,113,0.12); color: var(--red); }
.badge-blue   { background: rgba(79,142,247,0.12);  color: var(--accent); }
.badge-purple { background: rgba(167,139,250,0.12); color: var(--purple); }

/* Forms */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; }
.form-control { background: var(--surface2); border: 1px solid var(--border2); border-radius: 9px; padding: 10px 12px; font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--text); outline: none; transition: border-color 0.15s; width: 100%; }
.form-control:focus { border-color: var(--accent); }
.form-control::placeholder { color: var(--muted); }
select.form-control option { background: var(--surface2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.2s; padding: 20px; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--surface); border: 1px solid var(--border2); border-radius: 18px; padding: 28px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; transform: scale(0.95); transition: transform 0.2s; }
.modal-overlay.open .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 20px; padding: 4px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 18px; border-radius: 12px; font-size: 13px; font-weight: 500; color: #fff; transform: translateY(80px); opacity: 0; transition: all 0.3s; z-index: 999; max-width: 320px; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: #1a3a2a; border: 1px solid rgba(52,211,153,0.3); color: var(--green); }
.toast-error   { background: #3a1a1a; border: 1px solid rgba(248,113,113,0.3); color: var(--red); }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.search-input { background: var(--surface2); border: 1px solid var(--border2); border-radius: 9px; padding: 9px 14px; font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--text); outline: none; min-width: 220px; }
.search-input::placeholder { color: var(--muted); }
.search-input:focus { border-color: var(--accent); }

/* Page header */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.5px; }
.page-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* Locked feature */
.locked-feature { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 48px 32px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.locked-icon { font-size: 48px; }
.locked-title { font-size: 1.2rem; font-weight: 700; }
.locked-sub { font-size: 13px; color: var(--muted); max-width: 360px; line-height: 1.6; }

/* Empty state */
.empty-state { padding: 48px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-icon { font-size: 40px; }
.empty-text { font-size: 14px; color: var(--muted); }

/* Filter pills */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-pill { padding: 6px 14px; border-radius: 20px; background: var(--surface2); border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; transition: all 0.15s; }
.filter-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Chart placeholder */
.chart-box { background: var(--surface2); border-radius: 10px; height: 200px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; margin-top: 12px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
