/* ==========================================================
   Sistemi i detyrave – light & dark themes
   Brand colours are injected from settings as CSS variables.
   ========================================================== */
:root {
    --primary: #0F6B5C;
    --primary-strong: color-mix(in srgb, var(--primary) 78%, #000);
    --primary-soft: color-mix(in srgb, var(--primary) 12%, var(--surface));
    --on-primary: #FFFFFF;

    --bg: #F3F4F1;
    --surface: #FFFFFF;
    --surface-2: #F8F9F7;
    --border: #E2E4DF;
    --border-strong: #D5D8D2;
    --text: #18201D;
    --text-2: #3A423E;
    --muted: #5B635F;

    --danger: #B42318;   --danger-soft: #FDECEA;
    --warn: #8A3F06;     --warn-soft: #FDF0E1;
    --info: #1D4ED8;     --info-soft: #E8EEFC;
    --neutral-soft: #EEF0EE;

    --header-bg: var(--brand-header-bg, #FFFFFF);
    --header-text: var(--brand-header-text, var(--text));
    --sidebar-bg: var(--brand-sidebar-bg, #FFFFFF);

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16, 24, 20, .04);
    --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, monospace;
    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #0E1412;
    --surface: #151D1A;
    --surface-2: #1A2420;
    --border: #26322D;
    --border-strong: #33423C;
    --text: #E7EEEA;
    --text-2: #C3CEC9;
    --muted: #93A19B;
    --primary-strong: color-mix(in srgb, var(--primary) 60%, #fff);
    --primary-soft: color-mix(in srgb, var(--primary) 26%, var(--surface));

    --danger: #F97066;   --danger-soft: #3A1714;
    --warn: #F5B66C;     --warn-soft: #36230F;
    --info: #8DB0FF;     --info-soft: #172240;
    --neutral-soft: #222C28;

    /* custom header/sidebar colours are designed for light mode */
    --header-bg: var(--surface);
    --header-text: var(--text);
    --sidebar-bg: var(--surface);
    --shadow: none;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5; }
a { color: var(--primary-strong); }
a:hover { color: var(--primary); }
h1 { font-size: 26px; margin: 0; letter-spacing: -.01em; line-height: 1.2; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0; }
p { margin: 0 0 8px; }
input, select, textarea, button { font: inherit; color: inherit; }
img { max-width: 100%; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; color: var(--text); text-decoration: none; }
a.strong:hover { color: var(--primary); }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.block { display: block; }
.grow { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.prewrap { white-space: pre-wrap; }
.c-danger { color: var(--danger); } .c-warn { color: var(--warn); } .c-info { color: var(--info); } .c-primary { color: var(--primary-strong); }
.is-danger { color: var(--danger); font-weight: 600; } .is-warn { color: var(--warn); font-weight: 600; }
.w-sm { max-width: 90px; }
.inline { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 85%, #000); color: var(--on-primary); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; min-height: 46px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-sm); color: var(--header-text); background: transparent; border: 0; cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: color-mix(in srgb, var(--header-text) 8%, transparent); color: var(--header-text); }
.link-strong { font-weight: 600; text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, fieldset legend { font-size: 13px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=number], input:not([type]), select, textarea {
    width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
textarea { resize: vertical; line-height: 1.5; }
input[type=color] { width: 52px; height: 42px; padding: 3px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
input[type=file] { font-size: 13px; }
.color-row { display: flex; gap: 8px; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; cursor: pointer; min-height: 32px; padding-top: 6px; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--primary); flex: 0 0 auto; }
.check.done { color: var(--muted); text-decoration: line-through; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin: 0; min-width: 0; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.row-between.wrap { flex-wrap: wrap; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.inline-form input[type=text], .inline-form select { flex: 1 1 200px; width: auto; }
.narrow { max-width: 640px; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid; font-weight: 500; }
.alert-success { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 30%, transparent); color: var(--primary-strong); }
.alert-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.alert-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--info); }

/* ---------- Layout ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 24px; background: var(--header-bg); color: var(--header-text); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand:hover { color: inherit; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; }
.brand-text small { font-size: 12px; opacity: .72; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--primary); color: var(--on-primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex: 0 0 auto; }
.brand-mark.lg { width: 44px; height: 44px; font-size: 19px; border-radius: 10px; }
.brand-mark.sm { width: 26px; height: 26px; font-size: 12px; border-radius: 6px; }
.brand-mark.inverse { background: var(--login-text); color: var(--login-bg); }
.brand-logo { height: 34px; width: auto; max-width: 160px; object-fit: contain; }
.brand-logo.lg { height: 48px; max-width: 200px; }
.top-search { flex: 1 1 280px; max-width: 460px; position: relative; display: flex; align-items: center; }
.top-search .icon { position: absolute; left: 12px; color: var(--muted); }
.top-search input { padding-left: 36px; min-height: 40px; background: var(--surface-2); }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.user-chip { display: inline-flex; align-items: center; color: inherit; text-decoration: none; padding: 3px; border-radius: 99px; }
.user-chip .avatar { width: 36px; height: 36px; font-size: 15px; box-shadow: 0 0 0 2px var(--header-bg); transition: box-shadow .15s; }
.user-chip:hover .avatar, .user-chip:focus-visible .avatar { box-shadow: 0 0 0 2px var(--header-bg), 0 0 0 4px color-mix(in srgb, var(--header-text) 25%, transparent); }
.user-chip:hover { color: inherit; }

.prefs { display: flex; align-items: center; gap: 6px; }
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.lang-switch a { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; min-height: 36px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600; }
.lang-switch a img { border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); width: 22px; height: 16px; object-fit: cover; }
.lang-switch a.active { background: var(--primary-soft); color: var(--primary-strong); }
.lang-switch a:not(.active) img { opacity: .75; }

.shell { display: flex; min-height: calc(100vh - 61px); }
.sidebar { flex: 0 0 220px; background: var(--sidebar-bg); border-right: 1px solid var(--border); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none; font-size: 14px; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }
.nav-logout { color: var(--danger); }
.nav-logout:hover { background: var(--danger-soft); color: var(--danger); }
.nav-count { margin-left: auto; background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 10px; }
.nav-sep { height: 1px; background: var(--border); margin: 8px 4px; }
.content { flex: 1 1 auto; min-width: 0; padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 18px; }
.app-footer { padding: 16px 28px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; text-align: center; background: var(--surface); }
.only-mobile { display: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.cols { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.col-main { flex: 3 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.col-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
form.col-main, aside.card.col-side { gap: 14px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.empty-state { text-align: center; padding: 48px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.empty { padding: 24px; text-align: center; }
.callout { display: flex; gap: 12px; align-items: flex-start; background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, transparent); color: var(--text); }
.callout .icon { color: var(--info); flex: 0 0 auto; }
aside .callout { padding: 12px; border-radius: var(--radius-sm); border: 1px solid; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi strong { font-size: 28px; line-height: 1.15; }
.kpi small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Badges & chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--neutral-soft); color: var(--text-2); white-space: nowrap; }
.st-todo { background: var(--neutral-soft); color: var(--text-2); }
.st-doing { background: var(--info-soft); color: var(--info); }
.st-approval { background: var(--warn-soft); color: var(--warn); }
.st-done { background: var(--primary-soft); color: var(--primary-strong); }
.pr-high { background: var(--warn-soft); color: var(--warn); }
.pr-medium { background: var(--info-soft); color: var(--info); }
.pr-low { background: var(--neutral-soft); color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--border-strong); color: var(--text-2); background: var(--surface); text-decoration: none; font-size: 13px; font-weight: 500; }
.chip:hover { color: var(--text); background: var(--surface-2); }
.chip.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg a { padding: 0 16px; min-height: 38px; display: inline-flex; align-items: center; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 13px; }
.seg a.active { background: var(--primary-soft); color: var(--primary-strong); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--neutral-soft); font-size: 12px; text-align: center; }
.cat-tag { font-size: 11.5px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 13%, var(--surface)); padding: 2px 8px; border-radius: 6px; }
[data-theme="dark"] .cat-tag { color: color-mix(in srgb, var(--c) 55%, #fff); }

.avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 14px; flex: 0 0 auto; }
.avatar.sm { width: 26px; height: 26px; font-size: 12px; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters input[type=search] { flex: 1 1 260px; width: auto; }
.filters select { flex: 0 1 200px; width: auto; }
.filters input[type=date] { flex: 0 0 auto; width: auto; }

/* ---------- Board ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.board-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.board-col-head { display: flex; justify-content: space-between; align-items: center; }
.task-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text); }
.task-card:hover { border-color: var(--primary); color: var(--text); }
.task-card strong { font-size: 14px; line-height: 1.35; }
.task-card-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.task-card-foot { display: flex; align-items: center; gap: 10px; justify-content: space-between; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; padding: 0; }
.card.table-wrap { padding: 0; }
.table { width: 100%; border-collapse: collapse; min-width: 760px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; }
.table tr.inactive td:not(:nth-child(4)):not(:last-child) { opacity: .55; }

/* ---------- Dashboard ---------- */
.scroll-x { overflow-x: auto; }
.week { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); gap: 8px; min-width: 800px; }
.week-day { border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 96px; }
.week-day.has { background: var(--surface); border-color: var(--border-strong); }
.week-item { font-size: 12px; line-height: 1.35; color: var(--text); text-decoration: none; background: var(--primary-soft); border-radius: 6px; padding: 6px 8px; font-weight: 500; }
.week-item.st-approval { background: var(--warn-soft); }
.row-item { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.card-head + .row-item { border-top: 0; }
.load-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 90px; gap: 12px; align-items: center; padding: 6px 0; }
.bar { height: 10px; background: var(--neutral-soft); border-radius: 5px; overflow: hidden; display: flex; }
.bar-danger { background: var(--danger); height: 10px; }
.bar-ok { background: var(--primary); height: 10px; }
.legend { display: flex; gap: 16px; margin-top: 10px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend .sw { height: 10px; }

.feed, .history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.feed li, .history li { display: flex; gap: 10px; }
.feed li > div, .history li > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dot { flex: 0 0 8px; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--muted); }
.feed-status .dot { background: var(--warn); }
.feed-email .dot { background: var(--info); }
.feed-note .dot { background: var(--primary); }
.history { border-left: 2px solid var(--border); margin-left: 3px; padding-left: 14px; margin-top: 12px; }
.history .dot { margin-left: -20px; box-shadow: 0 0 0 3px var(--surface); }
.diff { font-size: 13px; }
.diff s { color: var(--muted); }

/* ---------- Ticket ---------- */
.crumbs { color: var(--muted); }
.crumbs a { color: var(--muted); }
.ticket-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.ticket-head h1 { margin: 6px 0 4px; font-size: 24px; }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tabs a { padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; min-height: 44px; }
.tabs a.active { color: var(--primary-strong); border-bottom-color: var(--primary); }
.tabs a:hover { color: var(--text); }
.files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.files li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.check-row { margin: 0; }
.flow { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.flow li { display: flex; gap: 12px; align-items: center; }
.flow li > div { display: flex; flex-direction: column; }
.flow-mark { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; border: 2px solid var(--border-strong); color: var(--muted); flex: 0 0 auto; }
.flow-done .flow-mark { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.flow-current .flow-mark { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.note { display: flex; gap: 12px; }
.props { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 16px 0; font-size: 13px; }
.props dt { color: var(--muted); }
.props dd { margin: 0; word-break: break-word; }
.tpl-list { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- Settings ---------- */
.roles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.perm-list { display: flex; flex-direction: column; gap: 2px; }
.perm-list small { font-weight: 400; }
.preview { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.preview-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--header-bg); color: var(--header-text); border-bottom: 1px solid var(--border); }
.preview-head .btn { margin-left: auto; pointer-events: none; }
.preview-body { display: flex; min-height: 110px; background: var(--bg); }
.preview-side { width: 160px; background: var(--sidebar-bg); border-right: 1px solid var(--border); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.preview-main { padding: 14px; flex: 1; }
.preview .kpi { max-width: 180px; }

.code { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-family: var(--mono); font-size: 12.5px; overflow-x: auto; white-space: pre; margin: 0; }

.ph { font-family: var(--mono); font-size: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; cursor: help; }
.mail-preview { width: 100%; height: 460px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #F3F4F1; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: flex; flex-wrap: wrap; }
.login-brand { flex: 1 1 420px; background: var(--login-bg); color: var(--login-text); padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; min-height: 360px; }
.login-brand .brand strong { font-size: 18px; }
.login-pitch { max-width: 520px; display: flex; flex-direction: column; gap: 20px; }
.login-pitch h1 { font-size: 40px; line-height: 1.15; letter-spacing: -.02em; }
.login-pitch p { font-size: 16px; line-height: 1.6; opacity: .82; }
.login-pitch ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.login-pitch li { display: flex; gap: 10px; align-items: center; }
.login-pitch li .icon { color: color-mix(in srgb, var(--login-text) 40%, #7FD1BF); flex: 0 0 auto; }
.login-company { font-size: 13px; opacity: .7; }
.login-form-wrap { flex: 1 1 420px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px; gap: 20px; position: relative; }
.login-top { position: absolute; top: 20px; right: 24px; }
.login-top .icon-btn { color: var(--text); }
.login-card { width: 100%; max-width: 400px; padding: 36px; display: flex; flex-direction: column; gap: 18px; }
.login-card h2 { font-size: 24px; margin: 0 0 4px; }
.brand.center { flex-direction: column; text-align: center; }
.no-panel .login-form-wrap { flex-basis: 100%; }
.forgot summary { font-size: 13px; color: var(--primary-strong); cursor: pointer; list-style: none; }
.forgot summary::-webkit-details-marker { display: none; }
.forgot[open] p { font-size: 12.5px; color: var(--muted); margin-top: 6px; position: absolute; right: 36px; left: 36px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px; z-index: 2; }
.login-card .field { position: relative; }

/* ---------- Notifications (bell) ---------- */
.notif { position: relative; }
.notif > summary { list-style: none; position: relative; }
.notif > summary::-webkit-details-marker { display: none; }
.notif[open] > summary { background: color-mix(in srgb, var(--header-text) 10%, transparent); }
.notif-badge { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--header-bg); }
.notif-badge[hidden] { display: none; }
.notif-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, calc(100vw - 32px)); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0, 0, 0, .18); z-index: 40; overflow: hidden; }
.notif-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-head form { margin: 0; }
.notif-empty { padding: 14px; margin: 0; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-panel .notif-list { max-height: 380px; overflow-y: auto; }
.notif-list li + li { border-top: 1px solid var(--border); }
.notif-list a { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; color: var(--text); text-decoration: none; }
.notif-list a:hover { background: var(--surface-2); }
.notif-list .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-text { font-size: 13.5px; line-height: 1.4; }
.notif-list li.unread { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.notif-list li.unread .notif-text { font-weight: 600; }
.notif-ico { flex: 0 0 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--neutral-soft); color: var(--text-2); }
.notif-ico.n-completed { background: var(--primary-soft); color: var(--primary-strong); }
.notif-ico.n-email_reply { background: var(--info-soft); color: var(--info); }
.notif-ico.n-due_soon { background: var(--warn-soft); color: var(--warn); }
.notif-ico.n-overdue { background: var(--danger-soft); color: var(--danger); }
.notif-foot { display: block; text-align: center; padding: 10px; border-top: 1px solid var(--border); font-weight: 600; }
.notif-log { padding: 0; overflow: hidden; }
.notif-log > p { padding: 18px 20px; margin: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.nowrap { white-space: nowrap; }

.form-wide { max-width: 860px; }

/* ---------- Auto-assign (Settings › Email) ---------- */
.aa-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.aa-list:empty { display: none; }
.aa-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.aa-list li + li { border-top: 1px solid var(--border); }
.aa-list li form { margin: 0; }
.aa-list .grow { display: flex; flex-direction: column; min-width: 0; }
.aa-list li.is-off { opacity: .6; }
.aa-btn { width: 32px; height: 32px; color: var(--text-2); }
.aa-btn:hover { background: var(--surface-2); color: var(--text); }
.aa-btn:disabled { opacity: .3; cursor: default; }
.aa-modes { border: 0; padding: 0; margin: 0; }
.aa-modes legend { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }

[hidden] { display: none !important; }
.card.table-wrap > .card-head { padding: 16px 20px 12px; margin: 0; }

/* ---------- Attendance (clock + check in/out) ---------- */
.dash-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 18px; }
.dash-top.team-only { grid-template-columns: 1fr; }
.att-widget { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; padding: 22px 24px; }
.clock { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 210px; margin: 0 auto; }
.clock svg { width: 190px; height: 190px; }
.clock-face { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 2; }
.tick-h { stroke: var(--text); stroke-width: 3; stroke-linecap: round; }
.tick-m { stroke: var(--muted); stroke-width: 1.2; opacity: .6; }
.clock-num { font: 600 13px var(--font); fill: var(--text-2); text-anchor: middle; }
.hand-h { stroke: var(--text); stroke-width: 6; stroke-linecap: round; }
.hand-m { stroke: var(--text); stroke-width: 4; stroke-linecap: round; }
.hand-s { stroke: var(--danger); stroke-width: 1.8; stroke-linecap: round; }
.clock-pin { fill: var(--danger); stroke: var(--surface); stroke-width: 2; }
.clock-digital { font: 700 26px var(--mono); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.att-side { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.att-side h2 { margin: 0 0 6px; }
.att-today-h { display: flex; align-items: center; gap: 5px; margin: -2px 0 6px; }
.att-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; font-size: 14.5px; }
.att-status.in b { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--primary-strong); }
.att-status.out { color: var(--muted); }
.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 60%, transparent); animation: pulse 1.8s infinite; flex: 0 0 auto; }
.pulse-dot.off { background: var(--muted); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 55%, transparent); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.att-form textarea { resize: vertical; min-height: 54px; }
.btn-lg { min-height: 52px; font-size: 16px; font-weight: 700; justify-content: center; gap: 8px; border-radius: 12px; }
.btn-checkout { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-checkout:hover { filter: brightness(.94); color: #fff; }
.att-stats { display: flex; gap: 22px; align-items: flex-end; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); }
.att-stats div { display: flex; flex-direction: column; }
.att-stats strong { font: 700 18px var(--mono); }
.att-stats a { margin-left: auto; }
.att-people { list-style: none; margin: 0; padding: 0; }
.att-people li { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.att-people li + li { border-top: 1px solid var(--border); }
.att-people .grow { display: flex; flex-direction: column; min-width: 0; }
.att-pill { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 13px; font-weight: 600; }
.att-pill.in { background: var(--primary-soft); color: var(--primary-strong); }
.att-pill.out { background: var(--danger-soft); color: var(--danger); }
.att-notes div + div { margin-top: 2px; }
.kpis-sm .kpi { padding: 12px 14px; }
.kpis-sm .kpi strong { font-size: 22px; }
.nav-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ---------- Reports ---------- */
.rep-filters { justify-content: space-between; }
.rep-filters input[type=date] { width: auto; }
.rep-mine { vertical-align: middle; font-size: 12.5px; margin-left: 6px; }
.rep-section { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 18px; }
.vchart { display: grid; grid-template-columns: repeat(var(--n), minmax(26px, 1fr)); gap: 6px; align-items: end; height: 220px; min-width: calc(var(--n) * 30px); padding-top: 10px; }
.vcol { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.vbars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--border); }
.vbars span { width: 45%; max-width: 18px; min-height: 2px; border-radius: 4px 4px 0 0; font-size: 10px; color: transparent; text-align: center; }
.vcol:hover .vbars span { color: var(--text-2); }
.vbars span:empty { min-height: 0; }
.vlabel { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bar-created, .sw.bar-created { background: var(--info); }
.bar-info { background: var(--info); height: 10px; }
.bar-st-todo { background: var(--text-2); height: 10px; } .bar-st-doing { background: var(--info); height: 10px; } .bar-st-done { background: var(--primary); height: 10px; }
.bar-pr-high { background: var(--warn); height: 10px; } .bar-pr-medium { background: var(--info); height: 10px; } .bar-pr-low { background: var(--muted); height: 10px; }
.hbar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 32px; gap: 10px; align-items: center; padding: 7px 0; }
.hbar-row b { text-align: right; }
.pct { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.pct .bar { flex: 1; }
.flag-sm { border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); vertical-align: middle; }

.rep-toggle svg { transition: transform .15s; }
.rep-toggle[aria-expanded="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-strong); }
.rep-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.rep-detail > td { background: var(--surface-2); padding: 16px 20px 14px !important; }
.rep-lists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 10px; }
.rep-list { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--info); border-radius: var(--radius-sm); padding: 12px 14px; min-width: 0; }
.rep-list.rep-overdue { border-top-color: var(--danger); }
.rep-list.rep-closed { border-top-color: var(--primary); }
.rep-list h3 { margin: 0 0 8px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.rep-list .count { background: var(--neutral-soft); border-radius: 10px; padding: 0 8px; font-size: 12px; }
.rep-list ul { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.rep-list li { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; white-space: normal; }
.rep-list li + li { border-top: 1px solid var(--border); }
.rep-list li a { font-weight: 600; color: var(--text); text-decoration: none; line-height: 1.35; }
.rep-list li a:hover { color: var(--primary); text-decoration: underline; }
.rep-list li .badge { font-size: 11px; padding: 1px 6px; }
@media (max-width: 900px) { .rep-lists { grid-template-columns: 1fr; } }

/* ---------- Roles: grouped permissions ---------- */
.perm-group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 12px 10px; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.perm-group legend { display: flex; align-items: center; gap: 6px; padding: 0 6px; font-weight: 700; font-size: 13px; color: var(--text-2); }
.perm-count { font-weight: 600; font-size: 11px; color: var(--muted); background: var(--neutral-soft); border-radius: 9px; padding: 0 7px; }
.perm-group .check small { font-size: 12px; line-height: 1.35; }

/* ---------- Users: active / disabled switch ---------- */
.switch { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); }
.switch .knob { position: relative; width: 38px; height: 22px; border-radius: 11px; background: var(--border-strong); transition: background .15s; flex: 0 0 auto; }
.switch .knob::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch.on { color: var(--primary-strong); }
.switch.on .knob { background: var(--primary); }
.switch.on .knob::after { transform: translateX(16px); }
.switch:focus-visible .knob { outline: 2px solid var(--primary); outline-offset: 2px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--primary-strong); }
.status-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }

/* ---------- Security tab ---------- */
.sec-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 16px; }
.sec-list li { display: flex; align-items: flex-start; gap: 6px; }
.sec-list svg { color: var(--primary); flex: 0 0 auto; margin-top: 2px; }
.sec-bad { background: var(--danger-soft); color: var(--danger); }
.sec-detail { max-width: 320px; overflow-wrap: anywhere; }

.ipb-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.ipb-form .field { flex: 1 1 200px; }
.ipb-form .field.grow-2 { flex: 2 1 260px; }
.ipb-quick { display: inline-flex; vertical-align: middle; margin-left: 4px; color: var(--muted); padding: 3px; border-radius: 6px; }
.ipb-quick:hover { color: var(--danger); background: var(--danger-soft); }
.logs-table td { vertical-align: middle; }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; min-height: 42px; }
.btn-danger-solid:hover { background: color-mix(in srgb, var(--danger) 88%, #000); color: #fff; }

/* ---------- Installer checks ---------- */
.install-checks { list-style: none; margin: 0 0 6px; padding: 0; font-size: 13px; }
.install-checks li { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; }
.install-checks span { font-weight: 700; width: 14px; flex: 0 0 auto; }
.install-checks .ok span { color: var(--primary); } .install-checks .bad { color: var(--danger); } .install-checks .warn { color: var(--warn); }

/* ---------- Favicon preview (a browser tab) ---------- */
.fav-tab { flex: 0 0 auto; width: 230px; background: var(--neutral-soft); border: 1px solid var(--border); border-radius: 10px 10px 4px 4px; padding: 8px 10px 0; display: flex; flex-direction: column; gap: 6px; }
.fav-dots { display: flex; gap: 5px; }
.fav-dots i { width: 9px; height: 9px; border-radius: 50%; background: #F87171; } .fav-dots i:nth-child(2) { background: #FBBF24; } .fav-dots i:nth-child(3) { background: #34D399; }
.fav-chip { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 8px 8px 0 0; padding: 7px 10px; font-size: 12px; }
.fav-chip img { width: 16px; height: 16px; object-fit: contain; border-radius: 3px; }
.fav-chip b { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-chip span { color: var(--muted); }

/* ---------- Email test results ---------- */
.diag { border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); }
.diag.bad { border-left-color: var(--danger); }
.diag-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.diag-steps { list-style: none; margin: 0; padding: 0; }
.diag-steps li { display: grid; grid-template-columns: 20px 150px minmax(0, 1fr); gap: 6px; padding: 4px 0; align-items: baseline; }
.diag-steps li span.small { overflow-wrap: anywhere; color: var(--text-2); }
.diag-ico { font-weight: 700; } .diag-steps .ok .diag-ico { color: var(--primary); } .diag-steps .bad .diag-ico, .diag-steps .bad b { color: var(--danger); }
.diag-hint { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-weight: 500; }
.diag.ok .diag-hint { background: var(--info-soft); color: var(--info); }
.diag-log summary { cursor: pointer; margin-top: 8px; color: var(--muted); }
.diag-log pre { max-height: 260px; overflow: auto; font-size: 12px; }
.cron-status { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--primary-soft); }
.cron-status.bad { background: var(--danger-soft); color: var(--danger); }
.cron-status .pulse-dot.off { background: var(--danger); }
.cron-status div { display: flex; flex-direction: column; }
@media (max-width: 700px) { .diag-steps li { grid-template-columns: 20px minmax(0, 1fr); } .diag-steps li span.small { grid-column: 2; } }

.rec-badge { background: var(--info-soft); color: var(--info); }
.rec-mark { color: var(--info); font-weight: 700; }

.day-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.day-opt { position: relative; cursor: pointer; }
.day-opt input { position: absolute; opacity: 0; pointer-events: none; }
.day-opt span { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; min-height: 40px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-weight: 600; font-size: 13px; background: var(--surface); }
.day-opt input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-strong); }
.day-opt input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
input[type=time] { min-height: 42px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }

/* ---------- Work schedules ---------- */
.sch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 18px; align-items: start; }
.sch-card.is-default { border-color: var(--primary); }
.w-time { max-width: 160px; }
.dg-today h3 { font-size: 14px; margin: 6px 0 8px; }
.dg-today .table { font-size: 13px; }
.dg-today tr.dg-no td:first-child { opacity: .65; }
.sch-days { border-collapse: collapse; width: 100%; }
.sch-days td { padding: 3px 4px; }
.sch-days td:first-child { width: 44%; }
.sch-days input[type=time] { width: 100%; min-height: 36px; padding: 4px 8px; }
.sch-days tr.off input[type=time] { opacity: .35; }
.sch-days tr.off .check { color: var(--muted); }
.sch-users { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0 10px; max-height: 260px; overflow-y: auto; }
.sch-users .check span { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
@media (max-width: 500px) { .sch-grid { grid-template-columns: 1fr; } }

/* ---------- Login page (shape + illustration on the left, form on the right) ---------- */
.lp { --lp-a: var(--primary); --lp-b: color-mix(in srgb, var(--primary) 35%, #4F46E5); min-height: 100vh; margin: 0; display: flex; background: var(--surface); position: relative; overflow-x: hidden; }
.lp-art { position: relative; flex: 0 0 58%; min-height: 100vh; color: #fff; overflow: hidden; }
.lp-blob { position: absolute; inset: 0; width: 100%; height: 100%; }
.lp-brand { position: absolute; top: 28px; left: 40px; display: flex; align-items: center; gap: 10px; z-index: 2; font-size: 18px; }
.lp-mark { width: 38px; height: 38px; border-radius: 10px; background: rgba(255, 255, 255, .95); color: var(--lp-a); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.lp-logo { height: 38px; width: auto; border-radius: 8px; background: #fff; padding: 4px; }
.lp-illu { position: absolute; left: 4%; top: 13%; width: 78%; max-width: 760px; height: auto; z-index: 1; }
.lp-caption { position: absolute; left: 40px; bottom: 34px; z-index: 2; max-width: 420px; padding: 16px 20px; border-radius: 16px; background: rgba(255, 255, 255, .14); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .22); }
.lp-caption h2 { margin: 0 0 6px; font-size: 18px; line-height: 1.3; color: #fff; }
.lp-caption ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; opacity: .92; }
.lp-caption li { display: flex; align-items: center; gap: 6px; }
.lp-corner { position: absolute; right: 0; bottom: 0; width: 160px; height: 160px; opacity: .9; pointer-events: none; }
.lp-form-wrap { flex: 1 1 auto; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 72px 32px 48px; position: relative; z-index: 1; }
.lp-top { position: absolute; top: 18px; right: 24px; }
.lp-top .icon-btn { color: var(--text); }
.lp-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.lp-form-brand { display: none; justify-content: center; margin-bottom: 4px; }
.lp-form h1 { margin: 0 0 14px; font-size: 34px; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; background: linear-gradient(90deg, var(--lp-a), var(--lp-b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-sub { margin: 0 0 10px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.lp-input { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); transition: border-color .15s, box-shadow .15s; text-align: left; }
.lp-input:focus-within { border-color: var(--lp-a); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lp-a) 18%, transparent); color: var(--lp-a); }
.lp-input input { flex: 1; min-width: 0; border: 0; background: transparent; min-height: 48px; padding: 0; font-size: 15px; color: var(--text); outline: none; box-shadow: none; }
.lp-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; text-align: left; font-size: 13px; }
.lp-row .check { padding-top: 0; min-height: 0; font-size: 13px; }
.lp-row .forgot summary { color: var(--muted); font-size: 13px; }
.lp-row .forgot[open] p { position: absolute; left: 0; right: 0; }
.lp-row .forgot { position: static; }
.lp-form .forgot[open] p { margin-top: 6px; font-size: 12.5px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.lp-btn { align-self: center; width: 70%; min-height: 50px; border: 0; border-radius: 999px; background: linear-gradient(90deg, var(--lp-a), var(--lp-b)); color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .03em; text-transform: uppercase; cursor: pointer; box-shadow: 0 10px 24px color-mix(in srgb, var(--lp-a) 30%, transparent); transition: transform .12s, box-shadow .12s; margin-top: 4px; }
.lp-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 28px color-mix(in srgb, var(--lp-a) 36%, transparent); }
.lp-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--lp-a) 45%, transparent); outline-offset: 3px; }
.lp-notice { margin: 8px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.lp .alert { text-align: left; margin: 0; }
.lp-no-art .lp-form-brand { display: flex; }
@media (max-width: 1180px) { .lp-caption { display: none; } .lp-illu { width: 84%; top: 16%; } }
/* Phones and small tablets: only the form */
@media (max-width: 900px) {
    .lp-art, .lp-corner { display: none; }
    .lp-form-wrap { padding: 72px 20px 32px; }
    .lp-form-brand { display: flex; }
    .lp-form h1 { font-size: 28px; }
    .lp-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .lp-btn { transition: none; } }

/* ---------- Avatar colour picker ---------- */
.color-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.color-opt { position: relative; cursor: pointer; }
.color-opt input { position: absolute; opacity: 0; pointer-events: none; }
.color-opt .avatar { width: 34px; height: 34px; transition: transform .1s, box-shadow .1s; }
.color-opt input:checked + .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); transform: scale(1.06); }
.color-opt input:focus-visible + .avatar { outline: 2px solid var(--primary); outline-offset: 3px; }
.color-opt.auto .avatar { background: repeating-conic-gradient(var(--neutral-soft) 0 25%, var(--surface) 0 50%) 50% / 12px 12px !important; color: var(--text-2); border: 1px dashed var(--border-strong); font-size: 11px; }
.color-custom { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.color-custom input[type=color] { width: 34px; height: 34px; padding: 0; border: 1px solid var(--border-strong); border-radius: 50%; background: none; cursor: pointer; }
.color-custom input[type=color]::-webkit-color-swatch-wrapper { padding: 2px; }
.color-custom input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }

/* ---------- Pop-up (new task) ---------- */
.modal { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 24px 70px rgba(0, 0, 0, .3); }
.modal::backdrop { background: rgba(10, 20, 16, .5); }
.modal[open] { animation: modal-in .16s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 0; }
.modal-head h2 { margin: 0 0 4px; }
.modal-head p { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.modal-x { color: var(--muted); margin: -6px -8px 0 0; }
.modal-x:hover { color: var(--text); background: var(--surface-2); }
.modal > form { padding: 16px 20px 20px; }
.modal-sm { width: min(560px, calc(100vw - 32px)); }
.modal-confirm { width: min(380px, calc(100vw - 32px)); }
.confirm-body { padding: 26px 24px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.confirm-body h2 { margin: 6px 0 0; font-size: 18px; }
.confirm-body p { margin: 0 0 12px; }
.confirm-ico { width: 52px; height: 52px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--danger-soft); color: var(--danger); }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.btn-logout { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-logout:hover { background: color-mix(in srgb, var(--danger) 88%, #000); color: #fff; }
.input-btn { display: flex; gap: 6px; }
.input-btn input { flex: 1; min-width: 0; }
.input-btn .btn { flex: 0 0 auto; min-height: 42px; }
.send-cred { background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); border-radius: var(--radius-sm); padding: 10px 12px; }
.send-cred span { display: flex; flex-direction: column; gap: 2px; }
.send-cred b { display: inline-flex; align-items: center; gap: 6px; }
.inline-block { display: inline-block; margin: 0; }
.modal .row-between > .row-end { margin-left: auto; }
@media (max-width: 700px) { .modal .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Calendar ---------- */
.cal { padding: 0; overflow: hidden; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-wd { padding: 10px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal-day { min-height: 118px; padding: 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.weekend { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.cal-day.out { background: var(--surface-2); }
.cal-day.out .cal-num { color: var(--muted); opacity: .6; }
.cal-day-head { display: flex; justify-content: space-between; align-items: center; min-height: 26px; }
.cal-num { font-size: 13px; font-weight: 600; }
.cal-day.today .cal-num { background: var(--primary); color: var(--on-primary); border-radius: 13px; min-width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; }
.cal-add { opacity: 0; color: var(--muted); width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; }
.cal-day:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-add:hover { background: var(--primary-soft); color: var(--primary-strong); }
.cal-item { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.3; padding: 4px 7px; border-radius: 6px; text-decoration: none; color: var(--text); border-left: 3px solid transparent; }
.cal-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-item:hover { filter: brightness(.96); }
.cal-item.st-todo, .cal-sw.st-todo { background: var(--neutral-soft); }
.cal-item.st-doing, .cal-sw.st-doing { background: var(--info-soft); }
.cal-item.st-done, .cal-sw.st-done { background: var(--primary-soft); }
.cal-item.st-done span { text-decoration: line-through; color: var(--muted); }
.cal-item.is-late { border-left-color: var(--danger); background: var(--danger-soft); }
.cal-sw.is-late { background: var(--danger); }
.cal-sw.st-todo { box-shadow: inset 0 0 0 1.5px var(--text-2); }
.cal-sw.st-doing { box-shadow: inset 0 0 0 1.5px var(--info); }
.cal-sw.st-done { box-shadow: inset 0 0 0 1.5px var(--primary); }
.cal-dot { flex: 0 0 7px; height: 7px; border-radius: 50%; }
.cal-none { padding: 14px; margin: 0; }
.cal-nav .btn { min-width: 40px; justify-content: center; }
.only-mobile-inline { display: none; }

/* ---------- Profile: language with flags ---------- */
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 6px; font-weight: 600; font-size: 13.5px; }
.lang-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.lang-opt { position: relative; cursor: pointer; }
.lang-opt input { position: absolute; opacity: 0; pointer-events: none; }
.lang-opt span { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); font-weight: 600; }
.lang-opt img { border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); object-fit: cover; }
.lang-opt input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); box-shadow: 0 0 0 1px var(--primary); }
.lang-opt input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.lang-opt input:not(:checked) + span img { opacity: .8; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .only-mobile { display: inline-flex; }
    .hide-sm { display: none !important; }
    .topbar { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
    .top-search { order: 5; flex-basis: 100%; max-width: none; }
    .sidebar { position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; padding-top: 70px; }
    .nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
    .content { padding: 18px 16px 32px; }
    .brand-text small { display: none; }
    .login-brand { padding: 32px 24px; min-height: 0; }
    .login-pitch h1 { font-size: 28px; }
    .login-top { position: static; align-self: flex-end; }
    .load-row { grid-template-columns: 100px minmax(0, 1fr) 70px; }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpi strong { font-size: 24px; }
    .topbar .lang-switch span { display: none; }
    .user-chip { padding: 0; }
    .board { grid-template-columns: repeat(3, minmax(250px, 80vw)); }
    /* Calendar becomes an agenda: only days with tasks */
    .cal-grid { grid-template-columns: 1fr; }
    .cal-wd, .cal-day.empty { display: none; }
    .cal-day { min-height: 0; border-right: 0; padding: 10px 14px; }
    .cal-day.out { display: none; }
    .cal-day.out:not(.empty) { display: flex; }
    .only-mobile-inline { display: inline; }
    .cal-add { opacity: 1; }
    .cal-item { font-size: 13.5px; padding: 8px 10px; }
    .notif-panel { position: fixed; top: 60px; right: 16px; }
    .dash-top { grid-template-columns: 1fr; }
    .att-widget { padding: 18px; gap: 18px; }
    .att-stats a { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .pulse-dot { animation: none; } }


/* ==========================================================
   Phones & small tablets – loaded last so it wins
   ========================================================== */
@media (max-width: 900px) {
    html, body { overflow-x: hidden; }
    /* nothing may push the page wider than the screen */
    .content > *, .cols > *, .col-main > *, .col-side > *, .card { min-width: 0; max-width: 100%; }
    .content { padding: 14px 12px 28px; gap: 14px; }
    .card { padding: 14px; border-radius: 14px; }
    h1 { font-size: 22px; }
    h2 { font-size: 15px; }

    /* top bar: logo + bell + theme + avatar on one line, search below */
    .topbar { padding: 8px 12px; gap: 6px; }
    .brand-text strong { font-size: 15px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
    .top-actions { gap: 2px; }
    .top-actions .icon-btn { width: 38px; height: 38px; }
    .user-chip .avatar { width: 32px; height: 32px; }
    .sidebar { width: 82vw; max-width: 300px; }
    .nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(10, 20, 16, .35); z-index: 25; }

    /* page heads, filters, chips */
    .page-head { align-items: flex-start; }
    .page-head > div:first-child { flex: 1 1 100%; }
    .page-head .row-end, .page-head .seg { width: 100%; justify-content: flex-start; }
    .filters { gap: 8px; }
    .filters > * { flex: 1 1 100%; }
    .filters .check { flex: 1 1 auto; }
    .filters .btn { flex: 1 1 auto; }
    .filters input[type=date] { flex: 1 1 40%; }
    .chips { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-width: none; }
    .chips::-webkit-scrollbar { display: none; }
    .chip { flex: 0 0 auto; }
    .tabs, .settings-tabs, nav.tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .tabs a { flex: 0 0 auto; white-space: nowrap; }

    /* dashboard */
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .kpi { padding: 12px 14px; }
    .kpi strong { font-size: 22px; }
    .dash-top { grid-template-columns: 1fr; }
    .att-widget { flex-direction: column; align-items: stretch; padding: 16px; gap: 14px; }
    .clock { width: 100%; flex-direction: row; justify-content: center; gap: 16px; }
    .clock svg { width: 120px; height: 120px; }
    .clock-digital { font-size: 22px; }
    .clock-date { display: none; }
    .att-stats { gap: 16px; }
    .week { min-width: 0; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 46%; overflow-x: auto; scroll-snap-type: x mandatory; }
    .week-day { scroll-snap-align: start; min-height: 80px; }
    .row-item { flex-wrap: wrap; }

    /* tables → cards (needs app.js; without JS they simply scroll sideways) */
    .table.rt { min-width: 0; }
    .table.rt thead { display: none; }
    .table.rt, .table.rt tbody { display: block; width: 100%; }
    .table.rt tr { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
    .table.rt tr:hover td { background: none; }
    .table.rt td { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 6px; padding: 2px 0; border: 0; text-align: right; min-height: 26px; }
    .table.rt td::before { content: attr(data-label); flex: 0 0 auto; max-width: 45%; margin-right: auto; padding-right: 10px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
    .table.rt td:not([data-label])::before, .table.rt td[data-label=""]::before { display: none; }
    .table.rt td:not([data-label]) { justify-content: flex-end; }
    .table.rt td[colspan] { display: block; text-align: left; }
    .table.rt td.num { text-align: right; }
    .table.rt td > .inline, .table.rt td > a.strong, .table.rt td > div { text-align: right; }
    .table.rt td .pct { min-width: 0; flex: 1; justify-content: flex-end; }
    /* task rows: code + title as the card heading, without labels */
    .table.rt td.mono:first-child { min-height: 0; justify-content: flex-start; color: var(--muted); }
    .table.rt td.mono:first-child::before, .table.rt td.mono:first-child + td::before { display: none; }
    .table.rt td.mono:first-child + td { display: block; text-align: left; font-size: 15px; padding-bottom: 6px; }
    .table.rt td.mono:first-child + td > a.strong { text-align: left; }
    .table-wrap { overflow-x: visible; }
    .card.table-wrap > .card-head { padding: 14px 14px 8px; }
    .table.rt tr.rep-detail { padding: 0; }
    .rep-detail > td { padding: 12px !important; }

    /* ticket page: details under the content */
    .ticket-head { flex-direction: column; align-items: stretch; }
    .ticket-head .actions { width: 100%; }
    .ticket-head .actions form, .ticket-head .actions .btn { width: 100%; }
    .props { grid-template-columns: 110px minmax(0, 1fr); }

    /* forms */
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .row-end { justify-content: stretch; }
    .row-end > .btn, .row-end > form > .btn { flex: 1 1 auto; }
    input, select, textarea { font-size: 16px; }   /* no zoom-in on iPhone */
    .inline-form > * { flex: 1 1 100%; }
    .rep-filters .row-end { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 10px; align-items: center; }
    .rep-filters .row-end > .btn { grid-column: 1 / -1; }

    /* pop-ups slide up from the bottom, full width */
    .modal, .modal-sm, .modal-confirm { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0 0; border-radius: 18px 18px 0 0; border-bottom: 0; }
    .modal[open] { animation: sheet-in .2s ease-out; }
    @keyframes sheet-in { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
    .modal > form { padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); }
    .color-pick { gap: 6px; }

    /* settings */
    .sch-grid, .roles-grid { grid-template-columns: 1fr; }
    .sch-days td:first-child { width: 40%; }
    .diag-steps li { grid-template-columns: 20px minmax(0, 1fr); }
    .ipb-form > * { flex: 1 1 100%; }
    .callout { flex-direction: column; }

    /* reports & calendar */
    .hbar-row { grid-template-columns: 90px minmax(0, 1fr) 28px; }
    .vchart { height: 170px; }
    .notif-panel { left: 8px; right: 8px; width: auto; top: 56px; position: fixed; }
}
@media (max-width: 420px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpi small { display: none; }
    .brand-text small { display: none; }
}
