/**
 * HR Dashboard shell — Phases 1–5
 * (sidebar dashboard + light tables + satellite pages + polish)
 * Loaded after page inline styles on dashboard and related pages.
 */

:root {
    --ds-bg: #f4f5f7;
    --ds-surface: #ffffff;
    --ds-sidebar: #ffffff;
    --ds-border: #e8eaef;
    --ds-text: #1f2937;
    --ds-text-muted: #6b7280;
    --ds-primary: #7c3aed;
    --ds-primary-soft: #f3e8ff;
    --ds-primary-hover: #6d28d9;
    --ds-danger: #dc2626;
    --ds-radius: 12px;
    --ds-radius-sm: 8px;
    --ds-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.04);
    --ds-sidebar-w: 260px;
    --ds-topbar-h: 64px;
    --ds-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* —— Body when shell is active —— */
/* UI is rendered at 90% scale. Viewport units ignore `zoom`, so any box that must
   fill the real screen divides by the same 0.9 — keep the two values in sync. */
body.app-shell-body {
    font-family: var(--ds-font) !important;
    background: var(--ds-bg) !important;
    color: var(--ds-text) !important;
    color-scheme: light !important;
    display: block !important;
    overflow: hidden !important;
    zoom: 0.9;
    height: calc(100vh / 0.9) !important;
    min-height: calc(100vh / 0.9) !important;
}

body.app-shell-body .ambient-bg {
    display: none !important;
}

/* Hide legacy top header + horizontal tabs (replaced by shell) */
body.app-shell-body > .header,
body.app-shell-body .tabs-header.legacy-tabs-header {
    display: none !important;
}

.app-shell {
    display: flex;
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: var(--ds-bg);
}

/* —— Sidebar —— */
.ds-sidebar {
    width: var(--ds-sidebar-w);
    flex-shrink: 0;
    background: var(--ds-sidebar);
    border-right: 1px solid var(--ds-border);
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: transform 0.22s ease;
    overflow: hidden;
    min-height: 0;
}

.ds-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--ds-border);
}

.ds-brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--ds-primary) 0%, #a78bfa 100%);
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ds-brand-text strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--ds-text);
    letter-spacing: -0.02em;
}

.ds-brand-text span {
    display: block;
    font-size: 11px;
    color: var(--ds-text-muted);
    margin-top: 2px;
}

.ds-sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.ds-sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.ds-sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.ds-sidebar-nav::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
}

.ds-sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.ds-nav-section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9ca3af;
    padding: 10px 12px 6px;
}

.ds-sidebar .tab-btn,
.ds-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: #4b5563;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.ds-sidebar .tab-btn:hover,
.ds-nav-link:hover {
    background: #f3f4f6;
    color: var(--ds-text);
}

.ds-sidebar .tab-btn.active,
.ds-sidebar .ds-nav-link.active {
    background: var(--ds-primary-soft);
    color: var(--ds-primary);
    font-weight: 600;
    box-shadow: none;
}

.ds-sidebar .tab-btn.active::after {
    display: none;
}

.ds-nav-ico {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 14px;
    opacity: 0.95;
    flex-shrink: 0;
}

.ds-nav-ico img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
}

.ds-sidebar .tab-btn.active .ds-nav-ico,
.ds-sidebar .ds-nav-link:hover .ds-nav-ico {
    opacity: 1;
}

.ds-sidebar-footer {
    padding: 12px 14px 16px;
    border-top: 1px solid var(--ds-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    min-width: 0;
    overflow: hidden;
}

.ds-client-switch {
    display: flex;
    gap: 6px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 10px;
}

.ds-client-pill {
    flex: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--ds-text-muted);
    padding: 8px 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.ds-client-pill.active {
    background: var(--ds-surface);
    color: var(--ds-primary);
    box-shadow: var(--ds-shadow);
}

.ds-help-card {
    background: linear-gradient(160deg, #f5f3ff 0%, #ede9fe 100%);
    border-radius: var(--ds-radius);
    padding: 14px;
}

.ds-help-card h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--ds-text);
    margin: 0 0 4px;
}

.ds-help-card p {
    font-size: 11px;
    color: var(--ds-text-muted);
    margin: 0 0 10px;
    line-height: 1.4;
}

.ds-help-card a,
.ds-help-card .ds-help-chat-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--ds-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
}

.ds-help-card a:hover,
.ds-help-card .ds-help-chat-btn:hover {
    background: var(--ds-primary-hover);
}

/* —— Main column —— */
.ds-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--ds-bg);
}

.ds-topbar {
    height: var(--ds-topbar-h);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    background: var(--ds-surface);
    border-bottom: 1px solid var(--ds-border);
    z-index: 30;
}

.ds-menu-toggle {
    display: none;
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--ds-text);
}

.ds-topbar-search {
    flex: 1;
    max-width: 380px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 0 8px 0 14px;
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.03);
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.ds-topbar-search:hover {
    background: #eef0f3;
    border-color: #d1d5db;
}

.ds-topbar-search:focus-within {
    background: #fff;
    border-color: #a78bfa;
    box-shadow:
        0 0 0 3px rgba(124, 58, 237, 0.12),
        0 4px 14px rgba(15, 23, 42, 0.06);
}

.ds-topbar-search input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ds-text);
    line-height: 1.3;
    padding: 10px 0;
}

.ds-topbar-search input::placeholder {
    color: #9ca3af;
    font-weight: 450;
}

.ds-topbar-search input::-webkit-search-decoration,
.ds-topbar-search input::-webkit-search-cancel-button,
.ds-topbar-search input::-webkit-search-results-button,
.ds-topbar-search input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.ds-topbar-search .ds-search-clear {
    display: none;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 999px;
    background: #e5e7eb;
    color: #6b7280;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    line-height: 0;
    transition: background 0.15s, color 0.15s;
}

.ds-topbar-search .ds-search-clear:hover {
    background: #d1d5db;
    color: #111827;
}

.ds-topbar-search.has-value .ds-search-clear {
    display: inline-flex;
}

.ds-topbar-search .ds-kbd {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #6b7280;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
    padding: 3px 7px;
    border-radius: 7px;
    flex-shrink: 0;
    line-height: 1.2;
    font-family: inherit;
}

.ds-topbar-search:focus-within .ds-kbd {
    border-color: #ddd6fe;
    color: #7c3aed;
}

.ds-topbar-search .ds-topbar-ico {
    width: 18px;
    height: 18px;
    opacity: 0.95;
}

.ds-topbar-ico {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.ds-icon-btn .ds-topbar-ico {
    width: 24px;
    height: 24px;
}

.ds-icon-btn .ds-chat-topbar-ico {
    width: 30px;
    height: 30px;
}

.ds-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.ds-topbar-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 4px;
}

.ds-topbar-date .input-date {
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    color: var(--ds-text);
    font-size: 12px;
    font-family: inherit;
}

.ds-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #4b5563;
    text-decoration: none;
    position: relative;
    font-size: 15px;
}

.ds-icon-btn:hover {
    background: #f9fafb;
    color: var(--ds-text);
}

.ds-icon-btn-static,
.ds-icon-btn-static:hover {
    cursor: default;
    background: var(--ds-surface);
    color: #4b5563;
}

.ds-icon-btn .ds-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--ds-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.app-shell-body .ds-notif-wrap {
    position: relative;
}

body.app-shell-body .ds-notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(360px, calc(100vw - 24px));
    max-height: min(420px, calc(100vh - 120px));
    background: #fff;
    border: 1px solid var(--ds-border);
    border-radius: 12px;
    box-shadow: var(--ds-shadow);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.app-shell-body .ds-notif-panel[hidden] {
    display: none !important;
}

