:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #22263a;
  --border: #2e3348;
  --accent: #7c5cfc;
  --accent-hover: #6a4ee0;
  --green: #22c55e;
  --yellow: #f59e0b;
  --red: #ef4444;
  --text: #e2e8f0;
  --muted: #8b95b0;
  --radius: 12px;
  --font: 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: inherit; text-decoration: none; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--surface); border-right: 1px solid var(--border);
           padding: 24px 0; display: flex; flex-direction: column; position: fixed; height: 100vh; top: 0; }
.sidebar-logo { padding: 0 20px 24px; font-size: 1.1rem; font-weight: 700; letter-spacing: 0.5px; }
.sidebar-logo span { color: var(--accent); }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 20px;
            cursor: pointer; border-radius: 8px; margin: 0 8px; color: var(--muted);
            transition: all .15s; font-size: .9rem; }
.nav-item:hover, .nav-item.active { background: var(--surface2); color: var(--text); }
.nav-item.active { color: var(--accent); }
.nav-icon { font-size: 1.1rem; width: 20px; text-align: center; }
.nav-bottom { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; }
.main { margin-left: 220px; padding: 32px; flex: 1; }

/* Big numbers */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
        padding: 20px; }
.card-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.card-value { font-size: 2rem; font-weight: 700; }
.card-sub { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.card.green .card-value { color: var(--green); }
.card.yellow .card-value { color: var(--yellow); }
.card.red .card-value { color: var(--red); }
.card.purple .card-value { color: var(--accent); }

/* Table */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px;
                border-bottom: 1px solid var(--border); }
.table-header h2 { font-size: 1rem; font-weight: 600; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { text-align: left; padding: 10px 16px; color: var(--muted); font-weight: 500;
     font-size: .75rem; text-transform: uppercase; letter-spacing: .4px;
     border-bottom: 1px solid var(--border); background: var(--surface2); }
td { padding: 11px 16px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .75rem; font-weight: 500; }
.badge.green { background: #14532d33; color: var(--green); }
.badge.red { background: #7f1d1d33; color: var(--red); }
.badge.yellow { background: #78350f33; color: var(--yellow); }
.badge.purple { background: #3b0764aa; color: #c4b5fd; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
       border-radius: 8px; border: none; cursor: pointer; font-size: .875rem;
       font-weight: 500; transition: all .15s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text); }
.btn-danger { background: #7f1d1d33; color: var(--red); border: 1px solid #7f1d1d55; }
.btn-danger:hover { background: #7f1d1d55; }
.btn-sm { padding: 4px 10px; font-size: .8rem; }

/* Forms */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
input, select { width: 100%; padding: 9px 12px; background: var(--surface2); border: 1px solid var(--border);
                border-radius: 8px; color: var(--text); font-size: .875rem; }
input:focus, select:focus { outline: none; border-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Modal */
.modal-bg { display: none; position: fixed; inset: 0; background: #000a; z-index: 100;
            align-items: center; justify-content: center; }
.modal-bg.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
         padding: 28px; min-width: 380px; max-width: 500px; width: 100%; }
.modal h3 { margin-bottom: 20px; font-size: 1.1rem; }

/* Upload zone */
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 32px;
               text-align: center; cursor: pointer; transition: all .15s; }
.upload-zone:hover { border-color: var(--accent); }
.upload-zone p { color: var(--muted); font-size: .875rem; margin-top: 8px; }

/* Filters */
.filters { display: flex; gap: 10px; margin-bottom: 16px; }
.filters select, .filters input { width: auto; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 6px; padding: 16px; }
.page-btn { padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border);
            background: transparent; color: var(--muted); cursor: pointer; font-size: .8rem; }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:hover:not(.active) { border-color: var(--text); color: var(--text); }

/* Alert */
.alert { padding: 10px 14px; border-radius: 8px; font-size: .875rem; margin-bottom: 12px; }
.alert.success { background: #14532d33; color: var(--green); border: 1px solid #14532d55; }
.alert.error { background: #7f1d1d33; color: var(--red); border: 1px solid #7f1d1d55; }

/* Page title */
.page-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 24px; }
.page-title span { color: var(--muted); font-weight: 400; font-size: 1rem; }

/* WA link */
.wa-link { color: var(--green); font-size: .85rem; }
.wa-link:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 16px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
