/* ===== DESIGN TOKENS ===== */
:root {
    --tg-safe-top: 0px;
    --tg-safe-right: 0px;
    --bg-page: #0d0c1a;
    --bg-card: #161428;
    --bg-muted: #1e1b36;
    --border: #2d2a4a;
    --text-primary: #f0eeff;
    --text-secondary: #c8c4e0;
    --text-tertiary: #9590c0;
    --text-muted: #6b6599;
    --accent-teal: #38c4a8;
    --accent-orange: #e8a838;
    --error: #e84f5e;
    --success: #a8e06b;
    --info: #5ecee8;
    --gradient-btn: linear-gradient(180deg, #38c4a8, #2a9a82);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* ===== APP LAYOUT ===== */
.app-layout {
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* ===== SIDEBAR (desktop) ===== */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}
.sidebar-logo {
    padding: 20px 16px 8px;
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 18px;
    color: var(--accent-teal);
    letter-spacing: -0.5px;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}
.sidebar-user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--gradient-btn);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; }
.sidebar-user-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-role {
    font-size: 11px;
    color: var(--text-muted);
}
.sidebar-nav { flex: 1; padding: 4px 8px; }
.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background .15s, color .15s;
    margin-bottom: 2px;
}
.sidebar-nav-item:hover { background: var(--bg-muted); }
.sidebar-nav-item.active {
    background: rgba(56,196,168,.12);
    color: var(--accent-teal);
}
.sidebar-nav-item i { width: 18px; height: 18px; flex-shrink: 0; }

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--error);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    margin-left: auto;
}
.nav-badge:empty { display: none; }

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    padding-top: var(--tg-safe-top);
    -webkit-overflow-scrolling: touch;
}

/* ===== PAGES ===== */
.page { display: none; padding: 20px 24px 80px; }
.page.active { display: block; }
.page-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.page-title {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
}
.page-back-btn {
    display: none;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--accent-teal);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    flex-shrink: 0;
}
.page-back-btn i { width: 16px; height: 16px; }
.page-header-action { flex-shrink: 0; }

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
}
.card-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}
.card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.card-text {
    font-size: 13px;
    color: var(--text-secondary);
}
.card-footer {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: var(--gradient-btn);
    color: #fff;
    padding: 8px 16px;
    font-size: 13px;
}
.btn-secondary {
    background: var(--bg-muted);
    color: var(--text-secondary);
    padding: 6px 12px;
    font-size: 12px;
}
.btn-danger {
    background: rgba(232,79,94,.15);
    color: var(--error);
    padding: 6px 12px;
    font-size: 12px;
}
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }
.gradient-btn {
    background: var(--gradient-btn);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px;
    width: 100%;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: opacity .15s;
}
.gradient-btn:active { opacity: 0.85; }

/* ===== FILTER CHIPS ===== */
.filter-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-tertiary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.filter-chip.active {
    background: rgba(56,196,168,.15);
    border-color: var(--accent-teal);
    color: var(--accent-teal);
}
.filter-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 12px;
}
.filter-chips::-webkit-scrollbar { display: none; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 12px; overflow: hidden; }
.form-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color .15s;
}
.form-control:focus { border-color: var(--accent-teal); }
.form-control::placeholder { color: var(--text-muted); }
input[type="date"].form-control { max-width: 100%; min-width: 0; }
select.form-control { appearance: auto; }
textarea.form-control { min-height: 80px; resize: vertical; }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}
.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    background: var(--bg-card);
    border-radius: 18px 18px 0 0;
    padding: 20px 16px 32px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform .3s ease;
}
.modal-overlay.open .modal-content {
    transform: translateY(0);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.modal-title {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 17px;
    color: var(--text-primary);
}
.modal-close {
    background: var(--bg-muted);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-tertiary);
    cursor: pointer;
}
.modal-handle {
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 12px;
}
.route-modal-sheet {
    background: var(--bg-card);
    border-radius: 18px 18px 0 0;
    padding: 12px 16px 32px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform .3s ease;
}
.modal-overlay.open .route-modal-sheet {
    transform: translateY(0);
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-active { background: rgba(168,224,107,.15); color: var(--success); }
.badge-inactive { background: rgba(107,101,153,.15); color: var(--text-muted); }
.badge-pending { background: rgba(232,168,56,.15); color: var(--accent-orange); }
.badge-approved { background: rgba(56,196,168,.15); color: var(--accent-teal); }
.badge-rejected { background: rgba(232,79,94,.15); color: var(--error); }
.badge-cancelled { background: rgba(107,101,153,.15); color: var(--text-muted); }

/* ===== SECTION ===== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.section-title {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
}
.section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin: 16px 0 8px;
}
.detail-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* ===== LOADING ===== */
.loading { text-align: center; padding: 40px 0; }
.spinner {
    width: 28px; height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--accent-teal);
    border-radius: 50%;
    animation: spin .6s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
}
.empty-state-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    transition: all .3s;
    pointer-events: none;
    white-space: nowrap;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== APPROVAL STEPS ===== */