body.app-shell-body .ds-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--ds-border);
    font-size: 13px;
    color: var(--ds-text);
}

body.app-shell-body .ds-notif-mark-all {
    border: none;
    background: transparent;
    color: var(--ds-primary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    padding: 4px 6px;
    border-radius: 6px;
}

body.app-shell-body .ds-notif-mark-all:hover {
    background: var(--ds-primary-soft);
}

body.app-shell-body .ds-notif-list {
    overflow-y: auto;
    padding: 6px 0;
}

body.app-shell-body .ds-notif-empty {
    padding: 20px 14px;
    margin: 0;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
}

body.app-shell-body .ds-notif-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 10px 14px;
    cursor: pointer;
    font-family: inherit;
    border-bottom: 1px solid #f3f4f6;
}

body.app-shell-body .ds-notif-item:last-child {
    border-bottom: none;
}

body.app-shell-body .ds-notif-item:hover {
    background: var(--ds-primary-soft);
}

body.app-shell-body .ds-notif-item-title {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ds-text);
    line-height: 1.35;
}

body.app-shell-body .ds-notif-item-sub {
    display: block;
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}

body.app-shell-body .ds-notif-item-time {
    display: block;
    font-size: 10px;
    color: #9ca3af;
    margin-top: 4px;
}

.ds-topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.ds-topbar-link:hover {
    background: #f9fafb;
}

.ds-topbar-link.primary {
    background: var(--ds-primary);
    border-color: var(--ds-primary);
    color: #fff;
}

.ds-topbar-link.primary:hover {
    background: var(--ds-primary-hover);
}

.ds-chat-now-btn .ds-chat-now-ico {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.ds-user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    max-width: 220px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    color: inherit;
}

.ds-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ds-primary-soft);
    color: var(--ds-primary);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ds-user-meta {
    min-width: 0;
    line-height: 1.25;
}

.ds-user-meta strong {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ds-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ds-user-meta span {
    display: block;
    font-size: 10px;
    color: var(--ds-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ds-page-title-row {
    display: none; /* optional; top search is enough for phase 1 */
}

/* —— Content area hosts existing tabs-container —— */
.ds-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

body.app-shell-body .main-content {
    position: relative !important;
    z-index: 1 !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    overflow: hidden !important;
    min-height: 0 !important;
    height: 100% !important;
}

body.app-shell-body .tabs-container {
    background: transparent !important;
    border-top: none !important;
    flex: 1 !important;
}

body.app-shell-body .dashboard-toolbar {
    background: var(--ds-surface) !important;
    border-bottom: 1px solid var(--ds-border) !important;
    backdrop-filter: none !important;
    width: 100%;
    box-sizing: border-box;
    padding-left: 12px !important;
    padding-right: 12px !important;
}

body.app-shell-body .ds-content,
body.app-shell-body .tabs-container,
body.app-shell-body .main-content {
    width: 100%;
    max-width: none;
}

body.app-shell-body .search-box {
    background: #f3f4f6 !important;
    border: 1px solid var(--ds-border) !important;
}

body.app-shell-body .search-box input {
    color: var(--ds-text) !important;
}

body.app-shell-body .search-box input::placeholder {
    color: #9ca3af !important;
}

body.app-shell-body .refresh-btn {
    background: #fff;
    color: #374151;
    border: 1px solid var(--ds-border);
}

body.app-shell-body .refresh-btn:hover {
    background: #f9fafb;
}

body.app-shell-body .refresh-btn.upload-excel-btn {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

body.app-shell-body .refresh-btn.new-user-toolbar-btn {
    background: var(--ds-primary);
    border-color: var(--ds-primary);
    color: #fff;
}

body.app-shell-body .ds-toolbar-label {
    color: var(--ds-text-muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

body.app-shell-body .ds-toolbar-select,
body.app-shell-body .dashboard-toolbar select {
    padding: 8px 14px;
    padding-right: 36px;
    border-radius: 8px;
    border: 1px solid var(--ds-border) !important;
    background: #fff !important;
    color: var(--ds-text) !important;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    min-width: 140px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' 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") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 14px !important;
}

body.app-shell-body .ds-toolbar-select option,
body.app-shell-body .dashboard-toolbar select option,
body.app-shell-body .modal select option {
    background: #fff !important;
    color: #111827 !important;
}

body.app-shell-body .onboarding-status-total {
    color: var(--ds-text) !important;
}

body.app-shell-body #leaveSheetEditBtn,
body.app-shell-body #attendanceSheetEditBtn {
    color: #4f46e5;
    background: #eef2ff;
    border-color: #c7d2fe;
}

body.app-shell-body #leaveSheetEditBtn.active,
body.app-shell-body #attendanceSheetEditBtn.active {
    background: #dcfce7 !important;
    border-color: #86efac !important;
    color: #166534 !important;
}

/* User account menu on light top bar */
body.app-shell-body .ds-user-menu-wrap {
    position: relative;
}

body.app-shell-body .ds-user-chip {
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

body.app-shell-body .ds-user-chip:hover {
    background: #f9fafb;
}

body.app-shell-body .ds-user-menu-dropdown {
    background: #fff;
    border: 1px solid var(--ds-border);
    box-shadow: var(--ds-shadow);
}

body.app-shell-body .ds-user-menu-dropdown .user-menu-item {
    color: var(--ds-text);
}

body.app-shell-body .ds-user-menu-dropdown .user-menu-item:hover {
    background: var(--ds-primary-soft);
    color: var(--ds-primary);
}

body.app-shell-body .ds-user-menu-dropdown .user-menu-item-danger {
    color: #b91c1c;
    border-top: 1px solid var(--ds-border);
    margin-top: 4px;
}

body.app-shell-body .ds-user-menu-dropdown .user-menu-item-danger:hover {
    background: #fef2f2;
    color: #991b1b;
}

/* —— Phase 3: Light operational sections (tables, filters, legend) —— */
body.app-shell-body .tab-content {
    background: transparent;
    width: 100%;
    max-width: none;
}

body.app-shell-body .tab-content.active {
    padding: 0 !important;
    overflow: auto;
    background: var(--ds-bg);
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

body.app-shell-body .table-wrapper {
    background: var(--ds-surface) !important;
    border: none !important;
    border-top: 1px solid var(--ds-border) !important;
    border-radius: 0 !important;
    overflow: auto;
    box-shadow: none;
    backdrop-filter: none !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    flex: 1;
    min-height: 0;
}

body.app-shell-body .table-wrapper table {
    color: var(--ds-text);
    width: 100%;
}

body.app-shell-body .table-wrapper th,
body.app-shell-body .table-wrapper table th {
    background: #f8fafc !important;
    color: #64748b !important;
    border-bottom: 1px solid var(--ds-border);
}

body.app-shell-body .table-wrapper table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f1f5f9 !important;
}

body.app-shell-body .table-wrapper td,
body.app-shell-body .table-wrapper table td {
    color: #374151;
    border-bottom: 1px solid #f1f5f9 !important;
}

/* Keep attendance status pill text (set on span) — don't inherit forced gray */
body.app-shell-body .table-wrapper td.day-cell {
    color: inherit;
}

body.app-shell-body .table-wrapper tr:hover td {
    background: #f8fafc;
}

body.app-shell-body .table-wrapper tr:hover td.day-cell {
    background: transparent;
}

body.app-shell-body .table-wrapper tr:hover td.col-emp-id,
body.app-shell-body .table-wrapper tr:hover td.col-emp-name {
    background: #f8fafc !important;
}

body.app-shell-body .employee-name-link,
body.app-shell-body .record-name-link {
    color: var(--ds-primary) !important;
}

body.app-shell-body .employee-name-link:hover,
body.app-shell-body .record-name-link:hover {
    color: var(--ds-primary-hover) !important;
}

body.app-shell-body .table-wrapper th .col-filter {
    background: #fff !important;
    border: 1px solid var(--ds-border) !important;
    color: var(--ds-text) !important;
}

body.app-shell-body .table-wrapper th .col-filter:focus {
    border-color: #c4b5fd !important;
    background: #fff !important;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}

body.app-shell-body .table-wrapper th .col-filter::placeholder {
    color: #9ca3af !important;
}

body.app-shell-body .table-wrapper th .col-filter option {
    background: #fff !important;
    color: #111827 !important;
}

body.app-shell-body .empty-state {
    color: var(--ds-text-muted);
}

body.app-shell-body .empty-state p {
    /* no !important — allow inline error colors (red/amber) to win */
    color: var(--ds-text-muted);
}

body.app-shell-body .empty-state-icon,
body.app-shell-satellite .empty-state-icon {
    width: 96px;
    height: auto;
    max-width: 40vw;
    display: block;
    object-fit: contain;
    margin: 0 auto 4px;
}

body.app-shell-body .spinner {
    border-color: #e9d5ff;
    border-top-color: var(--ds-primary);
}

body.app-shell-body .leave-cell-input {
    background: #fff !important;
    color: var(--ds-text) !important;
    border: 1px solid #a5b4fc !important;
}

body.app-shell-body .leave-edit-mode td.editable-leave-cell {
    outline-color: rgba(124, 58, 237, 0.35);
}

body.app-shell-body .leave-edit-mode td.editable-leave-cell:hover,
body.app-shell-body .attendance-edit-mode td.editable-day-cell:hover {
    background: rgba(124, 58, 237, 0.08) !important;
    outline-color: rgba(124, 58, 237, 0.4);
}

/* Attendance sheet — light sticky cols + legend; keep status pill colors */
body.app-shell-body #attendanceSheetLegend {
    margin: 0 !important;
    padding: 6px 12px !important;
    width: 100%;
    box-sizing: border-box;
    background: var(--ds-surface) !important;
    border: none !important;
    border-bottom: 1px solid var(--ds-border) !important;
    border-radius: 0 !important;
    gap: 4px 8px !important;
}

body.app-shell-body #attendanceSheetLegend .legend-item {
    color: var(--ds-text-muted) !important;
    font-size: 0.62rem !important;
    gap: 4px !important;
}

body.app-shell-body #attendanceSheetLegend .legend-badge {
    padding: 1px 5px !important;
    font-size: 0.58rem !important;
    line-height: 1.35 !important;
    border-radius: 3px !important;
}

body.app-shell-body th.day-col,
body.app-shell-body td.day-cell {
    border-left-color: #f1f5f9 !important;
    min-width: 26px !important;
    max-width: 28px !important;
    width: 28px !important;
    padding: 2px 1px !important;
    vertical-align: middle !important;
}

body.app-shell-body td.day-cell span {
    min-width: 20px !important;
    padding: 1px 3px !important;
    font-size: 0.58rem !important;
    line-height: 1.35 !important;
    border-radius: 3px !important;
}

body.app-shell-body td.day-cell.status-empty span {
    color: #d1d5db !important;
}

body.app-shell-body #attendanceSheetTable table th.col-emp-id,
body.app-shell-body #attendanceSheetTable table td.col-emp-id {
    width: 118px !important;
    min-width: 118px !important;
    max-width: 118px !important;
    font-size: 0.72rem !important;
    padding: 4px 6px !important;
    vertical-align: middle !important;
    background: #fff !important;
    box-shadow: 2px 0 6px rgba(15, 23, 42, 0.06);
}

body.app-shell-body #attendanceSheetTable table th.col-emp-name,
body.app-shell-body #attendanceSheetTable table td.col-emp-name {
    left: 118px !important;
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
    font-size: 0.72rem !important;
    padding: 4px 6px !important;
    vertical-align: middle !important;
    background: #fff !important;
    box-shadow: 2px 0 6px rgba(15, 23, 42, 0.06);
}

body.app-shell-body #attendanceSheetTable table thead th.col-emp-id,
body.app-shell-body #attendanceSheetTable table thead th.col-emp-name {
    background: #f1f5f9 !important;
    z-index: 5;
}

