/* =========================================================
   Vutto · People Performance Culture
   Professional HR product
   v11 — add: .brand-trigger wrapper + .brand-menu dropdown for Vutto logo
         click-to-open menu with "Vutto 360° Portal" (current) and "vutto.in" link.
         v11b — fix: reset <button> defaults on .brand-trigger (transparent bg,
              no border, no padding) so it doesn't show browser-default gray.
         v12 — add: .reset-data-btn + .reset-confirm modal styles for the
              "Reset Demo Data" button on the login page (clears all
              localStorage keys and re-seeds fresh demo data).
   v13 — add: access-role badges (.access-badge.access-hr/admin/founder/employee)
              and the .role-desc help text under the role dropdown in
              the Add Employee modal.
   v13b — add: .role-security-note (lock icon + muted text shown to HR
              users explaining why they can't grant Admin/Founder access).
   v14 — change: .demo-grid now 2-column (was 1-column); mobile collapses
              to 1 column. Lays out HR + Admin in a single row on desktop
              so the two privileged quick-login buttons sit side-by-side.
   v10 — fix: removed .content > * fadeIn animation that created per-element
         CSS stacking contexts, trapping the .custom-select-list inside its
         parent .card and making it clip behind sibling cards (All Assignments).
         Also bumped .custom-select-list z-index to 9999 defensively.
         v9 — cache-bust bump after v8 regression fix
   ========================================================= */

:root {
  --vutto-red:        #D23757;
  --vutto-red-600:    #B22B49;
  --vutto-red-50:     #FDF1F4;
  --vutto-red-100:    #FAD8DF;
  --vutto-red-200:    #F5B6C1;

  --bg:        #F5F6F8;
  --surface:   #FFFFFF;
  --surface-2: #FAFBFC;
  --line:      #E5E7EB;
  --line-2:    #EEF0F3;
  --ink:       #0F172A;
  --ink-soft:  #475569;
  --ink-mute:  #64748B;
  --sidebar-bg:#0F172A;
  --sidebar-fg:#94A3B8;

  --success: #16a34a;
  --warning: #d97706;
  --danger:  #dc2626;

  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .10);
  --shadow-xl: 0 24px 60px rgba(15, 23, 42, .14);

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Sora', 'Inter', -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { overflow-x: hidden; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.55;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
button { font-family: inherit; }
a { color: var(--vutto-red); }

.view { display: none; }
.view.active { display: block; }

/* =========================================================
   LOGIN — Clean centered card on white background
   ========================================================= */
.login-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface);
  padding: 0;
}

/* Top header with logo */
.login-header {
  width: 100%;
  padding: 28px 40px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line-2);
}

/* ----- Brand trigger + dropdown menu (v11) ----- */
.brand-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  border-radius: var(--r-sm);
  transition: opacity .12s;
}
.brand-trigger:hover { opacity: .85; }
.brand-trigger:focus-visible {
  box-shadow: 0 0 0 3px var(--vutto-red-50);
}
.brand-trigger .chevron {
  margin-left: 10px;
  color: var(--ink-mute);
  display: inline-flex;
  transition: transform .15s, color .12s;
}
.brand-trigger:hover .chevron,
.brand-trigger.is-open .chevron { color: var(--vutto-red); }
.brand-trigger.is-open .chevron { transform: rotate(180deg); }

/* Dark variant — used inside the sidebar (dark background) */
.brand-trigger.dark .chevron { color: var(--sidebar-fg); }
.brand-trigger.dark:hover .chevron,
.brand-trigger.dark.is-open .chevron { color: #fff; }
.brand-trigger.dark:hover { opacity: 1; }
.brand-trigger.dark:focus-visible {
  box-shadow: 0 0 0 3px rgba(255,255,255,.08);
}

/* Dropdown menu */
.brand-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(-4px) scale(.98);
  pointer-events: none;
  transition: opacity .12s, transform .12s;
}
.brand-trigger.is-open .brand-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.brand-menu-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  text-decoration: none;
  transition: background .1s;
}
.brand-menu-item:hover,
.brand-menu-item:focus-visible {
  background: var(--vutto-red-50);
  outline: none;
}
.brand-menu-item .item-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--vutto-red);
}
.brand-menu-item .item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.brand-menu-item .item-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}
.brand-menu-item .item-sub {
  font-size: 11.5px;
  color: var(--ink-mute);
  line-height: 1.3;
}
.brand-menu-item.is-current {
  cursor: default;
  background: transparent;
}
.brand-menu-item.is-current .item-title {
  color: var(--ink-soft);
  font-weight: 600;
}
.brand-menu-item.is-current .item-icon {
  color: var(--ink-mute);
}
.brand-menu-item.is-current .item-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--vutto-red);
  background: var(--vutto-red-50);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
  align-self: flex-start;
}
.brand-menu-item .item-ext {
  margin-left: auto;
  color: var(--ink-mute);
  align-self: center;
  display: flex;
  opacity: .6;
}
.brand-menu-item:hover .item-ext { color: var(--vutto-red); opacity: 1; }
.brand-menu-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

