/* K FORMA design language — dark sidebar, #00BCD4 accent, Arial Narrow, compact grid */

* {
    font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
}

:root {
    --kf-primary: #00BCD4;
    --kf-dark: #1a1f2e;
    --kf-dark-lighter: #252b3b;
    --kf-text: #212529;
    --kf-text-muted: #6c757d;
    --kf-bg-alt: #f8f9fa;
    --kf-border: #e9ecef;
    --kf-success: #22c55e;
    --kf-danger: #ef4444;
    --kf-warning: #f59e0b;
}

/* The K FORMA tokens were only ever declared once, so anything painted with
   --kf-text vanished in dark mode (headings, the app bar name, the register's
   addresses). Redefine the surface and ink tokens for both dark paths; the
   accent and the semantic colours work on either ground unchanged. */
[data-theme="dark"] {
    --kf-text: #e8ecf1;
    --kf-text-muted: #9aa4b2;
    --kf-bg-alt: #1e2430;
    --kf-border: #2f3743;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --kf-text: #e8ecf1;
        --kf-text-muted: #9aa4b2;
        --kf-bg-alt: #1e2430;
        --kf-border: #2f3743;
    }
}

/* ICON BUTTONS — bell, theme toggle, sidebar handle */
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    margin: 0;
    border-radius: 3px;
    color: var(--kf-text-muted);
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.icon-btn:hover {
    background: rgba(0, 188, 212, 0.12);
}
.icon-btn:hover {
    color: var(--kf-primary);
}
.theme-toggle {
    /* inherits icon-btn */
}

/* TIMER BANNER — persistent across all pages */
.timer-banner {
    background: var(--kf-dark-lighter);
    color: white;
    padding: 0.4rem 0;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--kf-primary);
}

/* MAIN CONTENT */
.main-content {
    padding-top: 1rem;
    padding-bottom: 2rem;
    max-width: 1400px;
}

/* HEADINGS */
h1, h2, h3, h4 {
    color: var(--kf-text);
    font-weight: 700;
    letter-spacing: 0.03em;
}
h2 {
    font-size: 1.3rem;
    text-transform: uppercase;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--kf-primary);
    display: inline-block;
    margin-bottom: 1.5rem;
}

/* BUTTONS */
[role="button"], button, input[type="submit"] {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    font-weight: 600;
}
button:not(.outline):not(.secondary):not(.btn-action):not(.btn-link):not(.icon-btn), [role="button"]:not(.outline):not(.secondary):not(.btn-action):not(.btn-link):not(.icon-btn) {
    background-color: var(--kf-primary);
    border-color: var(--kf-primary);
}
button:not(.outline):not(.secondary):not(.btn-action):not(.btn-link):not(.icon-btn):hover, [role="button"]:not(.outline):not(.secondary):not(.btn-action):not(.btn-link):not(.icon-btn):hover {
    background-color: #00a5bb;
    border-color: #00a5bb;
}

/* A button that should read as a link, not a call to action.
   The colour must be stated: without it the button keeps Pico's white, which
   is invisible once the fill is gone. */
.btn-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    width: auto;
    color: inherit;
    text-transform: none;
    letter-spacing: normal;
}

/* TABLES — compact, sortable */
table {
    font-size: 0.82rem;
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}
thead th {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.7rem;
    color: var(--kf-text-muted);
    font-weight: 700;
    border-bottom: 2px solid var(--kf-primary);
    padding: 0.4rem 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    user-select: none;
}
thead th[data-sortable] {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease;
}
thead th[data-sortable]::after {
    content: " \2195";
    opacity: 0.35;
    font-size: 0.65rem;
    margin-left: 0.25rem;
}
thead th[data-sortable]:hover {
    color: var(--kf-primary);
}
thead th[data-sortable]:hover::after {
    opacity: 0.85;
    color: var(--kf-primary);
}
thead th[data-sortable].sorted-asc::after {
    content: " \25B2";
    opacity: 1;
    color: var(--kf-primary);
}
thead th[data-sortable].sorted-desc::after {
    content: " \25BC";
    opacity: 1;
    color: var(--kf-primary);
}
tbody td {
    padding: 0.35rem 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid var(--kf-border);
}
tbody tr:hover {
    background-color: rgba(0, 188, 212, 0.04);
}

