/* ============================================================================
   Texterous — Time Tracking (Urenregistratie)
   Brand: accent #009BFF · ink #050505 · bg #FBFBFB · Domine (display) + Inter
   Visual language matches texterous.com (grid + grain), rebuilt for an app.
   ============================================================================ */

/* ---- Fonts (vendored, no external dependency) ---- */
@font-face { font-family: "Inter"; src: url("fonts/Inter-400.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-500.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-600.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-700.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Domine"; src: url("fonts/Domine-600.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Domine"; src: url("fonts/Domine-700.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --bg: #fbfbfb;
  --ink: #050505;
  --body-text: #3d4450;
  --muted: #7b8494;
  --accent: #009bff;
  --accent-hover: #0077d6;
  --accent-soft: rgba(0, 155, 255, 0.09);
  --accent-line: rgba(0, 155, 255, 0.28);
  --card: #ffffff;
  --panel: #f2f4f7;
  --line: rgba(5, 5, 5, 0.09);
  --line-soft: rgba(5, 5, 5, 0.055);
  --grid-line: rgba(5, 5, 5, 0.04);
  --ok: #1f9d63;
  --ok-soft: rgba(31, 157, 99, 0.12);
  --warn: #c9791b;
  --warn-soft: rgba(201, 121, 27, 0.13);
  --danger: #c2472f;
  --danger-soft: rgba(194, 71, 47, 0.1);
  --at: #d4351c;   /* Austria red accent for the flag chip */
  --nl: #ff6a13;   /* Netherlands orange accent */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow: 0 14px 34px rgba(5, 5, 5, 0.09);
  --shadow-sm: 0 4px 14px rgba(5, 5, 5, 0.06);
  --font-display: "Domine", Georgia, serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' seed='3300' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)' opacity='0.72'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 72px 72px;
  color: var(--body-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--grain);
  background-size: 9rem 9rem;
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); font-weight: 700; line-height: 1.15; margin: 0; }
h1 { font-size: 1.9rem; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.kicker {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent);
}
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-size: 0.92rem; font-weight: 600;
  border-radius: var(--radius-sm); padding: 11px 18px; cursor: pointer;
  border: 1px solid transparent; background: none; color: var(--ink);
  transition: background 0.15s, border-color 0.15s, transform 0.15s var(--ease), box-shadow 0.18s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(5,5,5,0.14), inset 0 1px 0 rgba(255,255,255,0.18); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,155,255,0.28); text-decoration: none; }
.btn-secondary { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: var(--accent-line); background: var(--accent-soft); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--muted); padding: 8px 12px; }
.btn-ghost:hover { color: var(--ink); background: var(--line-soft); text-decoration: none; }
.btn-sm { padding: 7px 12px; font-size: 0.83rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---- App shell ---- */
.app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.local-dev-banner {
  background: #16301f;
  color: #c8f5d8;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 14px;
  border-bottom: 2px solid #3ddc84;
  letter-spacing: 0.01em;
}

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251, 251, 251, 0.86);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 22px; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand img { width: 28px; height: 28px; display: block; border-radius: 6px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--ink); letter-spacing: 0.01em; }
.brand-sub { font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.topnav { display: flex; align-items: center; gap: 4px; }
.navlink {
  font-size: 0.9rem; font-weight: 500; color: var(--body-text);
  padding: 8px 13px; border-radius: 8px; cursor: pointer; border: none; background: none;
  font-family: var(--font-body);
}
.navlink:hover { background: var(--line-soft); color: var(--ink); text-decoration: none; }
.navlink.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 12px; }

/* Language switch */
.lang { display: inline-flex; gap: 2px; background: var(--panel); border-radius: var(--radius-pill); padding: 3px; }
.lang button {
  border: none; background: none; font-family: var(--font-body); font-size: 0.76rem; font-weight: 600;
  color: var(--muted); padding: 4px 9px; border-radius: var(--radius-pill); cursor: pointer;
}
.lang button.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }

.who { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.who-name { font-size: 0.86rem; font-weight: 600; color: var(--ink); line-height: 1.1; }
.who-role { font-size: 0.72rem; color: var(--muted); }

main { flex: 1; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 26px 22px 80px; }
.wrap-narrow { max-width: 720px; }

/* ---- Cards / panels ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px 22px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.wrap-row { flex-wrap: wrap; }

/* ---- Chips / pills ---- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; font-weight: 600;
  padding: 3px 10px; border-radius: var(--radius-pill); border: 1px solid var(--line);
  color: var(--body-text); background: var(--card); white-space: nowrap;
}
.chip.flag-at, .chip.flag-nl { border-color: var(--line); color: var(--body-text); background: var(--card); font-weight: 700; letter-spacing: 0.03em; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; font-weight: 700; padding: 4px 11px; border-radius: var(--radius-pill); white-space: nowrap; }
.pill.open { background: var(--panel); color: var(--muted); }
.pill.confirmed { background: var(--accent-soft); color: var(--accent-hover); }
.pill.locked { background: var(--ok-soft); color: var(--ok); }
.pill.notlogged { background: var(--danger-soft); color: var(--danger); }
/* Weeks before the person's contract start — informational, never alarming. */
.pill.notemployed { background: var(--panel); color: var(--muted); opacity: 0.75; font-style: italic; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ============================================================
   LOGIN
   ============================================================ */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; z-index: 1; }
.login-card { width: 100%; max-width: 420px; }
.login-head { text-align: center; margin-bottom: 26px; }
.login-head .owl { width: 56px; height: 56px; margin: 0 auto 16px; display: block; border-radius: 12px; }
.login-head h1 { font-size: 1.7rem; margin-bottom: 6px; }
.login-head p { color: var(--muted); font-size: 0.95rem; }
.login-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink); margin-bottom: 7px; }
.input {
  width: 100%; font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 13px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--card); }
