:root {
  --bg: #ffffff; --bg2: #f8fafc; --card: #ffffff; --text: #1a1a1a; --muted: #64748b;
  --border: #e2e8f0; --surface: #f1f5f9; --surface-hover: #e2e8f0;
  /* Team Time 2.0 palette (assets/colors/colors.xml): --primary for text / borders / active states, --primary-fill for
     fills under white text (≥ 4.5:1 in both themes), --primary-gradient for primary buttons like the app. */
  --primary: #6A4CF0; --primary-hover: #5A3BE0; --primary-fill: #6A4CF0; --primary-fill-hover: #5A3BE0;
  --primary-gradient: linear-gradient(135deg, #5B5BF2 0%, #7C4DFF 100%);
  --danger: #dc2626; --danger-hover: #b91c1c;
  --success: #16a34a; --warning: #d97706;
  /* App background pattern (AppPatternBackground): vertical gradient + cyan glow top-left + pink glow bottom-right. */
  --pattern-top: #F7F7FF; --pattern-bottom: #EEEEFB;
  --glow-cyan: rgba(56, 189, 248, .22); --glow-pink: rgba(244, 114, 182, .18);
  --shadow: 0 1px 3px rgba(0,0,0,.08); --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1);
  --radius: 8px;
}
[data-theme="dark"] {
  --bg: #0f172a; --bg2: #1e293b; --card: #1e293b; --text: #e2e8f0; --muted: #94a3b8;
  --border: #334155; --surface: #1e293b; --surface-hover: #334155;
  --primary: #A594FF; --primary-hover: #B8AAFF; --primary-fill: #6A4CF0; --primary-fill-hover: #7B5FF5;
  --danger: #ef4444; --danger-hover: #dc2626;
  --pattern-top: #14152A; --pattern-bottom: #0F1019;
  --glow-cyan: rgba(56, 189, 248, .16); --glow-pink: rgba(244, 114, 182, .14);
  --shadow: 0 1px 3px rgba(0,0,0,.3); --shadow-md: 0 4px 6px -1px rgba(0,0,0,.4);
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
/* clip, not hidden: overflow-x:hidden on html/body silently breaks position:sticky
   (forces the other axis into its own scroll container in Safari/Chrome) */
html, body { overflow-x: clip; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--text); font-size: 14px; line-height: 1.5;
  min-height: 100vh; background-color: var(--pattern-bottom);
  background-image: radial-gradient(circle 90vmin at 18% 22%, var(--glow-cyan), transparent),
    radial-gradient(circle 90vmin at 85% 84%, var(--glow-pink), transparent),
    linear-gradient(180deg, var(--pattern-top), var(--pattern-bottom));
  background-attachment: fixed; }