body.app-shell-body th.agg-col {
    background: #faf5ff !important;
    border-left-color: #c4b5fd !important;
    color: #6d28d9 !important;
    font-size: 0.58rem !important;
    padding: 2px 4px !important;
    min-width: 36px !important;
}

body.app-shell-body .table-wrapper td.agg-cell {
    background: #fafafa !important;
    border-left-color: #e5e7eb !important;
    font-size: 0.68rem !important;
    padding: 2px 4px !important;
}

body.app-shell-body .table-wrapper tr:hover td.agg-cell {
    background: #f3f4f6 !important;
}

body.app-shell-body #attendanceSheetTable table th.col-actions,
body.app-shell-body #attendanceSheetTable table td.col-actions {
    background: #fff !important;
    border-left-color: #c4b5fd !important;
    min-width: 56px !important;
    width: 56px !important;
    padding: 2px 4px !important;
}

/* Status badges — readable on white tables */
body.app-shell-body .status-badge.status-pending,
body.app-shell-body .status-badge.pending {
    background: #fffbeb !important;
    color: #b45309 !important;
    border-color: #fcd34d !important;
    box-shadow: none !important;
}

body.app-shell-body .status-badge.status-in-progress,
body.app-shell-body .status-badge.status-submitted {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border-color: #93c5fd !important;
    box-shadow: none !important;
}

body.app-shell-body .status-badge.status-completed,
body.app-shell-body .status-badge.approved,
body.app-shell-body .status-badge.status-paid,
body.app-shell-body .status-badge.paid,
body.app-shell-body .status-badge.reimbursed {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border-color: #6ee7b7 !important;
    box-shadow: none !important;
}

body.app-shell-body .status-badge.status-expired,
body.app-shell-body .status-badge.rejected,
body.app-shell-body .status-badge.status-not-started {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border-color: #fca5a5 !important;
    box-shadow: none !important;
}

body.app-shell-body .hr-approval-status-dropdown {
    background: #fff !important;
    border: 1px solid var(--ds-border) !important;
    color: var(--ds-text) !important;
}

body.app-shell-body .hr-approval-status-dropdown.status-pending {
    background: #fffbeb !important;
    color: #b45309 !important;
}

body.app-shell-body .hr-approval-status-dropdown.status-approve {
    background: #ecfdf5 !important;
    color: #047857 !important;
}

body.app-shell-body .hr-approval-status-dropdown.status-reject {
    background: #fef2f2 !important;
    color: #b91c1c !important;
}

body.app-shell-body .filter-count {
    background: var(--ds-primary-soft);
    color: var(--ds-primary);
}

/* Onboarding status cards */
body.app-shell-body #onboardingStatusContainer,
body.app-shell-body #invitationsTable {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
}

body.app-shell-body #attendance-sheet.tab-content.active {
    display: flex;
    flex-direction: column;
}

body.app-shell-body #attendanceSheetTable {
    min-width: 100%;
}