.approval-steps {
    margin-top: 8px;
    padding: 8px;
    background: var(--bg-muted);
    border-radius: 10px;
}
.approval-step-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-size: 12px;
}
.approval-step-icon { font-size: 14px; flex-shrink: 0; }
.approval-step-text { color: var(--text-secondary); }
.step-hint { color: var(--text-muted); }
.step-comment { color: var(--error); }

/* ===== TABS (inside modals) ===== */
.tabs {
    display: flex;
    background: var(--bg-muted);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}
.tab-btn {
    flex: 1;
    padding: 7px 8px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-tertiary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.tab-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* ===== UTILITY ===== */
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.text-sm { font-size: 12px; }
.text-hint { color: var(--text-muted); }
.mt-8 { margin-top: 8px; }
.mb-8 { margin-bottom: 8px; }
.mt-12 { margin-top: 12px; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== ROUTES SPECIFIC ===== */
.routes-page-title {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 14px;
}
.route-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: border-color .15s;
}
.route-card.expanded { border-color: var(--accent-teal); }
.route-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    cursor: pointer;
}
.route-card-header-left { flex: 1; min-width: 0; }
.route-card-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.route-card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.route-card-chevron {
    color: var(--text-muted);
    transition: transform .2s;
    flex-shrink: 0;
}
.route-card.expanded .route-card-chevron { transform: rotate(180deg); }
.route-card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    padding: 0 14px;
}
.route-card.expanded .route-card-body {
    max-height: 600px;
    padding: 0 14px 14px;
}
.type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
}
.type-badge.vacation { background: rgba(56,196,168,.15); color: var(--accent-teal); }
.type-badge.remote { background: rgba(94,206,232,.15); color: var(--info); }
.type-badge.sick { background: rgba(232,168,56,.15); color: var(--accent-orange); }
.count-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    background: var(--bg-muted);
    color: var(--text-muted);
}

/* Route steps */
.step-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}
.step-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: #fff;
    flex-shrink: 0;
}
.step-info { flex: 1; min-width: 0; }
.step-info-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.step-info-role { font-size: 11px; color: var(--text-muted); }
.step-badge {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}
.step-remove-btn {
    background: rgba(232,79,94,.15);
    border: none;
    border-radius: 50%;
    width: 24px; height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--error);
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Step add inline */
.step-add-inline {
    max-height: 0;
    overflow: hidden;
    transition: max-height .2s;
}
.step-add-inline.open { max-height: 120px; }
.add-step-btn {
    background: none;
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 8px;
    width: 100%;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    margin: 8px 0;
}
.add-route-btn {
    background: none;
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 10px;
    width: 100%;
    color: var(--accent-teal);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin: 8px 0;
}

/* Emp chips */
.emp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.emp-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-muted);
    border-radius: 20px;
    padding: 4px 10px 4px 4px;
}
.emp-avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 10px;
    color: #fff;
}
.emp-name-text { font-size: 12px; color: var(--text-secondary); }

/* Unassigned */
.unassigned-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.unassigned-row:last-child { border-bottom: none; }
.unassigned-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--bg-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.unassigned-info { flex: 1; min-width: 0; }
.unassigned-info-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.unassigned-info-role { font-size: 11px; color: var(--text-muted); }
.unassigned-btn {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    color: var(--accent-teal);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

/* Route type chip group */
.type-chip-group { display: flex; gap: 6px; }
.type-chip-toggle {
    padding: 7px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-tertiary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.type-chip-toggle.active {
    background: rgba(56,196,168,.15);
    border-color: var(--accent-teal);
    color: var(--accent-teal);
}
.route-modal-sheet .type-chip-toggle.active {
    background: #38c4a8;
    border-color: #38c4a8;
    color: #fff;
}

/* Assign modal */
.assign-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.radio-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color .15s;
}
.radio-option.selected { border-color: var(--accent-teal); }
.radio-dot {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color .15s;
}
.radio-dot.selected { border-color: var(--accent-teal); }
.radio-dot-inner {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--accent-teal);
    transform: scale(0);
    transition: transform .15s;
}
.radio-dot.selected .radio-dot-inner { transform: scale(1); }
.radio-info { flex: 1; }
.radio-info-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.radio-info-desc { font-size: 11px; color: var(--text-muted); }