/* CARDS / ARTICLES */
article {
    border: 1px solid var(--kf-border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* STAT CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    text-align: center;
    border-top: 3px solid var(--kf-primary);
}
.stat-card h3 {
    font-size: 2.2rem;
    margin-bottom: 0.25rem;
    color: var(--kf-primary);
    border: none;
    display: block;
    padding: 0;
}
.stat-card small {
    color: var(--kf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.75rem;
}

/* TIMER */
.timer-display {
    font-size: 2.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}
.timer-running {
    color: var(--kf-success);
}

/* FORMS — compact */
label {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--kf-text-muted);
    margin-bottom: 0.2rem;
}
input, select, textarea {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
}
.grid {
    gap: 0.75rem;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--kf-primary);
    box-shadow: 0 0 0 2px rgba(0, 188, 212, 0.15);
}

/* MESSAGES */
.message {
    border-left: 4px solid var(--kf-primary);
    border-radius: 4px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.message.error {
    border-left-color: var(--kf-danger);
}

/* ERRORS */
small.error {
    color: var(--kf-danger);
    font-size: 0.8rem;
}

/* LINKS */
a {
    color: var(--kf-primary);
}
a:hover {
    color: #00a5bb;
}

/* LOGIN PAGE */
.login-card {
    max-width: 400px;
    margin: 3rem auto;
    border-top: 3px solid var(--kf-primary);
}
.login-card .login-logo {
    display: block;
    height: 48px;
    margin: 0 auto 1rem;
}
.login-card h2 {
    text-align: center;
    border: none;
    display: block;
}

/* PROJECT COLOR DOT */
.project-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.3rem;
    vertical-align: middle;
}

/* CONTINUE BUTTON */
.btn-continue {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.1rem 0.3rem;
    color: #999;
    transition: color 0.2s;
}
.btn-continue:hover {
    color: var(--kf-success);
}

/* WEEKEND COLUMNS */
.weekend-col {
    background-color: rgba(239, 68, 68, 0.08);
    color: var(--kf-danger);
}
.weekend-col input {
    color: var(--kf-danger);
}

/* WEEKLY TIMESHEET */
.weekly-table {
    /* Fixed layout + auto width: the table is exactly as wide as its columns,
       so explicit widths (defaults and user-dragged ones) are honoured instead
       of being renegotiated proportionally by the browser. */
    table-layout: fixed;
    width: auto;
}

/* Column width variables — js/weekly-columns.js widens the project column to
   fill the card by default, and overrides both once the user drags. */
.weekly-table {
    --col-project: 300px;
    --col-day: 54px;
}

.weekly-table .sticky-col {
    position: sticky;
    left: 0;
    background: var(--pico-background-color);
    z-index: 1;
    width: var(--col-project);
    min-width: 140px;
    padding-right: 0.75rem;
}
.weekly-table .day-col {
    width: var(--col-day);
    text-align: center;
    padding: 0.2rem;
}
.weekly-table .total-col {
    width: 64px;
    text-align: center;
}

/* Project cell: number, full address (wraps), category */
.weekly-table .project-head {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.weekly-table .project-address {
    display: block;
    font-size: 0.8rem;
    line-height: 1.25;
    color: var(--kf-text);
    /* Full address stays readable: wraps to a second line, never ellipsised.
       Very long names are capped at 2 lines to keep row heights even. */
    white-space: normal;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.weekly-table .project-category {
    font-size: 0.72rem;
    line-height: 1.2;
    color: var(--kf-text-muted);
    white-space: nowrap;
}
.weekly-table .project-category::before {
    content: "· ";
}

/* Compact day inputs — the space freed goes to the project column */
.weekly-table .day-input {
    width: 100%;
    min-width: 0;
    text-align: center;
    padding: 0.25rem 0.1rem;
    margin: 0;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

/* Excel-style column resizing */
.weekly-table th[data-col-resize] {
    position: relative;
}
.weekly-table th[data-col-resize]::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    /* The grip itself is invisible until hovered. */
    background: transparent;
}
.weekly-table th[data-col-resize]:hover::after {
    background: var(--kf-primary);
    opacity: 0.35;
}
.weekly-table.is-resizing,
.weekly-table.is-resizing th[data-col-resize]::after {
    cursor: col-resize;
}
.weekly-table.is-resizing {
    user-select: none;
}
.weekly-table input[type="number"] {
    border: 1px solid var(--kf-border);
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
}
.weekly-table input[type="number"]:focus {
    border-color: var(--kf-primary);
    background: rgba(0, 188, 212, 0.05);
}
.weekly-table tfoot td {
    border-top: 2px solid var(--kf-primary);
    font-weight: 700;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* NOTIFICATIONS */
.notification-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.notification-bell {
    /* inherits icon-btn — no extra overrides needed */
}
.notification-badge {
    position: absolute;
    top: -4px;
    right: -2px;
    background: var(--kf-danger);
    color: white;
    font-size: 0.65rem;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.notification-panel {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--kf-dark);
    border: 1px solid rgba(0,188,212,0.3);
    border-radius: 8px;
    z-index: 200;
    margin-top: 0.5rem;
}
.notification-panel.open {
    display: block;
}
.notification-item {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--kf-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
}
.notification-item.unread {
    color: white;
    background: rgba(0,188,212,0.08);
}
.notification-item:hover {
    background: rgba(0,188,212,0.15);
}
.notification-item small {
    display: block;
    color: var(--kf-text-muted);
    margin-top: 0.25rem;
    font-size: 0.75rem;
}

/* LEAVE CALENDAR */
.leave-calendar {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}
.leave-calendar th {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.leave-calendar td {
    text-align: center;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: background 0.15s;
}
.leave-calendar td:hover:not(.cal-empty):not(.leave-approved):not(.leave-pending) {
    background: rgba(0, 188, 212, 0.15);
}
.cal-empty { cursor: default; }
.cal-today { font-weight: 700; box-shadow: inset 0 0 0 2px var(--kf-primary); }
.leave-approved { background: rgba(34, 197, 94, 0.25) !important; color: var(--kf-success); cursor: default; }
.leave-pending { background: rgba(245, 158, 11, 0.25) !important; color: #f59e0b; cursor: default; }
.leave-rejected { background: rgba(239, 68, 68, 0.1); text-decoration: line-through; color: var(--kf-text-muted); }
.cal-selected-start, .cal-selected-end { background: var(--kf-primary) !important; color: white !important; }
.cal-selected-range { background: rgba(0, 188, 212, 0.2) !important; }

/* GANTT CHART */
/* GANTT CHART */
.gantt-wrap {
    overflow-x: auto;
    margin-bottom: 1rem;
    min-width: 0;
}
.gantt-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--kf-border);
    min-height: 34px;
}
.gantt-header {
    min-height: auto;
    border-bottom: 2px solid var(--kf-border);
}
.gantt-label {
    width: 140px;
    min-width: 140px;
    padding: 0.25rem 0.5rem;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
}
.gantt-month-col {
    flex: 1;
    min-width: 200px;
    border-left: 1px solid var(--kf-border);
    display: flex;
    flex-direction: column;
}
.gantt-month-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--kf-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.4rem;
    text-align: center;
}
.gantt-bars {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    min-height: 28px;
}
.gantt-day-marker {
    flex: 1;
    text-align: center;
    border-left: 1px solid var(--kf-border);
    font-size: 0.55rem;
    color: var(--kf-text-muted);
    padding: 0;
    line-height: 1.8;
    max-width: 18px;
}
.gantt-bar {
    position: absolute;
    height: 20px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: white;
    overflow: hidden;
    white-space: nowrap;
    padding: 0 2px;
}
.gantt-approved { background: rgba(34, 197, 94, 0.75); }
.gantt-pending { background: rgba(245, 158, 11, 0.75); }

[data-theme="dark"] .gantt-row        { border-bottom: 1px solid rgba(255,255,255,0.07); }
[data-theme="dark"] .gantt-header     { border-bottom: 2px solid rgba(255,255,255,0.12); }
[data-theme="dark"] .gantt-month-col  { border-left:   1px solid rgba(255,255,255,0.1);  }
[data-theme="dark"] .gantt-day-marker { border-left:   1px solid rgba(255,255,255,0.06); }
[data-theme="dark"] .mini-month       { border:        1px solid rgba(255,255,255,0.08); }

/* YEAR GRID (12-month view) */
.year-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.mini-month {
    border: 1px solid var(--kf-border);
    border-radius: 8px;
    padding: 0.6rem 0.5rem;
}
.mini-month-header {
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
    color: var(--kf-primary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.mini-calendar {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}
.mini-calendar th {
    text-align: center;
    font-size: 0.6rem;
    padding: 0.15rem 0;
    color: var(--kf-text-muted);
    text-transform: uppercase;
}
.mini-day {
    text-align: center;
    padding: 0.2rem 0.1rem;
    font-size: 0.72rem;
    cursor: pointer;
    border-radius: 3px;
    line-height: 1.6;
}
.mini-day:hover:not(.leave-approved):not(.leave-pending) {
    background: rgba(0, 188, 212, 0.15);
}
@media (max-width: 900px) {
    .year-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .year-grid { grid-template-columns: 1fr; }
}

/* ADMIN ACTION BUTTONS — compact, used inside table cells */
.btn-action {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    font-size: 0.78rem;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    line-height: 1.4;
}
.btn-success         { background: var(--kf-success); color: white; }
.btn-success:hover   { background: #1aad52; }
.btn-danger          { background: var(--kf-danger);  color: white; }
.btn-danger:hover    { background: #dc2626; }
.btn-danger-outline  { background: none; border: 1px solid var(--kf-danger); color: var(--kf-danger); }
.btn-ghost           { background: none; border: none; color: var(--kf-text-muted); }
.btn-ghost:hover     { color: var(--kf-danger); }

/* STATUS BADGES */
.badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.badge-approved { background: rgba(34,197,94,0.15);  color: var(--kf-success); }
.badge-rejected { background: rgba(239,68,68,0.12);  color: var(--kf-danger);  }
.badge-pending  { background: rgba(245,158,11,0.15); color: var(--kf-warning); }

/* ACTION CELL — flex row of buttons in a td */
.action-cell { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }

/* REJECT EXPAND ROW */
.reject-form > td    { padding: 0.5rem 0.75rem; background: rgba(239,68,68,0.04); }
.reject-textarea     { width: 100%; font-size: 0.82rem; resize: vertical; min-height: 4rem; }
.reject-actions      { display: flex; gap: 0.5rem; margin-top: 0.4rem; }

/* MISC */
.heading-pending { color: var(--kf-warning); }
.text-muted-p    { color: var(--kf-text-muted); }

/* MISSING HOURS BANNER (dashboard) */
.shortfall-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    border-left: 4px solid var(--kf-warning, #f59e0b);
    border-radius: 4px;
    background: rgba(245, 158, 11, 0.09);
}
.shortfall-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--kf-warning, #f59e0b);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}
.shortfall-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1 1 auto;
    min-width: 0;
}
.shortfall-text small {
    color: var(--kf-text-muted);
}
.shortfall-banner .shortfall-action {
    flex: 0 0 auto;
    margin: 0;
    padding: 0.3rem 0.9rem;
    font-size: 0.82rem;
}
@media (max-width: 560px) {
    .shortfall-banner {
        flex-wrap: wrap;
    }
    .shortfall-banner .shortfall-action {
        width: 100%;
        text-align: center;
    }
}

/* SETTINGS — a switch row reads as a sentence, not a form label */
.settings-switch {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 0;
}
.settings-switch input[type="checkbox"] {
    flex: 0 0 auto;
    margin: 0.1rem 0 0 0;
}
.settings-switch-text {
    text-transform: none;
    letter-spacing: normal;
}
.settings-switch-text strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--kf-text);
}
.settings-switch-text small {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--kf-text-muted);
}


/* SORTABLE HEADERS (server-side) */
.sort-col .sort-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}
.sort-col .sort-link:hover {
    color: var(--kf-primary);
}
.sort-col .sort-mark {
    font-size: 0.7em;
    opacity: 0.35;
}
.sort-col.sorted .sort-mark {
    opacity: 1;
    color: var(--kf-primary);
}

/* CLIENT-SIDE SORTABLE HEADERS */
.js-sort-col {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.js-sort-col::after {
    content: "↕";
    font-size: 0.7em;
    opacity: 0.35;
    margin-left: 0.3rem;
}
.js-sort-col.sorted-asc::after {
    content: "▲";
    opacity: 1;
    color: var(--kf-primary);
}
.js-sort-col.sorted-desc::after {
    content: "▼";
    opacity: 1;
    color: var(--kf-primary);
}
.js-sort-col:hover {
    color: var(--kf-primary);
}

/* XLSX EXPORT BUTTONS */
.xlsx-btn {
    white-space: nowrap;
}
.xlsx-btn::before {
    content: "\2913";
    margin-right: 0.35rem;
    font-weight: 700;
}

/* ══════════════════════════════════════════════════════════════════════════
   SIDEBAR LAYOUT
   Fixed dark rail on the left, content column to its right. The rail slides
   off-canvas below 900px and is brought back by the hamburger in the app bar.
   ══════════════════════════════════════════════════════════════════════════ */

:root {
    --side-w: 220px;
}

.app-side {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--side-w);
    z-index: 120;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--kf-dark) 0%, var(--kf-dark-lighter) 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.side-brand {
    display: block;
    padding: 0.8rem 0.95rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.side-brand:hover {
    color: var(--kf-primary);
}

.side-links {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.4rem 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0.35rem;
    padding: 0.45rem 0.6rem;
    border-radius: 3px;
    border-left: 3px solid transparent;
    color: rgba(255, 255, 255, 0.66);
    text-decoration: none;
    font-size: 0.82rem;
    line-height: 1.25;
}
.side-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}
.side-link.is-active {
    background: rgba(0, 188, 212, 0.12);
    border-left-color: var(--kf-primary);
    border-radius: 0 3px 3px 0;
    margin-left: 0;
    color: #fff;
}
.side-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.side-group {
    padding: 0.75rem 0.95rem 0.25rem;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.32);
}

