/* Trakya styles: one stylesheet shared by the shell and every module's screens. */

:root {
    --brand: #ea580c;
    --brand-dark: #c2410c;
    --brand-soft: #fff1e8;
    --ink: #1c1917;
    --ink-soft: #57534e;
    --ink-faint: #a8a29e;
    --line: #e7e5e4;
    --bg: #f7f6f4;
    --card: #ffffff;
    --good: #15803d;
    --good-soft: #ecfdf3;
    --warn: #92400e;
    --warn-soft: #fffbeb;
    --bad: #b91c1c;
    --radius: 12px;
    --side: 232px;
    --top: 56px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
}
a { color: var(--brand-dark); }
.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--ink-soft); font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13px; }

/* ---------- Shell: left menu, top bar, page ---------- */

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 15px; }

.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--side); z-index: 30;
    background: var(--card); border-right: 1px solid var(--line);
    display: flex; flex-direction: column; padding: 14px 12px;
}
.sidebar .brand { padding: 4px 8px 16px; }
.side-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
    color: var(--ink-soft); text-decoration: none; font-weight: 500;
}
.side-nav a:hover { background: #f5f5f4; color: var(--ink); }
.side-nav a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.side-group { margin: 14px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.side-foot { padding: 10px; font-size: 12px; color: var(--ink-soft); border-top: 1px solid var(--line); }

.with-shell .main { margin-left: var(--side); min-height: 100vh; }
.topbar {
    position: sticky; top: 0; z-index: 20; height: var(--top);
    display: flex; align-items: center; gap: 12px; padding: 0 24px;
    background: rgba(247, 246, 244, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.search-trigger {
    flex: 0 1 420px; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px;
    background: var(--card); border: 1px solid var(--line); border-radius: 9px; color: var(--ink-faint);
    font: inherit; cursor: pointer; text-align: left;
}
.search-trigger span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-trigger:hover { border-color: #d6d3d1; }
kbd { font: 600 11px/1 inherit; font-family: inherit; color: var(--ink-soft); background: #f5f5f4; border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; }
.icon-btn:hover { background: #ecebe9; color: var(--ink); }
.menu-btn { display: none; }

.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 999px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: #ecebe9; }
.user-name { font-weight: 600; font-size: 13px; }
.menu-pop {
    position: absolute; right: 0; top: calc(100% + 6px); width: 230px; background: var(--card);
    border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(28, 25, 23, 0.12); padding: 6px; z-index: 40;
}
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: grid; gap: 2px; }
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 7px; border: 0; background: none; font: inherit; color: var(--ink); text-decoration: none; cursor: pointer; }
.menu-pop a:hover, .menu-pop button:hover { background: #f5f5f4; }
.menu-pop form { margin: 0; }

.page { max-width: 1120px; margin: 0 auto; padding: 24px 24px 64px; }
.plain .page { max-width: 960px; }
.plain-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.plain-top form { margin: 0; }

.bottom-bar, .backdrop { display: none; }

/* ---------- Search box (Ctrl+K) ---------- */

.palette { position: fixed; inset: 0; z-index: 50; background: rgba(28, 25, 23, 0.35); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.palette[hidden] { display: none; }
.palette-box { width: 100%; max-width: 600px; background: var(--card); border-radius: 14px; box-shadow: 0 24px 60px rgba(28, 25, 23, 0.25); overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.palette-input input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 16px; padding: 16px 0; background: transparent; color: var(--ink); }
.palette-results { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.palette-results li { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.palette-results li.selected, .palette-results li:hover { background: var(--brand-soft); }
.palette-results .kind { font-size: 11px; font-weight: 600; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.palette-results .label { font-weight: 600; }
.palette-results .detail { color: var(--ink-soft); font-size: 13px; }
.palette-results .palette-empty { display: block; color: var(--ink-soft); cursor: default; }
.palette-results .palette-empty:hover { background: none; }
.palette-results:empty { display: none; }
.palette-hint { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; }

/* ---------- Page parts ---------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.page-head p { margin: 4px 0 0; color: var(--ink-soft); }
.flash { background: var(--good-soft); color: var(--good); border: 1px solid #bbf7d0; padding: 10px 14px; border-radius: 10px; margin-bottom: 18px; font-weight: 500; }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; font-weight: 500; font-size: 13px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 16px; }
.card-title { margin: 0 0 12px; font-size: 15px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -4px 0 20px; overflow-x: auto; }
.tabs a { text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: 13px; padding: 9px 12px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--brand-dark); border-bottom-color: var(--brand); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer;
    background: var(--brand); color: #fff; font: inherit; font-weight: 600;
    padding: 9px 16px; border-radius: 9px; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); }
.btn-quiet { background: transparent; color: var(--brand-dark); padding: 7px 10px; }
.btn-quiet:hover { background: var(--brand-soft); }
.btn-wide { width: 100%; justify-content: center; padding: 11px 16px; }
.actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.actions.end { justify-content: flex-end; }
.actions form { margin: 0; }

/* Forms */
.form { max-width: 520px; }
.form-wide { max-width: 760px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 13px; }
.field input, .field select {
    width: 100%; font: inherit; padding: 9px 11px; border: 1px solid #d6d3d1; border-radius: 9px; background: #fff;
}
.field input:focus, .field select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.field input:disabled { background: #f5f5f4; color: var(--ink-soft); }
.field .hint { color: var(--ink-soft); font-size: 12px; margin-top: 4px; }
.field .error { color: var(--bad); font-size: 12px; margin-top: 4px; font-weight: 500; }
fieldset.field { border: 0; padding: 0; margin: 0 0 16px; }
fieldset.field legend { font-weight: 600; margin-bottom: 8px; padding: 0; font-size: 13px; }
.form-section { border-top: 1px solid var(--line); margin: 22px 0 16px; padding-top: 18px; }
.form-section.first { border-top: 0; margin-top: 0; padding-top: 0; }
.form-section h2 { margin: 0 0 4px; font-size: 15px; }
.form-section .muted { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-2.align-start { align-items: start; gap: 14px; }
.choice-list { display: grid; gap: 6px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice input { margin-top: 4px; accent-color: var(--brand); }
.choice strong, .choice .muted { display: block; }
.check { display: flex; align-items: center; gap: 8px; margin: -4px 0 18px; font-size: 13px; color: var(--ink-soft); }
.inline-add { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.inline-add .field { margin-bottom: 0; }
.inline-add .grow { flex: 1 1 240px; }
.inline-add .narrow { flex: 0 0 96px; }
.inline-add .btn { margin-top: 24px; }

/* Lists and tables */
.search-bar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.search-bar input, .search-bar select { font: inherit; padding: 8px 11px; border: 1px solid #d6d3d1; border-radius: 9px; background: #fff; }
.search-bar input { flex: 1 1 260px; }
.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--ink-soft); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafaf9; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fcfcfb; }
.table tr.inactive td { opacity: 0.55; }
.table .right { text-align: right; }
.narrow-col { width: 70px; }
.cell-strong { font-weight: 600; }
a.row-link { color: var(--ink); text-decoration: none; }
a.row-link:hover { color: var(--brand-dark); text-decoration: underline; }
.empty { text-align: center; color: var(--ink-soft); padding: 32px 20px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 8px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-on { background: var(--good-soft); color: var(--good); }
.badge-wait { background: var(--warn-soft); color: var(--warn); }
.badge-off { background: #f5f5f4; color: var(--ink-soft); }

/* Organisation */
.branch-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.branch-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.branch-name { font-weight: 600; margin-right: 6px; }
.state-tag { background: #f5f5f4; color: var(--ink-soft); padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.id-list { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 12px 0 0; }
.id-list div { display: flex; gap: 6px; align-items: baseline; }
.id-list dt { color: var(--ink-soft); font-size: 12px; }
.id-list dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.todo { margin: 12px 0 0; padding: 9px 12px; background: var(--warn-soft); border: 1px solid #fde68a; color: var(--warn); border-radius: 9px; font-size: 13px; }
.todo a { font-weight: 600; margin-left: 4px; }

/* People */
.person-head { display: flex; align-items: center; gap: 14px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; font-weight: 700; font-size: 17px; flex: none; }
.avatar.small { width: 30px; height: 30px; font-size: 13px; }
.facts { margin: 0; display: grid; gap: 8px; }
.facts div { display: grid; grid-template-columns: 120px 1fr; gap: 10px; }
.facts dt { color: var(--ink-soft); font-size: 13px; }
.facts dd { margin: 0; font-weight: 500; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding-left: 12px; border-left: 3px solid var(--brand-soft); }
.timeline .when { color: var(--ink-soft); font-size: 13px; font-variant-numeric: tabular-nums; }

/* Login and password */
.login-wrap { display: grid; place-items: center; padding-top: 6vh; }
.login-card { width: 100%; max-width: 400px; padding: 26px; }
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-card .muted { margin: 0 0 20px; }

/* ---------- Home ---------- */

.home-head { margin-bottom: 18px; }
.home-head h1 { margin: 0; font-size: 22px; }
.home-head p { margin: 2px 0 0; color: var(--ink-soft); }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 22px; }
.home-grid .card { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }
.stat { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.card-link { margin-top: auto; padding-top: 6px; font-weight: 600; text-decoration: none; font-size: 13px; }
.card-link:hover { text-decoration: underline; }
.card.attention { border-color: #fde68a; background: var(--warn-soft); }
.section-title { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 0 0 10px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-actions a {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; background: var(--card);
    border: 1px solid var(--line); border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 600;
}
.quick-actions a:hover { border-color: var(--brand); color: var(--brand-dark); }

/* ---------- Phones and small tablets ---------- */

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: 0 0 40px rgba(28, 25, 23, 0.2); }
    .menu-open .sidebar { transform: none; }
    .menu-open .backdrop { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(28, 25, 23, 0.3); }
    .with-shell .main { margin-left: 0; padding-bottom: 64px; }
    .menu-btn { display: grid; }
    .topbar { padding: 0 12px; }
    .search-trigger kbd, .user-name { display: none; }
    .page { padding: 18px 16px 48px; }
    .bottom-bar {
        display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; inset: auto 0 0 0; z-index: 20;
        background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    }
    .bottom-bar a, .bottom-bar button {
        display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border: 0; background: none;
        font: inherit; font-size: 11px; font-weight: 600; color: var(--ink-soft); text-decoration: none; cursor: pointer;
    }
    .bottom-bar a.active { color: var(--brand-dark); }
    .bottom-bar .icon { width: 22px; height: 22px; }
}

@media (max-width: 640px) {
    .grid-2 { grid-template-columns: 1fr; }
    .timeline li { grid-template-columns: 1fr; gap: 2px; }
    .branch-list li { flex-direction: column; align-items: flex-start; }
    .search-trigger span { font-size: 13px; }
    .page-head h1 { font-size: 20px; }
}

/* Two columns of facts inside one card */
.facts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
@media (max-width: 640px) { .facts-2 { grid-template-columns: 1fr; } }

/* Excel import */
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.import-go { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; flex-wrap: wrap; }
.error-line { color: var(--bad); font-size: 13px; font-weight: 500; }

/* Holidays */
.holiday-list { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 4px; }
.holiday-list li { display: grid; grid-template-columns: 110px 1fr auto auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 8px; }
.holiday-list li:hover { background: #fafaf9; }
.holiday-date { font-variant-numeric: tabular-nums; color: var(--ink-soft); font-size: 13px; }
.holiday-name { font-weight: 600; }
.inline-form { margin: 0; }
.narrow-date { flex: 0 0 160px; }
details.more { margin-top: 12px; }
details.more summary { cursor: pointer; color: var(--brand-dark); font-weight: 600; font-size: 13px; }
.copy-form { margin-top: 12px; }
@media (max-width: 640px) { .holiday-list li { grid-template-columns: 1fr auto; } }

/* Shifts */
.shift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 22px; }
.shift-grid .card { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.shift-card.inactive { opacity: 0.6; }
.shift-code { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 6px; margin-right: 8px; border-radius: 7px; background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; font-size: 12px; }
.shift-time { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.shift-card .facts div { grid-template-columns: 110px 1fr; }

/* Attendance register */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.register-wrap { overflow-x: auto; }
.register { border-collapse: collapse; font-size: 12px; min-width: 100%; }
.register th, .register td { border-bottom: 1px solid var(--line); padding: 4px 2px; text-align: center; white-space: nowrap; }
.register th { font-weight: 600; color: var(--ink-soft); background: #fafaf9; position: sticky; top: 0; }
.register th small { font-weight: 400; color: var(--ink-faint); }
.register th.weekend { color: var(--brand-dark); }
.register .who { text-align: left; position: sticky; left: 0; background: var(--card); padding: 6px 10px; min-width: 210px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; z-index: 1; }
.register thead .who { background: #fafaf9; z-index: 2; }
.register .num { font-weight: 600; padding: 4px 8px; }
.st { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 3px; border-radius: 5px; font-weight: 700; font-size: 11px; text-decoration: none; color: var(--ink-soft); background: #f5f5f4; }
.st-present { background: var(--good-soft); color: var(--good); }
.st-half_day { background: #eef6ff; color: #1d4ed8; }
.st-absent { background: #fdecec; color: var(--bad); }
.st-missed_punch { background: var(--warn-soft); color: var(--warn); }
.st-weekly_off, .st-holiday { background: #f5f5f4; color: var(--ink-faint); }
.st-worked_weekly_off, .st-worked_holiday { background: #f3e8ff; color: #7e22ce; }
.st-not_tracked { background: transparent; color: var(--ink-faint); }
.st.late { box-shadow: inset 0 -3px 0 #f59e0b; }
.st.big { min-width: 52px; height: 44px; font-size: 16px; border-radius: 10px; }
.day-status { display: flex; align-items: center; gap: 14px; }
.void-form { display: flex; gap: 6px; justify-content: flex-end; }
.void-form input { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid #d6d3d1; border-radius: 8px; width: 170px; }

/* Textareas, colour and file pickers (letterhead, branch address) */
.field textarea { width: 100%; font: inherit; padding: 9px 11px; border: 1px solid #d6d3d1; border-radius: 9px; background: #fff; resize: vertical; }
.field textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.field input[type="color"] { width: 64px; height: 38px; padding: 3px; cursor: pointer; }
.field input[type="file"] { padding: 7px; background: #fafaf9; }
.brand-preview { display: block; max-height: 56px; max-width: 220px; margin-bottom: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* Checklists (joining; exit later) */
.progress { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; min-width: 120px; }
.progress span { display: block; height: 100%; background: var(--good); border-radius: 999px; }
.checklist-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.checklist-head .card-title { margin-bottom: 2px; }
.checklist-head p { margin: 0; }
.checklist-head .progress { flex: 0 1 220px; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.task-mark { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 2px solid #d6d3d1; display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-top: 1px; }
.task.closed .task-mark { background: var(--good); border-color: var(--good); color: #fff; }
.task.overdue .task-mark { border-color: var(--bad); }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 600; }
.task.closed .task-title { color: var(--ink-soft); font-weight: 500; }
.task-meta { font-size: 12px; color: var(--ink-soft); }
.task.overdue .task-meta strong { color: var(--bad); }
.task-help { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.task-actions { display: flex; gap: 2px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
.skip summary { list-style: none; }
.skip summary::-webkit-details-marker { display: none; }
.skip-form { display: flex; gap: 6px; margin-top: 6px; }
.skip-form input { font: inherit; padding: 7px 10px; border: 1px solid #d6d3d1; border-radius: 9px; min-width: 200px; }
.bad-text { color: var(--bad); font-weight: 600; }
.nowrap { white-space: nowrap; }
@media (max-width: 640px) {
    .task { flex-wrap: wrap; }
    .task-actions { width: 100%; justify-content: flex-start; padding-left: 34px; }
    .skip-form { flex-wrap: wrap; }
    .skip-form input { min-width: 0; flex: 1 1 160px; }
}
.task.skipped .task-mark { background: var(--ink-faint); border-color: var(--ink-faint); }

/* Letters: steps, picking a template, checking a letter beside its wording */
.stepper { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 18px; counter-reset: step; flex-wrap: wrap; }
.stepper li { counter-increment: step; font-size: 13px; color: var(--ink-faint); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stepper li::before { content: counter(step); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); font-size: 12px; }
.stepper li + li::after { order: -1; content: ""; width: 18px; height: 2px; background: var(--line); }
.stepper li.active { color: var(--brand-dark); }
.stepper li.active::before { border-color: var(--brand); background: var(--brand); color: #fff; }
.stepper li.done { color: var(--ink-soft); }
.stepper li.done::before { border-color: var(--good); background: var(--good); color: #fff; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 16px; }
.choice-card { display: grid; gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); text-decoration: none; color: var(--ink); }
.choice-card:hover { border-color: var(--brand); }
.choice-card.selected { border-color: var(--brand); background: var(--brand-soft); }
.letter-review { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.letter-paper { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #e7e5e4; padding: 12px; }
.letter-paper .lh { zoom: 0.62; }
.fields-help { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 12px; margin: 8px 0 14px; }
.fields-help dt { font-family: ui-monospace, monospace; color: var(--brand-dark); }
.fields-help dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 960px) {
    .letter-review { grid-template-columns: 1fr; }
    .letter-paper .lh { zoom: 0.45; }
}

/* Joining form: the employee's phone page, HR's review */
.join-page { background: var(--bg); margin: 0; }
.join { max-width: 560px; margin: 0 auto; padding: 18px 16px 40px; }
.join h1 { font-size: 22px; margin: 6px 0; }
.join .card { margin-bottom: 14px; }
.join-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.join-head img { max-height: 44px; max-width: 160px; object-fit: contain; }
.join-company { font-weight: 700; color: var(--ink-soft); }
.join .field input, .join .field select, .join .field textarea { font-size: 16px; } /* 16px stops phones zooming in */
.pill-choice { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-choice label { display: flex; gap: 6px; align-items: center; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; }
.pill-choice label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.center { text-align: center; }
.good-text { color: var(--good); font-weight: 600; }
.share-link { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.share-link input { flex: 1 1 280px; font: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid #d6d3d1; border-radius: 9px; background: #fafaf9; }
.table tr.changed td { background: var(--warn-soft); }
.pre { white-space: pre-line; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.doc { display: grid; gap: 2px; text-decoration: none; color: var(--ink); font-size: 13px; }
.doc img, .doc-file { width: 100%; height: 110px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); background: #fafaf9; }
.doc-file { display: grid; place-items: center; font-weight: 700; color: var(--ink-soft); }
.doc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.decision { display: grid; gap: 14px; }
.join .todo { margin-bottom: 14px; }

/* Employee app invitation code, shown once */
.app-code { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; padding: 12px 14px; border-radius: 10px; background: var(--brand-soft); }
.app-code-digits { font-size: 26px; font-weight: 700; letter-spacing: 3px; color: var(--brand-dark); }

/* Exit: serving notice, or left */
.exit-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius); background: var(--warn-soft); border: 1px solid #fde68a; margin-bottom: 16px; }
.exit-banner > div:first-child { display: grid; gap: 2px; }
.exit-banner.left { background: #f5f5f4; border-color: var(--line); }
.st-leave, .st-half_leave { background: #eef2ff; color: #3730a3; }
.st-unpaid_leave { background: #fdf2f8; color: #9d174d; }

/* Leave */
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.table-wrap { overflow-x: auto; }
.table.balances td, .table.balances th { padding: 6px 10px; font-variant-numeric: tabular-nums; }
.openings { margin-top: 12px; }
.openings summary { cursor: pointer; }
.openings .inline-add { margin-top: 8px; }

/* Payroll */
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.payroll-table td, .payroll-table th { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* SpinMinds support session, shown to whoever is using the client's account */
.support-banner { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: #1c1917; color: #fff; font-weight: 600; }
.support-banner a { color: #fdba74; margin-left: 8px; }

/* Super admin panel (/admin): a dark bar, so it is never mistaken for a client's Trakya */
.admin-body { background: var(--bg); margin: 0; }
.admin-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 10px max(16px, env(safe-area-inset-left, 0px)); background: #1c1917; color: #fff; }
.admin-top .brand { color: #fff; text-decoration: none; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.admin-nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.admin-nav a { color: #d6d3d1; text-decoration: none; padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: 13px; }
.admin-nav a.active, .admin-nav a:hover { background: #44403c; color: #fff; }
.admin-out { color: #fdba74; }
.admin-page { max-width: 1200px; margin: 0 auto; }
.badge-bad { background: #fdecec; color: var(--bad); }

/* Getting started guide */
.setup-bar { height: 8px; border-radius: 99px; background: var(--brand-soft); overflow: hidden; margin-top: 10px; }
.setup-bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s ease; }

/* Reports */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .grid-3 { grid-template-columns: 1fr; } }
.table.muster th, .table.muster td { padding: 6px 5px; font-size: 12px; }
a.card { color: inherit; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
a.card:hover { transform: translateY(-2px); }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; max-height: 260px; overflow-y: auto; padding: 4px 0; }
section.card.inactive { opacity: .7; }