/* Delete link */
.delete-link {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--error);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 16px;
    padding: 8px 0;
}
.route-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}

/* ===== MOBILE TAB BAR ===== */
.mobile-tab-bar {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 6px 0 env(safe-area-inset-bottom, 8px);
    z-index: 900;
}
.mobile-tab-bar-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
}
.mobile-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: color .15s;
}
.mobile-tab-item.active { color: var(--accent-teal); }
.mobile-tab-item i { width: 22px; height: 22px; }

.mobile-tab-icon-wrap {
    position: relative;
    display: inline-flex;
}
.mobile-tab-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--error);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}
.mobile-tab-badge:empty { display: none; }

/* ===== MORE PAGE (mobile) ===== */
.more-menu-list { padding: 0; }
.more-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background .15s;
}
.more-menu-item:active { background: var(--bg-muted); }
.more-menu-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--bg-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    flex-shrink: 0;
}
.more-menu-icon i { width: 18px; height: 18px; }
.more-menu-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}
.more-menu-arrow {
    margin-left: auto;
    color: var(--text-muted);
}
.more-menu-arrow i { width: 16px; height: 16px; }

/* ===== ROUTE MODAL REDESIGN ===== */

/* Close button */
.route-modal-close-btn {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,.06);
    border: none;
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
}
.route-modal-close-btn:hover { background: rgba(255,255,255,.12); }
.route-modal-close-btn i { width: 18px; height: 18px; }

/* Step card */
.route-step-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #161428;
    border: 1px solid #2d2a4a;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 6px;
    transition: opacity .15s, box-shadow .15s, border-color .15s;
}
.route-step-card.dragging {
    opacity: .4;
}
.route-step-card.drag-over {
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 1px var(--accent-teal);
}
.route-step-ghost {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    opacity: .85;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    border-radius: 12px;
}
.route-step-drag {
    color: var(--text-tertiary);
    cursor: grab;
    flex-shrink: 0;
    display: flex; align-items: center;
    touch-action: none;
}
.route-step-drag:active { cursor: grabbing; }
.route-step-drag i { width: 16px; height: 16px; }
.route-step-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.route-step-info { flex: 1; min-width: 0; }
.route-step-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-step-position { font-size: 11px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-step-badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.route-step-remove {
    background: none; border: none;
    color: var(--text-tertiary);
    font-size: 18px; line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    flex-shrink: 0;
    transition: color .15s;
}
.route-step-remove:hover { color: #e84f5e; }

/* Add participant button */
.route-add-participant-btn {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px;
    border-radius: 12px;
    border: 1.5px dashed rgba(56,196,168,.4);
    background: rgba(56,196,168,.06);
    color: #38c4a8;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    margin-top: 6px;
}
.route-add-participant-btn:hover { background: rgba(56,196,168,.12); border-color: rgba(56,196,168,.7); }
.route-add-participant-btn i { width: 16px; height: 16px; }

/* Approver picker (searchable list) */
.route-approver-picker {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, margin .3s ease;
    margin-top: 0;
}
.route-approver-picker.open {
    max-height: 320px;
    margin-top: 8px;
}
.route-approver-picker .form-control {
    margin-bottom: 8px;
    position: sticky;
    top: 0;
    z-index: 1;
}
.route-approver-list {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.route-approver-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .12s;
}
.route-approver-row:hover { background: rgba(255,255,255,.06); }
.route-approver-row:active { background: rgba(56,196,168,.12); }
.route-approver-row-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.route-approver-row-info { flex: 1; min-width: 0; }
.route-approver-row-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-approver-row-position { font-size: 11px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-approver-row-action {
    flex-shrink: 0;
    color: var(--accent-teal);
    display: flex; align-items: center;
}
.route-approver-empty {
    padding: 16px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

/* Employee chips in modal */
.route-emp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #161428;
    border: 1px solid #2d2a4a;
    border-radius: 20px;
    padding: 4px 10px 4px 4px;
    margin: 0 6px 6px 0;
}
.route-emp-chip-avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    flex-shrink: 0;
}
.route-emp-chip-name {
    font-size: 12px;
    color: var(--text-primary);
    white-space: nowrap;
}
.route-emp-chip-remove {
    background: none; border: none;
    color: var(--text-tertiary);
    font-size: 14px; line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    margin-left: 2px;
    transition: color .15s;
}
.route-emp-chip-remove:hover { color: #e84f5e; }

/* Add employee chip */
.route-emp-add-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1.5px dashed rgba(56,196,168,.4);
    background: rgba(56,196,168,.06);
    border-radius: 20px;
    padding: 4px 12px;
    color: #38c4a8;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    margin-bottom: 6px;
}
.route-emp-add-chip:hover { background: rgba(56,196,168,.12); border-color: rgba(56,196,168,.7); }

/* Modal footer */
.route-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    gap: 10px;
}
.route-footer-right {
    display: flex;
    gap: 8px;
}
.route-delete-btn {
    display: flex; align-items: center; gap: 6px;
    background: none; border: none;
    color: #e84f5e;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 4px;
    transition: opacity .15s;
}
.route-delete-btn:hover { opacity: .8; }
.route-delete-btn i { width: 16px; height: 16px; }
.route-cancel-btn {
    padding: 10px 20px;
    border-radius: 10px;
    background: #161428;
    border: 1px solid #2d2a4a;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.route-cancel-btn:hover { background: #1e1b36; }
.route-save-btn {
    padding: 10px 24px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-teal), var(--accent-teal-dark));
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
}
.route-save-btn:hover { opacity: .9; }

