/* Digicorns HR — Concept B (Night Desk layout, Colour Blocks palette) */
:root {
  --ground: #F3F2F5; --card: #FFFFFF; --soft: #F7F6F9; --line: #E6E3EC;
  --ink: #2D2C2D; --muted: #5B5B60; --faint: #6E6E73;
  --plum: #6B5E81; --plum-dark: #4F4466; --plum-soft: #E9E5F0;
  --teal: #5E9FAB; --teal-ink: #13282C; --teal-soft: #DCEEF1; --teal-dark: #24626D;
  --orange: #FF8A00; --orange-soft: #FFE7CC; --orange-dark: #8A4800;
  --pink: #EF3D69; --pink-soft: #FDE4EA; --pink-dark: #9E1A3E;
  --radius: 18px;
  --font: Montserrat, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--plum-dark); }
a:hover { color: #3E3452; }
h1 { font-size: 28px; font-weight: 800; margin: 2px 0 0; letter-spacing: -0.01em; }
h2 { font-size: 17px; font-weight: 800; margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 800; margin: 0 0 8px; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; color: var(--plum); text-transform: uppercase; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

/* Shell: sidebar + main, stacks on phones */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar { flex: 1 1 230px; max-width: 100%; background: var(--plum); color: #fff; padding: 22px 18px; display: flex; flex-direction: column; gap: 20px; }
.sidebar .logo { background: #fff; border-radius: 12px; padding: 8px 10px; display: flex; }
.sidebar .logo img { width: 100%; max-width: 200px; height: auto; }
.sidebar nav { display: flex; flex-direction: column; gap: 3px; }
.sidebar nav a { color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; padding: 10px 12px; border-radius: 10px; display: flex; justify-content: space-between; align-items: center; }
.sidebar nav a:hover { background: rgba(255,255,255,.12); }
.sidebar nav a.on { background: #fff; color: var(--plum-dark); font-weight: 800; }
.sidebar .navlabel { font-size: 10px; font-weight: 800; letter-spacing: .14em; color: #DCD6E6; margin: 10px 12px 2px; }
.sidebar .who { margin-top: auto; font-size: 12px; color: #E9E5F0; display: flex; flex-direction: column; gap: 8px; }
.sidebar .who form button { background: transparent; border: 1px solid rgba(255,255,255,.5); color: #fff; border-radius: 10px; padding: 8px 12px; font: 700 12px var(--font); cursor: pointer; }
.main { flex: 999 1 560px; min-width: 0; padding: 28px 28px 48px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 820px) {
  .sidebar { padding: 14px 16px; gap: 10px; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar .navlabel { display: none; }
  .sidebar .who { flex-direction: row; align-items: center; justify-content: space-between; }
  .main { padding: 18px 16px 40px; }
}
.pagehead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }

/* Cards, tiles */
.card { background: var(--card); border-radius: var(--radius); padding: 18px; }
.card.tight { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 14px; }
.grid.tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.tile { border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; }
.tile b { font-size: 34px; font-weight: 800; line-height: 1.1; }
.tile span { font-size: 13px; font-weight: 700; }
.t-teal { background: var(--teal); color: var(--teal-ink); }
.t-orange { background: var(--orange); color: var(--ink); }
.t-pink { background: var(--pink-soft); color: var(--pink-dark); }
.t-plum { background: var(--plum); color: #fff; }
.t-ink { background: var(--ink); color: #fff; }
.t-white { background: var(--card); color: var(--ink); }

/* Tables */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--faint); font-weight: 700; padding: 12px 14px; white-space: nowrap; background: var(--soft); }
td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; }
tr.dim td { color: var(--faint); }
td .sub, th .sub { display: block; font-size: 12px; color: var(--faint); }

/* Pills */
.pill { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.p-teal { background: var(--teal-soft); color: var(--teal-dark); }
.p-orange { background: var(--orange-soft); color: var(--orange-dark); }
.p-pink { background: var(--pink-soft); color: var(--pink-dark); }
.p-plum { background: var(--plum-soft); color: var(--plum-dark); }
.p-grey { background: #EDECF0; color: var(--muted); }

/* Forms */
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
input, select, textarea { font: 15px var(--font); color: var(--ink); padding: 11px 12px; border: 1px solid #D9D6E0; border-radius: 12px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid #BFB4D3; border-color: var(--plum); }
input[type=checkbox] { width: auto; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink); font-weight: 600; }
.form { display: grid; gap: 14px; }
.form .row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 11px 18px; font: 800 14px var(--font); cursor: pointer; text-decoration: none; background: var(--plum); color: #fff; min-height: 44px; }
.btn:hover { background: var(--plum-dark); color: #fff; }
.btn.light { background: #fff; color: var(--plum-dark); border: 1px solid #D9D6E0; }
.btn.light:hover { background: var(--plum-soft); }
.btn.orange { background: var(--orange); color: var(--ink); }
.btn.danger { background: var(--pink-soft); color: var(--pink-dark); }
.btn.sm { min-height: 34px; padding: 7px 12px; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.err { color: var(--pink-dark); font-size: 13px; font-weight: 600; }
.flash { padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: 14px; }
.flash.ok { background: var(--teal-soft); color: var(--teal-dark); }
.flash.bad { background: var(--pink-soft); color: var(--pink-dark); }
.flash.warn { background: var(--orange-soft); color: var(--orange-dark); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters input, .filters select { width: auto; min-width: 160px; }

/* Definition list */
.dl { display: grid; grid-template-columns: minmax(120px, 160px) 1fr; gap: 8px 14px; font-size: 14px; }
.dl dt { color: var(--faint); font-weight: 600; }
.dl dd { margin: 0; font-weight: 600; }

/* Timeline of effective-dated records */
.timeline { display: flex; flex-direction: column; gap: 10px; }
.period { background: var(--soft); border-radius: 14px; padding: 12px 14px; display: grid; gap: 4px; }
.period.now { background: var(--teal-soft); }
.period .when { font-weight: 800; font-size: 13px; }

/* Auth pages */
.authwrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.authcard { width: 100%; max-width: 420px; background: #fff; border-radius: 22px; overflow: hidden; }
.authtop { background: var(--plum); color: #fff; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.authtop .logo { background: #fff; border-radius: 12px; padding: 8px 12px; display: flex; }
.authtop .logo img { width: 100%; height: auto; }
.authbody { padding: 22px; display: grid; gap: 14px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--soft); border-radius: 12px; padding: 4px; gap: 4px; }
.tabs a { text-align: center; padding: 9px; border-radius: 9px; text-decoration: none; font-weight: 700; font-size: 13px; color: var(--muted); }
.tabs a.on { background: #fff; color: var(--plum-dark); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* Matrix */
.matrix select { min-width: 110px; padding: 7px 8px; font-size: 13px; border-radius: 9px; }
.matrix td, .matrix th { padding: 8px 10px; }
.matrix th.role { text-align: center; }
.diff td { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; word-break: break-word; }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.pagination a, .pagination span { padding: 6px 11px; border-radius: 9px; background: #fff; text-decoration: none; font-size: 13px; font-weight: 700; }
.pagination .on { background: var(--plum); color: #fff; }
:focus-visible { outline: 3px solid #BFB4D3; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
