:root {
  --bg: #0f1115;
  --panel: #161a22;
  --panel2: #1c2230;
  --border: #252b38;
  --text: #e6e8ee;
  --muted: #8a93a6;
  --accent: #5b8def;
  --ok: #29c16b;
  --warn: #f0a93b;
  --err: #e95d5d;
  --radius: 8px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* Auth pages */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.auth-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 1.4rem; margin-bottom: .5rem; }
.auth-card .muted { color: var(--muted); font-size: .85rem; margin-bottom: 1.5rem; }
.auth-card label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.auth-card input { display: block; width: 100%; margin-top: .3rem; padding: .6rem .8rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: .9rem; }
.auth-card input:focus { outline: none; border-color: var(--accent); }
.link-row { margin-top: 1rem; font-size: .85rem; color: var(--muted); text-align: center; }
.link-row a { color: var(--accent); text-decoration: none; }

/* Buttons */
.btn { display: inline-block; padding: .6rem 1.2rem; border: none; border-radius: var(--radius); font-size: .9rem; cursor: pointer; transition: opacity .2s; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: #fff; width: 100%; margin-top: .5rem; }
.btn.primary:hover:not(:disabled) { opacity: .85; }
.btn.danger { background: var(--err); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }

/* Messages */
.msg { margin-top: 1rem; padding: .6rem .8rem; border-radius: var(--radius); font-size: .85rem; }
.msg.err { background: rgba(233,93,93,.15); color: var(--err); }
.msg.ok { background: rgba(41,193,107,.15); color: var(--ok); }

/* Panel layout */
.panel-layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--panel); border-right: 1px solid var(--border); padding: 1.5rem 0; display: flex; flex-direction: column; }
.sidebar .brand { padding: 0 1rem 1.5rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.sidebar .brand h2 { font-size: 1.1rem; }
.sidebar .brand small { color: var(--muted); font-size: .75rem; }
.sidebar nav a { display: block; padding: .7rem 1.2rem; color: var(--muted); text-decoration: none; font-size: .9rem; transition: background .15s; }
.sidebar nav a:hover, .sidebar nav a.active { background: var(--panel2); color: var(--text); }
.sidebar .spacer { flex: 1; }
.sidebar .logout { padding: .7rem 1.2rem; color: var(--err); text-decoration: none; font-size: .85rem; cursor: pointer; border: none; background: none; text-align: left; }

.main-content { flex: 1; padding: 2rem; overflow-y: auto; }
.main-content h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }

/* Cards / Stats */
.stats-row { display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; flex: 1; min-width: 150px; }
.stat-card .label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.stat-card .value { font-size: 1.5rem; font-weight: 700; margin-top: .3rem; }

/* Table */
.table-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th { text-align: left; padding: .7rem 1rem; background: var(--panel2); color: var(--muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; }
td { padding: .7rem 1rem; border-top: 1px solid var(--border); }
tr:hover td { background: rgba(91,141,239,.04); }

/* Badges */
.badge { display: inline-block; padding: .2rem .5rem; border-radius: 4px; font-size: .75rem; font-weight: 600; }
.badge-ok { background: rgba(41,193,107,.15); color: var(--ok); }
.badge-warn { background: rgba(240,169,59,.15); color: var(--warn); }
.badge-err { background: rgba(233,93,93,.15); color: var(--err); }
.badge-info { background: rgba(91,141,239,.15); color: var(--accent); }

/* Forms in panel */
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .3rem; }
.form-group input, .form-group select { width: 100%; padding: .5rem .7rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: .9rem; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--accent); }
.form-row { display: flex; gap: .8rem; align-items: flex-end; }

/* Color preview */
.color-preview { width: 32px; height: 32px; border-radius: var(--radius); border: 1px solid var(--border); }

/* Responsive */
@media (max-width: 768px) {
  .panel-layout { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; padding: .5rem; overflow-x: auto; }
  .sidebar .brand { display: none; }
  .sidebar nav { display: flex; }
  .sidebar nav a { white-space: nowrap; padding: .5rem .8rem; }
  .sidebar .spacer { display: none; }
  .main-content { padding: 1rem; }
  .stats-row { flex-direction: column; }
}