.input.err { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.login-note { font-size: 0.8rem; color: var(--muted); margin-top: 14px; text-align: center; }
.login-or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--border, #e5e7eb); }
.login-error { color: var(--danger); font-size: 0.86rem; margin-top: 10px; display: none; }
.login-error.show { display: block; }
.demo-logins { margin-top: 22px; }
.demo-logins .demo-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; text-align: center; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.demo-btn {
  text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 9px;
  padding: 8px 11px; cursor: pointer; font-family: var(--font-body); transition: border-color 0.15s, background 0.15s;
}
.demo-btn:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.demo-btn b { display: block; font-size: 0.82rem; color: var(--ink); font-weight: 600; }
.demo-btn span { font-size: 0.7rem; color: var(--muted); }

/* ============================================================
   WEEK NAVIGATOR + SUMMARY
   ============================================================ */
.page-head { margin-bottom: 20px; }
.page-head h1 { margin-bottom: 4px; }
.page-head .sub { color: var(--muted); font-size: 0.95rem; }

.weeknav { display: flex; align-items: center; gap: 10px; }
.weeknav .arrow {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}
.weeknav .arrow:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.weeknav .label { min-width: 210px; text-align: center; }
.weeknav .label .wk { font-family: var(--font-display); font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.weeknav .label .rng { font-size: 0.78rem; color: var(--muted); }
.weeknav .today-btn { margin-left: 2px; }

/* ---- Day badges + flags (grid day heads, worker modal, statements) ---- */
.day-badge { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; margin-top: 3px; }
.day-badge.holiday { color: var(--warn); }
.day-badge.weekend { color: var(--muted); }

.inp {
  font-family: var(--mono); font-size: 0.92rem; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--card); }

.day-flag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 600; color: var(--muted); cursor: pointer; user-select: none;
}
.day-flag input[type="checkbox"] { accent-color: var(--accent); margin: 0; }
.day-flag-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.68rem; font-weight: 700; padding: 3px 9px; border-radius: var(--radius-pill);
  background: var(--panel); color: var(--muted); cursor: help;
}
.day-flag-badge.ordered { background: var(--accent-soft); color: var(--accent-hover); }
.day-flag-badge.reconstructed { background: var(--warn-soft, #fdf1dc); color: var(--warn); }
.day-flag-badge.exception { background: var(--danger-soft); color: var(--danger); }
.day-flag-badge.notvol { background: var(--danger-soft); color: var(--danger); }
/* Badges with a click-to-explain dialog behind them */
[data-action="explain"] { cursor: pointer; }
[data-action="explain"]:hover { filter: brightness(0.96); }

/* ---- Summary bar ---- */
.summary {
  position: sticky; bottom: 0; z-index: 20; margin-top: 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 -6px 24px rgba(5,5,5,0.07); padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.summary-total { display: flex; align-items: baseline; gap: 10px; }
.summary-total .big { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; color: var(--ink); }
.summary-total .norm { font-size: 0.85rem; color: var(--muted); }
.summary-bar-track { height: 7px; width: 160px; background: var(--panel); border-radius: 4px; overflow: hidden; }
.summary-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.4s var(--ease); }
.summary-bar-fill.over { background: var(--warn); }
.summary-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.delta { font-size: 0.82rem; font-weight: 600; }
.delta.over { color: var(--warn); }
.delta.under { color: var(--muted); }
.delta.exact { color: var(--ok); }

/* ---- AT compliance strip (under the week summary) ---- */
.comp-strip {
  margin-top: 14px; padding: 12px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.comp-title { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.comp-items { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.comp-item { display: flex; align-items: baseline; gap: 6px; cursor: help; }
.comp-label { font-size: 0.74rem; font-weight: 600; color: var(--muted); }
.comp-value { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--ink); }
.comp-sub { font-size: 0.72rem; color: var(--muted); }
.warn-text { color: var(--warn); }
.saldo-pos { color: var(--ok); }
.saldo-neg { color: var(--danger); }

/* Admin compliance tab: stacked cards */
.cards-col { display: flex; flex-direction: column; gap: 18px; }
.cards-col h3 { margin: 0 0 6px; font-size: 1.02rem; }
.cards-col .muted { font-size: 0.84rem; margin: 0 0 12px; }

/* ---- Quick actions row ---- */
.quickrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ---- Notices ---- */
.notice { border-radius: var(--radius-sm); padding: 12px 15px; font-size: 0.88rem; display: flex; gap: 10px; align-items: flex-start; }
.notice .ico { flex-shrink: 0; margin-top: 1px; }
.notice.info { background: var(--accent-soft); color: var(--accent-hover); border: 1px solid var(--accent-line); }
.notice.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(201,121,27,0.3); }
.notice.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid rgba(31,157,99,0.28); }
.notice.locked-note { background: var(--panel); color: var(--body-text); border: 1px solid var(--line); }
.notice b { color: inherit; }

/* ============================================================
   ADMIN
   ============================================================ */
.subtabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.subtab {
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 600; color: var(--muted);
  padding: 10px 14px; cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.subtab:hover { color: var(--ink); }
.subtab.active { color: var(--accent); border-bottom-color: var(--accent); }
.subtab.disabled,
.subtab:disabled {
  color: var(--muted);
  opacity: 0.55;
  cursor: not-allowed;
  border-bottom-color: transparent;
}
.subtab.disabled:hover,
.subtab:disabled:hover { color: var(--muted); }
.subtab-soon {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--line-soft);
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
}

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.table-wrap-wide { max-width: 100%; }
.grid-table-dense th,
.grid-table-dense td { padding: 8px 10px; font-size: 0.84rem; vertical-align: top; }
.grid-table-dense th { font-size: 0.72rem; letter-spacing: 0.03em; }
.glance-pills { display: flex; flex-wrap: wrap; gap: 4px; max-width: 220px; }
.nowrap { white-space: nowrap; }
.admin-glance-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 22px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
/* border-collapse must stay "separate": collapsed borders break position:sticky
   cells in Chrome (the phone name column would let buttons paint over it). */
table.grid-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9rem; min-width: 720px; }
.grid-table th {
  text-align: left; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--muted); padding: 12px; border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 2;
}
.grid-table td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.grid-table tr:last-child td { border-bottom: none; }
.grid-table tr:hover td { background: rgba(0,155,255,0.02); }
.grid-table .worker-cell { display: flex; align-items: center; gap: 10px; }
.grid-table .worker-cell .avatar { width: 30px; height: 30px; font-size: 0.75rem; }
.grid-table .wk-name { font-weight: 600; color: var(--ink); }
.grid-table .wk-email { font-size: 0.74rem; color: var(--muted); }
.grid-table .num { font-family: var(--mono); text-align: right; }
.grid-table .num.week-over { color: var(--danger); font-weight: 700; }
.grid-table .num.week-over .muted { color: var(--danger); opacity: 0.7; }
.cellactions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.section-title { font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); margin: 0 0 4px; font-weight: 600; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi .k-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.kpi .k-value { font-family: var(--font-display); font-weight: 700; font-size: 1.8rem; color: var(--ink); margin-top: 4px; }
.kpi .k-sub { font-size: 0.78rem; color: var(--muted); }
.kpi.alert .k-value { color: var(--danger); }