/* On mobile the dropdown still floats but anchors from the trigger */
.brand-logo {
  height: 28px;
  width: auto;
  display: block;
}

/* The card */
.login-card {
  width: 100%;
  max-width: 420px;
  margin: auto;
  padding: 32px 28px;
}
.login-card.narrow { max-width: 400px; }

.login-card-inner {
  width: 100%;
}

/* Big slogan — typographic poster style */
.login-slogan {
  margin: -8px 0 32px;
  padding: 0;
  border-left: 4px solid var(--vutto-red);
  padding-left: 18px;
}
.slogan-line {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.0;
  color: var(--ink);
  margin-bottom: 2px;
}
.slogan-line span {
  display: inline-block;
  position: relative;
}
.slogan-line:nth-child(2) span {
  color: var(--vutto-red);
}
.slogan-line:last-child { margin-bottom: 0; }

/* Header inside the card */
.login-head { margin-bottom: 28px; }
.login-title {
  font-size: 22px;
  letter-spacing: -.02em;
  margin-bottom: 6px;
  color: var(--ink);
  font-weight: 700;
}
.login-tag {
  color: var(--ink-mute);
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
}

/* Form */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span {
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 600;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--vutto-red);
  box-shadow: 0 0 0 3px rgba(210, 55, 87, .10);
}
.field input::placeholder { color: var(--ink-mute); }

.pwd-wrap { position: relative; }
.pwd-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent;
  color: var(--vutto-red); font-size: 12px; font-weight: 600;
  padding: 4px 8px; cursor: pointer; border-radius: 6px;
}
.pwd-toggle:hover { background: var(--vutto-red-50); }

.form-error { color: var(--danger); font-size: 12px; margin: 0; min-height: 16px; }

/* Divider */
.login-divider {
  display: flex;
  align-items: center;
  margin: 28px 0 16px;
  gap: 12px;
  color: var(--ink-mute);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 600;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Demo buttons */
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-btn {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: all .15s;
}
.demo-btn:hover {
  border-color: var(--vutto-red);
  background: var(--vutto-red-50);
}
.demo-left { display: flex; flex-direction: column; gap: 2px; }
.demo-role { font-size: 13px; font-weight: 600; color: var(--ink); }
.demo-creds {
  font-size: 11.5px;
  color: var(--ink-mute);
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
}
.demo-arrow {
  color: var(--ink-mute);
  font-size: 16px;
  transition: color .15s, transform .15s;
}
.demo-btn:hover .demo-arrow {
  color: var(--vutto-red);
  transform: translateX(2px);
}

/* Footer */
.login-footer {
  width: 100%;
  padding: 24px 40px;
  border-top: 1px solid var(--line-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: auto;
}
.login-foot-meta { color: var(--ink-mute); }

/* ----- Reset Demo Data button (v12) ----- */
.login-card-foot {
  display: flex;
  justify-content: center;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}
.reset-data-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-mute);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.reset-data-btn:hover {
  background: var(--vutto-red-50);
  border-color: var(--vutto-red-200);
  color: var(--vutto-red);
}
.reset-data-btn:active { transform: translateY(1px); }
.reset-data-btn .reset-icon { display: inline-flex; }

/* Reset confirmation modal */
.reset-confirm {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.reset-confirm-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.reset-confirm-head .icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--vutto-red-50);
  color: var(--vutto-red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.reset-confirm-head h2 {
  margin: 0;
  font-size: 17px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}
.reset-confirm-head .sub {
  font-size: 12.5px;
  color: var(--ink-mute);
  margin-top: 2px;
}
.reset-confirm-body {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.reset-confirm-list {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--ink-soft);
  list-style: none;
  margin: 0;
}
.reset-confirm-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.reset-confirm-list li::before {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--vutto-red);
  border-radius: 50%;
  flex-shrink: 0;
}
.reset-confirm-list b {
  color: var(--ink);
  font-weight: 600;
}
.reset-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 6px;
}

