@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=DM+Mono:wght@400;500&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --bg: #0d0f14;
  --surface: #161920;
  --surface2: #1e2230;
  --border: #2a2f42;
  --accent: #5b8af5;
  --green: #34d399;
  --red: #f87171;
  --yellow: #fbbf24;
  --text: #e8eaf0;
  --muted: #6b7280;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

/* ── Sidebar ── */
.sidebar {
  width: 230px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}
.sidebar-logo { padding: 28px 24px 20px; border-bottom: 1px solid var(--border); }
.sidebar-logo h1 { font-family: 'Syne', sans-serif; font-size: 1.05rem; font-weight: 800; }
.sidebar-logo span { font-size: 0.72rem; color: var(--muted); font-family: 'DM Mono', monospace; }

.nav { padding: 16px 12px; flex: 1; }
.nav-section { font-size: 0.65rem; font-family: 'DM Mono', monospace; letter-spacing: .1em;
               color: var(--muted); text-transform: uppercase; padding: 8px 12px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px;
            border-radius: 8px; cursor: pointer; font-size: .875rem; font-weight: 500;
            color: var(--muted); transition: all .15s; margin-bottom: 2px; }
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: rgba(91,138,245,.12); color: var(--accent); }

.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); font-size: .8rem; color: var(--muted); }
.sidebar-footer strong { display: block; color: var(--text); font-size: .85rem; }

/* ── Main ── */
.main { margin-left: 230px; flex: 1; padding: 32px; max-width: 1600px; }

/* ── Page header ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.page-title { font-family: 'Syne', sans-serif; font-size: 1.6rem; font-weight: 700; }
.page-subtitle { font-size: .85rem; color: var(--muted); margin-top: 3px; }

/* ── Toolbar ── */
.toolbar { display: flex; gap: 10px; margin-bottom: 20px; align-items: center; }
.search-wrap { position: relative; flex: 1; }
.search-wrap input { width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px 10px 38px; color: var(--text);
  font-size: .875rem; font-family: 'DM Sans', sans-serif; outline: none; transition: border-color .2s; }
.search-wrap input:focus { border-color: var(--accent); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* ── Buttons ── */
.btn { padding: 10px 18px; border-radius: var(--radius); font-size: .875rem; font-weight: 500;
       font-family: 'DM Sans', sans-serif; cursor: pointer; border: none; transition: all .15s;
       display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #4070e0; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-danger { background: rgba(248,113,113,.1); color: var(--red); border: 1px solid rgba(248,113,113,.2); }
.btn-danger:hover { background: rgba(248,113,113,.2); }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-success { background: rgba(52,211,153,.15); color: var(--green); border: 1px solid rgba(52,211,153,.25); }
.btn-success:hover { background: rgba(52,211,153,.25); }

/* ── Table ── */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--surface2); }
th { padding: 12px 16px; text-align: left; font-size: .72rem; font-family: 'DM Mono', monospace;
     letter-spacing: .06em; color: var(--muted); text-transform: uppercase; border-bottom: 1px solid var(--border); }
td { padding: 13px 16px; font-size: .875rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }
.actions { display: flex; gap: 6px; }

/* ── Badge ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 20px;
         font-size: .72rem; font-weight: 600; font-family: 'DM Mono', monospace; }
.badge-green { background: rgba(52,211,153,.12); color: var(--green); }
.badge-red { background: rgba(248,113,113,.12); color: var(--red); }
.badge-blue { background: rgba(91,138,245,.12); color: var(--accent); }
.badge-yellow { background: rgba(251,191,36,.12); color: var(--yellow); }

/* ── Modal ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7);
                 backdrop-filter: blur(4px); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
         padding: 28px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
         animation: slideUp .2s ease; }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-family: 'Syne', sans-serif; font-size: 1.1rem; font-weight: 700; }

/* ── Form ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: .75rem; font-family: 'DM Mono', monospace; color: var(--muted); letter-spacing: .05em; }
input[type=text], input[type=email], input[type=number], input[type=date],
textarea, select {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; color: var(--text); font-size: .875rem;
  font-family: 'DM Sans', sans-serif; outline: none; transition: border-color .2s; width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 70px; }
select option { background: var(--surface2); }
.form-footer { display: flex; gap: 10px; justify-content: flex-end;
               margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }

/* ── Stats ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat-label { font-size: .72rem; font-family: 'DM Mono', monospace; color: var(--muted); letter-spacing: .05em; }
.stat-value { font-family: 'Syne', sans-serif; font-size: 1.8rem; font-weight: 700; margin-top: 6px; }

/* ── Toast ── */
#toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 18px; border-radius: 10px;
         font-size: .875rem; font-weight: 500; z-index: 999; opacity: 0; transform: translateY(8px);
         transition: all .2s; pointer-events: none; }
#toast.show { opacity: 1; transform: translateY(0); }
#toast.success { background: rgba(52,211,153,.15); border: 1px solid rgba(52,211,153,.3); color: var(--green); }
#toast.error { background: rgba(248,113,113,.15); border: 1px solid rgba(248,113,113,.3); color: var(--red); }
#toast.info { background: rgba(91,138,245,.15); border: 1px solid rgba(91,138,245,.3); color: var(--accent); }

/* ── Empty / Loading ── */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.loading-row td { text-align: center; padding: 40px; color: var(--muted); font-size: .875rem; }

/* ── Utils ── */
.mono { font-family: 'DM Mono', monospace; font-size: .8rem; }
.text-muted { color: var(--muted); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-accent { color: var(--accent); }
