@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg: #f0f2f5;
    --card: #ffffff;
    --text: #1a1a1a;
    --text-primary: var(--text);
    --text-secondary: #555555;
    --text-muted: #6b6b6b;
    --muted: #6b6b6b;
    --border: #e0e0e0;
    --bg-hover: #e8eaed;
    --bg-input: #ffffff;
    --accent: #334155;
    --primary: #334155;
    --primary-hover: #1e293b;
    --primary-light: #f1f5f9;
    --success: #3b7a5e;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --danger-light: #fef2f2;
    --secondary: #f0f0f0;
    --secondary-hover: #e4e4e4;
    --free-bg: #f0fdf4;
    --busy-bg: #f5f5f5;
    --past-bg: #f8f8f8;
    --th-bg: #f8fafc;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --radius-lg: 12px;
    --sidebar-bg: #1e1e2e;
    --sidebar-hover: rgba(255,255,255,0.06);
    --sidebar-active: rgba(255,255,255,0.1);
    --sidebar-text: #c8c8d0;
    --sidebar-text-active: #ffffff;
    --sidebar-width: 240px;
    --sidebar-collapsed: 60px;
    --sidebar-border: #2a2a3a;
    --topbar-height: 56px;
    --cov-empty: #c91c00;
    --cov-under: #c77700;
    --cov-ok:    #6b7280;
    --cov-full:  #217645;
    --cov-over:  #8b5cf6;
    --cov-empty-bg: rgba(201, 28, 0, 0.06);
    --cov-under-bg: rgba(199, 119, 0, 0.08);
    --cov-full-bg:  rgba(33, 118, 69, 0.06);
    --cov-over-bg:  rgba(139, 92, 246, 0.08);
}

:root.dark {
    --bg: #0b0d14;
    --card: #161820;
    --text: #e2e8f0;
    --text-primary: var(--text);
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --muted: #64748b;
    --border: #2a2e3e;
    --bg-hover: #202432;
    --bg-input: #0b0d14;
    --accent: #64748b;
    --primary: #64748b;
    --primary-hover: #94a3b8;
    --primary-light: #1e293b;
    --success: #3b7a5e;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: #450a0a;
    --secondary: #202432;
    --secondary-hover: #2a2e3e;
    --free-bg: #052e16;
    --busy-bg: #161820;
    --past-bg: #101218;
    --th-bg: #1a1e2e;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --sidebar-bg: #12121a;
    --sidebar-hover: rgba(255,255,255,0.08);
    --sidebar-active: rgba(255,255,255,0.12);
    --sidebar-text: #8888a0;
    --sidebar-text-active: #ffffff;
    --sidebar-border: #1a1a2e;
    --cov-empty-bg: rgba(224, 90, 74, 0.10);
    --cov-under-bg: rgba(214, 158, 46, 0.12);
    --cov-full-bg:  rgba(54, 162, 96, 0.10);
    --cov-over-bg:  rgba(139, 92, 246, 0.14);
}

:root.dark .badge-dayoff {
    background: #1e1b4b;
    color: #818cf8;
}

:root.dark .badge-vacation {
    background: #172554;
    color: #38bdf8;
}

:root.dark .badge-pending {
    background: #422006;
    color: #fbbf24;
}

:root.dark .badge-approved {
    background: #052e16;
    color: #4ade80;
}

:root.dark .badge-rejected {
    background: #450a0a;
    color: #f87171;
}

:root.dark input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
:root.dark select,
:root.dark textarea {
    color: var(--text);
}

:root.dark .slot.mine {
    outline-color: rgba(148, 163, 184, 0.3);
}

:root.dark .user-badge.mine {
    box-shadow:
        0 0 0 2px rgba(148, 163, 184, 0.3),
        0 2px 6px rgba(0, 0, 0, 0.3);
}

:root.dark .auth-form input:focus,
:root.dark .admin-form input:focus,
:root.dark .admin-form select:focus,
:root.dark .admin-form textarea:focus {
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15);
}

:root.dark .searchable-select-input:focus {
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15);
}

:root.dark .btn-steam {
    background: #1b1b2a;
    border-color: var(--border);
    color: var(--text-secondary);
}
:root.dark .btn-steam:hover {
    background: var(--secondary-hover);
    color: var(--text);
}

:root.dark {
    --jd-color-background: var(--card);
    --jd-color-background-button-hover: var(--bg-hover);
    --jd-color-background-progress: var(--accent);
    --jd-color-background-selection: var(--bg-hover);
    --jd-color-border: var(--border);
    --jd-color-dark: var(--text);
    --jd-color-default: var(--text);
    --jd-color-gray: var(--text-muted);
    --jd-color-label: var(--text-secondary);
    --jd-color-icon: var(--text-secondary);
    --jd-color-placeholder: var(--text-muted);
    --jd-color-tab: var(--text);
    --jd-color-trigger-icon: var(--text-muted);
    --jd-color-toolbar-background: var(--card);
    --jd-color-toolbar-border: var(--border);
    --jd-color-workplace-background: var(--bg);
    --jd-color-statusbar-background: var(--card);
    --jd-color-statusbar-border: var(--border);
    --jd-color-statusbar-color: var(--text-muted);
    --jd-color-tooltip-background: var(--card);
    --jd-color-tooltip-border: var(--border);
    --jd-color-tooltip-color: var(--text);
    --jd-color-drag-and-drop-background: var(--bg-hover);
}

:root.dark .jodit-toolbar-button__button:hover {
    background: var(--bg-hover) !important;
}

:root.dark .jodit-toolbar-button__trigger:hover {
    background: var(--bg-hover) !important;
}

:root.dark .jodit-toolbar-button__button--active {
    background: var(--bg-hover) !important;
}

