/* NOD theme — matches NOS (Nováre OS) palette and component shapes
   Source of truth: ~/Desktop/Claude/accounting/client/src/utils/colors.js */

:root {
  --bg: #f0f2f5;
  --sidebar: #1a1f36;
  --sidebar-hover: #272d45;
  --sidebar-active: #3b82f6;
  --white: #ffffff;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

body { display: flex; min-height: 100vh; }

/* ── SIDEBAR (dark navy, matches NOS) ───────────────── */
#sidebar {
  width: 220px;
  background: var(--sidebar);
  color: var(--white);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  padding: 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.logo {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.2px;
}
.logo-novare { color: #ffffff; }
.logo-suffix {
  color: #33AADD;
  font-weight: 900;
  font-style: italic;
  margin-left: 6px;
}
.brand-tag {
  font-size: 11px; color: rgba(255,255,255,0.55); margin-top: 4px;
}
#sidebar nav {
  flex: 1; padding: 8px 0; display: flex; flex-direction: column;
}
.nav-section {
  padding: 10px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}
#sidebar nav a {
  display: flex; align-items: center;
  padding: 10px 16px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.15s;
  gap: 10px;
  border: none;
}
.nav-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
#sidebar nav a:hover {
  background: var(--sidebar-hover);
  color: var(--white);
}
#sidebar nav a.active {
  background: var(--sidebar-active);
  color: var(--white);
}
#sidebar .footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
}
.health-dot {
  width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.3);
}
.health-dot.ok { background: var(--success); }
.health-dot.fail { background: var(--danger); }

/* ── MAIN ──────────────────────────────────────────── */
#main {
  flex: 1;
  padding: 0;
  max-width: 1200px;
  overflow-y: auto;
}
#topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 32px 12px;
  background: transparent;
}
#topbar h1 { margin: 0; font-size: 24px; font-weight: 700; color: var(--text); }
#view-container { padding: 12px 32px 32px; flex: 1; }

/* ── CARDS / STATCARDS (matches NOS Shared.Card) ─── */
.cards {
  display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.card {
  flex: 1; min-width: 180px;
  background: var(--white);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--card-shadow);
}
.card .label {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.card .value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}
.card .sub {
  font-size: 12px; color: var(--text-light); margin-top: 4px;
}
.card.ok   .value { color: var(--success); }
.card.warn .value { color: var(--warning); }
.card.fail .value { color: var(--danger);  }

/* ── TABLES ─────────────────────────────────────── */
table {
  width: 100%; border-collapse: collapse;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
  background: var(--white);
}
td {
  padding: 10px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* ── PILLS / STATUS BADGES ─────────────────────── */
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pill.ok    { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.pill.warn  { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.pill.fail  { background: rgba(239, 68, 68, 0.12);  color: var(--danger);  }
.pill.muted { background: rgba(100, 116, 139, 0.12); color: var(--text-light); }

/* ── BUTTONS ────────────────────────────────────── */
button, .btn {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  font-family: inherit;
}
button:hover, .btn:hover { opacity: 0.9; }
button.secondary, .btn.secondary {
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--border);
}
button.secondary:hover, .btn.secondary:hover {
  background: #f8fafc; opacity: 1;
}
button.danger, .btn.danger { background: var(--danger); }

/* ── FORMS ──────────────────────────────────────── */
input, select, textarea {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
label {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 4px;
}

.row { display: flex; gap: 12px; align-items: center; }
.muted { color: var(--text-light); }

/* ── MODAL ──────────────────────────────────────── */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--white);
  border-radius: 12px;
  padding: 24px;
  min-width: 380px;
  max-width: 600px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal h2 { margin: 0 0 16px; font-size: 18px; color: var(--text); font-weight: 700; }
.modal .form-row { margin-bottom: 14px; }
.modal .actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 22px;
}

/* ── EMPTY / SECTION HEAD ──────────────────────── */
.empty {
  padding: 40px;
  text-align: center;
  color: var(--text-light);
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
}
.section-head {
  display: flex; justify-content: space-between; align-items: center;
  margin: 12px 0 14px;
}
.section-head h2 {
  margin: 0; font-size: 16px; font-weight: 700; color: var(--text);
}

/* ── CODE STYLING ─────────────────────────────── */
code {
  background: rgba(59, 130, 246, 0.08);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ── SCROLLBAR ────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::selection { background: var(--primary); color: var(--white); }
