/* ============================================================================
   SANVIT HR — theme
   Loaded AFTER style.css. Changes only how things look: no page, form or logic
   depends on this file. Delete the <link> to theme.css in base.html to undo.

   Brand palette: Deep Blue #0F3B74 · Blue #007DB8 · Teal #00A6A6
                  Green #7AC943 · Orange #F28C1E · Gray #6C757D
   Type: IBM Plex Sans · 6 sizes (12 / 13 / 14 / 16 / 20 / 24)
   Shapes: buttons + inputs 36px tall, 6px corners · cards 8px corners
   ========================================================================== */

:root {
  --font-sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;

  --bg: #f3f6fa;
  --bg-tint: none;
  --surface: #ffffff;
  --border: #dce4ed;
  --border-soft: #ebf0f5;
  --line: #dce4ed;

  --text: #13233a;
  --text-dim: #5a636b;
  --text-faint: #6c757d;
  --ink-soft: #5a636b;

  --brand: #007db8;
  --brand-dark: #0f3b74;
  --accent: #007db8;
  --accent-soft: #e1eef8;
  --grad: linear-gradient(#007db8, #007db8);
  --grad-soft: linear-gradient(#e1eef8, #e1eef8);

  --sidebar-bg: #0f3b74;
  --sidebar-glow: none;

  --ok: #2f6f14;
  --ok-bg: #e9f6de;
  --ok-line: #b9e09a;
  --warn: #8a4a05;
  --warn-bg: #fef2e4;
  --warn-line: #f6c891;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --bad-line: #f5b5ae;
  --neutral-bg: #eef2f6;
  --teal: #00a6a6;
  --violet: #0f3b74;
  --violet-bg: #e1eef8;

  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(15, 59, 116, 0.06);
  --shadow: 0 1px 3px rgba(15, 59, 116, 0.08);
  --shadow-lg: 0 8px 24px -12px rgba(15, 59, 116, 0.25);
  --glow: none;
}

/* ---------- base text ---------- */
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  background-image: none;
  color: var(--text);
}
::selection { background: rgba(0, 125, 184, 0.18); }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1 { font-size: 24px; font-weight: 600; letter-spacing: 0; }
h2 { font-size: 20px; font-weight: 600; letter-spacing: 0; }
h3 { font-size: 16px; font-weight: 600; letter-spacing: 0; }
h4, h5, h6 { font-size: 14px; font-weight: 600; letter-spacing: 0; }
.muted { color: var(--text-faint); font-size: 12px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: var(--text-dim); }

/* ---------- sidebar ---------- */
.side {
  background: var(--sidebar-bg);
  background-image: none;
  color: #d3e3f4;
  padding: 16px 12px 16px;
  gap: 2px;
}
.side .brand {
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  padding: 4px 8px 16px;
  line-height: 1.2;
}
.side .brand .mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
  padding: 4px;
}
.side .brand .mark img { width: 100%; height: auto; display: block; }
.side .brand .brand-text { display: flex; flex-direction: column; }
.side .brand .brand-text small { font-size: 11px; font-weight: 500; color: #8db4dd; }
.side a {
  padding: 7px 10px;
  border-radius: 6px;
  color: #d3e3f4;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  gap: 10px;
}
.side a .ic { width: 16px; height: 16px; }
.side a:hover:not(.active) { background: rgba(255, 255, 255, 0.08); color: #ffffff; }
.side a.active {
  background: var(--brand);
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #f28c1e;
}
.side .grp {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #8db4dd;
  margin: 16px 10px 4px;
}
.side a.signout:hover { background: rgba(242, 140, 30, 0.16); color: #ffd7ab; }

/* ---------- top of page ---------- */
.main { padding: 24px 24px 48px; }
.topbar { margin-bottom: 24px; gap: 12px; }
.topbar h1 { font-size: 24px; font-weight: 600; letter-spacing: 0; }
.topbar .sub { font-size: 13px; font-weight: 400; margin-top: 2px; }
.avatar { border-radius: 50%; background: var(--brand-dark); box-shadow: none; font-weight: 600; font-size: 12px; width: 32px; height: 32px; }
.role-chip, .date-pill { border-radius: 6px; font-size: 12px; font-weight: 500; box-shadow: none; }
.tenant-context-banner { border-radius: 6px; }

/* ---------- buttons: one height, one corner ---------- */
.btn, .btn-primary, .btn-outline, .btn-secondary, .login-btn {
  min-height: 36px;
  padding: 0 16px;
  border-radius: 6px !important;
  font: 600 14px/1 var(--font-sans);
  letter-spacing: 0;
  box-shadow: none;
  transform: none;
}
.btn, .btn-primary { background: var(--brand); color: #ffffff; border: 1px solid var(--brand); }
.btn:hover, .btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #ffffff; filter: none; transform: none; box-shadow: none; }
.btn.ghost, .btn-outline { background: #ffffff; color: var(--text); border: 1px solid #cbd5e1; font-weight: 500; }
.btn.ghost:hover, .btn-outline:hover { background: #f5f8fb; border-color: #9fb3c8; color: var(--brand-dark); transform: none; }
.btn-secondary { background: var(--neutral-bg); color: var(--text); border: 1px solid var(--border); font-weight: 500; }
.btn.link { border-radius: 6px; }
.btn-danger { background: var(--bad); border-color: var(--bad); box-shadow: none; }
.btn-danger:hover { background: #8f1c13; border-color: #8f1c13; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 6px; }
.btn-small { min-height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn:focus-visible, .btn-primary:focus-visible, .btn-outline:focus-visible { outline: 3px solid rgba(0, 125, 184, 0.3); outline-offset: 1px; }
.link-btn { font-weight: 500; }

/* ---------- inputs: same height as buttons ---------- */
input, select, textarea {
  border-radius: 6px !important;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font: 400 14px var(--font-sans) !important;
  color: var(--text);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="hidden"]), select {
  min-height: 36px;
  padding-top: 0;
  padding-bottom: 0;
}
textarea { padding: 8px 10px; }
input:hover, select:hover, textarea:hover { border-color: #9fb3c8; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 125, 184, 0.15);
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); width: 16px; height: 16px; }
.field label { font-size: 12px; font-weight: 500; letter-spacing: 0; }
.field { margin-bottom: 16px; }

/* ---------- cards, panels, stats ---------- */
.panel, .card, .stat, .stat-card, .table-wrap, .admin-form-card, .chart-panel {
  border-radius: 8px !important;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.panel { padding: 16px; }
.panel h3, .panel .phead h3, .card h3, .table-head h3 { font-size: 16px; font-weight: 600; letter-spacing: 0; }
.panel .phead .note { font-size: 12px; font-weight: 400; color: var(--text-dim); }
.stats { gap: 16px; }
.stat { padding: 16px; }
.stat:hover { transform: none; box-shadow: var(--shadow-sm); }
.stat::after { height: 3px; }
.stat.ok::after { background: #7ac943; }
.stat.warn::after { background: #f28c1e; }
.stat.bad::after { background: var(--bad); }
.stat.info::after { background: var(--brand); }
.stat.violet::after { background: var(--teal); }
.stat .lbl { font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; margin-bottom: 8px; }
.stat .val { font-size: 20px; font-weight: 600; letter-spacing: 0; }
.stat .delta { font-size: 12px; font-weight: 400; color: var(--text-dim); }
.stat.info .val { color: var(--brand-dark); }
.panels, .grid2, .grid3, .grid-3 { gap: 16px; }

/* ---------- tables ---------- */
table { font-size: 14px; }
thead th {
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-dim);
  background: #f5f8fb;
  padding: 10px 16px;
}
tbody td { padding: 12px 16px; }
tbody tr:hover { background: #f5f9fc; }
.table-head { padding: 16px; }
.namecell .initials { border-radius: 50%; background: var(--accent-soft); color: var(--brand-dark); font-weight: 600; font-size: 12px; }
.namecell .name { font-weight: 600; }
.namecell .sub { font-size: 12px; }

/* ---------- tags, chips, tabs, notices ---------- */
.badge { border-radius: 4px; padding: 2px 8px; font-size: 12px; font-weight: 600; letter-spacing: 0; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info, .badge.violet { background: var(--accent-soft); color: var(--brand-dark); }
.chip, .tab, .tabs .tab, .type-pill, .status-chip { border-radius: 6px !important; font-size: 13px; }
.chip.active, .tabs .tab.active { background: var(--brand); border-color: var(--brand); color: #ffffff; }
.notice { border-radius: 8px; font-size: 13px; }
.notice-ok { background: var(--ok-bg); border-color: var(--ok-line); }
.notice-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.flash, .alert { border-radius: 6px; font-size: 14px; }

/* ---------- payroll charts ---------- */
.payroll-mini-track i { background: var(--teal); border-radius: 4px 4px 0 0; }

/* ---------- pages with their own inline sizes ---------- */
/* Inline styles can only be outranked with !important. Corners and font family are
   brought in line everywhere; inline font sizes and spacing are left as the page set them. */
[style*="border-radius"]:is(button, a.btn, input, select, textarea) { border-radius: 6px !important; }
.card[style*="border-radius"], .panel[style*="border-radius"] { border-radius: 8px !important; }
[style*="font-family"]:not(code):not(pre):not(.mono):not(.code) { font-family: var(--font-sans) !important; }

/* ---------- v2: all buttons white, one row of actions at the top ---------- */
.btn, .btn-primary, .btn-outline, .btn-secondary, .btn.ghost, .toolbar-actions .btn, a.btn, button.btn {
  background: #ffffff !important;
  color: var(--brand-dark) !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 500;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
}
.btn:hover, .btn-primary:hover, .btn-outline:hover, .btn-secondary:hover, .btn.ghost:hover, .toolbar-actions .btn:hover {
  background: #e1eef8 !important;
  border-color: var(--brand) !important;
  color: var(--brand-dark) !important;
}
.btn-danger, .btn.btn-danger {
  background: #ffffff !important;
  color: var(--bad) !important;
  border-color: #f5b5ae !important;
}
.btn-danger:hover { background: var(--bad-bg) !important; border-color: var(--bad) !important; }
.toolbar-actions .btn { min-width: 0; height: 36px; border-radius: 6px !important; }

/* Action buttons sit in one row: no wrapping onto a second line; the row scrolls sideways on a narrow screen. */
.page-actions { align-items: center; gap: 16px; margin: 0 0 24px; }
.page-actions > .action-row, .page-actions > div:last-child,
.action-row, .toolbar-actions, .dashboard-actions, .table-head .action-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}
.toolbar-actions { justify-content: flex-end; flex: 1 1 auto; }
.action-row > *, .toolbar-actions > *, .dashboard-actions > * { flex: 0 0 auto; }

/* ---------- v3: tab buttons (Time, Recruitment, Performance, Analytics) and any other buttons ---------- */
/* Tabs: white like every other button; the selected tab is shown in light blue with a blue underline. */
.tabs { gap: 8px; padding: 8px; }
.tabs .tab, .tab, .resource-tabs a, .recruitment-tabs a, .recruitment-tabs .tab {
  background: #ffffff !important;
  color: var(--brand-dark) !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  filter: none !important;
  font: 500 14px/1 var(--font-sans) !important;
  min-height: 36px;
  padding: 0 14px !important;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.tabs .tab:hover, .tab:hover, .resource-tabs a:hover, .recruitment-tabs a:hover {
  background: #f5f9fc !important;
  border-color: var(--brand) !important;
}
.tabs .tab.active, .tab.active, .resource-tabs a.active, .recruitment-tabs a.active, .chip.active {
  background: #e1eef8 !important;
  color: var(--brand-dark) !important;
  border-color: var(--brand) !important;
  box-shadow: inset 0 -2px 0 var(--brand) !important;
  font-weight: 600 !important;
}

/* Buttons a page has coloured itself (inline style) or left without a class: white as well. */
button[style*="background"]:not(.modal-close):not(.icon-button),
a[class*="btn"][style*="background"],
input[type="submit"], input[type="button"],
button:not([class]):not([aria-label]) {
  background: #ffffff !important;
  color: var(--brand-dark) !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  font-family: var(--font-sans) !important;
  cursor: pointer;
}
button[style*="background"]:not(.modal-close):not(.icon-button):hover,
a[class*="btn"][style*="background"]:hover,
input[type="submit"]:hover, input[type="button"]:hover,
button:not([class]):not([aria-label]):hover {
  background: #e1eef8 !important;
  border-color: var(--brand) !important;
}

/* ---------- login page ---------- */
.login-page { background: var(--bg); background-image: none; font-family: var(--font-sans); }
.login-wrap { border-radius: 8px; border-color: var(--border); box-shadow: var(--shadow-lg); max-width: 960px; min-height: 580px; }
.login-art { background: #0f3b74; padding: 40px; }
.login-art::before { display: none; }
.login-logo { display: inline-flex; background: #ffffff; border-radius: 8px; padding: 12px 16px; align-self: flex-start; }
.login-logo img { height: 56px; width: auto; display: block; }
.login-art h2 { font-size: 24px; font-weight: 600; line-height: 1.35; letter-spacing: 0; color: #ffffff; max-width: 360px; }
.login-art h2 em { background: none; -webkit-background-clip: initial; background-clip: initial; color: #7ac943; font-style: normal; }
.art-point { font-size: 14px; font-weight: 500; color: #d3e3f4; }
.art-point i { border-radius: 4px; background: #00a6a6; border: 0; color: #ffffff; }
.login-art .foot { font-size: 12px; font-weight: 500; color: #8db4dd; opacity: 1; }
.login-form { padding: 48px 44px; }
.login-form h1 { font-size: 24px; font-weight: 600; letter-spacing: 0; color: var(--text); }
.login-form p.sub { font-size: 14px; margin-bottom: 24px; }
.lfield { margin-bottom: 16px; }
.lfield label { font-size: 12px; font-weight: 500; letter-spacing: 0; }
.lfield input { min-height: 40px; padding: 0 12px; border: 1px solid #cbd5e1; border-radius: 6px !important; background: #ffffff; font: 400 14px var(--font-sans) !important; }
.lfield input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 125, 184, 0.15); }
.login-btn {
  min-height: 40px; width: 100%; margin-top: 8px;
  background: #ffffff !important; color: var(--brand-dark) !important;
  border: 1px solid var(--brand) !important; border-radius: 6px !important;
  font: 600 14px var(--font-sans) !important; letter-spacing: 0; box-shadow: none !important; transform: none !important;
}
.login-btn:hover { background: #e1eef8 !important; filter: none; }
.login-note { font-size: 12px; color: var(--text-dim); }
.login-form .flash { border-radius: 6px; font-size: 13px; }
@media (max-width: 760px) { .login-art { display: none; } .login-form { width: 100%; } }
