/*
  Kua HR — Static Demo styles
  No build step. Hand-crafted to mirror kua-hr-web's design tokens.
*/

:root {
  --navy: #0D2F55;
  --navy-dark: #081E38;
  --navy-light: #1A4A7A;
  --ink-deep: #060D1A;

  --blue: #1A5CB8;
  --blue-50: #EBF3FF;
  --blue-100: #CCDFF8;

  --amber: #C98C15;
  --amber-light: #FEF3C7;
  --amber-50: #FFFBEB;

  --green: #166534;
  --green-light: #DCFCE7;

  --red: #B91C1C;
  --red-light: #FEE2E2;

  --canvas: #F5F3EE;
  --surface: #FFFFFF;
  --border: #E3DFD9;
  --border-light: #EDEBE6;

  --ink: #111827;
  --ink-2: #374151;
  --ink-3: #6B7280;
  --ink-4: #9CA3AF;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
}

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

html, body {
  height: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.5;
}

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

h1, h2, h3, h4 {
  letter-spacing: -0.02em;
  color: var(--ink);
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ── Demo banner ───────────────────────────────────────────── */
.demo-banner {
  background: var(--navy);
  color: white;
  padding: 8px 16px;
  text-align: center;
  font-size: 13px;
}
.demo-banner strong { color: var(--amber); margin-right: 6px; letter-spacing: 0.06em; }
.demo-banner a {
  color: white;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.4);
  margin-left: 8px;
}

/* ── Layout ────────────────────────────────────────────────── */
.shell {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 36px);
}

.layout {
  display: flex;
  flex: 1;
}

.sidebar {
  width: 240px;
  background: white;
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 16px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 12px;
}
.sidebar .brand .logo {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
}
.sidebar .brand .name { font-weight: 700; font-size: 14px; line-height: 1.1; }
.sidebar .brand .meta { font-size: 11px; color: var(--ink-3); }

.sidebar .group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-4);
  font-weight: 600;
  padding: 12px 10px 6px;
}

.sidebar a.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  font-weight: 500;
  font-size: 14px;
}
.sidebar a.nav:hover {
  background: var(--canvas);
  text-decoration: none;
}
.sidebar a.nav.active {
  background: var(--navy);
  color: white;
}
.sidebar a.nav .ico {
  width: 16px; height: 16px;
  display: inline-block;
  flex-shrink: 0;
}

.sidebar .me {
  margin-top: auto;
  padding: 12px 10px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar .me .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--blue-50);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
}
.sidebar .me .who { font-weight: 600; font-size: 13px; }
.sidebar .me .role { font-size: 11px; color: var(--ink-3); }

/* Top bar */
.topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar .crumbs {
  font-size: 13px;
  color: var(--ink-3);
}
.topbar .persona {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-3);
}
.persona-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
}
.persona-toggle a {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}
.persona-toggle a.active {
  background: white;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* Main */
main {
  flex: 1;
  padding: 24px 32px 64px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  align-self: flex-start;
}

@media (max-width: 900px) {
  .sidebar {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    overflow-x: auto;
    padding: 12px;
    gap: 6px;
  }
  .sidebar .brand, .sidebar .me, .sidebar .group-label { display: none; }
  .sidebar a.nav { white-space: nowrap; }
  .layout { flex-direction: column; }
  main { padding: 16px; }
}

/* ── Page header ───────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-header .desc {
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 13px;
}
.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  font-weight: 700;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card.compact { padding: 16px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat .label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.stat .value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.stat .hint {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 4px;
}
.stat .ico {
  width: 18px; height: 18px;
  color: var(--ink-3);
}
.stat.amber { border-color: #F4D38C; }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}
@media (max-width: 720px) { .split { grid-template-columns: 1fr; } }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  border-radius: 10px;
  padding: 9px 16px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
}
.btn-primary { background: var(--navy); color: white; }
.btn-primary:hover { background: var(--navy-light); text-decoration: none; }
.btn-outline {
  background: white; color: var(--ink);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--canvas); text-decoration: none; }
.btn-green { background: var(--green); color: white; }
.btn-green:hover { filter: brightness(1.05); text-decoration: none; }
.btn-danger-outline {
  background: white; color: var(--red);
  border: 1px solid var(--border);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

/* ── Table ─────────────────────────────────────────────────── */
table.data {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
table.data thead {
  background: var(--canvas);
}
table.data th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 600;
  padding: 12px 14px;
}
table.data td {
  padding: 12px 14px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--ink-2);
  vertical-align: middle;
}
table.data tr:hover { background: rgba(245, 243, 238, 0.5); }
.tnum { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.muted { color: var(--ink-3); }

/* ── Pills / badges ────────────────────────────────────────── */
.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}
.pill-green { background: var(--green-light); color: var(--green); }
.pill-amber { background: var(--amber-light); color: var(--amber); }
.pill-blue { background: var(--blue-50); color: var(--blue); }
.pill-red { background: var(--red-light); color: var(--red); }
.pill-slate { background: #E2E8F0; color: #334155; }

/* ── Avatars ───────────────────────────────────────────────── */
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--blue-50);
  color: var(--blue);
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
}
.row-emp {
  display: flex; align-items: center; gap: 10px;
}
.row-emp .who { font-weight: 600; color: var(--ink); font-size: 13px; }
.row-emp .email { font-size: 11px; color: var(--ink-3); }

/* ── Forms (look only, not interactive) ────────────────────── */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-family: inherit;
}

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  font-size: 13px;
}
.alert-amber {
  background: #FFFAEB;
  border: 1px solid #FBE5A1;
  color: #92400E;
}
.alert-amber strong { color: #78350F; display: block; }

/* ── List sections ─────────────────────────────────────────── */
.list { list-style: none; }
.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border-light);
}
.list li:first-child { border-top: 0; }

/* ── Run cards ─────────────────────────────────────────────── */
.run-card { margin-bottom: 12px; }
.run-card .head {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.run-card .head h3 { font-size: 16px; font-weight: 700; }
.run-card .head .meta { font-size: 12px; color: var(--ink-3); }
.run-card .stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 600px) { .run-card .stats { grid-template-columns: repeat(2, 1fr); } }
.run-card .stats .v {
  font-weight: 700; font-size: 14px;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.run-card .stats .v.big { font-size: 16px; font-weight: 800; }
.run-card .actions {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 10px; margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.run-card .actions .note {
  flex: 1;
  font-size: 12px;
  color: var(--ink-3);
  max-width: 480px;
}

/* ── Mini icon set ─────────────────────────────────────────── */
.ico-svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