body.app-shell-body .onboarding-record-card {
    background: var(--ds-surface) !important;
    border: 1px solid var(--ds-border) !important;
    box-shadow: var(--ds-shadow);
}

body.app-shell-body .onboarding-record-card:hover {
    background: #fafafa !important;
    border-color: #c4b5fd !important;
}

body.app-shell-body .record-title h4 {
    color: var(--ds-text) !important;
}

body.app-shell-body .detail-value {
    color: #374151 !important;
}

body.app-shell-body .record-footer {
    border-top-color: var(--ds-border) !important;
}

body.app-shell-body .view-details-btn,
body.app-shell-body .resend-inv-btn,
body.app-shell-body .delete-inv-btn,
body.app-shell-body .change-emp-id-btn {
    background: #fff !important;
    border: 1px solid var(--ds-border) !important;
    color: #374151 !important;
}

body.app-shell-body .view-details-btn {
    background: var(--ds-primary-soft) !important;
    border-color: #c4b5fd !important;
    color: var(--ds-primary) !important;
}

body.app-shell-body .view-details-btn:hover {
    background: #ede9fe !important;
    border-color: #a78bfa !important;
    color: var(--ds-primary-hover) !important;
}

body.app-shell-body .resend-inv-btn {
    background: #eff6ff !important;
    border-color: #93c5fd !important;
    color: #1d4ed8 !important;
}

body.app-shell-body .delete-inv-btn {
    background: #fef2f2 !important;
    border-color: #fca5a5 !important;
    color: #b91c1c !important;
}

body.app-shell-body .onboarding-status.status-submitted {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border-color: #6ee7b7 !important;
}

body.app-shell-body .onboarding-status.status-in-progress {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
}

body.app-shell-body .onboarding-status.status-pending,
body.app-shell-body .onboarding-status.status-other {
    background: #fffbeb !important;
    color: #b45309 !important;
}

/* Dark modals stay on their own dark styles (table light rules are scoped to .table-wrapper only) */

/* —— Phase 2: Home overview —— */
body.app-shell-body #home.tab-content.active {
    padding: 12px 12px 16px !important;
    overflow: auto;
    background: var(--ds-bg);
}

.ds-home {
    width: 100%;
    max-width: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
}

.ds-home-loading,
.ds-home-error {
    padding: 32px 16px;
    text-align: center;
    color: var(--ds-text-muted);
    font-size: 14px;
}

.ds-home-error {
    color: #b91c1c;
}

.ds-home-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.ds-topbar-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    min-width: 0;
    max-width: 240px;
    padding-right: 4px;
    border-right: 1px solid var(--ds-border);
    margin-right: 4px;
}

.ds-topbar-title strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--ds-text);
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ds-topbar-title span {
    font-size: 11px;
    color: var(--ds-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ds-home-hero h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--ds-text);
    letter-spacing: -0.02em;
}

.ds-home-hero p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--ds-text-muted);
}

.ds-home-toolbar-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ds-home-toolbar-title strong {
    font-size: 14px;
    color: var(--ds-text);
}

.ds-home-toolbar-title span {
    font-size: 12px;
    color: var(--ds-text-muted);
}

.ds-kpi-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.ds-kpi-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    padding: 14px 16px;
    box-shadow: var(--ds-shadow);
    min-width: 0;
}

.ds-kpi-card .ds-kpi-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--ds-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ds-kpi-card .ds-kpi-value {
    margin-top: 6px;
    font-size: 24px;
    font-weight: 700;
    color: var(--ds-text);
    letter-spacing: -0.03em;
}

.ds-kpi-card .ds-kpi-hint {
    margin-top: 4px;
    font-size: 11px;
    color: var(--ds-text-muted);
}

.ds-home-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
}

.ds-home-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    box-shadow: var(--ds-shadow);
    padding: 16px;
    min-width: 0;
}

.ds-home-card h3 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ds-text);
}

.ds-home-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.ds-home-card-head h3 {
    margin: 0;
}

.ds-home-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--ds-primary);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.ds-home-link:hover {
    text-decoration: underline;
}

.ds-home-chart-wrap {
    position: relative;
    height: 220px;
}

.ds-home-quick-below {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--ds-border);
}

.ds-home-quick-below h3 {
    margin: 0 0 12px;
}

.ds-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.ds-quick-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--ds-border);
    background: #fafafa;
    color: var(--ds-text);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
}

.ds-quick-btn img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.ds-quick-btn:hover {
    background: var(--ds-primary-soft);
    border-color: #ddd6fe;
    color: var(--ds-primary);
}

.ds-activity-list,
.ds-people-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 280px;
    overflow: auto;
}

.ds-activity-list li,
.ds-people-list li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13px;
}

/* Activity rows are a single line: dot, label, then the time on the right */
.ds-activity-list li {
    align-items: center;
    gap: 8px;
}

.ds-activity-list .ds-activity-text {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ds-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ds-activity-list .ds-activity-time {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--ds-text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ds-activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--ds-primary);
}

.ds-activity-dot.leave { background: #f59e0b; }
.ds-activity-dot.check_in { background: #10b981; }

.ds-activity-list strong,
.ds-people-list strong {
    display: block;
    font-weight: 600;
    color: var(--ds-text);
}

.ds-activity-list span,
.ds-people-list span {
    color: var(--ds-text-muted);
    font-size: 12px;
}

.ds-preview-table-wrap {
    overflow: auto;
}

.ds-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.ds-preview-table th,
.ds-preview-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--ds-border);
    text-align: center;
    white-space: nowrap;
}

.ds-preview-table th:first-child,
.ds-preview-table td:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    background: var(--ds-surface);
    font-weight: 600;
    color: var(--ds-text);
}

.ds-preview-table th {
    color: var(--ds-text-muted);
    font-weight: 600;
}

.ds-preview-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    background: #f3f4f6;
    color: #4b5563;
}

.ds-preview-pill.is-present { background: #dcfce7; color: #166534; }
.ds-preview-pill.is-present-short { background: #fef9c3; color: #854d0e; }
.ds-preview-pill.is-absent { background: #fee2e2; color: #991b1b; }
.ds-preview-pill.is-leave { background: #ffedd5; color: #9a3412; }
.ds-preview-pill.is-off { background: #e5e7eb; color: #6b7280; }

.ds-home-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ds-empty-inline {
    color: var(--ds-text-muted);
    font-size: 13px;
    padding: 8px 0;
}

@media (max-width: 1100px) {
    .ds-kpi-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .ds-home-grid,
    .ds-home-two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .ds-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .ds-quick-actions {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
.ds-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 35;
}

body.sidebar-open .ds-sidebar-backdrop {
    display: block;
}

@media (max-width: 960px) {
    .ds-menu-toggle {
        display: inline-flex;
    }

    .ds-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-105%);
        box-shadow: var(--ds-shadow);
    }

    body.sidebar-open .ds-sidebar {
        transform: translateX(0);
    }

    .ds-topbar-link span.ds-hide-sm {
        display: none;
    }

    .ds-user-meta {
        display: none;
    }

    .ds-topbar-search {
        max-width: none;
    }

    .ds-topbar-title {
        display: none;
    }

    .ds-topbar-date {
        display: none;
    }

    .ds-kbd {
        display: none;
    }
}

/* ==========================================================================
   Phase 4 — Satellite pages (record-detail, profile, analytics, create-user,
   onboarding polish). Use body.app-shell-satellite — NOT app-shell-body
   (that class hides .header for the sidebar dashboard).
   ========================================================================== */

body.app-shell-satellite {
    font-family: var(--ds-font) !important;
    background: var(--ds-bg) !important;
    color: var(--ds-text) !important;
    color-scheme: light !important;
    zoom: 0.9;
    height: auto !important;
    min-height: calc(100vh / 0.9) !important;
}

body.app-shell-satellite .ambient-bg {
    display: none !important;
}

body.app-shell-satellite .header {
    background: var(--ds-surface) !important;
    border-bottom: 1px solid var(--ds-border) !important;
    backdrop-filter: none !important;
}

body.app-shell-satellite .header-title h1,
body.app-shell-satellite .header-title h1 a {
    color: var(--ds-text) !important;
}

body.app-shell-satellite .header-title p {
    color: var(--ds-text-muted) !important;
}

body.app-shell-satellite .logo {
    background: linear-gradient(135deg, var(--ds-primary) 0%, #a78bfa 100%) !important;
}

body.app-shell-satellite .back-btn {
    background: #fff !important;
    color: #374151 !important;
    border: 1px solid var(--ds-border) !important;
}

body.app-shell-satellite .back-btn:hover {
    background: #f9fafb !important;
    color: var(--ds-text) !important;
}

body.app-shell-satellite .back-btn.hdr-primary {
    background: var(--ds-primary) !important;
    border-color: var(--ds-primary) !important;
    color: #fff !important;
}

body.app-shell-satellite .back-btn.hdr-primary:hover {
    background: var(--ds-primary-hover) !important;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25);
}

body.app-shell-satellite .main,
body.app-shell-satellite .main-content {
    position: relative;
    z-index: 1;
}

/* Shared cards / sections */
body.app-shell-satellite .hero,
body.app-shell-satellite .profile-hero,
body.app-shell-satellite .section,
body.app-shell-satellite .form-card,
body.app-shell-satellite .stat-card,
body.app-shell-satellite .analytics-panel,
body.app-shell-satellite .leave-detail-total-card,
body.app-shell-satellite .onboarding-card {
    background: var(--ds-surface) !important;
    border: 1px solid var(--ds-border) !important;
    box-shadow: var(--ds-shadow);
    backdrop-filter: none !important;
}

body.app-shell-satellite .hero h2,
body.app-shell-satellite .profile-hero h2,
body.app-shell-satellite .form-card-header h2,
body.app-shell-satellite .page-header h1,
body.app-shell-satellite .page-header h2 {
    color: var(--ds-text) !important;
}

body.app-shell-satellite .hero p,
body.app-shell-satellite .profile-hero .meta,
body.app-shell-satellite .form-card-header p,
body.app-shell-satellite .section-note,
body.app-shell-satellite .page-header p {
    color: var(--ds-text-muted) !important;
}

body.app-shell-satellite .section h3,
body.app-shell-satellite .analytics-panel h3,
body.app-shell-satellite .leave-detail-total-card h4 {
    color: var(--ds-primary) !important;
}

body.app-shell-satellite .info-item .label,
body.app-shell-satellite .info-label,
body.app-shell-satellite .leave-card-metric .m-label {
    color: var(--ds-text-muted) !important;
}

body.app-shell-satellite .info-item .value,
body.app-shell-satellite .info-value,
body.app-shell-satellite .leave-card-metric .m-value {
    color: var(--ds-text) !important;
}

body.app-shell-satellite .profile-hero .badge {
    background: var(--ds-primary-soft) !important;
    color: var(--ds-primary) !important;
    border-color: #c4b5fd !important;
}

body.app-shell-satellite .btn-cancel {
    background: #fff !important;
    color: #374151 !important;
    border: 1px solid var(--ds-border) !important;
}

body.app-shell-satellite .btn-cancel:hover {
    background: #f9fafb !important;
}

body.app-shell-satellite .btn-edit {
    background: var(--ds-primary) !important;
    color: #fff !important;
}

body.app-shell-satellite .edit-input {
    background: #fff !important;
    color: var(--ds-text) !important;
    border: 1px solid var(--ds-border) !important;
}

body.app-shell-satellite .edit-input:focus {
    border-color: #c4b5fd !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12) !important;
}

body.app-shell-satellite .spinner {
    border-color: #e9d5ff !important;
    border-top-color: var(--ds-primary) !important;
}

body.app-shell-satellite .loading,
body.app-shell-satellite .analytics-empty {
    color: var(--ds-text-muted) !important;
}

body.app-shell-satellite .toast {
    background: #fff !important;
    color: var(--ds-text) !important;
    border: 1px solid var(--ds-border) !important;
    box-shadow: var(--ds-shadow) !important;
}

body.app-shell-satellite .toast.success { color: #047857 !important; border-color: #6ee7b7 !important; }
body.app-shell-satellite .toast.error { color: #b91c1c !important; border-color: #fca5a5 !important; }

/* Analytics */
body.app-shell-satellite .stat-card:hover,
body.app-shell-satellite .analytics-panel:hover {
    background: #fafafa !important;
    border-color: #c4b5fd !important;
}

body.app-shell-satellite .refresh-btn {
    background: #fff !important;
    color: #374151 !important;
    border: 1px solid var(--ds-border) !important;
}

body.app-shell-satellite .refresh-btn:hover {
    background: #f9fafb !important;
}

body.app-shell-satellite .client-menu-btn {
    background: #fff !important;
    color: #374151 !important;
    border: 1px solid var(--ds-border) !important;
}

body.app-shell-satellite .client-menu-btn strong {
    color: var(--ds-primary) !important;
}

body.app-shell-satellite .client-menu-btn:hover,
body.app-shell-satellite .client-menu-btn[aria-expanded="true"] {
    background: #f9fafb !important;
    color: var(--ds-text) !important;
}

body.app-shell-satellite .client-menu-dropdown {
    background: #fff !important;
    border: 1px solid var(--ds-border) !important;
    box-shadow: var(--ds-shadow) !important;
}

body.app-shell-satellite .client-menu-item {
    color: var(--ds-text) !important;
}

body.app-shell-satellite .client-menu-item:hover,
body.app-shell-satellite .client-menu-item.active {
    background: var(--ds-primary-soft) !important;
    color: var(--ds-primary) !important;
}

body.app-shell-satellite .analytics-bar-track {
    background: #e5e7eb !important;
}

body.app-shell-satellite .analytics-login-table th {
    background: #f1f5f9 !important;
    color: #64748b !important;
}

body.app-shell-satellite .analytics-login-table td {
    color: var(--ds-text) !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

body.app-shell-satellite .stat-card .stat-value,
body.app-shell-satellite .stat-value {
    color: var(--ds-text) !important;
}

body.app-shell-satellite .stat-label {
    color: var(--ds-text-muted) !important;
}

/* Create HR user form */
body.app-shell-satellite .input-group label {
    color: var(--ds-text-muted) !important;
}

body.app-shell-satellite .input-group input,
body.app-shell-satellite .input-group select,
body.app-shell-satellite .input-group textarea {
    background: #fff !important;
    color: var(--ds-text) !important;
    border: 1px solid var(--ds-border) !important;
}

body.app-shell-satellite .input-group input:focus,
body.app-shell-satellite .input-group select:focus,
body.app-shell-satellite .input-group textarea:focus {
    border-color: #c4b5fd !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12) !important;
}

body.app-shell-satellite .input-group select option {
    background: #fff !important;
    color: #111827 !important;
}

body.app-shell-satellite .input-group input.readonly-field {
    background: #f3f4f6 !important;
    color: #6b7280 !important;
}

body.app-shell-satellite .btn-submit {
    background: var(--ds-primary) !important;
    border-color: var(--ds-primary) !important;
    color: #fff !important;
}

body.app-shell-satellite .btn-secondary {
    background: #fff !important;
    color: #374151 !important;
    border: 1px solid var(--ds-border) !important;
}

body.app-shell-satellite .btn-secondary:hover {
    background: #f9fafb !important;
    border-color: #ddd6fe !important;
}

body.app-shell-satellite .status-submitted {
    background: #ecfdf5 !important;
    color: #047857 !important;
}

body.app-shell-satellite .empty-onboarding-section {
    background: #fafafa !important;
    border-color: #e5e7eb !important;
}

/* Record detail — leave / attendance sub-cards */
body.app-shell-satellite .leave-month-block,
body.app-shell-satellite .att-day,
body.app-shell-satellite .att-summary-card {
    background: #f8fafc !important;
    border: 1px solid var(--ds-border) !important;
}

body.app-shell-satellite .leave-month-title,
body.app-shell-satellite .leave-month-types .lt-used,
body.app-shell-satellite .att-summary-card .value {
    color: var(--ds-text) !important;
}

body.app-shell-satellite .leave-month-types li {
    background: #fff !important;
    border: 1px solid var(--ds-border) !important;
    color: var(--ds-text) !important;
}

body.app-shell-satellite .leave-month-types .lt-label,
body.app-shell-satellite .att-summary-card .label,
body.app-shell-satellite .att-analysis-note,
body.app-shell-satellite .att-day .d {
    color: var(--ds-text-muted) !important;
}

body.app-shell-satellite .leave-card-divider {
    background: var(--ds-border) !important;
}

body.app-shell-satellite .att-summary-card.hours .value { color: #047857 !important; }
body.app-shell-satellite .att-summary-card.required .value { color: #1d4ed8 !important; }
body.app-shell-satellite .att-summary-card.avg .value { color: #a16207 !important; }
body.app-shell-satellite .att-summary-card.surplus .value { color: #047857 !important; }
body.app-shell-satellite .att-summary-card.deficit .value { color: #b91c1c !important; }
body.app-shell-satellite .leave-card-metric.balance .m-value { color: #047857 !important; }

body.app-shell-satellite .att-detail-table th {
    color: var(--ds-primary) !important;
    border-bottom-color: var(--ds-border) !important;
    background: #f8fafc !important;
}

body.app-shell-satellite .att-detail-table td {
    color: var(--ds-text) !important;
    border-bottom-color: #f1f5f9 !important;
}

body.app-shell-satellite .att-detail-table tbody tr:hover {
    background: #f8fafc !important;
}

/* Employee profile — docs + edit fields (keep dark modals as-is) */
body.app-shell-satellite .doc-card {
    background: #fff !important;
    border: 1px solid var(--ds-border) !important;
}

body.app-shell-satellite .doc-card:hover {
    background: #f9fafb !important;
    border-color: #c4b5fd !important;
}

body.app-shell-satellite .doc-label {
    color: var(--ds-text) !important;
}

body.app-shell-satellite .form-field label {
    color: var(--ds-text-muted) !important;
}

body.app-shell-satellite .form-field input,
body.app-shell-satellite .form-field select,
body.app-shell-satellite .form-field textarea {
    background: #fff !important;
    color: var(--ds-text) !important;
    border: 1px solid var(--ds-border) !important;
    color-scheme: light !important;
}

body.app-shell-satellite .form-field select option {
    background: #fff !important;
    color: #111827 !important;
}

/* Create HR user — setup lists / location selects */
body.app-shell-satellite .setup-block-title {
    color: var(--ds-text) !important;
}

body.app-shell-satellite .setup-block + .setup-block,
body.app-shell-satellite .setup-card .master-list-section + .master-list-section,
body.app-shell-satellite .form-card-header {
    border-color: var(--ds-border) !important;
}

body.app-shell-satellite .form-card-header {
    background: linear-gradient(180deg, #f5f3ff 0%, #fff 100%) !important;
}

body.app-shell-satellite .location-manage-row select {
    background-color: #fff !important;
    color: var(--ds-text) !important;
    border: 1px solid var(--ds-border) !important;
}

body.app-shell-satellite .btn-delete-loc {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border-color: #fca5a5 !important;
}

/* Onboarding wizard — remap tokens + fix hardcoded dark option menus */
body.app-shell-satellite {
    --ob-bg: #f4f5f7;
    --ob-surface: #ffffff;
    --ob-surface-2: #f8fafc;
    --ob-border: #e8eaef;
    --ob-text: #1f2937;
    --ob-muted: #6b7280;
    --ob-accent: #7c3aed;
    --ob-accent-2: #6d28d9;
}

body.app-shell-satellite .header-title h1 {
    color: var(--ds-text) !important;
}

body.app-shell-satellite .form-group select option {
    background: #fff !important;
    color: #111827 !important;
}

body.app-shell-satellite .form-group input.readonly-field {
    background: #f3f4f6 !important;
    color: #6b7280 !important;
    border-color: var(--ds-border) !important;
}

/* ==========================================================================
   Phase 5 — Polish: focus rings, empty/loading states
   ========================================================================== */

body.app-shell-body :focus-visible,
body.app-shell-satellite :focus-visible {
    outline: 2px solid #c4b5fd;
    outline-offset: 2px;
}

body.app-shell-body .ds-sidebar .tab-btn:focus-visible,
body.app-shell-body .ds-client-pill:focus-visible,
body.app-shell-body .ds-topbar-link:focus-visible,
body.app-shell-body .ds-icon-btn:focus-visible,
body.app-shell-body .ds-user-chip:focus-visible,
body.app-shell-satellite .back-btn:focus-visible {
    outline: 2px solid var(--ds-primary);
    outline-offset: 2px;
}

body.app-shell-body .ds-topbar-search:focus-within {
    outline: none;
}

body.app-shell-body .empty-state,
body.app-shell-satellite .empty-state,
body.app-shell-body .table-loading-state,
body.app-shell-body .table-wrapper.loading,
body.app-shell-body .table-wrapper .loading {
    color: var(--ds-text-muted);
}

body.app-shell-body .table-wrapper .empty-state {
    background: transparent;
}

body.app-shell-body .table-wrapper > p[style*="color:#f87171"],
body.app-shell-body .table-wrapper > p[style*="color: #f87171"] {
    color: #b91c1c !important;
}

body.app-shell-body .ds-sidebar-nav .tab-btn[aria-current="page"],
body.app-shell-body .ds-sidebar .tab-btn.active {
    outline: none;
}

/* —— In-dashboard Chat popup —— */
.ds-chat-popup {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1200;
    width: min(420px, calc(100vw - 24px));
    height: min(640px, calc(100vh - 40px));
    pointer-events: none;
}

.ds-chat-popup:not([hidden]) {
    pointer-events: auto;
}

.ds-chat-popup[hidden] {
    display: none !important;
}

.ds-chat-popup-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    animation: dsChatPopIn 0.18s ease-out;
}

@keyframes dsChatPopIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.ds-chat-popup-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--ds-border);
    background: linear-gradient(180deg, #faf7ff 0%, #fff 100%);
}

.ds-chat-popup-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ds-chat-popup-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: contain;
    background: #f3e8ff;
    padding: 4px;
    flex-shrink: 0;
}

.ds-chat-popup-header strong {
    display: block;
    font-size: 14px;
    color: var(--ds-text);
}

.ds-chat-popup-header span {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: var(--ds-text-muted);
    line-height: 1.35;
}

.ds-chat-popup-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.ds-chat-popup-icon {
    border: 1px solid var(--ds-border);
    background: #fff;
    color: #4b5563;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.ds-chat-popup-icon:hover {
    background: #f9fafb;
    color: var(--ds-text);
}

.ds-chat-popup-close {
    padding: 6px 9px;
    line-height: 1;
}

.ds-chat {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--ds-bg);
}

.ds-chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
}

.ds-chat-welcome {
    margin: auto 0;
    max-width: 520px;
    align-self: center;
    text-align: center;
    padding: 24px 16px;
}

.ds-chat-welcome-ico {
    width: 56px;
    height: 56px;
    object-fit: contain;
    margin: 0 auto 12px;
    display: block;
    border-radius: 14px;
    background: #f3e8ff;
    padding: 8px;
}

.ds-chat-welcome h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--ds-text);
}

.ds-chat-welcome p {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--ds-text-muted);
    line-height: 1.5;
}

.ds-chat-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.ds-chat-hint {
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    color: var(--ds-text);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.ds-chat-hint:hover {
    border-color: #c4b5fd;
    background: var(--ds-primary-soft);
    color: var(--ds-primary);
}

.ds-chat-msg {
    display: flex;
    max-width: 92%;
}

.ds-chat-msg.is-user {
    align-self: flex-end;
}

.ds-chat-msg.is-assistant {
    align-self: flex-start;
}

.ds-chat-bubble {
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ds-text);
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    box-shadow: var(--ds-shadow);
    white-space: normal;
    word-break: break-word;
}

.ds-chat-msg.is-user .ds-chat-bubble {
    background: var(--ds-primary);
    border-color: var(--ds-primary);
    color: #fff;
}

.ds-chat-bubble p {
    margin: 0 0 8px;
}

.ds-chat-bubble p:last-child {
    margin-bottom: 0;
}

.ds-chat-bubble .ds-chat-md-h {
    margin: 12px 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ds-text);
    line-height: 1.35;
}

.ds-chat-bubble .ds-chat-md-h:first-child {
    margin-top: 0;
}

.ds-chat-bubble h2.ds-chat-md-h { font-size: 15px; }
.ds-chat-bubble h3.ds-chat-md-h { font-size: 14px; }
.ds-chat-bubble h4.ds-chat-md-h,
.ds-chat-bubble h5.ds-chat-md-h { font-size: 13px; color: #374151; }

.ds-chat-list {
    margin: 6px 0 10px;
    padding-left: 1.15em;
}

.ds-chat-list li {
    margin: 0 0 4px;
    padding-left: 2px;
}

.ds-chat-list li:last-child {
    margin-bottom: 0;
}

.ds-chat-quote {
    margin: 8px 0;
    padding: 8px 12px;
    border-left: 3px solid #c4b5fd;
    background: #faf7ff;
    border-radius: 0 8px 8px 0;
    color: #4b5563;
}

.ds-chat-quote p {
    margin: 0 0 6px;
}

.ds-chat-quote p:last-child {
    margin-bottom: 0;
}

.ds-chat-hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 12px 0;
}

.ds-chat-code {
    margin: 8px 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #0f172a;
    color: #e2e8f0;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.45;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.ds-chat-code-lang {
    display: block;
    margin-bottom: 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.ds-chat-code code {
    font-family: inherit;
    white-space: pre;
}

.ds-chat-inline-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
    padding: 1px 5px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.ds-chat-msg.is-user .ds-chat-inline-code {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.ds-chat-table-wrap {
    overflow-x: auto;
    margin: 10px 0;
    border-radius: 8px;
    border: 1px solid var(--ds-border);
}

.ds-chat-bubble .ds-chat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
}

.ds-chat-bubble .ds-chat-table th,
.ds-chat-bubble .ds-chat-table td {
    border-bottom: 1px solid #eef2f7;
    padding: 8px 10px;
    text-align: left;
    white-space: nowrap;
}

.ds-chat-bubble .ds-chat-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.ds-chat-bubble .ds-chat-table tr:last-child td {
    border-bottom: none;
}

.ds-chat-bubble a {
    color: var(--ds-primary);
    font-weight: 600;
}

.ds-chat-download {
    display: inline-flex;
    align-items: center;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--ds-primary-soft);
    color: var(--ds-primary) !important;
    text-decoration: none;
    font-size: 13px;
}

.ds-chat-download:hover {
    background: #ede9fe;
}

.ds-chat-typing {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 0 14px 8px;
    font-size: 12px;
    color: var(--ds-text-muted);
}

.ds-chat-typing:not([hidden]) {
    display: flex;
}

.ds-chat-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ds-primary);
    opacity: 0.5;
    animation: dsChatPulse 1s infinite ease-in-out;
}

.ds-chat-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.ds-chat-typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes dsChatPulse {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-2px); }
}

.ds-chat-input-bar {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    padding: 12px;
    background: var(--ds-surface);
    border-top: 1px solid var(--ds-border);
}

.ds-chat-input-bar input {
    flex: 1;
    border: 1px solid var(--ds-border);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ds-text);
    background: #fff;
}