/* Employee picker modal rows */
.route-emp-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,.05);
    cursor: pointer;
    transition: background .15s;
    border-radius: 8px;
    padding-left: 8px;
    padding-right: 8px;
}
.route-emp-picker-row:hover { background: rgba(255,255,255,.04); }
.route-emp-picker-row:last-child { border-bottom: none; }
.route-emp-picker-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.route-emp-picker-info { flex: 1; min-width: 0; }
.route-emp-picker-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.route-emp-picker-position { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.route-emp-picker-add-btn {
    padding: 5px 14px;
    border-radius: 8px;
    background: rgba(56,196,168,.12);
    border: none;
    color: #38c4a8;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s;
}
.route-emp-picker-add-btn:hover { background: rgba(56,196,168,.22); }

/* ===== EMPLOYEES PAGE ===== */

.emp-header-actions { display: none; align-items: center; gap: 10px; margin-left: auto; }

/* Stats row */
.emp-stats-row {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 8px; margin-bottom: 14px;
}
.emp-stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 14px; padding: 14px;
    display: flex; flex-direction: column; gap: 4px;
}
.emp-stat-primary {
    background: var(--gradient-btn); border-color: transparent;
}
.emp-stat-primary .emp-stat-value { color: #fff; }
.emp-stat-primary .emp-stat-label { color: rgba(255,255,255,.7); }
.emp-stat-value {
    font-family: 'JetBrains Mono', monospace; font-weight: 700;
    font-size: 26px; line-height: 1;
}
.emp-stat-green { color: var(--success); }
.emp-stat-orange { color: var(--accent-orange); }
.emp-stat-blue { color: var(--info); }
.emp-stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.emp-stat-desktop-only { display: none; }
.emp-stat-clickable { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.emp-stat-clickable:hover { border-color: var(--text-muted); }
.emp-stat-clickable.active { border-color: var(--accent-teal); box-shadow: 0 0 0 1px var(--accent-teal); }

/* --- Detail page (Team / Department) --- */
.detail-subtitle { font-size: 13px; color: var(--text-muted); padding: 0 0 12px; }
.detail-stats-row {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px;
}
.detail-stat-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    padding: 12px 16px; display: flex; flex-direction: column; gap: 2px;
}
.detail-stat-value { font-size: 24px; font-weight: 700; }
.detail-stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.detail-stat-green { color: var(--success); }
.detail-stat-orange { color: var(--accent-orange); }
.detail-stat-blue { color: var(--info); }

/* Detail: Desktop table */
.detail-desktop-table-wrap { display: none; }
.detail-table { width: 100%; }
.detail-table-head {
    display: flex; padding: 8px 12px; color: var(--text-muted); font-size: 12px; font-weight: 600;
    border-bottom: 1px solid var(--border);
}
.detail-th { flex-shrink: 0; }
.detail-table-row {
    display: flex; align-items: center; padding: 10px 12px;
    border-bottom: 1px solid var(--border); transition: background .15s;
}
.detail-table-row:hover { background: rgba(255,255,255,.03); }
.detail-table-cell { flex-shrink: 0; display: flex; align-items: center; gap: 10px; }
.detail-member-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600; color: #fff; flex-shrink: 0;
}