/* ----- Access role badge + role description (v13) ----- */
.role-field-wrap { gap: 8px; }
.role-desc {
  line-height: 1.5;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  border-left: 2px solid var(--vutto-red);
  transition: background .12s;
}
.role-security-note {
  padding: 7px 10px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  border-left: 2px solid var(--ink-mute);
  margin-top: 4px;
}
.role-security-note svg { flex-shrink: 0; }
.access-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.access-badge.access-hr       { background: var(--vutto-red-50);  color: var(--vutto-red); }
.access-badge.access-admin    { background: #0F172A;             color: #fff; }
.access-badge.access-founder  { background: var(--vutto-red-100); color: var(--vutto-red-600); }
.access-badge.access-employee { background: #EEF0F3;             color: #475569; }

/* =========================================================
   APP SHELL — fixed sidebar, scrollable content
   ========================================================= */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
  width: 100%;
  max-width: 100vw;
}

/* SIDEBAR — truly fixed via fixed positioning */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 40;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.brand-mark-img {
  height: 28px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}
.sidebar .brand-name {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.01em;
}
.sidebar .brand-sub { color: rgba(255,255,255,.5); font-size: 11px; }

.nav {
  padding: 14px 12px;
  display: flex; flex-direction: column; gap: 2px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  color: var(--sidebar-fg);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: background .12s, color .12s;
  white-space: nowrap;
  min-width: 0;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active {
  background: var(--vutto-red);
  color: #fff;
}

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
  background: var(--sidebar-bg);
}
.sidebar-user .who { flex: 1; min-width: 0; overflow: hidden; }
.sidebar-user .who-name { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .who-role { color: rgba(255,255,255,.5); font-size: 11px; }
.icon-btn {
  background: transparent; border: none; color: var(--sidebar-fg);
  padding: 8px; border-radius: 8px; cursor: pointer;
  transition: background .12s, color .12s;
}
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }

/* MAIN — offset for the fixed sidebar */
.main {
  grid-column: 2;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
  gap: 16px;
}
.eyebrow {
  color: var(--vutto-red);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin-top: 4px;
  color: var(--ink);
  letter-spacing: -.02em;
}
.topbar-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.today {
  color: var(--ink-soft);
  font-size: 12.5px;
  padding: 5px 10px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
}

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--vutto-red);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 600; font-size: 13px;
  flex-shrink: 0;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.xl { width: 72px; height: 72px; font-size: 24px; }

.content {
  padding: 32px;
  flex: 1;
  max-width: 100%;
  overflow-x: hidden;
}

/* NOTE: fadeIn animation removed (v10) — it created a per-element CSS animation
   stacking context that trapped the custom-select dropdown inside its parent .card,
   making it visually clip behind sibling cards. Animation was also flagged as
   "childish / decorative" earlier. */

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: var(--vutto-red);
  color: #fff;
  font-weight: 600; font-size: 13.5px;
  cursor: pointer;
  transition: background .12s, transform .08s;
  white-space: nowrap;
  font-family: inherit;
}
.btn:hover { background: var(--vutto-red-600); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-ghost {
  background: var(--surface);
  color: var(--ink-soft);
  border-color: var(--line);
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--ink-mute);
}
.btn-soft {
  background: var(--vutto-red-50);
  color: var(--vutto-red);
}
.btn-soft:hover { background: var(--vutto-red-100); }
.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(220, 38, 38, .25);
}
.btn-danger:hover { background: rgba(220, 38, 38, .06); }
.btn-danger-solid {
  background: var(--danger);
  color: #fff;
}
.btn-danger-solid:hover { background: #b91c1c; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* =========================================================
   CARDS & LAYOUT
   ========================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 18px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.card-sub { color: var(--ink-mute); font-size: 12.5px; margin-top: 3px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  min-width: 0;
}
.kpi .label {
  color: var(--ink-mute);
  font-size: 12px;
  font-weight: 500;
}
.kpi .value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  margin-top: 6px;
  color: var(--ink);
  letter-spacing: -.02em;
}
.kpi.accent .value { color: var(--vutto-red); }
.kpi .delta { font-size: 11.5px; margin-top: 4px; color: var(--ink-mute); }