.ds-chat-input-bar input:focus {
    outline: 2px solid #c4b5fd;
    outline-offset: 0;
    border-color: #c4b5fd;
}

.ds-chat-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 12px;
    padding: 0 16px;
    min-width: 88px;
    background: var(--ds-primary);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}

.ds-chat-send:hover {
    background: var(--ds-primary-hover);
}

.ds-chat-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

body.app-shell-body .ds-topbar-link.primary {
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* ==========================================================================
   Light-theme overrides for shared styles.css components used on HR shell pages
   (dashboard / analytics / satellite pages). Scoped so the dark employee chat
   page (index.html) is unaffected.
   ========================================================================== */

body.app-shell-body .invite-modal,
body.app-shell-satellite .invite-modal {
    background: #ffffff;
    border: 1px solid #e8eaef;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.14);
}

body.app-shell-body .invite-modal-header,
body.app-shell-satellite .invite-modal-header {
    border-bottom: 1px solid #e8eaef;
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.06) 0%, transparent 100%);
}

body.app-shell-body .invite-modal-header-text h2,
body.app-shell-satellite .invite-modal-header-text h2 {
    color: #111827;
}

body.app-shell-body .invite-modal-header-text p,
body.app-shell-satellite .invite-modal-header-text p {
    color: #6b7280;
}

body.app-shell-body .invite-modal-close,
body.app-shell-satellite .invite-modal-close {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #6b7280;
}

body.app-shell-body .invite-modal-close:hover,
body.app-shell-satellite .invite-modal-close:hover {
    background: #f1f2f7;
    color: #111827;
    border-color: #d1d5db;
}

body.app-shell-body .invite-modal-body::-webkit-scrollbar-thumb,
body.app-shell-satellite .invite-modal-body::-webkit-scrollbar-thumb {
    background: #d8dae2;
}

body.app-shell-body .invite-card,
body.app-shell-satellite .invite-card {
    background: #f7f8fb;
    border: 1px solid #e8eaef;
}

body.app-shell-body .invite-card-title,
body.app-shell-satellite .invite-card-title {
    color: #111827;
}

body.app-shell-body .invite-field label,
body.app-shell-satellite .invite-field label {
    color: #374151;
}

body.app-shell-body .invite-field .req,
body.app-shell-satellite .invite-field .req {
    color: #7c3aed;
}

body.app-shell-body .invite-field .opt,
body.app-shell-satellite .invite-field .opt,
body.app-shell-body .invite-hint,
body.app-shell-satellite .invite-hint {
    color: #9ca3af;
}

body.app-shell-body .invite-hint.is-valid,
body.app-shell-satellite .invite-hint.is-valid {
    color: #047857;
}