:root.dark .jodit-dialog {
    background: var(--card) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

:root.dark .jodit-dialog__header {
    background: var(--card) !important;
    border-bottom-color: var(--border) !important;
}

:root.dark .jodit-dialog__footer {
    background: var(--card) !important;
    border-top-color: var(--border) !important;
}

:root.dark .jodit-ui-input__input {
    background: var(--bg-input) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

:root.dark .jodit-ui-button,
:root.dark .jodit-ui-button-variant_initial {
    color: var(--text) !important;
    background: var(--bg-hover) !important;
}

:root.dark .jodit-ui-button:hover,
:root.dark .jodit-ui-button-variant_initial:hover {
    background: var(--bg-hover) !important;
    filter: brightness(1.2);
}

:root.dark .jodit-popup {
    background: var(--card) !important;
    border-color: var(--border) !important;
}

:root.dark .jodit-dropdown-list {
    background: var(--card) !important;
    border-color: var(--border) !important;
}

:root.dark .jodit-dropdown-list__item:hover {
    background: var(--bg-hover) !important;
}

:root.dark .jodit-toolbar-list__item:hover {
    background: var(--bg-hover) !important;
}

:root.dark .jodit-color-picker {
    background: var(--card) !important;
    border-color: var(--border) !important;
}

/* Wiki always uses light theme */
:root.dark .wiki-content {
    --text-primary: #1a1a1a;
    --text-muted: #555555;
    --bg-hover: #f0f2f5;
    --bg-input: #ffffff;
    --accent: #334155;
    --border: #e0e0e0;
    --card: #ffffff;
    --bg: #ffffff;
    background: #ffffff !important;
}

:root.dark .wiki-content pre {
    background: #f5f5f5 !important;
}

:root.dark .wiki-content code {
    background: #f0f0f0 !important;
}

:root.dark .wiki-content blockquote {
    background: #f9f9f9 !important;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body, .gl-layout, .gl-topbar, .table-card, .auth-card,
.gl-card, .gl-card-header, .gl-card-body, .gl-table, .gl-table th,
.gl-table td, .slot, .slot-inner, .gl-nav-item, .gl-nav-section,
.gl-nav-divider, .gl-stat, .gl-list-item, .btn, .modal-content,
select, input, textarea, .shift-item, .duty-day-group, .duty-day-header,
.user-badge, .admin-form input, .admin-form select {
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ══════════════════════════════════════════════════════════
   LAYOUT — GitLab super-sidebar style
   ══════════════════════════════════════════════════════════ */

.gl-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: var(--topbar-bg);
}

/* ── Топбар (3-колоночный грид, как GitLab super-topbar) ── */
.gl-topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    flex-shrink: 0;
    background: var(--topbar-bg);
    padding: 0 16px;
    z-index: 200;
}

/* Левая колонка: мобильный тоггл + бренд */
.gl-topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* Мобильный гамбургер — скрыт на десктопе */
.gl-topbar-btn.gl-topbar-menu-btn {
    display: none;
    flex-shrink: 0;
}

/* Бренд */
.gl-topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.gl-topbar-brand-icon {
    display: flex;
    align-items: center;
    width: 24px;
    height: 24px;
    color: var(--accent);
    flex-shrink: 0;
}

.gl-topbar-brand-icon svg {
    width: 22px; height: 22px;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    display: block;
}

.gl-topbar-brand-text {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

/* Центральная колонка: строка поиска */
.gl-topbar-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.gl-search-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 440px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.gl-search-trigger:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

.gl-search-trigger:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.gl-search-trigger-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.gl-search-trigger-icon svg {
    width: 16px; height: 16px;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    display: block;
}

.gl-search-trigger-placeholder {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gl-search-trigger-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 11px;
    font-family: inherit;
    color: var(--text-muted);
    background: transparent;
    flex-shrink: 0;
}

/* Правая колонка: действия */
.gl-topbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

/* Кнопки топбара */
.gl-topbar-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.gl-topbar-btn:hover { background: var(--bg-hover); color: var(--text); }

.gl-topbar-btn svg {
    width: 18px; height: 18px;
    display: block;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Тело: сайдбар + контент ── */
.gl-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* ── Сайдбар (super-sidebar) — тот же серый, что и топбар ── */
.gl-nav-panel {
    width: var(--nav-width);
    min-width: var(--nav-width);
    background: var(--topbar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    transition: width 0.22s ease, min-width 0.22s ease;
    z-index: 100;
}

/* Мобильный оверлей — скрыт на десктопе */
.gl-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0);
    z-index: 299;
    transition: background 0.25s;
    pointer-events: none;
}

/* Контекстный заголовок (организация/проект) */
.gl-nav-context {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    height: 52px;
    min-height: 52px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}

.gl-nav-context-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--accent);
}

.gl-nav-context-icon svg {
    width: 20px; height: 20px;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    display: block;
}

.gl-nav-context-meta {
    min-width: 0;
    overflow: hidden;
}

.gl-nav-context-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.gl-nav-context-sub {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Навигационный список */
.gl-nav-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 6px 6px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.gl-nav-list::-webkit-scrollbar { width: 4px; }
.gl-nav-list::-webkit-scrollbar-track { background: transparent; }
.gl-nav-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.gl-nav-section {
    padding: 16px 10px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
}

.gl-nav-divider {
    display: none;
}

/* Nav item — основной элемент меню */
.gl-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 36px;
    padding: 0 10px;
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
    position: relative;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.gl-nav-item:hover {
    background: var(--nav-item-hover);
    color: var(--text);
}

.gl-nav-item.active {
    background: var(--nav-item-active-bg);
    color: var(--nav-item-active-text);
    font-weight: 500;
}

.gl-nav-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.gl-nav-item-icon svg {
    width: 16px; height: 16px;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    display: block;
}

.gl-nav-item-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Кнопка свернуть/развернуть (снизу, в стиле nav-item) */
.gl-nav-collapse-btn {
    margin: 4px 6px 8px;
    flex-shrink: 0;
}

/* Иконки состояния collapse */
.gl-nav-collapse-icon-close { display: flex; }
.gl-nav-collapse-icon-open  { display: none; }

/* ── Свёрнутое состояние (icon-only, 48px) ── */
.gl-nav-panel.collapsed {
    width: 56px;
    min-width: 56px;
}

.gl-nav-panel.collapsed .gl-nav-item-label,
.gl-nav-panel.collapsed .gl-nav-section,
.gl-nav-panel.collapsed .gl-nav-context-meta,
.gl-nav-panel.collapsed .gl-nav-context-sub {
    display: none;
}

.gl-nav-panel.collapsed .gl-nav-item {
    padding: 0;
    justify-content: center;
    border-radius: 8px;
}


.gl-nav-panel.collapsed .gl-nav-item-icon { opacity: 1; }

.gl-nav-panel.collapsed .gl-nav-context {
    justify-content: center;
    padding: 0;
}

.gl-nav-panel.collapsed .gl-nav-list {
    padding: 6px 8px;
}

.gl-nav-panel.collapsed .gl-nav-collapse-btn {
    margin: 4px 8px 8px;
}

.gl-nav-panel.collapsed .gl-nav-divider { display: none; }

.gl-nav-panel.collapsed .gl-nav-collapse-icon-close { display: none; }
.gl-nav-panel.collapsed .gl-nav-collapse-icon-open  { display: flex; }

/* Tooltip при icon-only режиме */
.gl-nav-panel.collapsed .gl-nav-item[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--text);
    color: var(--card);
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 999;
    box-shadow: var(--shadow);
}

/* ── Контент ── */
.gl-content {
    flex: 1;
    background: var(--card);
    border-top-left-radius: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    min-width: 0;
}

/* Заголовок страницы — выходит к краям через негативные отступы */
.gl-page-header {
    margin: -24px -24px 20px;
    padding: 18px 24px 16px;
    border-bottom: 1px solid var(--border);
    border-top-left-radius: 12px;
    flex-shrink: 0;
}

.gl-page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
}

.gl-page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin: 4px 0 0;
    line-height: 1.4;
}

/* ========== DASHBOARD ========== */

.gl-welcome {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.gl-welcome strong {
    color: var(--text);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 1000px;
}

.gl-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.gl-card:last-child {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.admin-sidebar .gl-card {
    margin-bottom: 0;
}

.gl-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 15px;
}

.gl-card-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    flex: 1;
}

.gl-card-icon {
    font-size: 20px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.gl-card-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.7;
}

.gl-card-body {
    padding: 18px;
}

.gl-card-body--flush {
    padding: 0;
}

.gl-card-body--no-pad-top {
    padding-top: 0;
}

.gl-card-body--no-pad-bottom {
    padding-bottom: 0;
}

.gl-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.gl-badge-danger {
    background: var(--danger);
    color: #fff;
}

.gl-badge--primary {
    background: var(--primary-light);
    color: var(--primary);
}

.gl-empty-state {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    padding: 24px 0;
    margin: 0;
}

.gl-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gl-list-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 6px;
}

.gl-list-item-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.gl-list-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    word-break: break-word;
}

