/* ------------------------------------------------------------------
   style.css — custom layer on top of W3.CSS
   Handles the app shell (sidebar/topbar), cards, and dark/light mode.
   ------------------------------------------------------------------ */

:root {
  --ars-bg: #f4f6f8;
  --ars-text: #1c2733;
  --ars-card-bg: #ffffff;
  --ars-border: #e1e6eb;
  --ars-accent: #2f6fed;
  --ars-sidebar-bg: #14213a;
  --ars-sidebar-text: #d7deea;
  --ars-topbar-bg: #ffffff;
}

body.ars-dark {
  --ars-bg: #10151c;
  --ars-text: #e6ebf1;
  --ars-card-bg: #1a212c;
  --ars-border: #29323e;
  --ars-accent: #5b8dfd;
  --ars-sidebar-bg: #0b1120;
  --ars-sidebar-text: #cbd5e3;
  --ars-topbar-bg: #131a24;
}

* { box-sizing: border-box; }

body.ars-body {
  background: var(--ars-bg);
  color: var(--ars-text);
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  margin: 0;
  transition: background .2s ease, color .2s ease;
}

a { color: var(--ars-accent); }

.ars-topbar {
  background: var(--ars-topbar-bg) !important;
  border-bottom: 1px solid var(--ars-border);
}
.ars-brand { font-weight: 700; color: var(--ars-accent); }

.ars-page.ars-with-topbar { padding-top: 51px; }
.ars-page { min-height: 100vh; }

.ars-sidebar {
  width: 220px;
  background: var(--ars-sidebar-bg);
  top: 51px;
  bottom: 0;
  padding-top: 8px;
  z-index: 3;
}
.ars-navlink { color: var(--ars-sidebar-text) !important; border-radius: 0; }
.ars-navlink:hover { background: rgba(255,255,255,0.08) !important; }

.ars-content {
  margin-left: 220px;
  padding: 24px;
}
@media (max-width: 900px) {
  .ars-sidebar { display: none; }
  .ars-sidebar.ars-sidebar-open { display: block; position: fixed; left:0; width: 240px; }
  .ars-content { margin-left: 0; }
}
.ars-sidebar-toggle { position: fixed; top: 60px; left: 10px; z-index: 4; border-radius: 6px; }

.ars-card {
  background: var(--ars-card-bg);
  border: 1px solid var(--ars-border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 18px;
}

.ars-stat {
  background: var(--ars-card-bg);
  border: 1px solid var(--ars-border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.ars-stat .num { font-size: 28px; font-weight: 700; color: var(--ars-accent); }
.ars-stat .label { font-size: 13px; opacity: .75; }

table.ars-table { background: var(--ars-card-bg); color: var(--ars-text); border-color: var(--ars-border) !important; }
table.ars-table th { background: rgba(47,111,237,0.08); }
table.ars-table, table.ars-table th, table.ars-table td { border-color: var(--ars-border) !important; }

.ars-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ars-auth-card {
  max-width: 440px;
  width: 100%;
  background: var(--ars-card-bg);
  border: 1px solid var(--ars-border);
  border-radius: 12px;
  padding: 32px;
}
.ars-auth-card.wide { max-width: 640px; }

input.w3-input, select.w3-input, textarea.w3-input {
  background: var(--ars-card-bg);
  color: var(--ars-text);
  border-color: var(--ars-border) !important;
}

.ars-flash-wrap { padding: 12px 24px 0 24px; }
.ars-badge-muted { opacity: .6; font-size: 12px; }

.ars-overdue { color: #d64545; font-weight: 700; }
.ars-not-due { opacity: .6; }