.progress {
  height: 8px;
  background: var(--line-2);
  border-radius: 999px;
  overflow: hidden;
}
.progress > span {
  display: block; height: 100%;
  background: var(--vutto-red);
  border-radius: 999px;
  transition: width .6s cubic-bezier(.22,1,.36,1);
}

/* =========================================================
   TABLE
   ========================================================= */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 600px;
}
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
th {
  background: var(--surface-2);
  font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-mute);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--line-2);
  color: var(--ink-soft);
  white-space: nowrap;
}
.badge.success { background: rgba(22,163,74,.10); color: var(--success); }
.badge.warn    { background: rgba(217,119,6,.12); color: var(--warning); }
.badge.danger  { background: rgba(220,38,38,.10); color: var(--danger); }
.badge.pink    { background: var(--vutto-red-50); color: var(--vutto-red); }

/* =========================================================
   FORMS
   ========================================================= */
.section-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}

.searchable { position: relative; }
.searchable input {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  font: inherit;
  color: var(--ink);
  outline: none;
}
.searchable input:focus {
  border-color: var(--vutto-red);
  box-shadow: 0 0 0 3px rgba(210, 55, 87, .10);
}
.searchable .dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  max-height: 240px; overflow-y: auto;
  overflow-x: hidden;
  z-index: 20;
}
.searchable .option {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--line-2);
}
.searchable .option:last-child { border-bottom: none; }
.searchable .option:hover {
  background: var(--vutto-red-50);
  color: var(--vutto-red);
}
.searchable .option .sub { color: var(--ink-mute); font-size: 11px; display: block; margin-top: 1px; }

/* =========================================================
   CUSTOM SELECT — replaces native <select>
   ========================================================= */
.custom-select {
  position: relative;
  width: 100%;
}
.custom-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.custom-select-trigger:hover {
  border-color: var(--ink-mute);
}
.custom-select-trigger:focus,
.custom-select-trigger.open {
  outline: none;
  border-color: var(--vutto-red);
  box-shadow: 0 0 0 3px rgba(210, 55, 87, .10);
}
.custom-select-trigger.open {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.custom-select-value {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.custom-select-value.muted {
  color: var(--ink-mute);
}
.custom-select-value.selected {
  color: var(--ink);
}
.custom-select-arrow {
  display: flex;
  align-items: center;
  color: var(--ink-mute);
  margin-left: 8px;
  transition: transform .15s;
}
.custom-select-trigger.open .custom-select-arrow {
  transform: rotate(180deg);
  color: var(--vutto-red);
}
.custom-select-list {
  position: absolute;
  left: 0; right: 0;
  top: 100%;
  margin-top: -1px;
  background: var(--surface);
  border: 1px solid var(--vutto-red);
  border-top: none;
  border-radius: 0 0 var(--r-md) var(--r-md);
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
  z-index: 9999;
}
.custom-select-option {
  padding: 9px 13px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
  border-left: 3px solid transparent;
  transition: background .12s, border-color .12s;
}
.custom-select-option:hover {
  background: var(--vutto-red-50);
  border-left-color: var(--vutto-red-200);
}
.custom-select-option.is-active {
  background: var(--vutto-red);
  color: #fff;
  border-left-color: var(--vutto-red);
}

.eval-row {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 1.4fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

/* =========================================================
   MODAL
   ========================================================= */
.modal-root {
  position: fixed; inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  background: rgba(15, 23, 42, .5);
  z-index: 100;
  padding: 24px;
  overflow-y: auto;
}
.modal-root.active { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  width: 100%; max-width: 720px;
  margin: auto;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: var(--shadow-xl);
}
.modal.wide { max-width: 880px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
  gap: 12px;
}
.modal-head h2 { font-size: 16px; }
.modal-head .sub { color: var(--ink-mute); font-size: 12.5px; margin-top: 3px; }
.modal-body { padding: 22px 24px; }
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 10px;
  position: sticky; bottom: 0; background: var(--surface);
}

/* =========================================================
   FEEDBACK SPECIFIC
   ========================================================= */
.values-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.value-item {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  background: var(--surface-2);
}
.value-item h4 { font-size: 13px; margin-bottom: 4px; font-family: var(--font-display); font-weight: 600; }
.value-item .desc { color: var(--ink-mute); font-size: 11.5px; margin-bottom: 10px; line-height: 1.5; }

.rating {
  display: flex; gap: 6px;
}
.rating label {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: all .12s;
}
.rating label:hover { border-color: var(--vutto-red); color: var(--vutto-red); }
.rating input { display: none; }
.rating input:checked + label {
  background: var(--vutto-red);
  color: #fff;
  border-color: var(--vutto-red);
}
.rating input[value="1"]:checked + label {
  background: var(--danger);
  border-color: var(--danger);
}

.kra-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  background: var(--surface-2);
  margin-bottom: 10px;
}

/* =========================================================
   REPORT
   ========================================================= */
.report-hero {
  display: flex; align-items: center; gap: 18px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  flex-wrap: wrap;
}
.report-hero .who { flex: 1; min-width: 200px; }
.report-hero h2 { font-size: 22px; }
.report-hero .meta { color: var(--ink-mute); font-size: 13px; margin-top: 4px; }

.value-row {
  display: grid;
  grid-template-columns: 200px 1fr 80px;
  gap: 16px; align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
}
.value-row:last-child { border-bottom: none; }
.value-row .label { font-size: 13px; font-weight: 500; }
.value-row .score {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--vutto-red);
  text-align: right;
  font-size: 15px;
}