.gl-list-item-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.gl-label {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.gl-label-danger {
    background: rgba(224,49,49,0.12);
    color: var(--danger);
}

.gl-see-all {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
}

.gl-see-all:hover {
    text-decoration: underline;
}

.gl-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.gl-stat {
    background: var(--bg);
    border-radius: 6px;
    padding: 14px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.gl-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.gl-stat-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gl-stat--hours .gl-stat-icon { color: var(--primary); }
.gl-stat--day    .gl-stat-icon { color: #d97706; }
.gl-stat--night  .gl-stat-icon { color: #7c3aed; }
.gl-stat--duty   .gl-stat-icon { color: var(--success); }

.gl-stat-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.gl-stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.gl-stat-adjust {
    font-size: 13px;
    font-weight: 600;
    margin-left: 4px;
}
.gl-stat-adjust--pos { color: #16a34a; }
.gl-stat-adjust--neg { color: var(--danger); }

.duty-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.duty-timer-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.duty-label {
    font-size: 14px;
    color: var(--text-muted);
    min-width: 60px;
}

.duty-status {
    font-size: 16px;
}

.duty-timer {
    font-size: 24px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    letter-spacing: 1px;
}

.duty-info .duty-btn {
    align-self: flex-start;
    margin-top: 4px;
}

/* override old .page class inside new layout */
.page {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* ========== TOPBAR ========== */
.topbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
    background: var(--card);
    border-radius: var(--radius);
    padding: 12px 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    min-height: 56px;
}

.topbar h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.3;
}

.subtitle {
    color: var(--text-secondary);
    margin-top: 4px;
    font-size: 14px;
    font-weight: 500;
}

/* ========== TABS ========== */
.tabs {
    display: flex;
    gap: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.tab {
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    border-right: 1px solid var(--border);
}

.tab:last-child {
    border-right: none;
}

.tab:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.tab-active {
    background: var(--primary);
    color: #fff;
}

.topbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: auto;
}

.theme-toggle {
    flex-shrink: 0;
    font-size: 16px;
    padding: 0 10px;
    touch-action: manipulation;
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    flex: 0 0 auto;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
    height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-sm {
    height: 28px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-xs {
    height: 22px;
    min-height: 0;
    padding: 0 6px;
    font-size: 12px;
    line-height: 1;
    border-radius: 4px;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

@media (hover: hover) {
    .btn-primary:hover {
        background: var(--primary-hover);
        transform: translateY(-1px);
    }
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text);
    border: 1px solid var(--border);
}

@media (hover: hover) {
    .btn-secondary:hover {
        background: var(--secondary-hover);
        border-color: #cbd5e1;
    }
}

.nav-active {
    background: var(--secondary-hover);
    border-color: var(--primary);
    box-shadow: inset 0 -2px 0 var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-hover);
    transform: translateY(-1px);
}

/* ========== CARDS ========== */
.table-card,
.auth-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    padding: 20px 24px;
    margin-bottom: 20px;
}

/* ========== SCHEDULE TOOLBAR ========== */
.schedule-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.schedule-tabs {
    display: flex;
    gap: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.schedule-tab {
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    border-right: 1px solid var(--border);
}

.schedule-tab:last-child { border-right: none; }

.schedule-tab:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.schedule-tab.active {
    background: var(--primary);
    color: #fff;
}

.schedule-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.schedule-nav .btn-sm {
    height: 34px;
    padding: 0 12px;
    font-size: 14px;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
}

@media (hover: hover) {
    .schedule-nav .btn-sm:hover {
        background: var(--secondary-hover);
        border-color: var(--primary);
    }
}

.schedule-week-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: auto;
    white-space: nowrap;
}



/* ========== SCHEDULE CARD ========== */
.schedule-card {
    overflow: hidden;
}

.schedule-card .table-wrap {
    border: none;
    border-radius: 0;
    background: none;
}

.schedule-card .schedule {
    min-width: 1100px;
}

.schedule-card .schedule th {
    background: var(--card);
    padding: 10px 8px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: normal;
    font-weight: 600;
}

.schedule-card .day-cell {
    min-width: 100px;
    width: 100px;
    font-size: 13px;
    padding: 8px 6px;
    color: var(--text-secondary);
}

.schedule-card .sticky-col {
    background: var(--card);
}

.schedule-card .schedule thead th.sticky-col {
    min-width: 100px;
    width: 100px;
    font-size: 12px;
    padding: 8px 6px;
}

.schedule-card .slot {
    min-width: 180px;
    width: 180px;
    height: var(--slot-height);
}

/* ========== DUTY ========== */
.duty-btn {
    flex-shrink: 0;
    background: var(--danger);
    color: #fff;
    border: none;
    touch-action: manipulation;
    transition: background .15s, box-shadow .15s;
}
.duty-btn.active {
    background: var(--success);
    box-shadow: inset 0 2px 4px rgba(0,0,0,.2);
}
@media (hover: hover) {
    .duty-btn:hover {
        filter: brightness(1.1);
    }
}

.duty-timer {
    flex-shrink: 0;
    font-size: 20px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--success);
    line-height: 38px;
    min-width: 80px;
    margin-right: 20px;
}

/* ========== AUTH ========== */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--text);
    text-decoration: none;
}

.auth-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.auth-brand-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-brand-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.auth-card h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text);
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
    flex-shrink: 0;
}

.auth-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.auth-form,
.admin-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.auth-form input:not([type="checkbox"]):not([type="radio"]),
.auth-form select,
.auth-form textarea {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
    min-height: unset;
}

.admin-form textarea {
    padding: 7px 10px;
    height: auto;
    min-height: 80px;
    resize: vertical;
}

/* GitLab-style standalone form input */
.form-input {
    display: block;
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
    box-sizing: border-box;
}

.form-input::placeholder { color: var(--text-muted); }

.form-input:focus,
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

.form-input[type="date"],
input[type="date"].form-input {
    padding-right: 6px;
}

select.form-input {
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23868686' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

input[type="date"] {
    cursor: pointer;
}

.auth-form input:focus,
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(51, 65, 85, 0.12);
}

.auth-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    flex-wrap: wrap;
    row-gap: 10px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.btn-steam {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    padding: 0 18px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    background: #171a21;
    color: #c6d4df;
    border: 1px solid #2a2e3e;
    transition: background .15s, color .15s;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
}
.btn-steam:hover {
    background: #2a2e3e;
    color: #fff;
}
.btn-steam svg {
    flex-shrink: 0;
}

/* ========== SCHEDULE TABLE ========== */
.table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
}

.schedule {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    border-spacing: 0;
}

.schedule th,
.schedule td {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    text-align: center;
    vertical-align: top;
}