/* audit log */
.audit-list { display: flex; flex-direction: column; }
.audit-item { display: flex; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line-soft); font-size: 0.87rem; }
.audit-item .a-ts { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); white-space: nowrap; min-width: 96px; }
.audit-item .a-actor { font-weight: 600; color: var(--ink); }

/* ============================================================
   MODAL / DRAWER (help + confirm)
   ============================================================ */
.overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(5,5,5,0.4);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.modal { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); max-width: 560px; width: 100%; max-height: 86vh; overflow-y: auto; transform: translateY(10px); transition: transform 0.2s var(--ease); }
.overlay.show .modal { transform: none; }
.modal-head { padding: 20px 24px 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-body { padding: 12px 24px 24px; }
.modal-body h4 { margin: 18px 0 6px; color: var(--ink); }
.modal-body p { margin-bottom: 8px; font-size: 0.92rem; }
.modal-close { border: none; background: none; cursor: pointer; color: var(--muted); font-size: 1.4rem; line-height: 1; padding: 4px; }
.modal-close:hover { color: var(--ink); }
/* In-modal language switcher: the overlay hides the topbar switcher, so every
   modal carries its own small one (next to the × or on a row of its own). */
.modal-lang { margin-left: auto; flex: none; align-self: center; }
.modal-lang button { padding: 4px 8px; font-size: 0.72rem; }
.modal-lang-row { display: flex; justify-content: flex-end; padding: 12px 14px 0; }
/* Action rows inside modals wrap instead of pushing buttons past the card
   edge on narrow screens (German labels are long). */
.modal .row { flex-wrap: wrap; }
/* Export-choice buttons carry whole sentences — let the text wrap. */
.export-choices .btn { white-space: normal; text-align: center; }
.help-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 6px; }
.help-country { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.help-country h4 { margin-top: 0; display: flex; align-items: center; gap: 8px; }
.help-country ul { margin: 8px 0 0; padding-left: 18px; font-size: 0.85rem; }
.help-country li { margin-bottom: 5px; }

/* ---- Toast ---- */
.toast-host { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; max-width: min(94vw, 560px); }
.toast {
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 18px;
  font-size: 0.88rem; font-weight: 500; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 9px;
  max-width: 100%; line-height: 1.45;
  animation: toast-in 0.25s var(--ease);
  transition: opacity 0.25s var(--ease);
}
.toast-close {
  background: none; border: 0; color: inherit; opacity: 0.72; cursor: pointer;
  font-size: 1.1rem; line-height: 1; padding: 2px 2px 2px 6px; flex: none;
  align-self: flex-start; border-radius: 6px;
}
.toast-close:hover { opacity: 1; }
.toast.warn { background: var(--warn); }
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---- Empty state ---- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* ============================================================
   LEAVE / VERLOF
   ============================================================ */
.balance { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.bal-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px; }
.bal-item.hero { background: var(--accent-soft); border-color: var(--accent-line); }
.bal-item .bal-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.bal-item .bal-value { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; color: var(--ink); margin-top: 3px; }
.bal-item.hero .bal-value { color: var(--accent-hover); }
.bal-item .bal-value .u { font-size: 0.72rem; color: var(--muted); font-weight: 500; font-family: var(--font-body); margin-left: 5px; }

.leave-form { margin-bottom: 18px; }
/* minmax(0, …) lets the columns shrink below the date inputs' intrinsic
   width — plain 1fr tracks blow the grid out of the card on phones. */
.leave-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 12px;
}
.leave-form .field { margin-bottom: 6px; min-width: 0; }
.leave-form .input { min-width: 0; }
.leave-form select.input { appearance: none; -webkit-appearance: none; cursor: pointer; }

.leave-list { overflow: hidden; }
.abs-item { display: flex; align-items: center; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line-soft); }
.abs-item:last-child { border-bottom: none; }
.abs-range { flex: 1; min-width: 0; }
.abs-dates { font-weight: 600; color: var(--ink); font-size: 0.92rem; }
.abs-meta { font-size: 0.78rem; color: var(--muted); }
.abs-type { display: inline-flex; align-items: center; font-size: 0.72rem; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-pill); border: 1px solid var(--line); white-space: nowrap; }
.abs-type.type-vacation { color: var(--accent-hover); background: var(--accent-soft); border-color: var(--accent-line); }
.abs-type.type-sick { color: var(--warn); background: var(--warn-soft); border-color: rgba(201,121,27,0.3); }
.abs-type.type-other { color: var(--muted); background: var(--panel); border-color: var(--line); }

.day-badge.leave { color: var(--accent-hover); }

/* ============================================================
   TIME GRID (weekly drag-and-drop blocks)
   ============================================================ */
.tg {
  margin-top: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.tg-head {
  display: grid;
  grid-template-columns: 52px repeat(7, 1fr);
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.tg-day-head {
  padding: 8px 8px 7px;
  border-left: 1px solid var(--line-soft);
  min-width: 0;
}
.tg-day-head.off { background: var(--panel); }
.tg-day-head.today { box-shadow: inset 0 3px 0 var(--accent); }
.tg-dow-row { display: flex; align-items: baseline; gap: 5px; }
.tg-dow { font-weight: 700; font-size: 0.82rem; color: var(--ink); }
.tg-dt { font-size: 0.72rem; color: var(--muted); }
.tg-add {
  margin-left: auto;
  width: 21px; height: 21px; line-height: 1;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--muted);
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: all 0.12s;
}
.tg-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.tg-head-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; min-height: 18px; flex-wrap: wrap; }
.tg-head-meta .day-badge { margin-top: 0; }
.tg-total { font-family: var(--mono); font-size: 0.8rem; font-weight: 700; color: var(--ink); margin-left: auto; }
.tg-total.zero { color: var(--muted); font-weight: 500; }
.tg-total .u { font-size: 0.66rem; color: var(--muted); }
.tg-head-extra { display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }

.tg-scroll { max-height: 540px; overflow-y: auto; position: relative; }
.tg-canvas {
  display: grid;
  grid-template-columns: 52px repeat(7, 1fr);
  position: relative;
  touch-action: pan-y;
}
.tg-axis { position: relative; }
.tg-hour {
  position: absolute; right: 7px; transform: translateY(-50%);
  font-family: var(--mono); font-size: 0.62rem; color: var(--muted);
}
.tg-hour:first-child { transform: none; }
.tg-day {
  position: relative;
  border-left: 1px solid var(--line-soft);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0, transparent 43px,
    var(--line-soft) 43px, var(--line-soft) 44px
  );
  cursor: crosshair;
  min-width: 0;
}
.tg.readonly .tg-day { cursor: default; }
.tg-day.off { background-color: rgba(5, 5, 5, 0.025); }
/* Days that can't be recorded (yet): future days & days before contract start */
.tg-day.disabled { background: repeating-linear-gradient(-45deg, transparent 0 7px, rgba(5, 5, 5, 0.028) 7px 14px); cursor: not-allowed; }
.tg-day-head.disabled .tg-dow, .tg-day-head.disabled .tg-dt, .tg-day-head.disabled .tg-total { opacity: 0.45; }
.tg-now {
  position: absolute; left: 0; right: 0; height: 0;
  border-top: 2px solid var(--accent); opacity: 0.7; pointer-events: none; z-index: 4;
}
.tg-now::before {
  content: ""; position: absolute; left: -1px; top: -4px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}

.tg-block {
  position: absolute; left: 3px; right: 3px; z-index: 3;
  border-radius: 7px; padding: 3px 7px;
  font-size: 0.7rem; line-height: 1.25;
  border: 1px solid; overflow: hidden;
  cursor: grab; user-select: none; -webkit-user-select: none;
  transition: box-shadow 0.12s;
}
.tg-block:hover { box-shadow: var(--shadow-sm); z-index: 5; }
.tg-block:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; z-index: 5; }
.tg.readonly .tg-block { cursor: default; }
.tg-block.small { padding: 1px 7px; }
.tg-block.small .tg-block-kind { display: none; }
.tg-block-time { display: block; font-family: var(--mono); font-weight: 700; font-size: 0.66rem; white-space: nowrap; }
.tg-block-kind { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-mark { margin-left: 4px; font-size: 0.66rem; }
.tg-ghost { opacity: 0.75; pointer-events: none; z-index: 6; border-style: dashed; }

.tg-block.k-work { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-hover); }
.tg-block.k-break { background: var(--panel); border-color: var(--line); color: var(--muted); }
.tg-block.k-travel_active { background: var(--ok-soft); border-color: rgba(31, 157, 99, 0.4); color: var(--ok); }
.tg-block.k-travel_passive { background: rgba(123, 132, 148, 0.12); border-color: rgba(123, 132, 148, 0.4); color: #5a6372; }
.tg-block.k-callout { background: var(--warn-soft); border-color: rgba(201, 121, 27, 0.45); color: var(--warn); }

.tg-rz {
  position: absolute; left: 0; right: 0; height: 7px; z-index: 4;
  cursor: ns-resize;
}
.tg-rz.top { top: -2px; }
.tg-rz.bot { bottom: -2px; }
.tg-rz::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  top: 2px; width: 22px; height: 3px; border-radius: 2px;
  background: currentColor; opacity: 0;
  transition: opacity 0.12s;
}
.tg-block:hover .tg-rz::after { opacity: 0.45; }