body.app-shell-body .invite-hint.is-invalid,
body.app-shell-satellite .invite-hint.is-invalid {
    color: #b91c1c;
}

body.app-shell-body .invite-field input.invite-resolved-id[readonly],
body.app-shell-satellite .invite-field input.invite-resolved-id[readonly] {
    background-color: #ecfdf5 !important;
    border-color: #a7f3d0;
    color: #065f46 !important;
}

body.app-shell-body .invite-field input.invite-db-value[readonly],
body.app-shell-body .invite-field select.invite-db-value:disabled,
body.app-shell-satellite .invite-field input.invite-db-value[readonly],
body.app-shell-satellite .invite-field select.invite-db-value:disabled {
    background-color: #f0fdf4 !important;
    border-color: #bbf7d0;
    color: #166534 !important;
    opacity: 1;
}

body.app-shell-body .invite-field input,
body.app-shell-body .invite-field select,
body.app-shell-satellite .invite-field input,
body.app-shell-satellite .invite-field select {
    border: 1px solid #e5e7eb;
    background-color: #ffffff !important;
    color: #111827 !important;
}

body.app-shell-body .invite-field input::placeholder,
body.app-shell-satellite .invite-field input::placeholder {
    color: #9ca3af;
}

body.app-shell-body .invite-field input:hover,
body.app-shell-body .invite-field select:hover,
body.app-shell-satellite .invite-field input:hover,
body.app-shell-satellite .invite-field select:hover {
    border-color: #d1d5db;
}

body.app-shell-body .invite-field input:focus,
body.app-shell-body .invite-field select:focus,
body.app-shell-satellite .invite-field input:focus,
body.app-shell-satellite .invite-field select:focus {
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

body.app-shell-body .invite-field select,
body.app-shell-satellite .invite-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

body.app-shell-body .invite-field input:-webkit-autofill,
body.app-shell-body .invite-field input:-webkit-autofill:hover,
body.app-shell-body .invite-field input:-webkit-autofill:focus,
body.app-shell-satellite .invite-field input:-webkit-autofill,
body.app-shell-satellite .invite-field input:-webkit-autofill:hover,
body.app-shell-satellite .invite-field input:-webkit-autofill:focus {
    -webkit-text-fill-color: #111827 !important;
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
}

body.app-shell-body .invite-btn-suggest,
body.app-shell-satellite .invite-btn-suggest {
    border: 1px solid #ddd6fe;
    background: #f5f3ff;
    color: #6d28d9;
}

body.app-shell-body .invite-btn-suggest:hover:not(:disabled),
body.app-shell-satellite .invite-btn-suggest:hover:not(:disabled) {
    background: #ede9fe;
    border-color: #c4b5fd;
}

body.app-shell-body .invite-policy-toggle,
body.app-shell-satellite .invite-policy-toggle {
    border: 1px solid #e8eaef;
    background: #f7f8fb;
}

body.app-shell-body .invite-policy-toggle:hover,
body.app-shell-satellite .invite-policy-toggle:hover {
    border-color: #ddd6fe;
    background: #f5f3ff;
}

body.app-shell-body .invite-policy-toggle input[type="checkbox"],
body.app-shell-satellite .invite-policy-toggle input[type="checkbox"] {
    accent-color: #7c3aed;
}

body.app-shell-body .invite-policy-copy strong,
body.app-shell-satellite .invite-policy-copy strong {
    color: #111827;
}

body.app-shell-body .invite-policy-copy small,
body.app-shell-satellite .invite-policy-copy small {
    color: #6b7280;
}

body.app-shell-body .invite-alert-error,
body.app-shell-satellite .invite-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

body.app-shell-body .invite-alert-success,
body.app-shell-satellite .invite-alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

body.app-shell-body .invite-modal-footer,
body.app-shell-satellite .invite-modal-footer {
    border-top: 1px solid #e8eaef;
    background: #f7f8fb;
}

body.app-shell-body .invite-btn-cancel,
body.app-shell-satellite .invite-btn-cancel {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #374151;
}

body.app-shell-body .invite-btn-cancel:hover,
body.app-shell-satellite .invite-btn-cancel:hover {
    background: #f1f2f7;
}

body.app-shell-body .invite-btn-submit,
body.app-shell-satellite .invite-btn-submit {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

body.app-shell-body .invite-btn-submit:hover:not(:disabled),
body.app-shell-satellite .invite-btn-submit:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.28);
}

body.app-shell-body .modal,
body.app-shell-satellite .modal {
    background-color: rgba(17, 24, 39, 0.42);
}

body.app-shell-body .modal-content,
body.app-shell-satellite .modal-content {
    background: #ffffff;
    border: 1px solid #e8eaef;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.14);
}

body.app-shell-body .user-menu-dropdown,
body.app-shell-satellite .user-menu-dropdown {
    background: #ffffff;
    border: 1px solid #e8eaef;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

body.app-shell-body .user-menu-item,
body.app-shell-satellite .user-menu-item {
    color: #374151;
}

body.app-shell-body .user-menu-item:hover,
body.app-shell-satellite .user-menu-item:hover {
    background: #f3e8ff;
    color: #6d28d9;
}

body.app-shell-body .toast,
body.app-shell-satellite .toast {
    background: #ffffff;
    border: 1px solid #e8eaef;
    color: #111827;
}

body.app-shell-body .input-date,
body.app-shell-satellite .input-date {
    color-scheme: light;
}

body.app-shell-body .toggle-password,
body.app-shell-satellite .toggle-password {
    color: #6b7280;
}

body.app-shell-body .toggle-password:hover,
body.app-shell-satellite .toggle-password:hover {
    color: #111827;
    background: #f1f2f7;
}

/* Top bar search replaces the per-section search box */
body.app-shell-body .dashboard-toolbar .search-box {
    display: none !important;
}

body.app-shell-body .ds-section-heading {
    font-size: 14px;
    font-weight: 700;
    color: var(--ds-text);
    letter-spacing: -0.01em;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Light scrollbars inside home cards and the chat popup */
.ds-activity-list::-webkit-scrollbar,
.ds-people-list::-webkit-scrollbar,
.ds-preview-table-wrap::-webkit-scrollbar,
.ds-chat-messages::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.ds-activity-list::-webkit-scrollbar-track,
.ds-people-list::-webkit-scrollbar-track,
.ds-preview-table-wrap::-webkit-scrollbar-track,
.ds-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ds-activity-list::-webkit-scrollbar-thumb,
.ds-people-list::-webkit-scrollbar-thumb,
.ds-preview-table-wrap::-webkit-scrollbar-thumb,
.ds-chat-messages::-webkit-scrollbar-thumb {
    background: #d8dae2;
    border-radius: 999px;
}

.ds-activity-list::-webkit-scrollbar-thumb:hover,
.ds-people-list::-webkit-scrollbar-thumb:hover,
.ds-preview-table-wrap::-webkit-scrollbar-thumb:hover,
.ds-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #b9bcc7;
}

/* Invitation modal — icon badges on the header and section cards */
.invite-modal-header-lead {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.invite-modal-ico,
.invite-card-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 10px;
    background: #f3e8ff;
    border: 1px solid #e9d5ff;
}

.invite-modal-ico {
    width: 40px;
    height: 40px;
}

.invite-card-ico {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.invite-modal-ico img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}

.invite-card-ico img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    display: block;
}

.invite-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.invite-card-head .invite-card-title {
    margin: 0;
}
