/* =============================================
   NIVOS — Premium Minimalist Design System 2026
   Light / Dark mode
   Accent: Neon Green #2CFF05
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── LIGHT (default) ─── */
:root {
  --bg:       #FFFFFF;
  --bg-alt:   #F7F7F7;
  --text:     #0F1115;
  --text-sec: #6B7280;
  --muted:    #9CA3AF;
  --border:   #EAEAEA;
  --accent:   #2CFF05;
  --accent-hover: #24D904;
  --accent-soft:  #B7FFB0;
  --accent-bg:    rgba(44,255,5,.06);
  --accent-bg-hover: rgba(44,255,5,.10);
  --panel:    #FFFFFF;
  --shadow-sm:  0 1px 2px rgba(0,0,0,.04);
  --shadow-card: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-hover: 0 4px 12px rgba(0,0,0,.08);
  --radius:   16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  color-scheme: light;
}

/* ─── DARK ─── */
html.dark {
  --bg:       #0A0A0B;
  --bg-alt:   #111113;
  --text:     #F5F5F5;
  --text-sec: #A1A1AA;
  --muted:    #71717A;
  --border:   #27272A;
  --accent:   #2CFF05;
  --accent-hover: #24D904;
  --accent-soft:  #1A3D12;
  --accent-bg:    rgba(44,255,5,.08);
  --accent-bg-hover: rgba(44,255,5,.14);
  --panel:    #141416;
  --shadow-sm:  0 1px 2px rgba(0,0,0,.30);
  --shadow-card: 0 1px 3px rgba(0,0,0,.40), 0 1px 2px rgba(0,0,0,.25);
  --shadow-hover: 0 4px 16px rgba(0,0,0,.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }

/* ─── Topbar ─── */
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar .brand { font-weight: 700; font-size: 15px; color: var(--text); }
.topbar .right { display: flex; gap: 12px; align-items: center; }

.muted { color: var(--muted); font-size: 13px; }
.link  { color: var(--text-sec); font-size: 13px; transition: color .15s; }
.link:hover { color: var(--text); }

/* ─── Shell ─── */
.shell { display: flex; min-height: calc(100vh - 56px); }

/* ─── Sidebar ─── */
.sidebar {
  width: 220px;
  padding: 20px 12px;
  border-right: 1px solid var(--border);
  background: var(--bg);
}

.sidebar .logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--text);
  color: var(--accent);
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 20px;
}

.sidebar nav { display: flex; flex-direction: column; gap: 4px; }

.sidebar a {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-sec);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all .15s ease;
}

.sidebar a:hover {
  color: var(--text);
  background: var(--bg-alt);
}

.sidebar a.active {
  color: var(--text);
  background: var(--accent-bg);
  border-color: rgba(44,255,5,.15);
}

/* ─── Content ─── */
.content { flex: 1; padding: 24px; background: var(--bg-alt); }

/* ─── Card ─── */
.card {
  max-width: 440px;
  margin: 64px auto;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

/* ─── Typography ─── */
h1 { margin: 0 0 6px; font-size: 22px; font-weight: 700; color: var(--text); }
p  { margin: 0 0 16px; color: var(--text-sec); font-size: 14px; }

/* ─── Form ─── */
label {
  display: block;
  margin: 14px 0 6px;
  color: var(--text-sec);
  font-size: 13px;
  font-weight: 500;
}

input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

input::placeholder, textarea::placeholder {
  color: var(--muted);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(44,255,5,.10);
}

/* ─── Button ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 16px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s ease;
}

.btn:hover {
  background: var(--accent-bg-hover);
  border-color: var(--accent);
  color: var(--text);
}

.btn-primary {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.btn-primary:hover {
  background: #1a1d25;
  border-color: #1a1d25;
}

/* ─── Small / Links ─── */
.small { margin-top: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.small a { color: var(--text); font-weight: 500; }
.small a:hover { text-decoration: underline; }

/* ─── Table ─── */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.table th, .table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 13px;
}

.table th {
  color: var(--text-sec);
  font-weight: 600;
  background: var(--bg-alt);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-alt); }

.row-actions a { color: var(--text); font-weight: 500; }
.row-actions a:hover { text-decoration: underline; }

/* ─── Actions ─── */
.top-actions { display: flex; gap: 10px; margin: 0 0 16px; }

.top-actions a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
}

.top-actions a:hover {
  background: var(--bg-alt);
  border-color: var(--accent);
}

/* ─── Alerts ─── */
.error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin: 12px 0;
  font-size: 13px;
}

.ok {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: #166534;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin: 12px 0;
  font-size: 13px;
}

/* ─── Utilities ─── */
.accent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-alt);
}

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

/* ─── Theme-aware buttons ─── */
.nv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s ease;
  border: 1px solid transparent;
}

.nv-btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.nv-btn-primary:hover {
  opacity: .88;
}

.nv-btn-secondary {
  background: var(--panel);
  color: var(--text-sec);
  border-color: var(--border);
}
.nv-btn-secondary:hover {
  background: var(--bg-alt);
  color: var(--text);
}

/* ─── Theme-aware badges ─── */
.nv-badge-ok {
  background: rgba(34,197,94,.10);
  color: #16a34a;
  border: 1px solid rgba(34,197,94,.25);
}
html.dark .nv-badge-ok {
  background: rgba(34,197,94,.15);
  color: #4ade80;
  border-color: rgba(34,197,94,.30);
}

.nv-badge-err {
  background: rgba(239,68,68,.10);
  color: #dc2626;
  border: 1px solid rgba(239,68,68,.25);
}
html.dark .nv-badge-err {
  background: rgba(239,68,68,.15);
  color: #f87171;
  border-color: rgba(239,68,68,.30);
}

/* ─── Theme-aware alerts ─── */
.nv-alert-ok {
  background: rgba(34,197,94,.08);
  border: 1px solid rgba(34,197,94,.20);
  color: #166534;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
}
html.dark .nv-alert-ok {
  background: rgba(34,197,94,.12);
  border-color: rgba(34,197,94,.25);
  color: #86efac;
}

.nv-alert-err {
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.20);
  color: #991b1b;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
}
html.dark .nv-alert-err {
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.25);
  color: #fca5a5;
}