/* Detail: Head/leader highlight */
.detail-head-badge {
    display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 6px;
    border-radius: 8px; background: var(--accent-teal); color: #fff;
    margin-left: 6px; vertical-align: middle; line-height: 16px;
}
.detail-table-row-head { background: rgba(56, 196, 168, .06); }
.detail-table-row-head:hover { background: rgba(56, 196, 168, .10); }

/* Detail: Mobile cards */
.detail-mobile-list { display: block; }
.detail-member-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    padding: 12px 16px; margin-bottom: 8px; display: flex; align-items: center; gap: 12px;
}
.detail-member-card-head { border-color: var(--accent-teal); background: rgba(56, 196, 168, .06); }
.detail-member-card-info { flex: 1; }
.detail-member-card-name { font-weight: 600; font-size: 14px; }
.detail-member-card-role { font-size: 12px; color: var(--text-muted); }
.detail-member-card-badge { flex-shrink: 0; }

/* Edit modal: members list */
.modal-edit-entity { max-height: 85vh; overflow-y: auto; }
.edit-members-list { max-height: 300px; overflow-y: auto; }
.edit-member-row {
    display: flex; align-items: center; gap: 10px; padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.edit-member-row:last-child { border-bottom: none; }
.edit-member-info { flex: 1; min-width: 0; }
.edit-member-name { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edit-member-role { font-size: 12px; color: var(--text-muted); }
.edit-member-lead-btn {
    font-size: 11px; padding: 2px 8px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--border); background: transparent; color: var(--text-muted);
    transition: all .15s; white-space: nowrap;
}
.edit-member-lead-btn.active {
    background: var(--accent-teal); color: #fff; border-color: var(--accent-teal);
}
.edit-member-remove {
    cursor: pointer; color: var(--error); background: none; border: none;
    font-size: 18px; padding: 4px; line-height: 1; flex-shrink: 0;
}
.modal-footer-actions {
    display: flex; justify-content: space-between; align-items: center; padding-top: 16px;
    border-top: 1px solid var(--border); margin-top: 12px;
}
.edit-members-empty {
    text-align: center; color: var(--text-muted); padding: 16px 0; font-size: 13px;
}

/* Search box */
.emp-search-box {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 0 12px; height: 44px;
    transition: border-color .15s;
}
.emp-search-box:focus-within { border-color: var(--accent-teal); }
.emp-search-box i { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.emp-search-box input {
    flex: 1; background: transparent; border: none; outline: none;
    font-family: inherit; font-size: 14px; color: var(--text-primary);
}
.emp-search-box input::placeholder { color: var(--text-muted); }
.emp-search-mobile { margin-bottom: 14px; }
.emp-search-desktop { width: 240px; }

/* Section label */
.emp-section-label {
    font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600;
    color: var(--text-muted); letter-spacing: 1.5px; margin-bottom: 10px;
}

/* Mobile employee cards */
.emp-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 16px; padding: 16px; margin-bottom: 10px;
    cursor: pointer; transition: border-color .15s;
}
.emp-card:active { border-color: rgba(56,196,168,.3); }
.emp-card-top { display: flex; align-items: center; gap: 12px; }
.emp-card-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0;
}
.emp-card-info { flex: 1; min-width: 0; }
.emp-card-name {
    font-weight: 500; font-size: 15px; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.emp-card-position {
    font-size: 12px; color: var(--text-tertiary); margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.emp-card-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.emp-card-balance-badge {
    padding: 4px 10px; border-radius: 8px;
    background: rgba(56,196,168,.12); color: var(--accent-teal);
    font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600;
}
.emp-card-chevron { color: var(--text-muted); width: 18px; height: 18px; }

/* Info bar inside mobile card */
.emp-card-info-bar {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0;
    background: var(--bg-page); border-radius: 10px; padding: 10px 0;
    margin-top: 12px;
}
.emp-card-info-col { text-align: center; }
.emp-card-info-label {
    font-size: 10px; color: var(--text-muted); margin-bottom: 2px;
}
.emp-card-info-value {
    font-size: 12px; color: var(--text-primary); font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.emp-card-info-value-teal {
    color: var(--accent-teal); font-family: 'JetBrains Mono', monospace; font-weight: 600;
}

/* Route row inside mobile card */
.emp-card-route-row {
    display: flex; align-items: center; gap: 8px;
    background: #1a1730; border-radius: 10px; padding: 8px 12px; margin-top: 8px;
}
.emp-card-route-name {
    flex: 1; font-size: 12px; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.emp-card-route-icon { color: var(--text-muted); width: 14px; height: 14px; flex-shrink: 0; }

/* Desktop employee table */
.emp-desktop-table-wrap { display: none; }
.emp-table {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 16px; overflow: hidden;
}
.emp-table-head {
    display: flex; align-items: center; padding: 0 20px; height: 48px;
    border-bottom: 1px solid var(--border);
}
.emp-th {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    letter-spacing: 0.5px;
}
.emp-table-row {
    display: flex; align-items: center; padding: 0 20px; height: 64px;
    border-bottom: 1px solid var(--border); cursor: pointer;
    transition: background .12s;
}
.emp-table-row:last-child { border-bottom: none; }
.emp-table-row:hover { background: rgba(255,255,255,.03); }
.emp-table-cell { display: flex; align-items: center; }
.emp-row-employee { display: flex; align-items: center; gap: 10px; }
.emp-row-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px; color: #fff; flex-shrink: 0;
}
.emp-row-name-block { min-width: 0; }
.emp-row-name {
    font-weight: 500; font-size: 14px; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.emp-row-dept { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.emp-row-dept-cell, .emp-row-team-cell {
    font-size: 13px; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.emp-row-route { display: flex; flex-direction: column; gap: 4px; }
.emp-row-route-item { display: flex; align-items: center; gap: 6px; }
.emp-row-route-name { font-size: 13px; color: var(--text-secondary); }
.emp-row-balance {
    font-family: 'JetBrains Mono', monospace; font-weight: 700;
    color: var(--accent-teal); font-size: 14px;
}
.emp-row-status-badge {
    display: inline-block; padding: 4px 10px; border-radius: 8px;
    font-size: 11px; font-weight: 600;
}
.emp-status-active { background: rgba(168,224,107,.12); color: var(--success); }
.emp-status-inactive { background: rgba(107,101,153,.12); color: var(--text-muted); }
.emp-row-edit-btn {
    width: 32px; height: 32px; border-radius: 8px; background: var(--bg-muted);
    border: none; display: flex; align-items: center; justify-content: center;
    color: var(--text-tertiary); cursor: pointer; transition: background .15s, color .15s;
}
.emp-row-edit-btn:hover { background: rgba(56,196,168,.12); color: var(--accent-teal); }
.emp-row-edit-btn i { width: 16px; height: 16px; }

/* ===== FAQ CARDS (accordion on top of .card) ===== */
.faq-card { cursor: pointer; transition: border-color .2s; }
.faq-card.expanded { border-color: rgba(56,196,168,.27); }
.faq-card-inactive { opacity: .6; }
.faq-card-chevron {
    width: 18px; height: 18px;
    color: #6b6599;
    transition: transform .2s, color .2s;
    flex-shrink: 0;
}
.faq-card.expanded .faq-card-chevron { transform: rotate(180deg); color: #38c4a8; }
.faq-card-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, margin-top .3s ease;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-muted);
    margin-top: 0;
}
.faq-card.expanded .faq-card-answer { max-height: 200px; margin-top: 12px; }

/* ===== REQUEST STAT CARDS ===== */
.req-stats-row {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 8px; margin-bottom: 14px;
}
.req-stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 14px; padding: 14px;
    display: flex; flex-direction: column; gap: 4px;
}
.req-stat-value {
    font-family: 'JetBrains Mono', monospace; font-weight: 700;
    font-size: 26px; line-height: 1;
}
.req-stat-orange { color: var(--accent-orange); }
.req-stat-green { color: var(--accent-teal); }
.req-stat-red { color: var(--error); }
.req-stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.req-stat-clickable { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.req-stat-clickable:hover { border-color: var(--text-muted); }
.req-stat-clickable.active { border-color: var(--accent-teal); box-shadow: 0 0 0 1px var(--accent-teal); }

/* ===== STATUS SECTION HEADERS (for "Все" view) ===== */
.req-section { margin-bottom: 6px; }
.req-section-header {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 0 6px; margin-bottom: 2px;
}
.req-section-icon {
    width: 14px; height: 14px; flex-shrink: 0; color: var(--text-muted);
}
.req-section-title {
    font-size: 13px; font-weight: 600; color: var(--text-secondary);
}
.req-section-count {
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    background: var(--bg-muted); border-radius: 10px; padding: 1px 8px;
}

/* ===== REQUEST TABS ===== */
.req-tab-bar {
    display: flex;
    background: var(--bg-muted);
    border-radius: 12px;
    padding: 3px;
    gap: 2px;
    margin-bottom: 14px;
}
.req-tab-btn {
    flex: 1;
    padding: 9px 8px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-tertiary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.req-tab-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
}
.req-tab-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px;
    font-size: 10px; font-weight: 700;
    background: rgba(232,168,56,.2); color: var(--accent-orange);
    margin-left: 4px;
    vertical-align: middle;
}
.req-tab-btn.active .req-tab-count {
    background: rgba(56,196,168,.2); color: var(--accent-teal);
}
.req-tab-count:empty { display: none; }
.req-tab-content { display: none; }
.req-tab-content.active { display: block; }

/* ===== REQUEST CARDS ===== */
.req-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 14px; padding: 14px; margin-bottom: 10px;
}
.req-card-top {
    display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.req-card-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0;
}
.req-card-info { flex: 1; min-width: 0; }
.req-card-name {
    font-weight: 600; font-size: 14px; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.req-card-dept {
    font-size: 12px; color: var(--text-muted); margin-top: 2px;
}
.req-card-badge {
    flex-shrink: 0;
}
.req-card-meta {
    display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
    margin-bottom: 10px;
}
.req-card-meta-item {
    display: flex; align-items: center; gap: 4px;
    font-size: 12px; color: var(--text-secondary);
}
.req-card-meta-item i { width: 14px; height: 14px; color: var(--text-muted); }
.req-card-type-label {
    display: inline-block;
    padding: 2px 8px; border-radius: 12px;
    font-size: 10px; font-weight: 600;
    background: rgba(56,196,168,.15); color: var(--accent-teal);
}

/* ===== APPROVAL CHAIN (chips with arrows) ===== */
.approval-chain {
    display: flex; align-items: center; gap: 4px;
    flex-wrap: wrap; margin-top: 8px;
}
.approval-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 10px; border-radius: 8px;
    font-size: 11px; font-weight: 600;
    white-space: nowrap;
}
.approval-chip-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 50%;
    font-size: 9px; font-weight: 700; color: #fff;
}
.approval-chip.approved { background: rgba(56,196,168,.15); color: var(--accent-teal); }
.approval-chip.approved .approval-chip-badge { background: var(--accent-teal); }
.approval-chip.pending { background: rgba(232,168,56,.15); color: var(--accent-orange); }
.approval-chip.pending .approval-chip-badge { background: var(--accent-orange); }
.approval-chip.waiting { background: var(--bg-muted); color: var(--text-muted); }
.approval-chip.waiting .approval-chip-badge { background: var(--text-muted); }
.approval-chip.rejected { background: rgba(232,79,94,.15); color: var(--error); }
.approval-chip.rejected .approval-chip-badge { background: var(--error); }
.approval-chain-arrow {
    color: var(--text-muted); display: flex; align-items: center;
}
.approval-chain-arrow i { width: 14px; height: 14px; }
.approval-chain-step-label {
    font-size: 11px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500;
}

/* ===== ACTION BUTTONS (approve/reject) ===== */
.req-card-actions {
    display: flex; gap: 8px; margin-top: 10px;
}
.req-action-btn {
    flex: 1; display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; padding: 9px 12px; border-radius: 10px;
    border: none; font-family: inherit; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: opacity .15s, transform .1s;
}
.req-action-btn:active { transform: scale(0.97); }
.req-action-btn.approve {
    background: var(--gradient-btn); color: #fff;
}
.req-action-btn.reject {
    background: rgba(232,79,94,.15); color: var(--error);
}
.req-action-btn i { width: 16px; height: 16px; }
.req-action-btn:disabled {
    opacity: .5; cursor: not-allowed;
}

/* ===== REMOTE WORK STAT CARDS ===== */
/* ===== REMOTE WORK STAT CARDS ===== */
.rw-stats-row {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 8px; margin-bottom: 14px;
}
.rw-stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 14px; padding: 14px;
    display: flex; flex-direction: column; gap: 4px;
}
.rw-stat-value {
    font-family: 'JetBrains Mono', monospace; font-weight: 700;
    font-size: 26px; line-height: 1;
}
.rw-stat-orange { color: var(--accent-orange); }
.rw-stat-green { color: var(--accent-teal); }
.rw-stat-red { color: var(--error); }
.rw-stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.rw-stat-clickable { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.rw-stat-clickable:hover { border-color: var(--text-muted); }
.rw-stat-clickable.active { border-color: var(--accent-teal); box-shadow: 0 0 0 1px var(--accent-teal); }

/* ===== REMOTE WORK TABS ===== */
.rw-tab-bar {
    display: flex;
    background: var(--bg-muted);
    border-radius: 12px;
    padding: 3px;
    gap: 2px;
    margin-bottom: 14px;
}
.rw-tab-btn {
    flex: 1;
    padding: 9px 8px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-tertiary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.rw-tab-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
}
.rw-tab-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px;
    font-size: 10px; font-weight: 700;
    background: var(--bg-muted); color: var(--text-muted);
    margin-left: 4px; vertical-align: middle;
}
.rw-tab-btn.active .rw-tab-count {
    background: rgba(56,196,168,.15); color: var(--accent-teal);
}
.rw-tab-count:empty { display: none; }
.rw-tab-content { display: none; }
.rw-tab-content.active { display: block; }

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
    .mobile-tab-bar { display: none !important; }
    .page-back-btn { display: none !important; }
    #page-team-detail .page-back-btn,
    #page-dept-detail .page-back-btn { display: flex !important; }
    .page { padding-bottom: 40px; }
    .faq-card-answer { font-size: 13px; line-height: 1.6; }
    /* Employees: desktop */
    .emp-header-actions { display: flex !important; }
    .emp-mobile-list { display: none !important; }
    .emp-search-mobile { display: none !important; }
    .emp-desktop-table-wrap { display: block; }
    .emp-stat-desktop-only { display: flex; }
    .emp-stats-row { grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
    .emp-stat-card { border-radius: 16px; padding: 20px 24px; gap: 6px; }
    .emp-stat-value { font-size: 36px; }
    /* Detail page: desktop */
    .detail-mobile-list { display: none; }
    .detail-desktop-table-wrap { display: block; }
    .detail-stats-row { gap: 12px; }
    .detail-stat-card { border-radius: 16px; padding: 20px 24px; gap: 6px; }
    .detail-stat-value { font-size: 36px; }
    /* Requests: desktop */
    .req-stats-row { grid-template-columns: repeat(4, 1fr); gap: 12px; }
    .req-stat-card { border-radius: 16px; padding: 18px 22px; gap: 6px; }
    .req-stat-value { font-size: 32px; }
    /* Remote work: desktop */
    .rw-stats-row { grid-template-columns: repeat(4, 1fr); gap: 12px; }
    .rw-stat-card { border-radius: 16px; padding: 18px 22px; gap: 6px; }
    .rw-stat-value { font-size: 32px; }
}
@media (max-width: 767px) {
    .sidebar { display: none; }
    .mobile-tab-bar { display: block; }
    .page { padding: 16px 16px 100px; }
    .page-title { font-size: 18px; }
    #page-more .page-back-btn { display: none; }
    #page-team-detail .page-back-btn,
    #page-dept-detail .page-back-btn { display: flex; }
    .page-header-action-label { display: none; }
    .page-header-action { padding: 6px; min-width: 0; }
    .route-modal-footer { flex-direction: column; }
    .route-modal-footer .route-delete-btn { order: 3; align-self: center; margin-top: 4px; }
    .route-footer-right { width: 100%; }
    .route-footer-right .route-cancel-btn,
    .route-footer-right .route-save-btn { flex: 1; text-align: center; }
    /* Employees: mobile */
    .emp-desktop-table-wrap { display: none !important; }
    .emp-search-desktop { display: none !important; }
    /* Remote work: mobile */
    .rw-stats-row { grid-template-columns: repeat(2, 1fr); }
}
