*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #121212; --bg2: #1A1A1A; --bg3: #222; --bg4: #2a2a2a;
  --accent: #FF5A1F; --accent2: #E14A10;
  --text: #f0f0f0; --text2: #B0B0B0; --text-muted: #777;
  --border: #333; --success: #22c55e; --danger: #ef4444; --warning: #f59e0b; --info: #3b82f6;
  --sidebar-w: 240px;
}
body { font-family: 'Inter','Segoe UI',system-ui,-apple-system,sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 600; }
h4 { font-size: 14px; font-weight: 600; }

/* LAYOUT */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--bg2); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 100; overflow-y: auto; }
.main-content { margin-left: var(--sidebar-w); flex: 1; padding: 28px 32px; min-height: 100vh; width: calc(100% - var(--sidebar-w)); }
.mobile-header { display: none; }

/* SIDEBAR */
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 20px 16px; border-bottom: 1px solid var(--border); }
.sidebar-brand img { width: 40px; height: 40px; border-radius: 8px; }
.brand-text h1 { font-size: 16px; font-weight: 700; line-height: 1.2; }
.brand-text span { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.sidebar-nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--text2); font-size: 13px; font-weight: 500; transition: all .15s; }
.sidebar-nav a:hover { background: var(--bg3); color: var(--text); }
.sidebar-nav a.active { background: rgba(255,90,31,.12); color: var(--accent); }
.nav-section { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); padding: 16px 12px 6px; }
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.user-info { font-size: 12px; color: var(--text-muted); }
.user-name { color: var(--text); font-weight: 600; }

/* PAGE HEADER */
.page-header { margin-bottom: 24px; }
.page-header p { color: var(--text-muted); font-size: 14px; margin-top: 2px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* CARDS */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 16px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

/* STATS */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 20px; position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.stat-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.stat-value { font-size: 32px; font-weight: 700; margin: 4px 0; }
.stat-value.accent { color: var(--accent); }
.stat-sub { font-size: 12px; color: var(--text-muted); }

/* FORMS */
.form-group { margin-bottom: 14px; flex: 1; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .5px; }
.form-control { width: 100%; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 14px; font-family: inherit; transition: border .15s; }
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,90,31,.1); }
select.form-control { cursor: pointer; }
textarea.form-control { min-height: 60px; resize: vertical; }
.form-row { display: flex; gap: 12px; }
.filter-row { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-row .form-control { max-width: 220px; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 6px; border: none; font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer; transition: all .15s; white-space: nowrap; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255,90,31,.3); }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg3); color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid rgba(239,68,68,.3); }
.btn-danger:hover { background: rgba(239,68,68,.1); }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: transparent; color: var(--warning); border: 1px solid rgba(245,158,11,.3); }
.btn-warning:hover { background: rgba(245,158,11,.1); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-ms { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 14px 20px; background: #2f2f2f; color: #fff; border: 1px solid #444; border-radius: 8px; font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: all .15s; text-decoration: none; }
.btn-ms:hover { background: #3a3a3a; border-color: #555; }

/* TABLE */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
tbody td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.04); font-size: 13px; }
tbody tr:hover { background: rgba(255,90,31,.03); }
td.empty { text-align: center; color: var(--text-muted); padding: 32px; }
.text-muted { color: var(--text-muted); }
.mono { font-family: 'JetBrains Mono', monospace; font-size: 13px; }

/* BADGES */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: .3px; }
.badge-success { background: rgba(34,197,94,.15); color: #4ade80; }
.badge-danger { background: rgba(239,68,68,.15); color: #f87171; }
.badge-warning { background: rgba(245,158,11,.15); color: #fbbf24; }
.badge-info { background: rgba(59,130,246,.15); color: #60a5fa; }

/* TABS */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.tab-btn { padding: 8px 16px; border: none; background: transparent; color: var(--text-muted); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 6px; transition: all .15s; }
.tab-btn:hover { background: var(--bg3); color: var(--text); }
.tab-btn.active { background: rgba(255,90,31,.12); color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn .2s; }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); display: none; justify-content: center; align-items: flex-start; padding: 40px 20px; z-index: 1000; overflow-y: auto; }
.modal-overlay.active { display: flex; }
.modal { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; width: 100%; max-width: 560px; animation: slideIn .2s; }
.modal.modal-lg { max-width: 780px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; max-height: 65vh; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 24px; cursor: pointer; padding: 0 4px; }
.modal-close:hover { color: var(--text); }

/* LINE ITEMS */
.line-item { border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 8px; background: var(--bg); }

/* LOGIN */
.login-page { min-height: 100vh; display: flex; justify-content: center; align-items: center; background: var(--bg); }
.login-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 40px 36px; width: 100%; max-width: 400px; text-align: center; }
.login-logo img { width: 90px; height: 90px; border-radius: 14px; margin-bottom: 16px; }
.subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.login-note { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 16px; }

/* ANIMATIONS */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn .3s; }

/* MOBILE */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 16px; padding-top: 60px; width: 100%; }
  .mobile-header { display: flex; align-items: center; gap: 10px; position: fixed; top: 0; left: 0; right: 0; background: var(--bg2); border-bottom: 1px solid var(--border); padding: 12px 16px; z-index: 99; }
  .mobile-menu-btn { background: none; border: none; color: var(--text); font-size: 22px; cursor: pointer; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { flex-direction: column; gap: 0; }
  .filter-row { flex-direction: column; }
  .filter-row .form-control { max-width: 100%; }
  .flex-between { flex-direction: column; align-items: flex-start; gap: 12px; }
  .modal { max-width: 100%; }
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }
