.interface-settings-card {
    display: grid;
    gap: 14px;
}

.theme-selector {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 4px;
    background: var(--page);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.theme-selector button {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 6px;
    font-weight: 750;
}

.theme-selector button.active {
    color: var(--primary);
    background: var(--card);
    box-shadow: 0 2px 8px rgba(31, 45, 92, .1);
}

.theme-selector svg,
.interface-order-row > svg {
    width: 18px;
    height: 18px;
}

.interface-order-list {
    display: grid;
    gap: 7px;
}

.interface-order-row {
    min-height: 52px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    color: var(--muted);
    background: var(--page);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.interface-order-row.selected {
    color: var(--ink);
    background: var(--card);
}

.interface-order-row > svg {
    color: var(--primary);
}

.interface-order-actions {
    display: flex;
    gap: 4px;
}

.interface-order-actions .icon-button {
    width: 34px;
    height: 34px;
}

.interface-nav-check {
    position: relative;
    width: 38px;
    height: 22px;
}

.interface-nav-check input {
    position: absolute;
    opacity: 0;
}

.interface-nav-check span {
    position: absolute;
    inset: 0;
    background: #cbd3e3;
    border-radius: 999px;
}

.interface-nav-check span::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform .16s ease;
}

.interface-nav-check input:checked + span { background: var(--primary); }
.interface-nav-check input:checked + span::after { transform: translateX(16px); }

.notification-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.admin-calendar-week-body,
.admin-calendar-bars {
    min-height: 126px !important;
    max-height: 126px;
}

.admin-calendar-board.week .admin-calendar-week-body,
.admin-calendar-board.week .admin-calendar-bars {
    min-height: 150px !important;
    max-height: 150px;
}

.admin-calendar-more {
    grid-column: 1 / -1;
    align-self: start;
    justify-self: center;
    z-index: 4;
    min-height: 20px;
    padding: 1px 9px;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid rgba(79, 70, 229, .18);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    pointer-events: none;
}

[data-theme="dark"] {
    color-scheme: dark;
    --primary: #8b83ff;
    --primary-strong: #aaa5ff;
    --primary-soft: #292852;
    --ink: #f3f5ff;
    --ink-soft: #d4daf0;
    --muted: #9aa7c5;
    --line: #303a52;
    --page: #0e1422;
    --card: #171f31;
    --green: #39c97b;
    --green-soft: #173a2a;
    --orange: #ff9b4a;
    --orange-soft: #432b1c;
    --red: #ff6680;
    --red-soft: #452333;
    --blue-soft: #202b48;
    --shadow: 0 16px 36px rgba(0, 0, 0, .28);
}

.admin-dashboard-ordered {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}
.admin-dashboard-block { grid-column: span 6; min-width: 0; }
.admin-dashboard-block-work,
.admin-dashboard-block-tasks { grid-column: span 8; }
.admin-dashboard-block-protocols,
.admin-dashboard-block-rbh,
.admin-dashboard-block-tracking,
.admin-dashboard-block-quick_access { grid-column: span 4; }
.admin-dashboard-block-leaves { grid-column: span 8; }
.admin-dashboard-block > * { height: 100%; margin: 0; }

.dashboard-protocol-count {
    width: 100%;
    min-height: 148px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    text-align: left;
}
.dashboard-protocol-count > span:nth-child(2) { display: grid; gap: 5px; }
.dashboard-protocol-count small { color: var(--muted); font-weight: 750; }
.dashboard-protocol-count strong { color: var(--ink); font-size: 42px; line-height: 1; }
.dashboard-protocol-count > svg { width: 20px; color: var(--muted); }

.admin-month-metrics { display: grid; gap: 12px; position: relative; }
.admin-month-metric { display: flex; align-items: center; gap: 12px; }
.admin-month-metric + .admin-month-metric { padding-top: 12px; border-top: 1px solid var(--line); }
.admin-month-metric > div { display: grid; gap: 3px; }
.admin-month-metric small { color: var(--muted); }
.admin-month-metric strong { font-size: 23px; color: var(--ink); }
.admin-month-metrics > button { position: absolute; top: 14px; right: 14px; }

.work-time-mode-action { width: 100%; margin-bottom: 12px; }
.task-scope-tabs { margin-bottom: 14px; }
.task-note-readonly { min-height: 92px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--page); white-space: pre-wrap; }
.readonly-caption { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.readonly-caption svg { width: 16px; }

[data-theme="dark"] {
    --background: var(--page);
    --surface: var(--card);
    --surface-secondary: #11192a;
    --text-primary: var(--ink);
    --text-secondary: var(--muted);
    --border: var(--line);
    --success: var(--green);
    --warning: var(--orange);
    --danger: var(--red);
    --info: #72a7ff;
}
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .offcanvas,
[data-theme="dark"] .table,
[data-theme="dark"] table,
[data-theme="dark"] th,
[data-theme="dark"] td,
[data-theme="dark"] .segmented,
[data-theme="dark"] .calendar-card,
[data-theme="dark"] .leave-calendar-card,
[data-theme="dark"] .vehicle-card,
[data-theme="dark"] .client-card,
[data-theme="dark"] .offer-card,
[data-theme="dark"] .invoice-card,
[data-theme="dark"] .order-card,
[data-theme="dark"] .wz-card {
    color: var(--text-primary);
    background-color: var(--surface);
    border-color: var(--border);
}
[data-theme="dark"] .table > :not(caption) > * > *,
[data-theme="dark"] table td,
[data-theme="dark"] table th { color: var(--text-primary); background: transparent; border-color: var(--border); }
[data-theme="dark"] .modal-backdrop { background-color: #020617; }
[data-theme="dark"] .alert-success { color: #8de8b5; background: #143526; border-color: #286344; }
[data-theme="dark"] .alert-warning { color: #ffd39a; background: #3b2915; border-color: #71491d; }
[data-theme="dark"] .alert-danger { color: #ffadba; background: #40202a; border-color: #783244; }
[data-theme="dark"] .alert-info { color: #b8d4ff; background: #172c4a; border-color: #2b568b; }
[data-theme="dark"] .badge-pill,
[data-theme="dark"] .dashboard-task-status { color: var(--ink-soft); background: var(--surface-secondary); border-color: var(--line); }
[data-theme="dark"] ::placeholder { color: #73809d; opacity: 1; }
[data-theme="dark"] option { color: var(--ink); background: var(--surface-secondary); }

@media (max-width: 980px) {
    .admin-dashboard-block,
    .admin-dashboard-block-work,
    .admin-dashboard-block-tasks,
    .admin-dashboard-block-protocols,
    .admin-dashboard-block-rbh,
    .admin-dashboard-block-tracking,
    .admin-dashboard-block-quick_access,
    .admin-dashboard-block-leaves { grid-column: span 12; }
}

[data-theme="dark"] body,
[data-theme="dark"] .app-shell,
[data-theme="dark"] .screen-root { background: var(--page); color: var(--ink); }
[data-theme="dark"] .auth-shell { background: #0e1422; }
[data-theme="dark"] .login-card,
[data-theme="dark"] .app-frame,
[data-theme="dark"] .app-topbar,
[data-theme="dark"] .bottom-nav,
[data-theme="dark"] .desktop-sidebar,
[data-theme="dark"] .app-card,
[data-theme="dark"] .dashboard-card,
[data-theme="dark"] .admin-dashboard-overview,
[data-theme="dark"] .admin-overview-metric,
[data-theme="dark"] .notification-item,
[data-theme="dark"] .protocol-card,
[data-theme="dark"] .task-card,
[data-theme="dark"] .punch-row,
[data-theme="dark"] .time-metric { background: var(--card); color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .notification-item.unread { background: #202943; }
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .field-input,
[data-theme="dark"] .select-input,
[data-theme="dark"] .task-note-input { color: var(--ink); background: #11192a; border-color: var(--line); }
[data-theme="dark"] .soft-action,
[data-theme="dark"] .icon-button { color: var(--ink-soft); background: #202940; border-color: var(--line); }
[data-theme="dark"] .admin-calendar-day,
[data-theme="dark"] .admin-calendar-week-number { color: var(--ink); background: transparent; border-color: var(--line); }
[data-theme="dark"] .admin-calendar-day.muted { color: #59647d; }
[data-theme="dark"] .admin-calendar-week,
[data-theme="dark"] .admin-calendar-weekdays,
[data-theme="dark"] .admin-calendar-card { border-color: var(--line); }
[data-theme="dark"] .brand-mark,
[data-theme="dark"] .topbar-brand-mark { background: #fff; }

@media (max-width: 560px) {
    .notifications-toolbar { align-items: flex-start; gap: 8px; }
    .notification-toolbar-actions { width: 100%; justify-content: stretch; }
    .notification-toolbar-actions .soft-action { flex: 1 1 auto; }
    .admin-calendar-board:not(.week) .admin-calendar-bars {
        align-content: start;
        gap: 4px 2px;
        padding-top: 40px;
    }
    .admin-calendar-board:not(.week) .admin-calendar-event-bar {
        min-height: 6px;
        height: 6px;
        padding: 0;
        border: 0;
        border-radius: 999px;
        background: var(--event-color);
        box-shadow: none;
    }
    .admin-calendar-board:not(.week) .admin-calendar-event-bar span { display: none; }
    .admin-calendar-board.week .admin-calendar-event-bar span { font-size: 9px; }
}

.tracking-trip-location {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    padding: 0;
    color: var(--ink);
    text-align: left;
    background: transparent;
    border: 0;
    cursor: pointer;
}
.tracking-trip-location span { overflow-wrap: anywhere; font-weight: 700; }
.tracking-trip-location svg { flex: 0 0 auto; width: 16px; height: 16px; color: var(--primary); }
.tracking-trip-location.is-unknown { color: var(--muted); }
.tracking-trip-location.is-unknown svg { color: var(--warning); }
.tracking-place-result.is-loading { opacity: .65; pointer-events: none; }
[data-theme="dark"] .tracking-map-modal,
[data-theme="dark"] .tracking-place-result { color: var(--ink); background: var(--surface); border-color: var(--line); }