/* ── Auth screens ── */
#screen-loading, #screen-denied, #screen-suspended { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; width: 100%; max-width: 380px; box-shadow: var(--shadow-md); }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card .subtitle { color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.auth-logo { font-size: 28px; margin-bottom: 12px; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Layout ── */
#screen-app { display: none; flex-direction: column; min-height: 100vh; }
header { background: color-mix(in srgb, var(--bg) 78%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 60; }
.header-brand { font-weight: 700; font-size: 16px; color: var(--primary); }
.header-right { display: flex; align-items: center; gap: 10px; }
.user-email { color: var(--muted); font-size: 13px; }
.main { flex: 1; padding: 24px; max-width: 1440px; width: 100%; margin: 0 auto; }

/* ── Lang switcher ── */
.lang { display: flex; gap: 2px; }
.lang a { color: var(--muted); text-decoration: none; padding: 2px 7px; border-radius: 4px; font-size: 12px; font-weight: 600; cursor: pointer; }
.lang a.cur { background: var(--text); color: var(--bg); }
.lang a:hover:not(.cur) { background: var(--surface); }

/* ── Tabs ── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab { background: none; border: none; padding: 10px 16px; cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.15s, border-color 0.15s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: -12px 0 20px; }
.subtab { display: inline-flex; align-items: center; background: none; border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 500; transition: color 0.15s, border-color 0.15s; }
.subtab:hover { color: var(--text); }
.subtab.active { color: var(--primary); border-color: var(--primary); background: var(--surface); }
.subtab .count-badge { margin-left: 6px; }
@media (max-width: 640px) {
  .subtabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 0 12px; scrollbar-width: none; }
  .subtabs::-webkit-scrollbar { display: none; }
  .subtab { flex-shrink: 0; }
}

/* ── Toolbar ── */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.toolbar-spacer { flex: 1; }

/* ── Form controls ── */
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], input[type="url"], select, textarea {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 7px 10px; font-size: 14px; font-family: inherit; outline: none; transition: border-color 0.15s;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
select { cursor: pointer; }
.search-input { min-width: 220px; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: var(--muted); }
label.field input, label.field select { color: var(--text); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.checkbox-row input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 6px; border: none; font-size: 13px; font-weight: 500; cursor: pointer; transition: background 0.15s, opacity 0.15s; white-space: nowrap; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary-gradient); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-gradient); filter: brightness(1.08); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }
.btn-danger.btn-outline { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger.btn-outline:hover:not(:disabled) { background: var(--danger); color: #fff; }
.btn-icon { padding: 6px 8px; }
.btn-logout { background: transparent; color: var(--muted); border: 1px solid var(--border); padding: 5px 12px; border-radius: 6px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.btn-logout:hover { background: var(--surface); }
.btn-site { color: var(--muted); border: 1px solid var(--border); padding: 5px 12px; border-radius: 6px; font-size: 13px; text-decoration: none; white-space: nowrap; }
.btn-site:hover { background: var(--surface); color: var(--text); }
.theme-btn { background: none; border: 1px solid var(--border); cursor: pointer; font-size: 13px; padding: 5px 9px; border-radius: 6px; color: var(--muted); white-space: nowrap; }
.theme-btn:hover { background: var(--surface); }
.burger-btn { display: none; flex-direction: column; justify-content: center; gap: 5px; cursor: pointer; background: none; border: none; padding: 4px; width: 32px; height: 32px; }
.burger-btn span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 1px; transition: all .2s; }
.burger-btn.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.burger-btn.open span:nth-child(2) { opacity: 0; }
.burger-btn.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
/* Desktop toolbar groups — transparent so children join parent flex */
.toolbar-row1 { display: contents; }
.toolbar-filters { display: contents; }

/* ── Table ── */
.settings-hint { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.5; max-width: 70ch; }
.pager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 10px 2px 0; font-size: 13px; color: var(--muted); }
.pager:empty { display: none; }
.pager-nav { display: flex; align-items: center; gap: 6px; }
.pager-page { min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; color: var(--text); }
.pager-range { font-variant-numeric: tabular-nums; }
.pager-size { display: flex; align-items: center; gap: 6px; }
.pager-size select { padding: 4px 8px; font-size: 13px; }
.bal-export { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.bal-export h3 { margin: 0; font-size: 16px; }
.bal-export-desc { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
table { width: 100%; border-collapse: collapse; }
th { background: var(--bg2); color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
.sort-ind { color: var(--primary); font-size: 10px; margin-left: 3px; }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface); }
.td-name { font-weight: 500; white-space: nowrap; }
.td-name-sub { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-top: 3px; font-weight: 400; white-space: nowrap; }
.td-name-plat { width: 20px; display: inline-flex; justify-content: center; flex: none; }
.td-name-rel { font-variant-numeric: tabular-nums; }
.td-name-bday { margin-left: 6px; cursor: default; }
.td-name-warn { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-right: 6px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; cursor: pointer; vertical-align: 1px; }
.td-name-warn:hover { background: var(--danger-hover); }
.missing-pop { position: fixed; z-index: 1000; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 10px 14px; font-size: 13px; }
.missing-pop-title { font-weight: 600; margin-bottom: 4px; }
.missing-pop ul { margin: 0; padding-left: 18px; color: var(--danger); }
.row-clickable { cursor: pointer; }
.td-email { color: var(--muted); font-size: 13px; }
.td-actions { display: flex; gap: 6px; }
.empty-row td { text-align: center; color: var(--muted); padding: 40px; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-employee { background: #e0f2fe; color: #0369a1; }
.badge-lead     { background: #fef3c7; color: #92400e; }
.badge-hr       { background: #f3e8ff; color: #6b21a8; }
.badge-admin    { background: #fee2e2; color: #991b1b; }
.badge-pm       { background: #d1fae5; color: #065f46; }
.badge-noleave  { background: #f1f5f9; color: #475569; text-transform: none; letter-spacing: 0; }
.badge-access   { background: #ede9fe; color: #5b21b6; text-transform: none; letter-spacing: 0; }
.emp-web-access { height: 32px; padding: 0 8px; font-size: 13px; }
[data-theme="dark"] .badge-employee { background: #0c4a6e; color: #7dd3fc; }
[data-theme="dark"] .badge-lead     { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .badge-hr       { background: #3b0764; color: #d8b4fe; }
[data-theme="dark"] .badge-admin    { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .badge-pm       { background: #052e16; color: #6ee7b7; }
[data-theme="dark"] .badge-noleave  { background: #1e293b; color: #cbd5e1; }
[data-theme="dark"] .badge-access   { background: #2e1065; color: #c4b5fd; }

/* ── Toggle ── */
.toggle { position: relative; display: inline-block; width: 36px; height: 20px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--border); border-radius: 20px; cursor: pointer; transition: background 0.2s; }
.toggle-slider:before { content: ''; position: absolute; height: 14px; width: 14px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: transform 0.2s; }
.toggle input:checked + .toggle-slider { background: var(--success); }
.toggle input:checked + .toggle-slider:before { transform: translateX(16px); }
.toggle input:disabled + .toggle-slider { opacity: 0.4; cursor: not-allowed; }

/* ── Departments ── */
.dept-list { display: flex; flex-direction: column; gap: 8px; }
.dept-item { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; }
.dept-item:hover { background: var(--surface); }
.dept-name { font-weight: 500; }
.dept-count { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none; align-items: flex-start; justify-content: center; z-index: 100; padding: 48px 16px; overflow-y: auto; }
.modal-overlay.open { display: flex; }
.modal { background: var(--bg); border-radius: var(--radius); padding: 28px; width: 100%; max-width: 520px; box-shadow: var(--shadow-md); position: relative; }
.modal h2 { font-size: 18px; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.modal-form { display: flex; flex-direction: column; gap: 14px; }
.modal-close { position: absolute; top: 14px; right: 14px; background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted); line-height: 1; padding: 4px; }
.modal-close:hover { color: var(--text); }

/* ── Toast ── */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast-item { background: #1e293b; color: #e2e8f0; padding: 10px 18px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow-md); animation: toast-in 0.2s ease; white-space: nowrap; }
.toast-item.success { background: #14532d; }
.toast-item.error   { background: #450a0a; }
.toast-item.warning { background: #713f12; white-space: normal; max-width: 90vw; }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; object-fit: cover; flex: none; vertical-align: middle; }
.td-person { display: flex; align-items: center; gap: 10px; }
.td-person-text { min-width: 0; }
.avatar--initials { background: var(--primary-fill); color: #fff; font-weight: 700; }
.news-admin-layout { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .news-admin-layout { grid-template-columns: minmax(0, 1fr); } }
.news-admin-layout .field { display: grid; gap: 6px; margin-bottom: 12px; }
.news-admin-layout > .settings-card { margin: 0; }
#news-list { min-width: 0; }
.news-schedule { display: grid; gap: 6px; margin-bottom: 12px; }
.bc-schedule { display: grid; gap: 6px; margin-bottom: 12px; }
.bc-schedule input[type="datetime-local"] { height: 36px; padding: 0 10px; max-width: 260px; }
.bc-queue { margin-top: 20px; border: 1px dashed var(--border); border-radius: var(--radius); padding: 12px 16px; background: var(--surface); }
.bc-queue-head { font-weight: 600; margin-bottom: 4px; }
.bc-queue-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.bc-queue-main { flex: 1; min-width: 0; }
.bc-queue-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-queue-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: 12px; }
.bc-queue-badge { text-transform: none; letter-spacing: 0; white-space: nowrap; }
.bc-queue-scheduled { background: #e0f2fe; color: #0369a1; }
.bc-queue-sending { background: #fef3c7; color: #92400e; }
.bc-queue-sent { background: #d1fae5; color: #065f46; }
.bc-queue-failed { background: #fee2e2; color: #991b1b; }
.bc-queue-cancelled { background: #f1f5f9; color: #475569; }
[data-theme="dark"] .bc-queue-scheduled { background: #0c4a6e; color: #7dd3fc; }
[data-theme="dark"] .bc-queue-sending { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .bc-queue-sent { background: #052e16; color: #6ee7b7; }
[data-theme="dark"] .bc-queue-failed { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .bc-queue-cancelled { background: #1e293b; color: #cbd5e1; }
.news-schedule input[type="datetime-local"] { height: 36px; padding: 0 10px; max-width: 260px; }
.news-drafts { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; }
.news-drafts-head { font-weight: 600; margin-bottom: 4px; }
.news-draft-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); }
.news-draft-row.active .news-draft-title { color: var(--primary); }
.news-draft-main { flex: 1; min-width: 0; }
.news-draft-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-draft-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: 12px; }
.news-draft-badge { white-space: nowrap; }
.news-draft-error { color: var(--danger); }
.news-pinned { background: var(--surface); border: 1px solid var(--primary); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; }
.news-admin-layout textarea { resize: vertical; }
.news-admin-files { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.news-as-company { margin: 4px 0 12px; }
.news-notify { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 4px 0 12px; }
.news-notify-users { max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 6px 8px; margin-bottom: 12px; }
.news-notify-users .checkbox-row { padding: 4px; }
.news-admin-body a { word-break: break-all; }
.news-file-state { font-size: 13px; color: var(--muted); }
.news-admin-reactions { display: flex; flex-wrap: wrap; gap: 6px; }
.news-admin-reaction { background: var(--bg2); border-radius: 12px; padding: 2px 10px; font-size: 13px; }
.news-admin-reaction--btn { border: 1px solid transparent; color: var(--text); font-family: inherit; cursor: pointer; }
.news-admin-reaction--btn:hover { border-color: var(--border); background: var(--surface-hover); }
.news-reactions-tabs { margin-bottom: 12px; }
.news-reactors { display: grid; max-height: 60vh; overflow-y: auto; }
.news-reactor-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.news-reactor-row:last-child { border-bottom: none; }
.news-reactor-main { flex: 1; min-width: 0; display: grid; font-size: 14px; }
.news-reactor-main span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-reactor-emojis { font-size: 16px; white-space: nowrap; }
.news-admin-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; display: grid; gap: 10px; }
.news-admin-head { display: flex; align-items: center; gap: 10px; }
.news-admin-meta { flex: 1; min-width: 0; display: grid; font-size: 13px; }
.news-admin-meta span { color: var(--muted); font-size: 12px; }
.news-admin-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.news-admin-card--pinned { border-color: var(--primary); }
.news-admin-meta .news-pinned-badge { color: var(--primary); font-weight: 600; }
.news-admin-title { font-weight: 700; font-size: 15px; }
.news-admin-body { white-space: pre-wrap; font-size: 14px; }
.news-admin-image { max-width: 100%; max-height: 260px; border-radius: 10px; object-fit: cover; }
.news-admin-file { font-size: 13px; }
/* ── FAQ ── */
.faq-pos { width: 48px; color: var(--muted); font-variant-numeric: tabular-nums; }
.faq-question-cell { overflow-wrap: anywhere; }
.faq-meta-cell { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.faq-detail-question { font-size: 15px; font-weight: 600; margin: 4px 0 16px; overflow-wrap: anywhere; }
.faq-detail-answer { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.55; background: var(--bg2); border-radius: 6px; padding: 12px; margin: 4px 0 16px; }
.faq-detail-links { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.faq-detail-links li { border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font-size: 13px; overflow-wrap: anywhere; }
.faq-detail-answer a, .faq-detail-links a { color: var(--primary); }
.faq-link-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.faq-link-bad { color: var(--danger); font-size: 12px; }
.faq-muted { color: var(--muted); font-size: 13px; margin-top: 4px; }
.faq-detail-meta { margin-top: 16px; color: var(--muted); font-size: 12px; }
.modal-actions .faq-delete-btn { margin-right: auto; }
.faq-links-field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.faq-links-field > .btn { align-self: flex-start; }
.faq-links-field > .settings-hint { margin: 0; font-weight: 400; }
.faq-links-editor { display: grid; gap: 8px; }
.faq-links-editor:empty { display: none; }
.faq-link-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto; grid-template-areas: 'name url remove'; gap: 8px; align-items: center; }
.faq-link-row input { min-width: 0; color: var(--text); }
.faq-link-name { grid-area: name; }
.faq-link-url { grid-area: url; }
.faq-link-remove { grid-area: remove; }
@media (max-width: 640px) {
  .faq-link-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'name remove' 'url url'; }
  .faq-link-row + .faq-link-row { border-top: 1px dashed var(--border); padding-top: 8px; }
  #panel-faq th, #panel-faq td { padding: 8px 10px; font-size: 13px; }
  #panel-faq th:nth-child(3), #panel-faq td:nth-child(3) { display: none; }
}
/* ── User guide ── */
.guide-toolbar { align-items: center; }
.guide-lang { display: flex; gap: 4px; }
.guide-dirty { color: var(--warning); font-size: 13px; font-weight: 600; white-space: nowrap; }
.guide-toolbar label.btn.is-disabled { opacity: 0.5; pointer-events: none; }
.guide-status { margin: 0 0 12px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.guide-status:empty { display: none; }
.guide-status--warn { max-width: 900px; padding: 10px 14px; border: 1px solid var(--wl-warn-border); border-radius: var(--radius); background: var(--wl-warn-bg); color: var(--wl-warn-text); line-height: 1.5; }
.guide-status--error, .guide-status-sub { color: var(--danger); }
.guide-status-sub { margin-top: 6px; }
.guide-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.guide-pane { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.guide-pane-head { display: flex; align-items: center; gap: 10px; min-height: 28px; font-size: 13px; font-weight: 600; color: var(--muted); }
.guide-counter { margin-left: auto; font-weight: 500; font-variant-numeric: tabular-nums; }
.guide-counter--bad { color: var(--danger); }
.guide-preview-toggle { display: none; }
.guide-text { width: 100%; height: 68vh; min-height: 360px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.55; tab-size: 4; }
.guide-text:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.guide-text:read-only { opacity: 0.7; }
/* Absolute content adds nothing to the grid row, so the row follows the editor height and the preview scrolls inside. */
.guide-preview-wrap { position: relative; flex: 1; min-height: 360px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg2); }
.guide-preview { position: absolute; inset: 0; overflow: auto; padding: 14px 18px; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.guide-preview-note { margin: 0; font-size: 12px; color: var(--muted); }
.guide-preview > :first-child { margin-top: 0; }
.guide-preview h1, .guide-preview h2, .guide-preview h3, .guide-preview h4 { margin: 1.2em 0 0.5em; line-height: 1.3; }
.guide-preview h1 { font-size: 22px; }
.guide-preview h2 { font-size: 18px; }
.guide-preview h3 { font-size: 16px; }
.guide-preview h4 { font-size: 14px; }
.guide-preview p, .guide-preview ul, .guide-preview ol, .guide-preview blockquote, .guide-preview pre, .guide-preview table { margin: 0 0 0.8em; }
.guide-preview ul, .guide-preview ol { padding-left: 1.4em; }
.guide-preview li + li { margin-top: 0.2em; }
.guide-preview a { color: var(--primary); }
.guide-preview code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--surface); border-radius: 4px; padding: 1px 4px; }
.guide-preview pre { background: var(--surface); border-radius: 6px; padding: 10px 12px; overflow-x: auto; }
.guide-preview pre code { background: none; padding: 0; }
.guide-preview blockquote { border-left: 3px solid var(--border); padding-left: 12px; color: var(--muted); }
.guide-preview hr { border: none; border-top: 1px solid var(--border); margin: 1.2em 0; }
.guide-preview table { display: block; width: auto; max-width: 100%; overflow-x: auto; }
.guide-preview th, .guide-preview td { border: 1px solid var(--border); padding: 6px 10px; font-size: 13px; text-transform: none; letter-spacing: 0; white-space: normal; color: var(--text); }
.guide-preview tr:hover td { background: none; }
.guide-preview img { max-width: 100%; }
.guide-versions { display: grid; gap: 8px; }
.guide-version { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; }
.guide-version-meta { flex: 1; min-width: 0; display: grid; gap: 2px; }
.guide-version-date { font-weight: 600; font-variant-numeric: tabular-nums; }
.guide-version-sub { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .guide-editor { grid-template-columns: minmax(0, 1fr); }
  .guide-preview-toggle { display: inline-flex; }
  .guide-preview-toggle.active { background: var(--surface-hover); color: var(--text); }
  .guide-editor:not(.guide-editor--preview) .guide-preview-pane { display: none; }
  .guide-text { height: 55vh; min-height: 280px; }
  .guide-preview-wrap { flex: none; height: 60vh; min-height: 280px; }
}
@media (max-width: 640px) {
  .guide-toolbar .toolbar-spacer { display: none; }
  .guide-version { flex-wrap: wrap; }
  .guide-version .btn { width: 100%; justify-content: center; }
}
.app-stat-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.app-stat-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px 28px; margin-bottom: 12px; }
.app-stat-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 6em; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; }
.app-stat-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-stat-value { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.app-stat-bar { display: block; height: 6px; border-radius: 3px; background: var(--surface); overflow: hidden; }
.app-stat-bar > span { display: block; height: 100%; background: var(--primary); }
.app-stat-bar--wide { margin-top: 10px; }
.app-icon-today { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 4px 0 14px; }
.app-icon-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); }
.app-icon-row .field { flex: 1 1 140px; min-width: 0; }
.app-icon-row .app-icon-narrow { flex: 0 1 90px; }
.app-icon-thumb { width: 40px; height: 40px; border-radius: 9px; flex: none; }
.app-icon-thumb--lg { width: 48px; height: 48px; border-radius: 11px; align-self: flex-end; object-fit: cover; }
.app-icon-tpl { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 12px 0 0; border-top: 1px solid var(--border); }
.app-icon-tpl .field { flex: 1 1 160px; min-width: 0; }
.app-icon-tpl-hint { flex: 1 1 160px; min-width: 0; align-self: center; font-size: 13px; color: var(--muted); }

/* Settings → Google Drive: workload plan sync */
.wd-grid { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(240px, 2fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 640px) { .wd-grid { grid-template-columns: 1fr; } }
.wd-alerts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 12px; }
.wd-run { margin-top: 12px; }
.wd-sa code { font-size: 12px; overflow-wrap: anywhere; user-select: all; }
.wd-source { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 13px; }
.wd-source:first-child { border-top: 0; }
.wd-source-week { font-weight: 600; min-width: 130px; }
.wd-source-title { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.wd-source-status { color: var(--muted); }
.wd-source-issue { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.wd-source--off { opacity: 0.6; }
.app-icon-tpl .btn { flex: none; }
.app-icon-switch { display: flex; align-items: center; gap: 8px; flex: none; min-width: 118px; padding-bottom: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.app-icon-row--off > :not(.app-icon-switch) { opacity: 0.5; }
.app-icon-check { display: flex; align-items: center; gap: 6px; font-size: 13px; padding-bottom: 8px; white-space: nowrap; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.count-badge { background: var(--surface); color: var(--muted); font-size: 12px; padding: 2px 8px; border-radius: 20px; margin-left: 8px; }

/* ── Period selector ── */
.period-tabs { display: flex; gap: 2px; background: var(--surface); border-radius: 8px; padding: 3px; width: fit-content; margin-bottom: 16px; }
.period-tab { background: none; border: none; padding: 6px 16px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; transition: background 0.15s, color 0.15s; }
.period-tab.active { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.period-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.year-select { font-size: 14px; font-weight: 600; padding: 6px 10px; min-width: 90px; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 6px; }
#month-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.chip { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 5px 12px; font-size: 13px; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; white-space: nowrap; }
.chip:hover { background: var(--surface-hover); }
.chip.active { background: var(--primary-fill); color: #fff; border-color: var(--primary-fill); }
.quarter-chip { padding: 7px 16px; font-size: 13px; }
.quarter-chip .q-range { font-size: 11px; color: inherit; opacity: .75; display: block; margin-top: 1px; }
.chip.active .q-range { opacity: .9; }
.custom-dates { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }

/* ── Dashboard ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; transition: border-color .15s, box-shadow .15s; }
.stat-card[onclick]:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.stat-value { font-size: 38px; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 6px; }
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .charts-grid { grid-template-columns: 1fr; } }
.chart-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.chart-card h3 { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.chart-desc { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.chart-wrap { position: relative; height: 310px; }

/* ── Request status / type ── */
.req-status { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; font-size: 13px; flex-shrink: 0; }
.rs-pending  { background: #fef3c7; color: #92400e; }
.rs-approved { background: #d1fae5; color: #065f46; }
.rs-rejected { background: #fee2e2; color: #991b1b; }
.rs-cancelled{ background: var(--surface); color: var(--muted); }
.push-status { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; background: var(--surface); color: var(--muted); }
.push-status.pst-sent    { background: #d1fae5; color: #065f46; }
.push-status.pst-partial { background: #fef3c7; color: #92400e; }
.push-status.pst-failed, .push-status.pst-error { background: #fee2e2; color: #991b1b; }
[data-theme="dark"] .push-status.pst-sent    { background: #052e16; color: #6ee7b7; }
[data-theme="dark"] .push-status.pst-partial { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .push-status.pst-failed, [data-theme="dark"] .push-status.pst-error { background: #450a0a; color: #fca5a5; }
.push-title-cell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-theme="dark"] .rs-pending  { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .rs-approved { background: #052e16; color: #6ee7b7; }
[data-theme="dark"] .rs-rejected { background: #450a0a; color: #fca5a5; }
.req-type-chip { font-size: 12px; background: var(--surface); color: var(--muted); padding: 2px 8px; border-radius: 4px; white-space: nowrap; }

/* ── Pipeline stepper ── */
.pipeline-steps { display: flex; flex-direction: column; }
.pipeline-step { display: flex; gap: 12px; }
.ps-track { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.ps-circle { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.ps-line { width: 2px; flex: 1; min-height: 12px; background: var(--border); margin: 3px 0; }
.pipeline-step.ps-last .ps-track { justify-content: flex-start; }
.ps-body { padding-bottom: 16px; padding-top: 3px; flex: 1; min-width: 0; }
.pipeline-step.ps-last .ps-body { padding-bottom: 4px; }
.ps-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ps-title { font-size: 13px; font-weight: 600; }
.ps-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.ps-approver { font-size: 13px; color: var(--muted); }
.ps-comment { font-size: 12px; color: var(--danger); margin-top: 4px; background: var(--surface); border-radius: 6px; padding: 6px 10px; }
.ps-approved .ps-circle { background: #d1fae5; color: #065f46; }
.ps-rejected .ps-circle { background: #fee2e2; color: #991b1b; }
.ps-pending  .ps-circle { background: #fef3c7; color: #92400e; border: 2px solid #f59e0b; }
.ps-skipped  .ps-circle { background: var(--surface); color: var(--muted); }
.ps-approved.ps-badge { background: #d1fae5; color: #065f46; }
.ps-rejected.ps-badge { background: #fee2e2; color: #991b1b; }
.ps-pending.ps-badge  { background: #fef3c7; color: #92400e; }
.ps-skipped.ps-badge  { background: var(--surface); color: var(--muted); }
[data-theme="dark"] .ps-approved .ps-circle { background: #052e16; color: #6ee7b7; }
[data-theme="dark"] .ps-rejected .ps-circle { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .ps-pending  .ps-circle { background: #451a03; color: #fcd34d; border-color: #f59e0b; }
[data-theme="dark"] .ps-approved.ps-badge { background: #052e16; color: #6ee7b7; }
[data-theme="dark"] .ps-rejected.ps-badge { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .ps-pending.ps-badge  { background: #451a03; color: #fcd34d; }

/* ── Calendar ── */
.cal-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.cal-nav { background: none; border: 1px solid var(--border); border-radius: 6px; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 20px; color: var(--text); }
.cal-nav:hover { background: var(--surface); }
.cal-month-title { font-size: 18px; font-weight: 600; min-width: 180px; }
.cal-grid { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.cal-wdays { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--bg2); border-bottom: 1px solid var(--border); }
.cal-wd { text-align: center; padding: 8px 2px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cal-cells { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell { min-height: 82px; padding: 6px 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); transition: background .1s; vertical-align: top; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:not(.other-month) { cursor: pointer; }
.cal-cell:not(.other-month):hover { background: var(--surface); }
.cal-cell.selected { background: color-mix(in srgb, var(--primary) 9%, transparent); }
.other-month { opacity: .3; cursor: default; }
.cal-day-num { font-size: 13px; font-weight: 500; margin-bottom: 3px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-cell.today .cal-day-num { background: var(--primary-fill); color: #fff; }
.cal-dot { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.cal-dot-circle { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.cal-dot-name { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 88px; }
.cal-more { font-size: 11px; color: var(--primary); }
.cal-detail { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-top: 16px; }
.cal-detail h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.cal-person { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cal-person:last-child { border-bottom: none; }
.cal-person-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── Responsive: tablet ── */
@media (max-width: 900px) {
  .charts-grid { grid-template-columns: 1fr; }
}

/* ── Responsive: mobile ── */
@media (max-width: 640px) {
  /* Header — tighten so lang/theme/site/logout never wrap onto a 2nd line */
  header { padding: 0 10px; height: 50px; position: fixed; left: 0; right: 0; }
  .user-email { display: none; }
  .header-brand { font-size: 14px; }
  .header-right { gap: 6px; }
  .lang a { padding: 2px 5px; font-size: 11px; }
  .btn-site, .btn-logout, .theme-btn { padding: 5px 8px; font-size: 12px; flex-shrink: 0; }

  /* Main */
  #screen-app { padding-top: 50px; }
  .main { padding: 12px; }

  /* Tabs — horizontal scroll, no wrap */
  .tabs { overflow-x: auto; flex-wrap: nowrap; gap: 0; -webkit-overflow-scrolling: touch;
          scrollbar-width: none; margin-bottom: 16px; padding-bottom: 0; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 10px 12px; font-size: 13px; flex-shrink: 0; }

  /* Forms */
  .form-row { grid-template-columns: 1fr; }
  .search-input { min-width: 0; flex: 1; width: 100%; }
  .toolbar { gap: 8px; }
  .toolbar > select { flex: 1; min-width: 0; }

  /* Stats grid — 2 columns */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px 16px; }
  .stat-value { font-size: 26px; }
  .stat-label { font-size: 12px; }

  /* Charts */
  .charts-grid { grid-template-columns: 1fr; }
  .chart-wrap { height: 265px; }

  /* Month chips — smaller */
  .chip { padding: 4px 9px; font-size: 12px; }
  .chip-grid { gap: 4px; }
  .period-row { gap: 6px; }

  /* Calendar — compact cells */
  .cal-header { gap: 8px; }
  .cal-month-title { font-size: 16px; min-width: auto; flex: 1; }
  .cal-cell { min-height: 52px; padding: 3px 3px; }
  .cal-wd { font-size: 9px; padding: 5px 1px; letter-spacing: 0; }
  .cal-day-num { font-size: 11px; width: 19px; height: 19px; }
  .cal-dot { gap: 2px; margin-bottom: 1px; }
  .cal-dot-circle { width: 5px; height: 5px; }
  .cal-dot-name { max-width: 46px; font-size: 10px; }
  .cal-more { font-size: 10px; }

  /* Modal — bottom sheet, floating with a margin so it never touches the browser's
     system zones (notch / home indicator / address bar) and always has padding. */
  .modal-overlay { padding: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); align-items: flex-end; }
  .modal { border-radius: 16px; max-height: 88vh; max-height: 88dvh; overflow-y: auto; width: 100%; padding: 20px 16px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; justify-content: center; }

  /* Requests table — compact, keep name/type/duration/status/created; hide the date range */
  #panel-requests table thead th:nth-child(3),
  #panel-requests table tbody td:nth-child(3) { display: none; }

  /* Employees table — compact, keep name(+platform/last-seen)/dept/role/position;
     hide email + active/hidden toggles (managed from the detail view on mobile) */
  #panel-employees table thead th:nth-child(2),
  #panel-employees table tbody td:nth-child(2),
  #panel-employees table thead th:nth-child(6),
  #panel-employees table tbody td:nth-child(6),
  #panel-employees table thead th:nth-child(7),
  #panel-employees table tbody td:nth-child(7) { display: none; }

  /* Push log table — keep time/recipient/title/status; type is in the detail modal */
  #panel-pushlog table thead th:nth-child(3),
  #panel-pushlog table tbody td:nth-child(3) { display: none; }
  .push-title-cell { max-width: 140px; }

  /* Tighter cells now that there's no Actions column to make room for */
  #panel-requests th, #panel-requests td,
  #panel-employees th, #panel-employees td,
  #panel-pushlog th, #panel-pushlog td { padding: 8px 10px; font-size: 13px; }
  #panel-requests .td-name-sub, #panel-employees .td-name-sub { font-size: 11px; }

  /* Sticky toolbar sits right under the fixed mobile header (50px, vs 56px on desktop) */
  .sticky-toolbar { top: 50px; }

  /* Burger nav — tabs as vertical slide-down overlay */
  .burger-btn { display: flex; }
  .tabs {
    position: fixed; top: 50px; left: 0; bottom: 0; width: 260px; z-index: 50;
    flex-direction: column; flex-wrap: nowrap; overflow-y: auto;
    background: var(--bg); border-right: 1px solid var(--border);
    box-shadow: 4px 0 16px rgba(0,0,0,.15); margin-bottom: 0;
    transform: translateX(-100%); transition: transform .28s ease;
  }
  .tabs.nav-open { transform: translateX(0); }
  .tab {
    width: 100%; text-align: left; padding: 14px 20px;
    border-bottom: 1px solid var(--border); border-left: 3px solid transparent;
    margin-bottom: 0; font-size: 15px; flex-shrink: 0;
  }
  .tab:last-child { border-bottom: none; }
  .tab.active { border-left-color: var(--primary); background: var(--surface); }
  #nav-overlay { display: none; position: fixed; inset: 0; top: 50px; z-index: 49; background: rgba(0,0,0,.35); }
  #nav-overlay.active { display: block; }

  /* Toolbars — row1 + filters on separate rows */
  .toolbar-row1 { display: flex; gap: 8px; align-items: center; width: 100%; }
  .toolbar-row1 .search-input { flex: 1; min-width: 0; }
  .toolbar-filters { display: flex; gap: 8px; width: 100%; }
  .toolbar-filters select { flex: 1; min-width: 0; }

  /* Dept items — stack on very narrow */
  .dept-item { flex-wrap: wrap; gap: 8px; }
  .dept-item .td-actions { margin-left: auto; }

  /* Toast — full width */
  #toast { left: 12px; right: 12px; transform: none; }
  .toast-item { white-space: normal; text-align: center; }

  /* Export — stack options */
  .period-tabs { flex-wrap: wrap; width: 100%; }
  .period-tab { flex: 1; text-align: center; }
}
/* ── Employee Detail Modal ── */
.emp-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.emp-detail-val { margin-top: 3px; font-size: 14px; font-weight: 500; }

/* ── Balance ── */
.bal-year-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.bal-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bal-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.bal-type { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.bal-numbers { font-size: 22px; font-weight: 700; line-height: 1.1; }
.bal-sep { color: var(--muted); font-weight: 400; }
.bal-unit { font-size: 13px; color: var(--muted); font-weight: 400; }
.bal-bar { height: 6px; background: var(--border); border-radius: 3px; margin: 8px 0; overflow: hidden; }
.bal-bar-fill { height: 100%; border-radius: 3px; transition: width .3s; }
.bal-sub { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.bal-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.bal-loading { color: var(--muted); font-size: 13px; padding: 8px 0; }
.bal-history-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; margin-top: 4px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.settings-divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── Settings ── */
.settings-section { margin-bottom: 24px; }
.settings-section-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.settings-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.holiday-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.holiday-date { font-size: 13px; font-weight: 600; min-width: 90px; flex-shrink: 0; }
.holiday-desc { font-size: 13px; color: var(--muted); flex: 1; }
.holiday-add-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.weekdays-row { display: flex; gap: 8px; flex-wrap: wrap; }
.weekday-btn { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.weekday-btn input { display: none; }
.weekday-btn span { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--border); font-size: 12px; font-weight: 600; transition: all .15s; }
.weekday-btn input:checked + span { background: var(--primary-fill); color: #fff; border-color: var(--primary-fill); }
.weekday-btn:hover span { border-color: var(--primary); }

/* ── Pipeline node item (settings) ── */
.pipeline-node-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; }

/* ── Requests legend — explains each status pictogram ── */
.req-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 10px 14px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); font-size: 12px; color: var(--muted); }
.req-legend-item { display: flex; align-items: center; gap: 6px; white-space: nowrap; }

/* ── Sticky toolbar (search/filters + legend) — stays visible while the table scrolls ── */
.sticky-toolbar { position: sticky; top: 56px; z-index: 10; background: var(--bg); padding-top: 4px; margin-bottom: 16px; }

/* ── Platform badge ── */
.platform-badge { display: inline-flex; align-items: center; color: var(--muted); opacity: .85; vertical-align: middle; margin: 0; cursor: default; line-height: 0; }
.platform-badge-empty { opacity: .4; }

/* ── Request warning badge ── */
.req-warn-badge { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--warning); color: #fff; font-size: 10px; font-weight: 700; line-height: 1; vertical-align: middle; margin-left: 5px; cursor: default; flex-shrink: 0; }

/* ── Settings cards grid ── */
.settings-tabs-nav { display: flex; gap: 6px; margin-bottom: 20px; }
.settings-tab-btn { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 7px 18px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--muted); transition: all .15s; }
.settings-tab-btn:hover { background: var(--surface); color: var(--text); }
.settings-tab-btn.active { background: var(--primary-fill); color: #fff; border-color: var(--primary-fill); }
.settings-cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.settings-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.settings-card--full { grid-column: 1 / -1; }
.settings-card-header { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.settings-card-icon { font-size: 20px; line-height: 1; flex-shrink: 0; }
.settings-radio-group { display: flex; flex-direction: column; gap: 8px; }
.settings-radio-option { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 10px 12px; border: 2px solid var(--border); border-radius: 8px; transition: border-color .15s, background .15s; }
.settings-radio-option:hover { border-color: var(--primary); }
.settings-radio-option:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--bg)); }
.settings-radio-option input[type="radio"] { margin-top: 2px; accent-color: var(--primary); flex-shrink: 0; width: 16px; height: 16px; }
.settings-radio-body { flex: 1; }
.settings-radio-title { font-size: 13px; font-weight: 600; }
.settings-radio-desc { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.settings-toggles { display: flex; flex-direction: column; gap: 14px; }
.settings-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.settings-toggle-label { font-size: 13px; font-weight: 500; line-height: 1.4; }

.pm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pm-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px 4px 12px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; }
.pm-chip-remove { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 11px; line-height: 1; padding: 0 2px; transition: color .15s; }
.pm-chip-remove:hover { color: var(--danger); }
.pm-chip-dept { color: var(--muted); font-size: 11px; }

/* Feedback */
.fb-filter-btns { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.fb-filter-btn { background: none; border: none; padding: 6px 14px; font-size: 13px; cursor: pointer; color: var(--muted); transition: background .15s, color .15s; }
.fb-filter-btn.active { background: var(--primary-fill); color: #fff; }
.fb-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 12px; transition: border-color .2s; }
.fb-card--unread { border-color: var(--primary); border-width: 2px; }
.fb-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.fb-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-name { font-size: 15px; font-weight: 600; color: var(--text); }
.fb-badge { display: inline-block; background: var(--primary-fill); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 10px; }
.fb-card-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.fb-date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.fb-stars { margin-bottom: 8px; }
.fb-star { font-size: 18px; color: var(--border); }
.fb-star--on { color: #f59e0b; }
.fb-message { font-size: 14px; color: var(--text); line-height: 1.6; white-space: pre-wrap; }
.btn-sm { font-size: 12px; padding: 4px 10px; min-height: unset; height: auto; }
.fb-delete-btn { color: var(--muted); }
.fb-delete-btn:hover { color: var(--danger); }

@media (max-width: 640px) {
  .settings-cards-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .bal-cards { grid-template-columns: 1fr; }
  .emp-detail-grid { grid-template-columns: 1fr; }
  .settings-row { grid-template-columns: 1fr; }
}

/* ── Workload plan ── */
:root {
  --wl-over: #b45309;
  --wl-warn-bg: #fffbeb; --wl-warn-border: #fcd34d; --wl-warn-text: #92400e;
  --wl-info-bg: #eff6ff; --wl-info-border: #bfdbfe; --wl-info-text: #1e3a8a;
  --wl-danger-bg: #fef2f2; --wl-danger-border: #fecaca; --wl-danger-text: #991b1b;
  --wl-ok-bg: #ecfdf5; --wl-ok-border: #a7f3d0; --wl-ok-text: #166534;
}
[data-theme="dark"] {
  --wl-over: #fbbf24;
  --wl-warn-bg: #2a1a05; --wl-warn-border: #92400e; --wl-warn-text: #fcd34d;
  --wl-info-bg: #172554; --wl-info-border: #1e40af; --wl-info-text: #bfdbfe;
  --wl-danger-bg: #2a0a0a; --wl-danger-border: #7f1d1d; --wl-danger-text: #fca5a5;
  --wl-ok-bg: #052e16; --wl-ok-border: #166534; --wl-ok-text: #6ee7b7;
}
.wl-weekbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.wl-weekbar .cal-nav:disabled { opacity: .4; cursor: not-allowed; }
.wl-week-title { font-size: 20px; font-weight: 700; margin: 0; }
.wl-history { display: flex; align-items: center; gap: 8px; margin-left: 8px; color: var(--muted); font-size: 13px; }
.wl-meta { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.wl-meta a, .wl-person-foot a { color: var(--primary); text-decoration: none; font-weight: 500; }
.wl-meta a:hover { text-decoration: underline; }
.wl-meta a.wl-meta-warn { color: var(--wl-warn-text); }
.wl-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.wl-stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); }
.wl-stat-label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.wl-stat-value { font-size: 26px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.wl-stat--over .wl-stat-value { color: var(--wl-over); }
.wl-stat--warn { background: var(--wl-warn-bg); border-color: var(--wl-warn-border); }
.wl-stat--warn .wl-stat-label, .wl-stat--warn .wl-stat-value { color: var(--wl-warn-text); }
.wl-over-only { font-size: 13px; white-space: nowrap; }
.wl-table { min-width: 760px; }
.wl-num { text-align: right; font-variant-numeric: tabular-nums; }
.wl-total { font-weight: 700; white-space: nowrap; }
.wl-total.wl-over { color: var(--wl-over); }
.wl-total.wl-zero { color: var(--muted); }
.wl-muted { color: var(--muted); }
.wl-hint { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0; }
.wl-warn-text { color: var(--wl-warn-text); }
.wl-table tr.wl-group td { background: var(--surface); padding: 8px 14px; font-weight: 700; }
.wl-group-sub { color: var(--muted); font-weight: 500; }
.wl-table tr.wl-group--warn td { background: var(--wl-warn-bg); color: var(--wl-warn-text); border-top: 1px solid var(--wl-warn-border); }
.wl-table tr.wl-group--ext td { background: var(--wl-info-bg); color: var(--wl-info-text); border-top: 1px solid var(--wl-info-border); }
.wl-table tr.wl-group--ext .wl-group-sub { color: inherit; opacity: .8; }
.wl-ext-text { color: var(--wl-info-text); }
.wl-stat--ext { background: var(--wl-info-bg); border-color: var(--wl-info-border); }
.wl-stat--ext .wl-stat-label, .wl-stat--ext .wl-stat-value { color: var(--wl-info-text); }
.modal-actions .wl-resolve-alt { margin-right: auto; }
.emp-leave-note { margin: 6px 0 0; }
.emp-leave-warn { color: var(--wl-warn-text); }
.wl-person { display: flex; flex-direction: column; }
.wl-person-name { font-weight: 600; }
.wl-person-src { color: var(--muted); font-size: 12px; }
/* Snapshot badges: .wl-person-src comes after the text colour helpers, so they need the extra class here. */
.wl-person-src.wl-warn-text { color: var(--wl-warn-text); }
.wl-person-src.wl-ext-text { color: var(--wl-info-text); }
.wl-dirs { color: var(--muted); font-size: 13px; }
.wl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wl-chip { padding: 2px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg2); font-size: 12px; white-space: nowrap; }
.wl-chip-more { padding: 2px 4px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.wl-unmatched-cell { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.wl-modal-wide { max-width: 860px; }
.modal h2.wl-modal-title { margin-bottom: 4px; }
.wl-modal-sub { margin-bottom: 16px; font-size: 13px; }
.wl-modal-foot { margin-top: 14px; }
.wl-person-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding-right: 28px; }
.wl-person-head-text { display: flex; flex-direction: column; min-width: 0; }
.wl-person-head-text h2 { margin: 0; }
.wl-edit-table { min-width: 640px; }
.wl-edit-table th, .wl-edit-table td { padding: 8px 10px; vertical-align: middle; }
.wl-edit-table input, .wl-edit-table select { width: 100%; height: 32px; padding: 0 10px; font-size: 13px; }
.wl-edit-table input.wl-hours { text-align: right; }
.wl-edit-table tr:hover td { background: transparent; }
.wl-edit-table tr.wl-edit-foot td { background: var(--bg2); }
.wl-col-hours { width: 90px; }
.wl-col-act { width: 44px; }
.wl-row-remove { width: 32px; height: 32px; border: none; border-radius: 6px; background: transparent; color: var(--danger); cursor: pointer; font-size: 14px; }
.wl-row-remove:hover { background: var(--surface-hover); }
.wl-add-row { border-style: dashed; color: var(--text); white-space: nowrap; }
.wl-note { margin-top: 14px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg2); font-size: 13px; line-height: 1.5; }
.wl-note--warn { background: var(--wl-warn-bg); border-color: var(--wl-warn-border); color: var(--wl-warn-text); }
.wl-note--info { background: var(--wl-info-bg); border-color: var(--wl-info-border); color: var(--wl-info-text); }
.wl-note--danger { background: var(--wl-danger-bg); border-color: var(--wl-danger-border); color: var(--wl-danger-text); }
.wl-note--ok { background: var(--wl-ok-bg); border-color: var(--wl-ok-border); color: var(--wl-ok-text); }
.wl-person-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-top: 16px; }
.wl-person-actions { display: flex; gap: 10px; margin-left: auto; }
.wl-resolve-who { display: flex; flex-direction: column; gap: 2px; }
.wl-upload { display: flex; flex-direction: column; gap: 12px; }
.wl-upload .period-tabs { margin-bottom: 0; }
.wl-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 16px; border: 2px dashed var(--border); border-radius: var(--radius); color: var(--muted); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.wl-drop:hover, .wl-drop.dragover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, transparent); }
.wl-drop-title { color: var(--text); font-weight: 500; word-break: break-word; }
.wl-week-field { max-width: 360px; }
.wl-up-opts { display: flex; flex-direction: column; gap: 8px; }
.wl-up-opts .checkbox-row { align-items: flex-start; font-size: 13px; }
.wl-up-opts .checkbox-row input { margin-top: 2px; flex: none; }
.wl-divider { border-top: 1px solid var(--border); margin: 4px 0 14px; }
.wl-pv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 12px; }
.wl-pv { padding: 10px 14px; border-radius: var(--radius); background: var(--surface); }
.wl-pv-value { font-size: 22px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.wl-pv-label { color: var(--muted); font-size: 12px; }
.wl-pv--ok { background: var(--wl-ok-bg); }
.wl-pv--ok .wl-pv-value, .wl-pv--ok .wl-pv-label { color: var(--wl-ok-text); }
.wl-pv--warn { background: var(--wl-warn-bg); }
.wl-pv--warn .wl-pv-value, .wl-pv--warn .wl-pv-label { color: var(--wl-warn-text); }
.wl-pv--ext { background: var(--wl-info-bg); }
.wl-pv--ext .wl-pv-value, .wl-pv--ext .wl-pv-label { color: var(--wl-info-text); }
.wl-pv-table { min-width: 680px; }
.wl-pv-table td, .wl-pv-table th { padding: 8px 12px; vertical-align: middle; }
.wl-pv-table tr:hover td { background: transparent; }
.wl-resolve-select { width: 100%; min-width: 200px; height: 32px; padding: 0 8px; font-size: 13px; }
.wl-resolve-select.wl-has-sugg { border-color: var(--primary); }
.wl-center { text-align: center; }
.wl-pv-subtitle { margin: 16px 0 8px; font-size: 14px; font-weight: 700; }
.wl-text { margin: 0 0 4px; font-size: 13px; }
.wl-warnings { margin: 12px 0 0; padding: 12px 16px 12px 32px; max-height: 240px; overflow: auto; border-radius: var(--radius); background: var(--wl-warn-bg); color: var(--wl-warn-text); font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.wl-uploader { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.wl-uploader .settings-card-header { margin-bottom: 14px; }
.wl-week-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 13px; }
.wl-week-row:first-child { border-top: none; padding-top: 0; }
.wl-week-row > span:last-child { text-align: right; }
.wl-weeks-note { margin: 12px 0 0; font-size: 12px; }
.wl-ver-table { min-width: 700px; font-size: 13px; }
.wl-ver-table td, .wl-ver-table th { padding: 9px 12px; vertical-align: middle; }
.wl-ver-table tr.wl-ver-current td { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.wl-ver-n { font-weight: 700; white-space: nowrap; }
.wl-badge-current { margin-left: 6px; padding: 1px 8px; border-radius: 20px; background: var(--primary-fill); color: #fff; font-size: 11px; font-weight: 600; }
.wl-ver-actions { text-align: right; white-space: nowrap; }
.wl-ver-actions .btn + .btn { margin-left: 6px; }
.wl-btn-accent { color: var(--primary); border-color: var(--primary); }
.wl-ver-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 12px; }
.wl-restore-box { display: flex; flex-direction: column; gap: 6px; }
.wl-restore-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
@media (max-width: 900px) {
  .wl-uploader { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .wl-week-title { font-size: 17px; }
  .wl-history { margin-left: 0; width: 100%; }
  .wl-history select { flex: 1; min-width: 0; }
  .wl-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .wl-stat { padding: 12px 14px; }
  .wl-stat-value { font-size: 22px; }
  .wl-pv-stats { grid-template-columns: 1fr 1fr; }
  #panel-workload .toolbar-filters { flex-wrap: wrap; }
  .wl-person-actions { width: 100%; }
  .wl-person-actions .btn { flex: 1; justify-content: center; }
}

/* ── Select arrow: own chevron with room on the right (native arrow sat on the edge) ── */
select:not([multiple]) {
  appearance: none; -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
}
[data-theme="dark"] select:not([multiple]) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* ── Settings forms: spacing between stacked rows and above the action button ── */
.settings-row + .settings-row { margin-top: 12px; }
.settings-actions { margin-top: 16px; }

/* ── Licence (license.js) ── */
#screen-suspended { padding: 16px; }
.license-card { max-width: 440px; text-align: center; }
.license-billing { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; padding: 14px 16px; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.license-row { display: flex; justify-content: space-between; gap: 12px; }
.license-row span:first-child { color: var(--muted); }
.license-row span:last-child { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.license-message { line-height: 1.5; overflow-wrap: anywhere; }
.license-contact { display: flex; flex-wrap: wrap; gap: 2px 12px; overflow-wrap: anywhere; }
.license-contact-title { color: var(--muted); }
.license-contact-name { font-weight: 600; }
.license-contact a { color: var(--primary); }
.license-btn { width: 100%; justify-content: center; margin-top: 8px; }
.license-banner { display: flex; flex-direction: column; gap: 4px; padding: 10px 24px; font-size: 13px; line-height: 1.5;
  background: var(--wl-warn-bg); border-bottom: 1px solid var(--wl-warn-border); color: var(--wl-warn-text); }
.license-banner .license-banner-text { font-weight: 600; }
.license-banner .license-contact-title { color: inherit; opacity: .8; }
.license-banner .license-contact a { color: inherit; text-decoration: underline; }
.license-billing[hidden], .license-banner[hidden] { display: none; }
.license-settings { margin-bottom: 16px; }
.license-settings-body { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; font-size: 13px; }
.license-settings-body > * { max-width: 560px; }
.license-settings-rows { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.license-settings-missing { margin: 0; }
.license-settings-meta { margin: 0; color: var(--muted); font-size: 12px; }
.license-chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; border: 1px solid;
  font-size: 12px; font-weight: 600; }
.license-chip--active { background: var(--wl-ok-bg); border-color: var(--wl-ok-border); color: var(--wl-ok-text); }
.license-chip--grace { background: var(--wl-warn-bg); border-color: var(--wl-warn-border); color: var(--wl-warn-text); }
.license-chip--suspended { background: var(--wl-danger-bg); border-color: var(--wl-danger-border); color: var(--wl-danger-text); }
.license-settings[hidden] { display: none; }
@media (max-width: 640px) { .license-banner { padding: 10px 12px; } .license-card { padding: 28px 20px; } }