.tg-gapbreak {
  position: absolute; left: 3px; right: 3px; z-index: 2;
  border-radius: 6px;
  background: repeating-linear-gradient(
    -45deg,
    rgba(123, 132, 148, 0.1) 0, rgba(123, 132, 148, 0.1) 4px,
    transparent 4px, transparent 9px
  );
  border: 1px dashed rgba(123, 132, 148, 0.35);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.tg-gapbreak span {
  font-size: 0.62rem; font-weight: 600; color: var(--muted);
  background: var(--card); border-radius: 4px; padding: 0 5px;
  white-space: nowrap; overflow: hidden; max-width: 92%;
}

.tg-legend {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 8px 12px; border-top: 1px solid var(--line-soft);
  font-size: 0.7rem; color: var(--muted);
}
.tg-leg { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.tg-leg i { width: 12px; height: 12px; border-radius: 4px; border: 1px solid; display: inline-block; }
.tg-leg i.k-work { background: var(--accent-soft); border-color: var(--accent-line); }
.tg-leg i.k-break { background: var(--panel); border-color: var(--line); }
.tg-leg i.k-travel_active { background: var(--ok-soft); border-color: rgba(31, 157, 99, 0.4); }
.tg-leg i.k-travel_passive { background: rgba(123, 132, 148, 0.12); border-color: rgba(123, 132, 148, 0.4); }
.tg-leg i.k-callout { background: var(--warn-soft); border-color: rgba(201, 121, 27, 0.45); }
.tg-leg i.k-gap {
  background: repeating-linear-gradient(-45deg, rgba(123, 132, 148, 0.18) 0, rgba(123, 132, 148, 0.18) 3px, transparent 3px, transparent 6px);
  border-color: rgba(123, 132, 148, 0.35); border-style: dashed;
}

/* Block editor popover */
.tg-pop {
  position: fixed; z-index: 300; width: 320px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px); overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 12px 14px 14px;
}
.tg-pop-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 9px; }
.tg-pop-head b { font-size: 0.92rem; color: var(--ink); }
.tg-pop-date { font-size: 0.72rem; color: var(--muted); }
.tg-pop-x {
  margin-left: auto; border: 0; background: none; font-size: 1.15rem;
  color: var(--muted); cursor: pointer; line-height: 1; padding: 0 2px;
}
.tg-pop-row { margin-bottom: 8px; }
.tg-pop-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tg-pop-row label {
  display: flex; flex-direction: column; gap: 3px;
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.tg-pop-row .inp { width: 100%; }
.tg-pop-flag, .tg-pop-confirm {
  display: flex; align-items: flex-start; gap: 7px; margin: 8px 0 4px;
  font-size: 0.78rem; font-weight: 600; color: var(--body-text); cursor: pointer;
}
.tg-pop-flag input, .tg-pop-confirm input { accent-color: var(--accent); margin-top: 2px; }
.tg-pop-flag.disabled { opacity: 0.55; cursor: not-allowed; }
.tg-pop-confirm.on span { color: var(--ok); }
.tg-pop-legal {
  font-size: 0.7rem; line-height: 1.45; color: var(--muted);
  background: var(--panel); border-radius: 7px; padding: 7px 9px; margin: 4px 0 8px;
}
.tg-pop-legal.warn { background: var(--warn-soft); color: var(--warn); }
/* Project booking: recents chips + company/project pair (popover & fill dialog) */
.tg-pop-proj { margin-bottom: 8px; }
.tg-proj-recents { display: flex; flex-wrap: wrap; gap: 5px; margin: 2px 0 8px; }
.tg-proj-chip {
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  border-radius: 999px; padding: 3px 10px; font-size: 0.72rem; cursor: pointer;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tg-proj-chip:hover { border-color: var(--accent); color: var(--accent); }
.tg-proj-chip.on { border-color: var(--accent); background: var(--accent-soft, rgba(37, 99, 235, 0.08)); color: var(--accent); }
.tg-proj-note { display: block; margin-top: 8px; }
.tg-proj-note .inp { width: 100%; }
.tg-pop-err {
  font-size: 0.74rem; font-weight: 600; color: var(--danger);
  background: var(--danger-soft); border-radius: 7px; padding: 7px 9px; margin-bottom: 8px;
}
/* Long labels (DE/NL) must never push the save button past the card edge:
   the row wraps and the delete action keeps its slot on the left. */
.tg-pop-actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; margin-top: 4px; flex-wrap: wrap;
}
.tg-pop-actions .tg-del { color: var(--danger); margin-right: auto; }

@media (max-width: 780px) {
  .tg-head, .tg-canvas { grid-template-columns: 38px repeat(7, 1fr); }
  .tg-dt { display: none; }
  .tg-block-kind { display: none; }
  .tg-pop { width: min(94vw, 340px); left: 50% !important; transform: translateX(-50%); }
}

/* Narrow columns: the "+" gets its own full-width row so it never bleeds into
   (and hides under) the neighbouring day head, and badges truncate cleanly. */
@media (max-width: 640px) {
  .tg-day-head { padding: 6px 5px; }
  .tg-dow { font-size: 0.74rem; }
  .tg-dow-row { flex-wrap: wrap; gap: 3px; }
  .tg-add { width: 100%; height: 20px; margin: 2px 0 0; border-radius: 5px; }
  .tg-head-meta { flex-wrap: nowrap; }
  .tg-head-meta .day-badge {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .tg-total { flex-shrink: 0; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 780px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .help-cols { grid-template-columns: 1fr; }
  .who-name, .who-role { display: none; }
  .weeknav .label { min-width: 150px; }
  .navlink { padding: 8px 10px; }
  .brand-sub { display: none; }
  .balance { grid-template-columns: 1fr 1fr; }
  .leave-form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .wrap { padding: 18px 14px 90px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .summary { flex-direction: column; align-items: stretch; }
  .summary-actions { justify-content: space-between; }
  .leave-form-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ============================================================
   REMINDERS (Friday Teams nudge)
   ============================================================ */
.remind-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent-hover); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 16px;
}
.remind-banner .rb-ico { flex-shrink: 0; display: inline-flex; }
.remind-banner .rb-text { flex: 1; min-width: 180px; font-size: 0.9rem; font-weight: 500; }
.remind-banner .rb-actions { display: flex; align-items: center; gap: 8px; }
.remind-banner .rb-close {
  border: none; background: none; cursor: pointer; color: var(--accent-hover);
  font-size: 1.3rem; line-height: 1; padding: 2px 8px; border-radius: 8px;
}
.remind-banner .rb-close:hover { background: rgba(0, 155, 255, 0.14); }

.rem-pre {
  font-family: var(--mono); font-size: 0.82rem; line-height: 1.5; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; margin: 6px 0 4px; white-space: pre-wrap; word-break: break-word; overflow-x: auto;
}
.rem-pre.rem-json { white-space: pre; max-height: 340px; overflow: auto; }

/* ---- Dismissible tooltip ---- */
.notice.dismissible { position: relative; padding-right: 40px; }
.notice-close { position: absolute; top: 8px; right: 10px; border: none; background: none; cursor: pointer; color: inherit; opacity: 0.65; font-size: 1.25rem; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.notice-close:hover { opacity: 1; background: rgba(0,155,255,0.12); }

/* ---- Footer ---- */
.app-footer { position: relative; z-index: 1; text-align: center; padding: 28px 16px 32px; color: var(--muted); font-size: 0.82rem; border-top: 1px solid var(--line-soft); }
.app-footer strong { color: var(--body-text); font-weight: 600; }

/* ============================================================
   STREAKS (gamification, Duolingo-inspired, Texterous style)
   ============================================================ */
.flame-svg { display: block; }

/* avatar with a streak ring + flame badge */
.avatar-wrap { position: relative; display: inline-flex; }
.avatar-wrap.clickable { cursor: pointer; }
.avatar-wrap.clickable:hover .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-line); }
.avatar-wrap.clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 50%; }
.avatar-wrap.has-streak::before {
  content: ""; position: absolute; inset: -3px; border-radius: 50%; z-index: 0;
  background: conic-gradient(from 210deg, #ffd23f, #ff8a1e, #e0451b, #ff8a1e, #ffd23f);
}
.avatar-wrap.has-streak .avatar { position: relative; z-index: 1; box-shadow: 0 0 0 2px var(--bg); }
.avatar-wrap.t1.has-streak::before { opacity: 0.5; }
.avatar-wrap.t2.has-streak::before { opacity: 0.78; }
.avatar-wrap.t3.has-streak::before { opacity: 1; filter: saturate(1.15); }
.avatar-wrap.t4.has-streak::before { opacity: 1; filter: saturate(1.35) drop-shadow(0 0 6px rgba(255,138,30,0.55)); }
.flame-badge {
  position: absolute; bottom: -5px; right: -7px; z-index: 2;
  display: inline-flex; align-items: center; gap: 1px;
  background: var(--card); border-radius: var(--radius-pill); padding: 1px 5px 1px 2px;
  box-shadow: 0 1px 4px rgba(5,5,5,0.22); border: 1px solid var(--line-soft);
}
.flame-badge .flame-svg { width: 12px; height: 15px; }
.flame-badge .fb-num { font-size: 0.66rem; font-weight: 800; color: var(--ink); }
.avatar-wrap.pulse.has-streak::before { animation: flame-in 0.7s var(--ease); }
@keyframes flame-in { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.avatar-wrap.pulse .flame-badge { animation: badge-pop 0.5s var(--ease) 0.2s both; }
@keyframes badge-pop { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* streak reward modal */
.streak-reward { text-align: center; padding: 34px 30px 28px; }
.streak-reward .reward-flame { position: relative; width: 96px; height: 116px; margin: 0 auto 12px; }
.streak-reward .reward-flame .flame-svg.huge { width: 96px; height: 116px; animation: reward-flicker 1.4s ease-in-out infinite alternate; filter: drop-shadow(0 6px 14px rgba(224,69,27,0.4)); }
.streak-reward .reward-num { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; color: #fff; text-shadow: 0 2px 4px rgba(150,45,10,0.85); }
@keyframes reward-flicker { from { transform: scale(1) rotate(-1.5deg); } to { transform: scale(1.05) rotate(1.5deg); } }
.streak-reward h2 { margin-bottom: 8px; }

/* leaderboard */
.board { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.board-row { display: grid; grid-template-columns: 24px auto 1fr auto; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm); }
.board-row.lead { background: var(--accent-soft); border: 1px solid var(--accent-line); }
.board-rank { font-family: var(--font-display); font-weight: 700; color: var(--muted); text-align: center; }
.board-name { font-weight: 600; color: var(--ink); font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.board-streak { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-display); }
.board-streak .flame-svg { width: 15px; height: 18px; }
.board-streak b { font-size: 1.05rem; color: var(--ink); }
.board-longest { font-size: 0.78rem; }

/* ---- Agenda / calendar breakdown ---- */
.proj-row { display: grid; grid-template-columns: 160px 1fr 52px; align-items: center; gap: 12px; padding: 5px 0; }
.proj-name { font-size: 0.88rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-bar { height: 9px; background: var(--panel); border-radius: 5px; overflow: hidden; }
.proj-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-hover)); border-radius: 5px; }
.proj-h { text-align: right; font-size: 0.85rem; color: var(--body-text); }
.agenda-day { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.agenda-day:last-child { border-bottom: none; }
.agenda-date { font-weight: 700; color: var(--ink); font-size: 0.9rem; margin-bottom: 6px; text-transform: capitalize; }
.agenda-ev { display: flex; align-items: center; gap: 12px; padding: 4px 0; font-size: 0.88rem; flex-wrap: wrap; }
.agenda-ev .ev-time { color: var(--muted); font-size: 0.8rem; min-width: 96px; }
.agenda-ev .ev-title { color: var(--ink); font-weight: 500; }
.agenda-ev .ev-proj { color: var(--accent-hover); background: var(--accent-soft); border-radius: var(--radius-pill); padding: 2px 9px; font-size: 0.74rem; font-weight: 600; }

@media (max-width: 780px) {
  .proj-row { grid-template-columns: 110px 1fr 44px; }
  .board-row { grid-template-columns: 20px auto 1fr auto; }
  .board-longest { display: none; }
}

/* ---- Balance / flexitime ---- */
.bal-over { color: var(--warn); font-weight: 700; }
.bal-under { color: var(--muted); }

/* ============================================================
   MOBILE — make it chill to work on a phone
   ============================================================ */
/* Topbar becomes two rows: brand + you on top, nav scrolls underneath.
   Collapses well before the single-row layout runs out of room (~860px with
   German labels), so "Abmelden" never gets pushed off-screen. */
@media (max-width: 900px) {
  .topbar-inner { height: auto; min-height: 56px; padding: 8px 12px; flex-wrap: wrap; row-gap: 8px; }
  .brand { order: 1; }
  .topbar-right { order: 2; margin-left: auto; gap: 8px; }
  .topnav { order: 3; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 2px; padding-bottom: 2px; scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
  .navlink { white-space: nowrap; flex: 0 0 auto; padding: 8px 12px; font-size: 0.9rem; }
  .lang button { padding: 5px 8px; }
}

@media (max-width: 760px) {
  /* Content */
  .wrap { padding: 16px 12px 96px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  /* The label keeps a readable width; "today" + the date jump wrap to a
     second line instead of squeezing the label into a 1-char column. */
  .page-head .weeknav { width: 100%; justify-content: space-between; flex-wrap: wrap; row-gap: 8px; }
  .weeknav .label { flex: 1 1 auto; min-width: 140px; }
  .weeknav .today-btn { flex: 0 0 auto; }
  .week-jump { flex: 1 1 140px; max-width: 220px; min-width: 0; }

  /* Admin subtabs scroll horizontally instead of wrapping/clipping */
  .subtabs { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; scrollbar-width: none; }
  .subtabs::-webkit-scrollbar { display: none; }
  .subtab { flex: 0 0 auto; }

  /* Comfortable tap targets */
  .inp { padding: 10px 11px; }

  /* Sticky summary stays, but stacks its bits */
  .summary { padding: 12px 14px; gap: 10px; }
  .summary-total { flex-wrap: wrap; row-gap: 6px; }
  .summary-actions { width: 100%; }
  .summary-actions .btn, .summary-actions .pill { width: 100%; justify-content: center; }

  .btn { padding: 11px 15px; }
  .modal { max-height: 92vh; }
}

@media (max-width: 430px) {
  .brand-name { display: none; }
  .weeknav .arrow { width: 36px; height: 36px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .agenda-ev { gap: 6px 10px; }
  .agenda-ev .ev-time { min-width: 84px; }
}

/* Pending-count badge on an admin subtab */
.tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 4px; margin-left: 6px; border-radius: var(--radius-pill); background: var(--danger); color: #fff; font-size: 0.66rem; font-weight: 800; vertical-align: middle; }

/* Login tagline (brand kicker) */
.login-tagline { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }

/* Admin tables on phones: scroll affordance + sticky name column, bigger tap targets */
@media (max-width: 640px) {
  .table-wrap { position: relative; }
  .table-wrap::after { content: ""; position: absolute; top: 1px; right: 1px; bottom: 1px; width: 26px; background: linear-gradient(90deg, transparent, var(--card)); pointer-events: none; border-radius: 0 var(--radius) var(--radius) 0; }
  /* z-index keeps the pinned column painted above buttons/pills that scroll
     underneath it (without it Chrome paints them on top of the names). */
  .grid-table td:first-child, .grid-table th:first-child { position: sticky; left: 0; background: var(--card); z-index: 1; }
  .grid-table thead th:first-child { background: var(--panel); z-index: 3; }
}
@media (max-width: 760px) {
  .lang button { padding: 7px 10px; }
  .notice-close, .rb-close { padding: 6px 11px; font-size: 1.35rem; }
  .modal-close { padding: 6px 10px; }
}

/* Jump-to-a-date picker in the week nav (log retroactively). */
.week-jump { font-family: var(--font-body); font-size: 0.8rem; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--card); cursor: pointer; }
.week-jump:hover { border-color: var(--accent-line); color: var(--ink); }
.week-jump:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ============================================================
   GUIDED TOUR (onboarding spotlight — tour.js)
   ============================================================ */
/* Nav entry: a discreetly accented "guide me" affordance. */
.navlink-tour { color: var(--accent); }
.navlink-tour::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px;
  border-radius: 50%; background: var(--accent); vertical-align: middle;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.navlink-tour:hover { color: var(--accent-hover); background: var(--accent-soft); }

/* Overlay host — lives outside #app so full re-renders never wipe it. */
.tour-root { position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0; transition: opacity 0.2s ease; }
.tour-root.show { opacity: 1; }

/* Transparent click-catcher: freezes the app behind the tour. */
.tour-blocker { position: absolute; inset: 0; pointer-events: auto; }

/* The spotlight: a rounded window with an accent ring and a huge shadow that
   dims everything around it. Animating position gives the "travel" feel. */
.tour-hole {
  position: fixed; top: 0; left: 0; width: 0; height: 0; z-index: 1;
  border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 9999px rgba(5, 5, 5, 0.55);
  transition: top 0.32s var(--ease), left 0.32s var(--ease), width 0.32s var(--ease),
              height 0.32s var(--ease), border-radius 0.32s var(--ease);
}
.tour-hole.collapsed { box-shadow: 0 0 0 9999px rgba(5, 5, 5, 0.6); }

/* Caret pointing from the card toward the highlighted element. */
.tour-caret { position: fixed; width: 0; height: 0; z-index: 2; pointer-events: none; transform: translate(-50%, -50%); filter: drop-shadow(0 1px 1px rgba(5,5,5,0.06)); }
.tour-caret.bottom { border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 9px solid var(--card); }
.tour-caret.top    { border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 9px solid var(--card); }
.tour-caret.right  { border-top: 8px solid transparent;  border-bottom: 8px solid transparent; border-right: 9px solid var(--card); }
.tour-caret.left   { border-top: 8px solid transparent;  border-bottom: 8px solid transparent; border-left: 9px solid var(--card); }

/* The coach-mark card. */
.tour-pop {
  position: fixed; z-index: 3; pointer-events: auto;
  width: min(340px, calc(100vw - 24px));
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 18px 14px;
  transition: top 0.32s var(--ease), left 0.32s var(--ease);
}
.tour-kicker { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.tour-title { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); margin: 0 0 6px; }
.tour-body { font-size: 0.9rem; color: var(--body-text); line-height: 1.55; margin: 0; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.tour-dots { display: flex; gap: 6px; flex-wrap: wrap; max-width: 150px; }
.tour-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background 0.2s, transform 0.2s; }
.tour-dot.active { background: var(--accent); transform: scale(1.25); }
.tour-btns { display: flex; gap: 8px; flex-shrink: 0; }
.tour-x { position: absolute; top: 9px; right: 10px; border: none; background: none; cursor: pointer; color: var(--muted); font-size: 1.3rem; line-height: 1; padding: 2px 7px; border-radius: 6px; }
.tour-x:hover { color: var(--ink); background: var(--line-soft); }

@media (max-width: 520px) {
  .tour-pop { width: calc(100vw - 24px); }
  .tour-dots { max-width: 90px; }
}

/* ============================================================
   JULY 2026 REVIEW REFINEMENTS (Dominik design review)
   ============================================================ */
/* Country-of-origin flag — replaces the AT/NL text pill everywhere. */
.flag { font-size: 1.15rem; line-height: 1; vertical-align: -0.12em; }

/* Danger buttons: remove account, approve-over confirm. */
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 1px 2px rgba(5,5,5,0.14); }
.btn-danger:hover { background: #a83a24; transform: translateY(-1px); text-decoration: none; }
.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover { color: #fff; background: var(--danger); text-decoration: none; }

/* "Clear week" sits apart from the primary shortcuts. */
.quick-clear { margin-left: auto; }
@media (max-width: 520px) { .quick-clear { margin-left: 0; } }

/* Edit-account form. */
.worker-form .field { margin-bottom: 12px; }
.worker-form .field > label { display: block; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.wf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.worker-form select.input { appearance: none; -webkit-appearance: none; cursor: pointer; }
.wf-check { align-self: end; }
.wf-check > label { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 0.9rem; font-weight: 500; color: var(--ink); cursor: pointer; margin: 0 0 12px; }
.wf-check input { width: 16px; height: 16px; accent-color: var(--accent); }
@media (max-width: 520px) { .wf-grid { grid-template-columns: 1fr; } }

/* Sign-up approval · onboarding modal (People → Pending → Approve & set up) */
.ob-step { margin: 20px 0 8px; font-size: 0.95rem; }
.ob-docs { display: flex; flex-direction: column; gap: 10px; }
.ob-doc { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ob-doc.is-filed { border-color: var(--ok, #2e9e5b); background: var(--ok-soft, #eefaf2); }
.ob-doc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.86rem; }
.ob-doc-req { font-size: 0.78rem; line-height: 1.45; }
.ob-doc-file { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; flex-wrap: wrap; }
.ob-doc-add { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; flex-wrap: wrap; }
.ob-feature { margin: 10px 0; }
.ob-feature.is-locked .day-flag { opacity: 0.55; cursor: not-allowed; }
.ob-feature .ob-doc-req { margin-top: 2px; }
.ob-feature[data-passive-travel-block] {
  margin: 12px 0 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.ob-feature[data-passive-travel-block] .day-flag { font-size: 0.88rem; color: var(--ink); }

/* Leave: over-balance flags (next year's balance / advance on unaccrued days). */
.abs-future { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 0.76rem; font-weight: 600; color: var(--warn); }
.abs-future svg { width: 13px; height: 13px; }
.future-badge { display: inline-block; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--warn-soft); color: var(--warn); font-size: 0.7rem; font-weight: 700; white-space: nowrap; }

/* Activity log: filters + scroll window (not full-page) + type badges. */
.audit-filters { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.input-sm { padding: 8px 12px; font-size: 0.85rem; max-width: 220px; }
select.input-sm { appearance: none; -webkit-appearance: none; cursor: pointer; }
.audit-scroll { max-height: 440px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.audit-more { margin-top: 12px; display: flex; justify-content: center; }
.a-kind { display: inline-block; padding: 1px 8px; margin-right: 6px; border-radius: var(--radius-pill); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; background: var(--panel); color: var(--muted); vertical-align: middle; }
.a-kind.kind-hours { background: var(--accent-soft); color: var(--accent-hover); }
.a-kind.kind-week { background: var(--ok-soft); color: var(--ok); }
.a-kind.kind-leave { background: rgba(255,106,19,0.13); color: #c85a12; }
.a-kind.kind-reminder { background: var(--warn-soft); color: var(--warn); }
.a-kind.kind-worker { background: var(--danger-soft); color: var(--danger); }
.a-kind.kind-system { background: var(--panel); color: var(--muted); }

/* ============================================================================
   Admin Command Center — Lagebild matrix + inbox
   ============================================================================ */
.admin-shell-lead {
  margin: 6px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  max-width: 42rem;
}
.admin-subtabs { margin-bottom: 18px; }

.admin-inbox {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.admin-inbox-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease), background 0.15s var(--ease);
  text-align: left;
}
.admin-inbox-chip:hover:not(:disabled) {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.admin-inbox-chip:disabled,
.admin-inbox-chip.is-empty {
  opacity: 0.45;
  cursor: default;
}
.admin-inbox-n {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1;
  min-width: 1.4rem;
}
.admin-inbox-l {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--body-text);
  max-width: 9.5rem;
  line-height: 1.25;
}
.admin-inbox-chip.tone-warn { border-color: rgba(201,121,27,0.35); background: var(--warn-soft); }
.admin-inbox-chip.tone-warn .admin-inbox-n { color: var(--warn); }
.admin-inbox-chip.tone-danger { border-color: rgba(194,71,47,0.35); background: var(--danger-soft); }
.admin-inbox-chip.tone-danger .admin-inbox-n { color: var(--danger); }
.admin-inbox-chip.tone-accent { border-color: var(--accent-line); background: var(--accent-soft); }
.admin-inbox-chip.tone-accent .admin-inbox-n { color: var(--accent-hover); }

.admin-hub {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  box-shadow: var(--shadow-sm);
}
.admin-hub-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 14px;
}
.admin-hub-stats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.admin-hub-stat {
  min-width: 72px;
  text-align: right;
}
.admin-hub-stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--ink);
  line-height: 1.1;
}
.admin-hub-stat span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-hub-stat.is-alert b { color: var(--danger); }

.admin-hub-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin-bottom: 12px;
}
.admin-seg {
  display: inline-flex;
  background: var(--panel);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}
.admin-seg-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.admin-seg-btn.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.admin-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--body-text);
  cursor: pointer;
  margin-left: auto;
}
.admin-check input { accent-color: var(--accent); width: 15px; height: 15px; }

.admin-matrix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
}
.admin-matrix-legend span { display: inline-flex; align-items: center; gap: 6px; }
.am-swatch {
  width: 12px; height: 12px; border-radius: 3px; display: inline-block;
  border: 1px solid transparent;
}
.am-swatch.am-ok { background: var(--ok); }
.am-swatch.am-warn { background: var(--warn); }
.am-swatch.am-miss { background: var(--danger); }
.am-swatch.am-empty { background: var(--panel); border-color: var(--line); }

.admin-matrix-scroll {
  overflow: auto;
  max-height: min(70vh, 640px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.admin-matrix {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
  font-size: 0.8rem;
}
.admin-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 8px 4px;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
}
.admin-matrix .am-person-h,
.admin-matrix .am-person {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--card);
  text-align: left;
  min-width: 200px;
  max-width: 240px;
  border-right: 1px solid var(--line);
  padding: 8px 12px;
}
.admin-matrix thead .am-person-h { z-index: 4; background: var(--panel); }
.admin-matrix .am-week.is-current { color: var(--accent-hover); background: var(--accent-soft); }
.admin-matrix .am-wn { display: block; font-variant-numeric: tabular-nums; }
.admin-matrix .am-cell {
  padding: 6px 3px;
  text-align: center;
  border-bottom: 1px solid var(--line-soft);
}
.admin-matrix .am-row:hover .am-person,
.admin-matrix .am-row:hover .am-cell { background: var(--accent-soft); }
.am-person-inner { display: flex; align-items: center; gap: 10px; }
.am-person-inner .avatar { width: 28px; height: 28px; font-size: 0.7rem; flex-shrink: 0; }
.am-person-inner .wk-email { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 0.72rem; }
.am-open-n {
  display: inline-block;
  min-width: 1.1rem;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
}
.am-dot {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: none;
  padding: 0;
  cursor: pointer;
  vertical-align: middle;
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
.am-dot:hover:not(:disabled) {
  transform: scale(1.18);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.am-dot:disabled { cursor: default; opacity: 0.85; }
.am-dot.am-ok { background: var(--ok); }
.am-dot.am-warn { background: var(--warn); }
.am-dot.am-miss { background: var(--danger); }
.am-dot.am-empty { background: transparent; border: 1px dashed var(--line); box-shadow: none; }
.am-empty-row { padding: 28px 16px; text-align: center; color: var(--muted); }

.admin-panel { margin-top: 4px; }
.admin-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 14px;
}
.admin-panel-title {
  font-size: 1.25rem;
  margin: 0;
}
.admin-panel-lead {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 40rem;
}
.admin-panel-actions { display: flex; align-items: center; gap: 8px; }
.admin-summary {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 14px;
}
.admin-summary.is-warn { background: var(--warn-soft); color: var(--warn); }

.admin-mini-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 4px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  padding: 8px 0 12px;
  margin-bottom: 4px;
}
.admin-mini-nav a {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--panel);
}
.admin-mini-nav a:hover { color: var(--accent-hover); background: var(--accent-soft); text-decoration: none; }

.admin-remind-list {
  margin: 0 0 14px;
  padding-left: 1.2rem;
  font-size: 0.9rem;
}
.admin-remind-list li { margin: 4px 0; }

@media (max-width: 720px) {
  .admin-hub-stat { text-align: left; }
  .admin-check { margin-left: 0; }
  .admin-matrix .am-person-h,
  .admin-matrix .am-person { min-width: 150px; }
}