.feedback-block {
  padding: 14px;
  border-left: 3px solid var(--vutto-red);
  background: var(--surface-2);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  margin-bottom: 10px;
}
.feedback-block .who-line {
  font-size: 12px;
  color: var(--vutto-red);
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: .02em;
}

/* =========================================================
   TOAST
   ========================================================= */
.toast-root {
  position: fixed; top: 20px; right: 20px;
  z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  max-width: calc(100vw - 40px);
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 11px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  max-width: 360px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warn { background: var(--warning); }

/* =========================================================
   UTILS
   ========================================================= */
.muted { color: var(--ink-mute); }
.small { font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.flex-1 { flex: 1; min-width: 0; }
.hidden { display: none !important; }
hr.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-mute);
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-2);
}
.empty strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
}

.activity-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  gap: 12px;
}
.activity-item:last-child { border-bottom: none; }
.activity-item .text { flex: 1; font-size: 13px; min-width: 0; }
.activity-item .time { font-size: 11.5px; color: var(--ink-mute); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 24px; }
  .topbar { padding: 16px 20px; }
}

@media (max-width: 768px) {
  .login-header { padding: 22px 24px; }
  .login-card { padding: 24px 20px; }
  .login-footer { padding: 18px 24px; flex-direction: column; gap: 4px; align-items: flex-start; }

  .slogan-line { font-size: 24px; }
  .login-slogan { padding-left: 14px; border-left-width: 3px; }

  /* Demo buttons stack 1-up on mobile so they don't get cramped */
  .demo-grid { grid-template-columns: 1fr; }

  /* App shell: sidebar becomes a fixed bottom nav, main takes full width */
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  .sidebar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    top: auto;
    width: 100%;
    height: auto;
    flex-direction: row;
    padding: 8px 6px;
    border-top: 1px solid rgba(255,255,255,.08);
    overflow: visible;
    z-index: 50;
  }
  .sidebar-brand { display: none; }
  .sidebar-user { display: none; }
  .nav {
    flex-direction: row;
    justify-content: space-around;
    padding: 0;
    gap: 0;
    overflow-y: hidden;
    overflow-x: auto;
    flex: 1;
  }
  .nav-item {
    flex-direction: column;
    gap: 3px;
    padding: 6px 8px;
    font-size: 10.5px;
    flex: 1;
    text-align: center;
    min-width: 64px;
  }
  .nav-item.active { background: transparent; color: var(--vutto-red); }

  .main {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
  }
  .content { padding: 18px 16px 90px; }
  .topbar { padding: 14px 16px; }
  .today { display: none; }
  .page-title { font-size: 18px; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .eval-row { grid-template-columns: 1fr; }
  .values-grid { grid-template-columns: 1fr; }
  .value-row { grid-template-columns: 1fr; gap: 6px; }
  .value-row .score { text-align: left; }
  .report-hero { flex-direction: column; align-items: flex-start; }
  .modal-root { padding: 0; }
  .modal { max-height: 100vh; border-radius: 0; }
  .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; }
  table { min-width: 100%; font-size: 12.5px; }
  th, td { padding: 10px 12px; }
}