.schedule th {
    background: var(--th-bg);
    padding: 10px;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 3;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sticky-col {
    position: -webkit-sticky;
    position: sticky;
    left: 0;
    background: var(--th-bg);
    z-index: 2;
}

.schedule thead .sticky-col {
    z-index: 4;
}

.schedule thead th.sticky-col {
    min-width: 100px;
    width: 100px;
    font-size: 12px;
    padding: 10px 6px;
    letter-spacing: 0.05em;
}

.day-cell {
    min-width: 100px;
    width: 100px;
    font-weight: 600;
    padding: 8px 6px;
    white-space: nowrap;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.day-header {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: center;
    text-align: center;
}

.day-title {
    font-weight: 700;
    font-size: 12px;
    color: var(--text);
    line-height: 1.2;
}

.day-duty {
    font-size: 10px;
    color: var(--muted);
    font-weight: 500;
    line-height: 1.2;
}
.day-duty svg {
    width: 10px;
    height: 10px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ========== SLOTS ========== */
.slot {
    min-width: 180px;
    width: 180px;
    height: var(--slot-height);
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
    touch-action: manipulation;
}

@media (hover: hover) {
    .slot:hover {
        background: var(--bg-hover);
    }
}

.slot.cov-empty { background: var(--cov-empty-bg); border-left: 3px solid var(--cov-empty); }
.slot.cov-under { background: var(--cov-under-bg); border-left: 3px solid var(--cov-under); }
.slot.cov-ok    { background: var(--busy-bg);      border-left: 3px solid var(--cov-ok); }
.slot.cov-full  { background: var(--cov-full-bg);  border-left: 3px solid var(--cov-full); }
.slot.cov-over  { background: var(--cov-over-bg);  border-left: 3px solid var(--cov-over); }

.slot.mine {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    background: var(--primary-light) !important;
}

.slot.past {
    background: var(--past-bg) !important;
    cursor: not-allowed;
    opacity: 0.6;
}

.slot.range-start {
    box-shadow: inset 0 0 0 2px var(--primary);
}

.slot.range-selected {
    background: var(--primary-light) !important;
    box-shadow: inset 0 0 0 1px var(--primary);
}

#rangeBatchBtn {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.25s ease;
    white-space: nowrap;
}

@keyframes fadeInUp {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.slot.skeleton .slot-inner {
    position: relative;
    overflow: hidden;
}

.slot.skeleton .slot-status,
.slot.skeleton .slot-names {
    visibility: hidden;
}

.slot.skeleton .slot-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (hover: hover) {
    .slot.past:hover {
        background: var(--past-bg) !important;
    }
}

.slot.blocked {
    opacity: .45;
    cursor: default;
    pointer-events: none;
}

.slot-inner {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    height: 100%;
    box-sizing: border-box;
}

.slot-status {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    line-height: 1.2;
    text-align: left;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.slot.cov-empty .slot-status { color: var(--cov-empty); }
.slot.cov-under .slot-status { color: var(--cov-under); }
.slot.cov-ok .slot-status    { color: var(--text-secondary); }
.slot.cov-full .slot-status  { color: var(--cov-full); }
.slot.cov-over .slot-status  { color: var(--cov-over); }
.slot.mine .slot-status      { color: var(--primary); }

.slot.past .slot-status {
    color: var(--muted);
    opacity: 0.5;
}

.slot-bar {
    position: relative;
    height: 3px;
    border-radius: 2px;
    background: var(--border);
    margin-top: 4px;
    flex-shrink: 0;
}
.slot-bar-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    border-radius: 2px;
    background: var(--cov-ok);
    transition: width 0.2s ease;
}
.slot-bar-tick {
    position: absolute;
    top: -1px; bottom: -1px;
    width: 2px;
    background: var(--text);
    opacity: 0.55;
    transform: translateX(-1px);
}
.slot.cov-empty .slot-bar-fill { background: var(--cov-empty); }
.slot.cov-under .slot-bar-fill { background: var(--cov-under); }
.slot.cov-ok .slot-bar-fill    { background: var(--cov-ok); }
.slot.cov-full .slot-bar-fill  { background: var(--cov-full); }
.slot.cov-over .slot-bar-fill  { background: var(--cov-over); }
.slot.past .slot-bar-fill      { background: var(--muted); opacity: 0.5; }
.slot.past .slot-bar-tick      { opacity: 0.3; }

.schedule-search {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--input-bg, var(--card));
    color: var(--text);
    min-width: 180px;
}
.schedule-search-count {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.slot.dim { opacity: 0.32; }
.user-badge.badge-match {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.schedule-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.schedule-chip {
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.schedule-chip.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.slot.filtered-out { opacity: 0.2; }

.coverage-summary {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}
.coverage-summary.has-under { color: var(--cov-under); }
.hour-coverage {
    display: block;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    margin-top: 2px;
    color: transparent;
}
.hour-coverage.bad { color: var(--cov-under); }

.slot-names {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    align-content: start;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px 3px 4px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    background: var(--secondary);
    flex-shrink: 0;
    transition: background 0.15s;
    cursor: default;
    position: relative;
    max-width: 100%;
}

.user-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--badge-dot, var(--muted));
}

.user-badge.mine {
    background: var(--primary-light);
    outline: 1px solid var(--primary);
    outline-offset: -1px;
}

.user-badge.mine::before {
    background: var(--primary);
}

.user-badge.has-remove {
    cursor: pointer;
    padding-right: 3px;
}

@media (hover: hover) {
    .user-badge:hover {
        background: var(--secondary-hover);
    }
    .user-badge.has-remove:hover {
        background: var(--danger-light);
        color: var(--danger);
    }
    .user-badge.has-remove:hover::before {
        background: var(--danger);
    }
}

.user-badge-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

/* ========== DAY UTILIZATION BAR ========== */
.warn-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0 4px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.4);
    transition: transform 0.15s ease;
    z-index: 2;
}

.warn-badge:hover {
    transform: scale(1.3);
}

/* ========== SCHEDULE DUTY GEAR & MODAL ========== */
.duty-gear {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
    line-height: 1;
    color: var(--text-muted);
    transition: color 0.15s;
    vertical-align: middle;
}
.duty-gear:hover { color: var(--primary); }
.calendar-duty-gear {
    display: block;
    margin-top: 4px;
    width: 100%;
    text-align: center;
    padding: 2px 0;
    border-radius: 4px;
    font-size: 13px;
}
.calendar-duty-gear:hover { background: var(--primary-light); }

.duty-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.duty-modal {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 400px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}
.duty-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 15px;
}
.duty-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 4px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.duty-modal-close:hover { color: var(--text); background: var(--bg-hover); }
.duty-modal-body {
    padding: 12px 16px;
    overflow-y: auto;
    flex: 1;
    min-height: 60px;
}
.duty-modal-body-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 16px 0;
    font-size: 14px;
}
.duty-modal-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    margin-bottom: 4px;
    background: var(--secondary);
    font-size: 14px;
}
.duty-modal-item .duty-slot-badge {
    width: 20px;
    height: 20px;
    font-size: 11px;
}
.duty-modal-item-name { flex: 1; }
.duty-modal-item-del {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.duty-modal-item-del:hover { color: var(--danger); background: var(--danger-light); }
.duty-modal-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}
.duty-modal-footer .duty-admin-form {
    display: flex;
    gap: 8px;
    align-items: center;
}
#dutyModalSelect { flex: 1; }

/* ========== SCHEDULE CALENDAR (Month view) ========== */
.calendar-body { padding: 0; overflow-x: auto; }
.calendar-table { min-width: 560px; table-layout: fixed; }
.calendar-th { text-align: center; width: 14.28%; }
.calendar-cell { vertical-align: top; padding: 6px; height: 100px; border: 1px solid var(--border); }
.calendar-empty { background: var(--bg); }
.calendar-today { background: var(--primary-light); }
.calendar-today .calendar-day-num { color: var(--primary); }
.calendar-day-num { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.calendar-duty-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
    margin-bottom: 2px;
    border-radius: 4px;
    background: var(--secondary);
    font-size: 12px;
}

/* ========== BADGES (timeoff type/status) ========== */
.badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    white-space: nowrap;
}
.badge-dayoff {
    background: #e0e7ff;
    color: #4338ca;
}
.badge-vacation {
    background: #dbeafe;
    color: #0369a1;
}
.badge-pending {
    background: #fef3c7;
    color: #b45309;
}
.badge-approved {
    background: #dcfce7;
    color: #15803d;
}
.badge-rejected {
    background: #fee2e2;
    color: #b91c1c;
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--card);
    border-radius: var(--radius);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--muted);
    padding: 0 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
}

.modal-content--sm {
    max-width: 420px;
}

.palette-overlay { align-items: flex-start; }
.palette-content {
    width: 100%; max-width: 560px; margin-top: 10vh; padding: 0;
    display: flex; flex-direction: column; overflow: hidden;
}
.palette-input {
    border: none; border-bottom: 1px solid var(--border);
    padding: 16px 18px; font-size: 15px; background: transparent; color: var(--text);
    outline: none; width: 100%; box-sizing: border-box;
}
.palette-results { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette-group-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    color: var(--text-secondary); padding: 8px 12px 4px;
}
.palette-item {
    display: flex; align-items: baseline; gap: 8px;
    padding: 8px 12px; border-radius: 6px; cursor: pointer;
}
.palette-item.active, .palette-item:hover { background: var(--primary-light); }
.palette-item-label { color: var(--text); font-size: 14px; }
.palette-item-sub { color: var(--text-secondary); font-size: 12px; }
.palette-empty { padding: 16px; color: var(--text-secondary); font-size: 13px; text-align: center; }


.warn-card {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.warn-card:last-child {
    margin-bottom: 0;
}

.warn-reason {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.warn-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--muted);
}

.warn-discord {
    margin-top: 6px;
    font-size: 12px;
}

.warn-discord a,
.discord-link {
    color: #5865f2;
    text-decoration: none;
    font-weight: 600;
}

.warn-discord a:hover,
.discord-link:hover {
    text-decoration: underline;
}

/* ========== GL TABLE (GitLab-style data tables) ========== */
.gl-table-wrap {
    overflow-x: auto;
    border-top: 1px solid var(--border);
}

.gl-table {
    width: 100%;
    min-width: 800px;
    border-collapse: separate;
    border-spacing: 0;
}

.gl-table th,
.gl-table td {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
    font-size: 13px;
}