.side-foot {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.35rem 0;
}
.side-foot form {
    margin: 0;
}
.side-link-btn {
    width: calc(100% - 0.7rem);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

/* ── content column ──────────────────────────────────────────────────────── */

.app-main {
    margin-left: var(--side-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.app-main-plain {
    margin-left: 0;
}

.app-bar {
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    /* Breathing room at the very top: flush against the viewport edge the bar
       runs straight into the browser's own toolbar and the two read as one. */
    padding: 0.45rem 0.85rem 0.35rem;
    /* A tint of its own, so the band is distinct from both the browser chrome
       above it and the page below. */
    background: var(--kf-bg-alt);
    border-bottom: 1px solid var(--kf-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    min-height: 46px;
}
[data-theme="dark"] .app-bar {
    box-shadow: none;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .app-bar {
        box-shadow: none;
    }
}
/* Every direct child sits on the same centre line, whatever its content. */
.app-bar > * {
    display: flex;
    align-items: center;
    min-height: 1.85rem;
}
.app-bar-spacer {
    flex: 1 1 auto;
    min-width: 0.5rem;
}

.app-bar-office {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}
.app-bar-logo {
    height: 22px;
    width: auto;
    max-width: 130px;
    object-fit: contain;
    flex: 0 0 auto;
}
.app-bar-mark {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 3px;
    background: var(--kf-dark);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 0.6rem;
    font-weight: 700;
}
.app-bar-company {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-bar-me {
    flex: 0 1 auto;
    display: flex;
    /* One line where there is room — the bar stays 46px and the three facts
       read as one sentence. It stacks only when the width forces it. */
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-end;
    gap: 0.4rem;
    line-height: 1.2;
    min-width: 0;
}
.app-bar-me small::before {
    content: "·";
    margin-right: 0.4rem;
    color: var(--kf-text-muted);
}
.app-bar-name {
    font-size: 0.8rem;
    color: var(--kf-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.app-bar-name:hover {
    color: var(--kf-primary);
}
.app-bar-me small {
    font-size: 0.68rem;
    color: var(--kf-text-muted);
    white-space: nowrap;
}
.app-bar-role {
    color: var(--kf-primary);
    font-weight: 600;
}

@media (max-width: 760px) {
    /* Out of room for one line: stack, and drop the separator that only made
       sense inline. The role stays — it is the one thing that tells a person
       what they are allowed to do. */
    .app-bar-me {
        flex-direction: column;
        align-items: flex-end;
        gap: 0;
    }
    .app-bar-me small::before {
        content: none;
    }
    .app-bar-company {
        max-width: 8rem;
    }
    .app-bar-name {
        font-size: 0.78rem;
    }
    .app-bar-me small {
        font-size: 0.65rem;
    }
}
@media (max-width: 470px) {
    .app-bar-company {
        display: none;
    }
}
@media (max-width: 360px) {
    /* Last thing to go is the hours figure, not the role. */
    .app-bar-hours {
        display: none;
    }
}

.app-bar-tools {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.app-bar .icon-btn {
    color: var(--kf-text-muted);
}
.app-bar .icon-btn:hover {
    color: var(--kf-primary);
}
.side-toggle {
    display: none;
}

.app-main .main-content {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.side-scrim {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 110;
    border: none;
    padding: 0;
    /* Declared after .btn-link so it wins the background at equal specificity. */
    background: rgba(10, 13, 20, 0.55);
    cursor: pointer;
}

/* ── narrow screens: the rail goes off-canvas ────────────────────────────── */

@media (max-width: 900px) {
    .app-side {
        transform: translateX(-100%);
        transition: transform 180ms ease;
    }
    .app-side.is-open {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
    }
    .side-toggle {
        display: flex;
    }
    .side-scrim.is-open {
        display: block;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-side {
        transition: none;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   REGISTERS — dense, gridded, editable in place
   ══════════════════════════════════════════════════════════════════════════ */

.register-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.register-head h2 {
    margin: 0;
}
.register-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.register-actions [role="button"] {
    margin: 0;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
}

.register-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}
.register-filters input[type="search"],
.register-filters select {
    flex: 1 1 200px;
    min-width: 0;
    margin: 0;
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
}
.register-filters button,
.register-filters [role="button"] {
    flex: 0 0 auto;
    margin: 0;
    padding: 0.3rem 0.9rem;
    font-size: 0.8rem;
}

.register-wrap {
    /* overflow-x:auto makes this a scroll container in BOTH axes, so the
       sticky header below is positioned against this box, not the page. Give
       it a height and the grid scrolls inside with its header pinned. */
    overflow: auto;
    max-height: calc(100vh - 16rem);
    border: 1px solid var(--kf-border);
    border-radius: 3px;
}

.register-grid {
    table-layout: fixed;
    width: auto;
    border-collapse: collapse;
    font-size: 0.78rem;
    margin: 0;
}
.register-grid th,
.register-grid td {
    /* Gridlines on every side — this reads as a sheet, not an article. */
    border: 1px solid var(--kf-border);
    padding: 0.25rem 0.45rem;
    vertical-align: top;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.register-grid thead th {
    position: sticky;
    top: 0; /* against .register-wrap, which is the scroll container */
    z-index: 20;
    background: var(--kf-bg-alt);
    border-bottom: 2px solid var(--kf-dark);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--kf-text-muted);
    text-align: left;
}
[data-theme="dark"] .register-grid thead th {
    background: var(--kf-dark-lighter);
}
.register-grid tbody tr:nth-child(even) td {
    background: color-mix(in srgb, var(--kf-bg-alt) 55%, transparent);
}
.register-grid tbody tr:hover td {
    background: rgba(0, 188, 212, 0.07);
}
.register-grid td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.register-grid .grid-empty {
    text-align: center;
    color: var(--kf-text-muted);
    padding: 1rem;
    white-space: normal;
}

/* column widths come from the header's data attributes via table-columns.js */
.register-grid th[data-col-resize="name"],
.register-grid td:nth-child(1) { width: var(--col-name); }

.register-grid td.is-editable {
    cursor: text;
}
.register-grid td.is-editable:hover {
    box-shadow: inset 0 0 0 1px var(--kf-primary);
}
.register-grid td.is-editing {
    padding: 0;
    box-shadow: inset 0 0 0 2px var(--kf-primary);
}
.cell-input {
    width: 100%;
    margin: 0;
    padding: 0.22rem 0.4rem;
    border: none;
    border-radius: 0;
    font-size: 0.78rem;
    font-family: inherit;
    background: var(--pico-background-color);
}
.cell-input:focus {
    outline: none;
    box-shadow: none;
}
.register-grid td.cell-error {
    box-shadow: inset 0 0 0 2px var(--kf-danger);
}

.grid-actions-col {
    width: 34px;
}
.register-grid td.grid-actions {
    text-align: center;
    padding: 0.1rem;
}
.grid-delete {
    color: var(--kf-text-muted);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
}
.grid-delete:hover {
    color: var(--kf-danger);
}

.register-hint {
    margin-top: 0.6rem;
    font-size: 0.78rem;
    color: var(--kf-text-muted);
}

/* company suggestions from the Enterprise Register */
.ur-wrap {
    position: relative;
}
.ur-list {
    position: absolute;
    z-index: 60;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 260px;
    overflow-y: auto;
    background: var(--pico-background-color);
    border: 1px solid var(--kf-border);
    border-radius: 0 0 3px 3px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
}
.ur-list li {
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    font-size: 0.82rem;
    line-height: 1.3;
    border-bottom: 1px solid var(--kf-border);
}
.ur-list li:last-child {
    border-bottom: none;
}
.ur-list li:hover,
.ur-list li.is-active {
    background: rgba(0, 188, 212, 0.12);
}
.ur-list .ur-meta {
    display: block;
    color: var(--kf-text-muted);
    font-size: 0.74rem;
}
.ur-list .ur-closed {
    color: var(--kf-danger);
    font-weight: 600;
}
.ur-status {
    position: absolute;
    right: 0.5rem;
    top: 0.45rem;
    font-size: 0.72rem;
    color: var(--kf-text-muted);
}

.grid-pin-col { width: 30px; }
.register-grid td.grid-pin { text-align: center; padding: 0.1rem; }
.btn-pin { cursor: pointer; font-size: 1rem; line-height: 1; }
.register-grid td.over-budget { color: var(--kf-danger); font-weight: 600; }

/* The identity column stays put while the rest of the grid scrolls sideways —
   without it, an 11-column register scrolls its own row labels out of view. */
.register-grid th.grid-frozen,
.register-grid td.grid-frozen {
    position: sticky;
    left: 0;
    z-index: 15;
    background: var(--pico-background-color);
}
.register-grid thead th.grid-frozen {
    z-index: 25;
    background: var(--kf-bg-alt);
}
[data-theme="dark"] .register-grid thead th.grid-frozen {
    background: var(--kf-dark-lighter);
}
.register-grid tbody tr:nth-child(even) td.grid-frozen {
    background: color-mix(in srgb, var(--pico-background-color) 55%, var(--kf-bg-alt));
}
.register-grid tbody tr:hover td.grid-frozen {
    background: color-mix(in srgb, var(--pico-background-color) 80%, var(--kf-primary));
}
.register-grid td.grid-frozen::after,
.register-grid th.grid-frozen::after {
    content: "";
    position: absolute;
    top: 0;
    right: -1px;
    bottom: 0;
    width: 1px;
    background: var(--kf-dark);
    opacity: 0.35;
}

/* SETTINGS — logo upload */
.logo-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}
.logo-preview {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 120px;
    height: 60px;
    border: 1px dashed var(--kf-border);
    border-radius: 3px;
    background: var(--kf-bg-alt);
    overflow: hidden;
}
.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.logo-placeholder {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--kf-text-muted);
    letter-spacing: 0.08em;
}
.logo-fields {
    flex: 1 1 260px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* ══════════════════════════════════════════════════════════════════════════
   TIMELINE — projects against a month axis
   ══════════════════════════════════════════════════════════════════════════ */

.timeline-wrap {
    border: 1px solid var(--kf-border);
    border-radius: 3px;
    overflow-x: auto;
}
.timeline-head,
.timeline-row {
    display: grid;
    grid-template-columns: 260px 1fr 90px;
    align-items: center;
    min-width: 700px;
}
.timeline-head {
    background: var(--kf-bg-alt);
    border-bottom: 2px solid var(--kf-dark);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--kf-text-muted);
}
.timeline-row {
    border-bottom: 1px solid var(--kf-border);
}
.timeline-row:last-child {
    border-bottom: none;
}
.timeline-row:hover {
    background: rgba(0, 188, 212, 0.06);
}

.timeline-label {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.78rem;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}
.timeline-label .timeline-name {
    color: var(--kf-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
a.timeline-label:hover .timeline-name {
    color: var(--kf-primary);
}

.timeline-axis,
.timeline-track {
    position: relative;
    display: flex;
    height: 100%;
    min-height: 28px;
}
.timeline-axis {
    align-items: center;
}
.timeline-month,
.timeline-grid {
    flex: 1 1 0;
    border-left: 1px solid var(--kf-border);
    height: 100%;
}
.timeline-month {
    display: flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

.timeline-bar {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 13px;
    border-radius: 2px;
    background: var(--kf-primary);
    min-width: 3px;
}
/* Derived from logged hours rather than entered dates — hatched so a guess is
   never mistaken for a plan. */
.timeline-bar.is-actual {
    background: repeating-linear-gradient(
        45deg,
        var(--kf-text-muted) 0 4px,
        transparent 4px 8px
    );
    opacity: 0.75;
    height: 9px;
}
.timeline-bar.is-overdue {
    box-shadow: 0 0 0 2px var(--kf-danger);
}

.timeline-today {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--kf-danger);
    opacity: 0.55;
    pointer-events: none;
}

.timeline-due {
    padding: 0.4rem 0.6rem;
    text-align: right;
    font-size: 0.75rem;
    color: var(--kf-text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.timeline-due .is-late {
    color: var(--kf-danger);
    font-weight: 600;
}

/* PROJECT CARD — planned dates */
.project-dates {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin: 0.5rem 0 0.9rem;
}
.project-dates > span {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.project-dates small {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--kf-text-muted);
}
.project-dates strong {
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}
.project-dates .is-late {
    color: var(--kf-danger);
}

/* OFFICE PICKER */
.office-switch {
    flex: 0 0 auto;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--kf-primary);
    text-decoration: none;
    padding: 0.1rem 0.35rem;
    border: 1px solid rgba(0, 188, 212, 0.4);
    border-radius: 3px;
    white-space: nowrap;
}
.office-switch:hover {
    background: rgba(0, 188, 212, 0.12);
}

.pick-office {
    max-width: 30rem;
}
.pick-office p {
    color: var(--kf-text-muted);
}
.office-list {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.office-list li {
    list-style: none;
}
.office-list li::marker {
    content: "";
}
.office-choice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--kf-border);
    border-radius: 4px;
    /* Not var(--pico-background-color): inside a button Pico rebinds that to
       its own primary colour, which paints the whole row blue. */
    background: var(--kf-bg-alt);
    color: var(--kf-text);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}
.office-choice:hover {
    border-color: var(--kf-primary);
    background: rgba(0, 188, 212, 0.06);
}
.office-choice.is-current {
    border-color: var(--kf-primary);
}
.office-mark {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 4px;
    background: var(--kf-dark);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.78rem;
}
.office-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.office-text strong {
    font-size: 0.95rem;
}
.office-text small {
    color: var(--kf-text-muted);
    font-size: 0.76rem;
}
.office-now {
    flex: 0 0 auto;
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--kf-primary);
    font-weight: 700;
}

/* PLATFORM PANEL */
.impersonation-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.5rem 1rem;
    background: rgba(245, 158, 11, 0.16);
    border-bottom: 2px solid var(--kf-warning);
    font-size: 0.85rem;
}
.impersonation-banner form {
    margin: 0;
}
.impersonation-banner button {
    margin: 0;
    padding: 0.2rem 0.7rem;
    font-size: 0.78rem;
}

.org-tree {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.org-node {
    margin: 0;
    padding: 0;
    border: 1px solid var(--kf-border);
    border-radius: 4px;
}
.org-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.6rem 0.85rem;
    border-radius: 3px 3px 0 0;
    background: var(--kf-bg-alt);
    border-bottom: 1px solid var(--kf-border);
}
.org-mark {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    background: var(--kf-dark);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.72rem;
}
.org-name {
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    min-width: 0;
}
.org-name small {
    color: var(--kf-text-muted);
    font-size: 0.74rem;
}
.org-metrics {
    /* The numbers give way before the action does — a row that hides its own
       "Ieiet" is useless. */
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
    gap: 0.9rem;
    flex-wrap: wrap;
    font-size: 0.76rem;
    color: var(--kf-text-muted);
}
.org-actions {
    flex: 0 0 auto;
}
.org-metrics b {
    color: var(--kf-text);
    font-variant-numeric: tabular-nums;
}
.org-actions form {
    margin: 0;
}
.org-actions button {
    margin: 0;
    padding: 0.25rem 0.8rem;
    font-size: 0.78rem;
}

.org-people {
    list-style: none;
    margin: 0;
    padding: 0.3rem 0.85rem;
}
.org-people li {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    padding: 0.25rem 0;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--kf-border);
}
.org-people li:last-child {
    border-bottom: none;
}
.org-people small {
    color: var(--kf-text-muted);
    font-size: 0.74rem;
}
.org-role {
    margin-left: auto;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--kf-primary);
    font-weight: 600;
}
.org-off {
    color: var(--kf-danger);
    font-size: 0.7rem;
}
.org-empty {
    color: var(--kf-text-muted);
}

.org-invite {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    padding: 0.5rem 0.85rem 0.7rem;
    border-top: 1px dashed var(--kf-border);
    margin: 0;
}
.org-invite input,
.org-invite select {
    margin: 0;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}
.org-invite input {
    flex: 1 1 220px;
    min-width: 0;
}
.org-invite button {
    margin: 0;
    padding: 0.25rem 0.8rem;
    font-size: 0.78rem;
}

.office-form {
    max-width: 32rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* PLATFORM SHELL — its own chrome, not an office's */
.platform-shell {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}
.platform-rail {
    flex: 0 0 190px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0.5rem 0;
    border-right: 1px solid var(--kf-border);
    position: sticky;
    top: 3.5rem;
}
.platform-brand {
    padding: 0.4rem 0.75rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--kf-text-muted);
}
.platform-rail a {
    padding: 0.45rem 0.75rem;
    border-left: 3px solid transparent;
    color: var(--kf-text);
    text-decoration: none;
    font-size: 0.85rem;
}
.platform-rail a:hover {
    background: rgba(0, 188, 212, 0.08);
}
.platform-rail a.is-active {
    border-left-color: var(--kf-primary);
    background: rgba(0, 188, 212, 0.1);
    font-weight: 600;
}
.platform-body {
    flex: 1 1 auto;
    min-width: 0;
}
@media (max-width: 760px) {
    .platform-shell {
        flex-direction: column;
        gap: 0.75rem;
    }
    .platform-rail {
        flex-direction: row;
        flex-wrap: wrap;
        border-right: none;
        border-bottom: 1px solid var(--kf-border);
        position: static;
        width: 100%;
    }
    .platform-brand {
        width: 100%;
    }
}

/* OPEN INVITATIONS — the link must be passable by hand when mail is not set up */
.org-invites {
    list-style: none;
    margin: 0;
    padding: 0.4rem 0.85rem;
    border-top: 1px dashed var(--kf-border);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.org-invites li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
}
.org-invites form {
    margin: 0;
}
.org-invite-to {
    font-weight: 600;
}
.org-invite-link {
    flex: 1 1 320px;
    min-width: 0;
    padding: 0.15rem 0.4rem;
    border: 1px solid var(--kf-border);
    border-radius: 3px;
    background: var(--kf-bg-alt);
    font-size: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
.org-invite-link:hover {
    border-color: var(--kf-primary);
}
.org-invite-link.is-copied {
    border-color: var(--kf-success);
    color: var(--kf-success);
}
.org-revoke {
    color: var(--kf-danger);
}