.gl-table th {
    background: var(--card);
    padding: 10px 12px;
    position: sticky;
    top: 0;
    z-index: 2;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.gl-table tr:last-child td {
    border-bottom: none;
}

.gl-table th:last-child,
.gl-table td:last-child {
    border-right: none;
}

.gl-table th.sort-asc::after { content: ' \25B2'; font-size: 10px; }
.gl-table th.sort-desc::after { content: ' \25BC'; font-size: 10px; }

th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { background: var(--bg-hover); }
th[data-sort]::after { content: ' \21C5'; opacity: 0.35; font-size: 0.85em; }

.gl-table th.sortable a {
    display: flex; align-items: center; gap: 4px;
    color: inherit; text-decoration: none;
    white-space: nowrap;
}
.gl-table th.sortable a:hover { color: var(--text); }

.sort-icon { font-size: 10px; opacity: 0.4; line-height: 1; }
.sort-icon--asc,
.sort-icon--desc { opacity: 1; color: var(--accent); }

.gl-table--striped tbody tr:nth-child(even) {
    background: var(--secondary);
}

.gl-table--compact th,
.gl-table--compact td {
    padding: 6px 8px;
    font-size: 12px;
}

.gl-table td .gl-table-td--center,
.gl-table-td--center {
    text-align: center;
    vertical-align: middle;
}

.gl-table-td--muted {
    font-size: 11px;
    color: var(--text-muted);
}

.gl-table-td--danger {
    font-size: 11px;
    color: var(--danger);
    font-weight: 500;
}

.gl-table-td--primary {
    font-size: 11px;
    color: var(--primary);
    font-weight: 500;
}

/* ========== ADMIN ========== */
.admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
    align-items: start;
}

.admin-main {
    min-width: 0;
}

.admin-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: -webkit-sticky;
    position: sticky;
    top: 24px;
}

.admin-sidebar .table-card {
    margin-bottom: 0;
}

.admin-users {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s ease;
}

.user-row:hover {
    border-color: #cbd5e1;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}

.user-nickname {
    font-weight: 700;
    font-size: 14px;
}

.user-login {
    color: var(--muted);
    font-size: 13px;
}

.user-group {
    font-size: 12px;
    background: var(--secondary);
    padding: 3px 10px;
    border-radius: 6px;
    color: var(--text-secondary);
}

.user-discord {
    font-size: 12px;
    color: #5865f2;
}

.user-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.popup-form {
    flex-direction: column;
    gap: 14px;
    padding: 20px;
}

.popup-form .field-label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ========== STATS TABLE ========== */
.stats-table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.staff-timeoff {
    font-size: 13px;
    line-height: 1.5;
}

.warn-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dc2626;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    padding: 0 8px;
    text-decoration: none;
    cursor: pointer;
}

.stats-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
}

.stats-table th,
.stats-table td {
    border: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

.stats-table th {
    background: var(--th-bg);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.stats-table th.sort-asc::after { content: ' \25B2'; font-size: 10px; }
.stats-table th.sort-desc::after { content: ' \25BC'; font-size: 10px; }

.stats-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stats-actions .btn {
    height: 34px;
    font-size: 13px;
    padding: 0 12px;
}

/* ========== STATUS PAGE ========== */
.status-month-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}
.status-month-form { margin: 0; }
.status-month-form input[type="month"] {
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    font-size: 14px;
}
.status-month-form input[type="month"]:focus {
    border-color: var(--primary);
    outline: none;
}
.status-group + .status-group { margin-top: 12px; }
.status-group-header {
    cursor: pointer;
    user-select: none;
}
.status-group-header:hover { background: var(--bg-hover); }
.status-group-count {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}
.status-group-toggle {
    margin-left: 8px;
    font-size: 14px;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.status-group-header.collapsed .status-group-toggle {
    transform: rotate(-90deg);
}
.status-group-body.collapsed { display: none; }
.status-col-num { text-align: center; white-space: nowrap; }
.status-col-num .status-night {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}
.status-total td {
    border-top: 2px solid var(--border);
    font-size: 13px;
}
.status-adjust {
    display: inline-block;
    min-width: 28px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
}
.status-adjust-positive { color: #16a34a; }
.status-adjust-negative { color: var(--danger); }
.status-adjust-btns {
    display: inline-flex;
    gap: 3px;
    margin-left: 6px;
    vertical-align: middle;
}
.status-hours {
    font-weight: 600;
}
.status-duty {
    font-size: 13px;
}

/* ========== STAFF PAGE ========== */
.staff-timeoff-link { font-weight:600; color:var(--primary); text-decoration:none; }
.staff-timeoff-link:hover { text-decoration:underline; }
.status-approved { color:#16a34a; font-weight:600; }
.status-rejected { color:var(--danger); font-weight:600; }
.status-pending { color:#d97706; font-weight:600; }

/* ========== DUTY ADMIN CALENDAR ========== */
.calendar-body.gl-card-body {
    padding: 0;
    overflow-x: auto;
}
.calendar-table.gl-table {
    min-width: 560px;
    table-layout: fixed;
}
.calendar-th {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    padding: 8px 4px;
}
.calendar-cell {
    vertical-align: top;
    padding: 6px;
    height: 100px;
    border: 1px solid var(--border);
    cursor: default;
    font-size: 12px;
}
.calendar-empty {
    background: var(--bg);
    cursor: default;
}
.calendar-today {
    background: var(--primary-light);
}
.calendar-today .calendar-day-num {
    color: var(--primary);
    font-weight: 700;
}
.calendar-day-num {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}
.calendar-duty-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
    margin-bottom: 2px;
    border-radius: 4px;
    background: var(--secondary);
    font-size: 12px;
}
.calendar-duty-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.calendar-duty-del {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.calendar-duty-del:hover {
    color: var(--danger);
    background: var(--danger-light);
}

/* ========== TOAST NOTIFICATIONS ========== */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 400px;
    width: calc(100% - 32px);
}

.toast {
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    font-size: 14px;
    line-height: 1.4;
    color: var(--text);
    animation: toastSlideIn 0.3s ease;
    cursor: default;
}

:root.dark .toast {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.toast.toast-hiding {
    animation: toastSlideOut 0.25s ease forwards;
}

.toast-success {
    background: #f0fdf4;
    border-left: 4px solid var(--success, #16a34a);
}

:root.dark .toast-success {
    background: #052e16;
}

.toast-error {
    background: var(--danger-light);
    border-left: 4px solid var(--danger);
}

:root.dark .toast-error {
    background: #450a0a;
}

.toast-info {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
}

:root.dark .toast-info {
    background: #1e293b;
}

/* Progress bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 var(--radius) var(--radius);
    animation: toastProgress var(--toast-duration, 4s) linear forwards;
}

.toast-success .toast-progress {
    background: var(--success, #16a34a);
}

.toast-error .toast-progress {
    background: var(--danger);
}

.toast-info .toast-progress {
    background: var(--primary);
}

.toast:hover .toast-progress {
    animation-play-state: paused;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    word-break: break-word;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px;
    line-height: 1;
    border-radius: 4px;
}

.toast-close:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.toast-undo {
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 13px;
    cursor: pointer;
    color: var(--primary);
    font-weight: 600;
    font-family: inherit;
    transition: background 0.15s;
}

.toast-undo:hover {
    background: var(--primary-light);
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Mobile */
@media (max-width: 600px) {
    .toast-container {
        left: 12px;
        right: 12px;
        top: 12px;
        max-width: none;
        width: auto;
    }
    .toast {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* ========== SHIFT LIST PAGINATED ========== */
.shift-list-paginated {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
}

.shift-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 220px;
    overflow-y: auto;
}

.shift-item {
    padding: 6px 10px;
    background: var(--secondary);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.3;
}

.duty-day-group {
    border-bottom: 1px solid var(--border);
}

.duty-day-group:last-child {
    border-bottom: none;
}

.duty-day-header {
    padding: 10px 16px;
    font-weight: 600;
    font-size: 14px;
    background: var(--secondary);
    color: var(--text);
    position: sticky;
    top: 0;
    z-index: 1;
}

/* ========== DUTY ADMIN WEEK GRID ========== */
.duty-week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    min-width: 560px;
}

.duty-week-cell {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    min-height: 140px;
    display: flex;
    flex-direction: column;
}

.duty-week-cell:first-child {
    border-left: 1px solid var(--border);
}

.duty-week-today {
    background: var(--primary-light);
}

.duty-week-header {
    padding: 8px 10px;
    font-weight: 600;
    font-size: 13px;
    background: var(--secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.duty-week-today-badge {
    font-size: 10px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    padding: 1px 6px;
    border-radius: 6px;
    text-transform: lowercase;
}

.duty-week-body {
    padding: 6px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.duty-week-admin {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.3;
    background: var(--card);
    border: 1px solid var(--border);
}

.duty-slot-badge {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.duty-slot-badge.slot-1 {
    background: #3b82f6;
}

.duty-slot-badge.slot-2 {
    background: #16a34a;
}

.duty-slot-badge.slot-3 {
    background: #f59e0b;
}

.duty-slot-badge.slot-4 {
    background: #8b5cf6;
}

.duty-admin-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.duty-admin-remove-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.duty-admin-remove-btn:hover {
    color: var(--danger);
    background: var(--danger-light);
}

.duty-week-empty {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 8px 0;
}

/* Self-service duty signup */
.duty-week-admin[data-date] {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.duty-week-admin[data-date]:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}
.duty-week-admin.duty-week-mine {
    background: var(--primary-light);
    border-color: var(--primary);
}
.duty-week-admin.duty-week-mine .duty-slot-badge {
    box-shadow: 0 0 0 2px var(--primary);
}

/* Mobile: collapse grid to stacked cards */
@media (max-width: 768px) {
    .duty-week-grid {
        grid-template-columns: 1fr;
        min-width: 0;
    }
    .duty-week-cell {
        border-left: 1px solid var(--border);
        min-height: 0;
    }
    .duty-week-cell + .duty-week-cell {
        border-top: 0;
    }
}

.shift-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.shift-page-btn {
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 8px;
    padding: 4px 10px;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.15s ease;
}

.shift-page-btn:hover:not(:disabled) {
    background: var(--secondary);
}

.shift-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.shift-page-info {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* ========== SECTIONS ========== */
.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.section-head h2,
.group-permissions-head h3 {
    margin: 0;
    font-weight: 700;
}

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.field-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-inline {
    display: inline;
}

.pwd-field {
    position: relative;
    width: 100%;
}
.pwd-field input {
    width: 100%;
    padding-right: 52px;
}
.pwd-toggle {
    position: absolute;
    right: 0;
    top: 0;
    width: 48px;
    height: 48px;
    padding: 0;
    cursor: pointer;
    border: 1.5px solid var(--border);
    border-left: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    transition: color .15s;
}
.pwd-toggle:hover {
    color: var(--text);
}
.pwd-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

/* hide browser-native password reveal */
.pwd-field input::-ms-reveal,
.pwd-field input::-ms-clear {
    display: none;
}
.pwd-field input::-webkit-credentials-auto-fill-button,
.pwd-field input::-webkit-password-eye {
    display: none !important;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}
.pwd-icon {
    width: 22px;
    height: 22px;
    display: block;
}
.pwd-eye-off {
    display: none;
}
.pwd-visible .pwd-eye {
    display: none;
}
.pwd-visible .pwd-eye-off {
    display: block;
}

/* ========== GROUPS ========== */
.group-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.group-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    background: var(--card);
}

.group-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.group-badge {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: var(--secondary);
    border: 1px solid var(--border);
    min-width: 220px;
}

.group-badge-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.group-code {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    word-break: break-word;
}

.group-color-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    vertical-align: middle;
    margin-left: 8px;
    border: 1px solid var(--border);
}

.group-edit-form {
    margin-bottom: 20px;
}

.group-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.group-permissions-form {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.group-permissions-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.permission-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
}

.permission-item:hover {
    border-color: #bfc9d4;
    background: var(--secondary);
}

.permission-item input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: var(--text);
    flex: 0 0 auto;
}

.permission-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.3;
}

.permission-code {
    font-size: 12px;
    color: var(--muted);
    word-break: break-word;
}

.group-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.group-permissions-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.perm-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

.group-help-list {
    margin: 0;
    padding-left: 18px;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 14px;
}

.group-help-list li + li {
    margin-top: 8px;
}

/* ========== UTILITIES ========== */
.muted {
    color: var(--muted);
}

.mobile-day-switcher {
    display: none;
}

.mobile-day-buttons {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0;
}

.mobile-day-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--card);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-day-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

@media (hover: hover) {
    .mobile-day-btn:hover {
        border-color: var(--primary);
        color: var(--text);
    }
}

.gl-mt-sm { margin-top: 8px; }
.gl-mb-sm { margin-bottom: 8px; }
.gl-mb { margin-bottom: 16px; }
.gl-mb-lg { margin-bottom: 24px; }
.gl-ml-auto { margin-left: auto; }
.text-danger { color: var(--danger); }

.form-actions {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

/* ========== LAYOUT & FLEX UTILITIES ========== */
.w-full { width: 100%; }
.w-auto { width: auto; }
.flex-row { display: flex; align-items: center; gap: 8px; }
.flex-end { display: flex; justify-content: flex-end; gap: 8px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.flex-col { display: flex; flex-direction: column; }
.flex-gap-sm { gap: 6px; }
.flex-gap-md { gap: 12px; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.align-self-end { align-self: flex-end; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: monospace; }
.sticky-col {
    position: sticky;
    left: 0;
    background: var(--card-bg);
    z-index: 2;
}
.sticky-col--row {
    position: sticky;
    left: 0;
    background: var(--card-bg);
    z-index: 1;
}
.pagination-wrapper {
    padding-top: 12px;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 14px;
    color: var(--text-muted);
    user-select: none;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .table-wrap,
    .stats-table-wrap,
    .gl-table-wrap {
        -webkit-overflow-scrolling: touch;
    }

    .admin-form > .btn:not(.btn-sm):not(.btn-xs) {
        width: 100%;
    }
}

/* ========== RESPONSIVE: MOBILE & TABLET ========== */
@media (max-width: 1024px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
    .admin-sidebar {
        position: static;
    }
    .permissions-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Мобильный гамбургер */
    .gl-topbar-btn.gl-topbar-menu-btn { display: flex; }

    /* Центральный поиск — скрыт на узких экранах */
    .gl-topbar-center { display: none; }

    /* Брендинг без текста на очень маленьких */
    .gl-topbar-brand-text { display: none; }

    /* Топбар */
    .gl-topbar {
        grid-template-columns: auto 1fr auto;
        padding: 0 12px;
        height: 52px;
        min-height: 52px;
        gap: 8px;
    }

    /* Сайдбар — оверлей (fixed) */
    .gl-nav-panel {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        z-index: 300;
        transform: translateX(-100%);
        transition: transform 0.25s ease, box-shadow 0.25s ease;
        border-top-right-radius: 16px;
        border-bottom-right-radius: 16px;
        border-top-left-radius: 0;
    }

    .gl-nav-panel.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 32px rgba(0,0,0,0.35);
    }

    .gl-nav-overlay {
        display: block; /* показываем на мобильных */
    }

    .gl-nav-overlay.active {
        background: rgba(0,0,0,0.45);
        pointer-events: auto;
    }

    /* Кнопка «Свернуть» не нужна — на мобильных сайдбар закрывается оверлеем */
    .gl-nav-collapse-btn { display: none; }

    /* Блокируем скролл страницы когда сайдбар открыт */
    body.sidebar-open { overflow: hidden; }

    /* Контент — убираем radius (сайдбар — оверлей), оставляем отступы */
    .gl-content {
        padding: 12px;
        border-top-left-radius: 0;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .gl-page-header {
        margin: -12px -12px 16px;
        border-top-left-radius: 0;
    }

    .gl-card-header {
        padding: 12px 14px;
    }

    .gl-card-body {
        padding: 14px;
    }

    .gl-page-title {
        font-size: 18px;
    }

    .gl-page-subtitle {
        font-size: 12px;
    }

    .schedule-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .schedule-nav {
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
    }

    .schedule-nav .schedule-week-label {
        width: 100%;
        text-align: center;
        margin-right: 0;
    }

    .duty-btn {
        width: auto;
        flex-shrink: 0;
    }

    .table-card,
    .auth-card {
        padding: 14px 16px;
        border-radius: var(--radius);
    }

    .week-nav {
        width: 100%;
        flex-direction: column;
    }

    .week-nav .btn {
        width: 100%;
        height: 42px;
        font-size: 14px;
    }

    .btn {
        height: 42px;
        font-size: 14px;
    }

    /* Маленькие кнопки не растягиваются */
    .btn-sm { height: 32px; font-size: 12px; }
    .btn-xs { height: 22px; font-size: 11px; }

    /* Кнопки во всю ширину только внутри форм */
    .auth-form .btn:not(.btn-sm):not(.btn-xs),
    .admin-form > .btn:not(.btn-sm):not(.btn-xs),
    .form-actions .btn:not(.btn-sm):not(.btn-xs),
    .settings-password-form .btn:not(.btn-sm):not(.btn-xs) {
        width: 100%;
    }

    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        gap: 0;
    }

    .tab {
        flex-shrink: 0;
        padding: 10px 16px;
        font-size: 13px;
    }

    .mobile-day-switcher {
        display: flex;
        justify-content: center;
        margin-bottom: 12px;
    }

    .mobile-day-btn {
        width: 36px;
        height: 36px;
        font-size: 11px;
    }

    .table-wrap {
        border-radius: 10px;
    }

    .schedule {
        min-width: 100%;
    }

    .schedule th,
    .schedule td {
        font-size: 12px;
    }

    .schedule thead th.sticky-col {
        min-width: 60px;
        width: 60px;
        font-size: 10px;
    }

    .day-cell {
        min-width: 60px;
        width: 60px;
        font-size: 11px;
        padding: 6px 4px;
    }

    .slot {
        min-width: auto;
        width: auto;
        height: auto;
        min-height: 56px;
    }

    .slot-inner {
        padding: 4px 5px;
        gap: 2px;
    }

    .slot-status {
        font-size: 10px;
    }

    .user-badge {
        padding: 1px 5px 1px 3px;
        font-size: 9px;
        border-radius: 10px;
        gap: 3px;
    }

    .user-badge::before {
        width: 6px;
        height: 6px;
    }

    .user-badge-text {
        max-width: 60px;
    }

    .schedule.mobile-one-day th.day-col,
    .schedule.mobile-one-day td.day-col {
        display: none;
    }

    .schedule.mobile-one-day th.day-col.active,
    .schedule.mobile-one-day td.day-col.active {
        display: table-cell;
    }

    .auth-form,
    .admin-form,
    .user-row {
        width: 100%;
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
        width: 100%;
    }

    .form-actions .btn {
        width: 100%;
    }

    .auth-form input:not([type="checkbox"]):not([type="radio"]),
    .admin-form input:not([type="checkbox"]):not([type="radio"]),
    .admin-form select {
        width: 100%;
        min-width: 100%;
    }

    .group-edit-grid {
        grid-template-columns: 1fr;
    }

    .group-card {
        padding: 14px;
    }

    .group-badge {
        min-width: 100%;
        width: 100%;
    }

    .stats-table {
        min-width: 950px;
    }

    .pagination {
        gap: 8px;
    }

    .pagination .btn {
        width: auto;
        min-width: 38px;
        padding: 0 10px;
        height: 36px;
        font-size: 13px;
    }

    .shift-list-paginated {
        min-width: 160px;
    }

    .shift-list {
        max-height: 240px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .gl-card:last-child {
        grid-column: 1;
    }

    .gl-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .duty-info .duty-btn {
        width: auto;
    }

    .schedule-card .schedule {
        min-width: 100%;
    }

    .schedule-card .slot {
        min-width: auto;
        width: auto;
        height: auto;
        min-height: 56px;
    }

    .schedule-card .day-cell {
        min-width: 60px;
        width: 60px;
    }

    .schedule-card .schedule thead th.sticky-col {
        min-width: 60px;
        width: 60px;
    }

    .gl-table {
        min-width: 0;
    }

    .gl-table th,
    .gl-table td {
        padding: 8px 8px;
        font-size: 12px;
    }

    .mobile-hide,
    [data-mobile-hide="true"] {
        display: none !important;
    }

    .gl-table td.actions {
        white-space: nowrap;
    }

    .gl-table td.actions form,
    .gl-table td.actions .btn {
        display: inline-block;
        margin: 2px 0;
    }

    .gl-table td.actions .btn-sm {
        height: 34px;
        font-size: 12px;
        padding: 0 10px;
    }

    .gl-table td.actions input[type="date"] {
        width: 100%;
        min-width: 0;
        margin-bottom: 4px;
    }

    .gl-table td .btn-sm {
        margin: 2px 4px 2px 0;
    }
}

@media (max-width: 480px) {
    .gl-topbar {
        padding: 0 10px;
        height: 48px;
        min-height: 48px;
    }

    .gl-topbar-brand-text { display: none; }

    .table-card {
        padding: 10px 12px;
    }

    .auth-card {
        padding: 20px 16px;
    }

    .auth-brand-name {
        font-size: 16px;
    }

    .auth-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-actions .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .remember-me {
        justify-content: center;
    }

    .btn-steam {
        height: 44px;
        font-size: 14px;
    }

    .calendar-cell {
        height: 60px;
        padding: 3px;
        font-size: 10px;
    }

    .calendar-day-num {
        font-size: 11px;
        margin-bottom: 2px;
    }

    .calendar-duty-item {
        font-size: 9px;
        padding: 1px 3px;
        gap: 2px;
        margin-bottom: 1px;
    }

    .calendar-th {
        font-size: 10px;
        padding: 4px 0;
    }

    .schedule thead th.sticky-col {
        min-width: 44px;
        width: 44px;
        font-size: 9px;
    }

    .day-cell {
        min-width: 52px;
        width: 52px;
        font-size: 10px;
        padding: 4px 2px;
    }

    .slot {
        height: auto;
        min-height: 48px;
    }

    .slot-inner {
        padding: 3px 4px;
        gap: 1px;
    }

    .day-title {
        font-size: 10px;
    }

    .day-duty {
        font-size: 8px;
    }

    .slot-status {
        font-size: 9px;
        margin-bottom: 0;
    }

    .user-badge {
        padding: 1px 4px 1px 2px;
        font-size: 8px;
        border-radius: 8px;
        gap: 2px;
    }

    .user-badge::before {
        width: 5px;
        height: 5px;
    }

    .user-badge-text {
        max-width: 36px;
    }

    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        max-width: 100%;
        max-height: 92vh;
        border-radius: var(--radius) var(--radius) 0 0;
    }

    .modal-body {
        padding: 12px;
    }

    .modal-header {
        padding: 14px 12px;
    }

    /* Настройки: сетки в 2 колонки */
    .gl-slot-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gl-theme-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .settings-page {
        max-width: 100%;
    }
}

/* ========== SEARCHABLE SELECT ========== */
.searchable-select-wrapper {
    position: relative;
    width: 100%;
    z-index: 10;
}
.searchable-select-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    cursor: text;
    box-sizing: border-box;
    color: var(--text);
}

.searchable-select-wrapper.input-sm .searchable-select-input {
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius);
    font-size: 14px;
}
.searchable-select-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(51, 65, 85, 0.15);
}
.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    z-index: 999;
    display: none;
    box-sizing: border-box;
}
.searchable-select-dropdown.show {
    display: block;
}
.searchable-select-option {
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.1s;
}
.searchable-select-option:hover,
.searchable-select-option.highlighted {
    background: var(--secondary);
}
.searchable-select-option.selected {
    background: var(--primary);
    color: #fff;
}
.searchable-select-option.empty {
    color: var(--muted);
    cursor: default;
}

/* ========== WIKI ========== */

.wiki-content {
    line-height: 1.6 !important;
    font-size: 15px !important;
    max-width: 100%;
    overflow-x: auto;
    color: var(--text-primary) !important;
}

.wiki-content * {
    color: inherit !important;
}

.wiki-content h1,
.wiki-content h2,
.wiki-content h3,
.wiki-content h4,
.wiki-content h5,
.wiki-content h6 {
    margin: 1.2em 0 0.6em !important;
    color: var(--text-primary) !important;
    font-family: inherit !important;
    background: transparent !important;
}

.wiki-content h1 { font-size: 1.6em !important; font-weight: 700 !important; }
.wiki-content h2 { font-size: 1.35em !important; font-weight: 700 !important; }
.wiki-content h3 { font-size: 1.15em !important; font-weight: 600 !important; }
.wiki-content h4 { font-size: 1.05em !important; font-weight: 600 !important; }

.wiki-content h1 span,
.wiki-content h2 span,
.wiki-content h3 span,
.wiki-content h4 span,
.wiki-content h5 span,
.wiki-content h6 span {
    font-family: inherit !important;
    font-size: inherit !important;
    color: inherit !important;
    background: transparent !important;
    font-weight: inherit !important;
    white-space: normal !important;
    vertical-align: baseline !important;
    text-decoration: none !important;
}

.wiki-content p {
    margin: 0 0 1em !important;
    font-family: inherit !important;
    font-size: 15px !important;
    color: var(--text-primary) !important;
    background: transparent !important;
    background-color: transparent !important;
    line-height: 1.6 !important;
    white-space: normal !important;
    vertical-align: baseline !important;
}

.wiki-content p span {
    font-family: inherit !important;
    font-size: 15px !important;
    color: var(--text-primary) !important;
    background: transparent !important;
    background-color: transparent !important;
    font-weight: inherit !important;
    font-style: inherit !important;
    white-space: normal !important;
    vertical-align: baseline !important;
    text-decoration: none !important;
}

.wiki-content ul,
.wiki-content ol {
    margin: 0 0 1em !important;
    margin-block: 0 1em !important;
    padding-left: 1.5em !important;
    padding-inline-start: 1.5em !important;
}

.wiki-content li {
    margin-bottom: 0.3em !important;
    font-size: 15px !important;
    font-family: inherit !important;
    color: var(--text-primary) !important;
    background: transparent !important;
    background-color: transparent !important;
    line-height: 1.6 !important;
    white-space: normal !important;
    vertical-align: baseline !important;
    text-decoration: none !important;
    font-weight: 400 !important;
    font-style: normal !important;
    font-variant: normal !important;
}

.wiki-content ol > li {
    list-style-type: decimal !important;
}

.wiki-content ul > li {
    list-style-type: disc !important;
}

.wiki-content li p {
    display: inline !important;
    margin: 0 !important;
    font-family: inherit !important;
    font-size: 15px !important;
    color: var(--text-primary) !important;
    background: transparent !important;
    background-color: transparent !important;
    line-height: 1.6 !important;
    white-space: normal !important;
    vertical-align: baseline !important;
    text-decoration: none !important;
    font-weight: inherit !important;
    font-style: inherit !important;
}

.wiki-content li span,
.wiki-content li p span {
    font-family: inherit !important;
    font-size: 15px !important;
    color: var(--text-primary) !important;
    background: transparent !important;
    background-color: transparent !important;
    line-height: 1.6 !important;
    white-space: normal !important;
    vertical-align: baseline !important;
    text-decoration: none !important;
    font-weight: inherit !important;
    font-style: inherit !important;
}

.wiki-content blockquote {
    margin: 1em 0 !important;
    padding: 0.5em 1em !important;
    border-left: 4px solid var(--accent) !important;
    background: var(--bg-hover) !important;
    color: var(--text-muted) !important;
}

.wiki-content blockquote * {
    color: var(--text-muted) !important;
}

.wiki-content pre {
    margin: 1em 0 !important;
    padding: 1em !important;
    background: var(--bg-input) !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 13px !important;
    line-height: 1.45 !important;
}

.wiki-content code {
    background: var(--bg-hover) !important;
    padding: 2px 5px !important;
    border-radius: 3px !important;
    font-size: 0.9em !important;
}

.wiki-content pre code {
    background: none !important;
    padding: 0 !important;
}

.wiki-content a {
    color: var(--accent) !important;
    text-decoration: underline !important;
}

.wiki-content a span {
    font-family: inherit !important;
    font-size: inherit !important;
    color: inherit !important;
}

.wiki-content strong,
.wiki-content b {
    font-weight: 700 !important;
}

.wiki-content em,
.wiki-content i {
    font-style: italic !important;
}

.wiki-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.wiki-content table {
    border-collapse: collapse !important;
    width: 100% !important;
    margin: 1em 0 !important;
    font-family: inherit !important;
    font-size: 14px !important;
    color: var(--text-primary) !important;
}

.wiki-content th,
.wiki-content td {
    border: 1px solid var(--border) !important;
    padding: 8px 12px !important;
    text-align: left !important;
    font-family: inherit !important;
    font-size: 14px !important;
    color: var(--text-primary) !important;
    background: transparent !important;
    background-color: transparent !important;
    vertical-align: middle !important;
}

.wiki-content th {
    background: var(--bg-hover) !important;
    font-weight: 600 !important;
}

.wiki-content th span,
.wiki-content td span {
    font-family: inherit !important;
    font-size: inherit !important;
    color: inherit !important;
    background: transparent !important;
    background-color: transparent !important;
    white-space: normal !important;
    vertical-align: baseline !important;
}

.wiki-content hr {
    border: none !important;
    border-top: 1px solid var(--border) !important;
    margin: 1.5em 0 !important;
}

.wiki-content br {
    display: initial !important;
}

.wiki-content [style*="text-align: center"],
.wiki-content [style*="text-align:center"] {
    text-align: center !important;
}

.wiki-content [style*="white-space"] {
    white-space: normal !important;
}



/* Jodit */
.jodit-container {
    border-radius: 6px !important;
    border-color: var(--border) !important;
}

.jodit-workplace {
    min-height: 400px !important;
}

.jodit-container .jodit-workplace {
    border: none !important;
}

.jodit-status-bar {
    border-top: 1px solid var(--border) !important;
    background: var(--card) !important;
    color: var(--text-muted) !important;
}

.jodit-status-bar a,
.jodit-status-bar span {
    color: var(--text-muted) !important;
}

.jodit-toolbar__box {
    border-bottom: 1px solid var(--border) !important;
    background: var(--card) !important;
}

.jodit-toolbar-button__button {
    color: var(--text-secondary) !important;
}

.jodit-toolbar-button__button:hover {
    background: var(--bg-hover) !important;
}

.jodit-icon {
    fill: var(--text-secondary) !important;
}

.jodit-workplace {
    min-height: 400px !important;
}

.jodit-container .jodit-workplace {
    border: none !important;
}

.jodit-status-bar {
    border-top: 1px solid var(--border) !important;
}

.jodit-toolbar__box {
    border-bottom: 1px solid var(--border) !important;
}

.gl-list-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-right: 12px;
    border-radius: 50%;
    background: var(--bg-hover);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ========== TIMEOFF GRID ========== */
.timeoff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px 16px;
    align-items: end;
}

.timeoff-grid-full {
    grid-column: 1 / -1;
}

.timeoff-grid .form-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

/* Safari < 14.1 flex gap fallback */
@supports not (gap: 1px) {
    .gl-nav-item > * + * { margin-left: 10px; }
    .gl-topbar-left > * + * { margin-left: 12px; }
    .gl-topbar-right > * + * { margin-left: 8px; }

    .auth-divider > * + * { margin-left: 12px; }
    .btn > * + * { margin-left: 5px; }
    .admin-form > * + * { margin-left: 12px; }
}

/* ========== STAFF PROFILE HEADER ========== */
.profile-header {
    margin-top: 16px;
}

.profile-name {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 700;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.profile-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.profile-meta a {
    color: var(--text-primary);
}
