/* ============================================
   ADMIN — Dark ERP console (Private Studio style)
   ============================================ */

.erp-admin,
.admin-shell {
    --erp-bg: #0f172a;
    --erp-bg-elevated: #1e293b;
    --erp-sidebar: #131c2e;
    --erp-card: rgba(30, 41, 59, 0.85);
    --erp-card-border: rgba(148, 163, 184, 0.14);
    --erp-text: #e2e8f0;
    --erp-text-muted: #94a3b8;
    --erp-accent: #3b82f6;
    --erp-accent-glow: rgba(59, 130, 246, 0.35);
    --erp-success: #22c55e;
    --erp-radius-lg: 16px;
    --sidebar-width: 248px;
    --header-height: 64px;
    --admin-surface: var(--erp-card);
    --admin-border: var(--erp-card-border);
    --admin-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    --admin-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --admin-radius: 12px;
}

.admin-shell {
    background: var(--erp-bg);
    color: var(--erp-text);
    min-height: 100vh;
}

.admin-shell .app-layout {
    background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.08), transparent), var(--erp-bg);
}

.admin-shell .main-content {
    background: transparent;
}

.admin-shell .page-content {
    padding: 1.25rem 1.5rem 2rem;
}

/* — Sidebar — */
.admin-shell .sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--erp-sidebar) 0%, #060910 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
}

.admin-shell .sidebar__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.125rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-shell .sidebar__logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 0 20px var(--erp-accent-glow);
}

.admin-shell .sidebar__title {
    font-size: 13px;
    font-weight: 600;
    color: #f8fafc;
    letter-spacing: -0.02em;
}

.admin-shell .sidebar__badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.admin-shell .sidebar__nav-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.55);
    padding: 0.875rem 1rem 0.35rem;
}

.admin-shell .sidebar__link {
    gap: 0.75rem;
    padding: 0.5rem 0.875rem;
    margin: 2px 0.5rem;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(226, 232, 240, 0.75);
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.admin-shell .sidebar__link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f8fafc;
    transform: none;
}

.admin-shell .sidebar__link--active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.05));
    color: #fff;
    box-shadow: inset 3px 0 0 var(--erp-accent);
}

.admin-shell .sidebar__link-icon {
    opacity: 0.85;
    color: #60a5fa;
}

.admin-shell .sidebar__link--active .sidebar__link-icon {
    color: #93c5fd;
}

.admin-shell .sidebar__link-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    flex: 1;
}

.admin-shell .sidebar__link-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.admin-shell .sidebar__link-badge[hidden] {
    display: none;
}

/* — Header — */
.admin-shell .header,
.admin-shell .erp-header {
    height: var(--header-height);
    background: rgba(13, 19, 33, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0 1.25rem;
}

.erp-search {
    display: none;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    max-width: 420px;
    margin-left: 0.75rem;
    padding: 0.5rem 0.875rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

@media (min-width: 900px) {
    .erp-search {
        display: flex;
    }
}

.erp-search__icon {
    color: var(--erp-text-muted);
    display: flex;
}

.erp-search__input {
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--erp-text);
    font-size: 13px;
    outline: none;
}

.erp-search__input::placeholder {
    color: rgba(148, 163, 184, 0.6);
}

.admin-shell .header__user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.admin-shell .header__user-role {
    font-size: 11px;
    color: var(--erp-text-muted);
}

.admin-shell .header__signout {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    background: #dc2626;
    border: 1px solid #f87171;
    white-space: nowrap;
}

.admin-shell .header__signout:hover {
    color: #fff;
    background: #b91c1c;
}

.admin-shell .header__user-avatar {
    background: linear-gradient(135deg, #2563eb, #6366f1);
    box-shadow: 0 0 16px var(--erp-accent-glow);
}

/* — Cards — */
.admin-shell .card,
.admin-shell .erp-card {
    background: var(--erp-card);
    border: 1px solid var(--erp-card-border);
    border-radius: var(--erp-radius-lg);
    box-shadow: var(--admin-shadow);
    color: var(--erp-text);
}

.admin-shell .card__title {
    color: #f8fafc;
    font-size: 1.125rem;
}

.admin-shell .card__subtitle,
.admin-shell .form-hint {
    color: var(--erp-text-muted);
}

.admin-shell .stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--admin-radius);
    padding: 1.125rem;
}

.admin-shell .stat-card__value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #f8fafc;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-shell .stat-card__label {
    color: var(--erp-text-muted);
    font-size: 0.8125rem;
}

.admin-shell .stat-card--highlight {
    border-color: rgba(37, 99, 235, 0.35);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(124, 58, 237, 0.08));
}

.admin-shell .stat-card--highlight .stat-card__value {
    color: #93c5fd;
    background: none;
    -webkit-text-fill-color: #93c5fd;
}

/* — Welcome hero — */
.erp-welcome {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 900px) {
    .erp-welcome {
        grid-template-columns: 1fr auto;
        align-items: stretch;
    }
}

.erp-welcome__main {
    padding: 1.5rem 1.75rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(124, 58, 237, 0.08) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--erp-radius-lg);
}

.erp-welcome__title {
    margin: 0 0 0.5rem;
    font-size: 1.625rem;
    font-weight: 700;
    color: #f8fafc;
}

.erp-welcome__subtitle {
    margin: 0 0 1.25rem;
    color: var(--erp-text-muted);
    font-size: 0.9375rem;
    max-width: 520px;
    line-height: 1.55;
}

.erp-welcome__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.erp-welcome__health {
    padding: 1.25rem 1.5rem;
    background: var(--erp-card);
    border: 1px solid var(--erp-card-border);
    border-radius: var(--erp-radius-lg);
    min-width: 200px;
}

.erp-welcome__health-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--erp-text-muted);
    margin-bottom: 0.5rem;
}

.erp-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.625rem;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--erp-success);
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 999px;
}

.erp-live-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--erp-success);
    box-shadow: 0 0 8px var(--erp-success);
    animation: erp-pulse 2s infinite;
}

@keyframes erp-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

/* — Buttons — */
.admin-shell .btn--primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border: 0;
    box-shadow: 0 4px 16px var(--erp-accent-glow);
}

.admin-shell .btn--secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--erp-text);
}

.admin-shell .btn--secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* — Forms & tables — */
[data-theme="dark"] .admin-shell .form-input,
[data-theme="dark"] .admin-shell .form-select,
[data-theme="dark"] .admin-shell .form-textarea {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--erp-text);
}

[data-theme="dark"] .admin-shell .form-label {
    color: #cbd5e1;
}

[data-theme="dark"] .admin-shell select option,
[data-theme="dark"] .admin-shell .form-select option {
    background-color: #1e293b;
    color: #e2e8f0;
}

[data-theme="light"] .admin-shell .form-input,
[data-theme="light"] .admin-shell .form-select,
[data-theme="light"] .admin-shell .form-textarea {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .admin-shell .form-input:focus,
[data-theme="light"] .admin-shell .form-select:focus,
[data-theme="light"] .admin-shell .form-textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

[data-theme="light"] .admin-shell .form-label {
    color: #334155;
    font-weight: 600;
}

[data-theme="light"] .admin-shell select option,
[data-theme="light"] .admin-shell .form-select option {
    background-color: #ffffff;
    color: #0f172a;
}

[data-theme="light"] .admin-shell .form-checkbox,
[data-theme="light"] .admin-shell .form-checkbox span {
    color: #0f172a;
}

.admin-shell .data-table {
    background: transparent;
}

.admin-shell .data-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--erp-text-muted);
    border-color: rgba(255, 255, 255, 0.06);
}

.admin-shell .data-table td {
    border-color: rgba(255, 255, 255, 0.06);
    color: var(--erp-text);
}

.admin-shell .data-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.06);
}

.admin-shell .admin-section-nav {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 0.35rem;
    margin-bottom: 1.25rem;
}

.admin-shell .admin-section-nav__link {
    color: var(--erp-text-muted);
    border-radius: 8px;
}

.admin-shell .admin-section-nav__link--active {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

/* — Users page — */
.erp-split {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 1024px) {
    .erp-split {
        grid-template-columns: 1fr 320px;
    }
}

.erp-panel {
    background: var(--erp-bg-elevated);
    border: 1px solid var(--erp-card-border);
    border-radius: var(--admin-radius);
    padding: 1.25rem;
}

.erp-panel__title {
    margin: 0 0 1rem;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--erp-text);
}

.user-form-panel__hint {
    margin: -0.5rem 0 1rem;
    font-size: 0.8125rem;
    color: var(--erp-text-muted);
    line-height: 1.45;
}

.user-form-panel .form-input,
.user-form-panel .form-select {
    min-height: 42px;
}

.erp-role-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.erp-role-pill {
    font-size: 11px;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--erp-text-muted);
}

.erp-role-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

.erp-role-badge--admin { background: rgba(124, 58, 237, 0.2); color: #c4b5fd; }
.erp-role-badge--manager { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.erp-role-badge--staff { background: rgba(34, 197, 94, 0.15); color: #86efac; }

.text-muted { color: var(--erp-text-muted); }
.text-sm { font-size: 0.8125rem; }

.code-block {
    display: block;
    margin: 0.5rem 0 0;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    overflow-x: auto;
    color: #e2e8f0;
}

[data-theme="light"] .admin-shell .code-block {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #0f172a;
}

/* — Login — */
.admin-shell.login-page {
    background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(59, 130, 246, 0.12), transparent), var(--erp-bg);
}

.admin-shell .login-card {
    background: var(--erp-card);
    border: 1px solid var(--erp-card-border);
    box-shadow: var(--admin-shadow);
    max-width: 420px;
}

.admin-shell .login-card .card__title {
    color: #f8fafc;
}

/* Legacy component tweaks (shell colors from ERP block above) */

[data-theme="light"] .admin-shell {
    --erp-bg: #f1f5f9;
    --erp-bg-elevated: #f8fafc;
    --erp-card: #ffffff;
    --erp-text: #0f172a;
    --erp-text-muted: #64748b;
    --erp-card-border: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .admin-shell .card,
[data-theme="light"] .admin-shell .erp-card {
    background: #fff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
}

[data-theme="light"] .admin-shell .card__title,
[data-theme="light"] .admin-shell .erp-panel__title {
    color: #0f172a;
}

[data-theme="light"] .admin-shell .card__subtitle,
[data-theme="light"] .admin-shell .form-hint {
    color: #64748b;
}

[data-theme="light"] .admin-shell .erp-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 1px 0 #fff;
}

[data-theme="light"] .admin-shell .erp-role-pill {
    background: #fff;
    border-color: #e2e8f0;
    color: #475569;
}

[data-theme="light"] .admin-shell .data-table th {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

[data-theme="light"] .admin-shell .data-table td {
    color: #0f172a;
    border-color: #e2e8f0;
}

[data-theme="light"] .admin-shell .btn--secondary {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .admin-shell .btn--primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
}

[data-theme="light"] .admin-shell .erp-search {
    background: #fff;
    border-color: #e2e8f0;
}

[data-theme="light"] .admin-shell .erp-search__input {
    color: #0f172a;
}

/* — ERP settings hub — */
.erp-settings-hub {
    margin-bottom: 1.25rem;
}

.erp-settings-hub__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1.25rem;
}

.erp-settings-hub__title {
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #f8fafc;
    margin: 0 0 0.35rem;
}

.erp-settings-hub__subtitle {
    margin: 0;
    max-width: 42rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--erp-text-muted);
}

.erp-settings-hub__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn--sm {
    padding: 0.45rem 0.875rem;
    font-size: 0.8125rem;
}

.erp-settings-hub__maint {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.erp-settings-hub__maint svg {
    width: 16px;
    height: 16px;
}

.erp-settings-sidecard {
    padding: 0.875rem;
    border-radius: var(--erp-border-radius, 16px);
    background: var(--erp-card);
    border: 1px solid var(--erp-card-border);
    box-shadow: var(--admin-shadow-sm);
}

.erp-settings-nav-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.erp-settings-brand {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0 0 0.875rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.erp-settings-brand__logo-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 88px;
    border-radius: 12px;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.02);
}

.erp-settings-brand__logo-slot-label {
    font-size: 0.8125rem;
    color: var(--erp-text-muted);
}

.erp-settings-brand__logo {
    width: 100%;
    max-height: 88px;
    border-radius: 12px;
    object-fit: contain;
    flex-shrink: 0;
}

.erp-settings-brand__logo--fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb, #6366f1);
    color: #fff;
}

.erp-settings-brand__logo--fallback svg {
    width: 22px;
    height: 22px;
}

.erp-settings-brand__name {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #f8fafc;
    line-height: 1.25;
}

.erp-settings-brand__meta {
    margin: 0.125rem 0 0;
    font-size: 0.75rem;
    color: var(--erp-text-muted);
}

[data-theme="light"] .erp-settings-hub__title {
    color: #0f172a;
}

[data-theme="light"] .erp-settings-brand {
    background: #fff;
    border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .erp-settings-brand__name {
    color: #0f172a;
}

/* — System settings status toggles — */
.erp-system-status__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

.erp-system-status__item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 0.875rem;
    border-radius: var(--erp-border-radius, 12px);
    border: 1px solid var(--erp-card-border);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    user-select: none;
}

.erp-system-status__item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.erp-system-status__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #64748b;
    flex-shrink: 0;
    box-shadow: none;
    transition: background 0.15s, box-shadow 0.15s;
}

.erp-system-status__dot--on,
.erp-system-status__item:has(input:checked) .erp-system-status__dot {
    background: #facc15;
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.65);
}

.erp-system-status__label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--erp-text);
}

.erp-system-status__item:has(input:checked) {
    border-color: rgba(250, 204, 21, 0.35);
    background: rgba(250, 204, 21, 0.06);
}

[data-theme="light"] .erp-system-status__item {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .erp-system-status__item:has(input:checked) {
    background: #fffbeb;
    border-color: rgba(234, 179, 8, 0.35);
}

/* — Global UI controls (density + scale) — */
.admin-shell {
    --erp-ui-font-scale: 1;
    --erp-page-padding-y: 1.25rem;
    --erp-card-padding: 20px;
    --erp-input-height: 40px;
    --erp-border-radius: 12px;
    font-size: calc(1rem * var(--erp-ui-font-scale));
}

.admin-shell.erp-ui-scale-default {
    --erp-ui-font-scale: 1;
    --erp-page-padding-y: 1.25rem;
}

.admin-shell.erp-ui-scale-normal-compact {
    --erp-ui-font-scale: 0.97;
    --erp-page-padding-y: 1.0625rem;
}

.admin-shell.erp-ui-scale-compact {
    --erp-ui-font-scale: 0.94;
    --erp-page-padding-y: 0.9375rem;
}

.admin-shell.erp-ui-scale-ultra-compact {
    --erp-ui-font-scale: 0.9;
    --erp-page-padding-y: 0.75rem;
    --sidebar-width: 220px;
    --header-height: 56px;
}

.admin-shell .page-content {
    padding: var(--erp-page-padding-y) 1.5rem 2rem;
}

.admin-shell .card,
.admin-shell .erp-card {
    padding: var(--erp-card-padding);
    border-radius: var(--erp-border-radius);
}

.admin-shell .stat-card {
    border-radius: var(--erp-border-radius);
}

.admin-shell .form-input,
.admin-shell .form-select {
    min-height: var(--erp-input-height);
    border-radius: calc(var(--erp-border-radius) * 0.65);
}

.phone-input {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.phone-input__country {
    flex: 0 0 auto;
    width: min(42%, 11rem);
    min-width: 7.5rem;
}

.phone-input__number {
    flex: 1 1 auto;
    min-width: 0;
}

.admin-shell .btn {
    border-radius: calc(var(--erp-border-radius) * 0.65);
}

.admin-shell.erp-table-density-compact .data-table th,
.admin-shell.erp-table-density-compact .data-table td {
    padding: 0.35rem 0.625rem;
    font-size: 0.8125rem;
}

.admin-shell.erp-table-density-comfortable .data-table th,
.admin-shell.erp-table-density-comfortable .data-table td {
    padding: 0.875rem 1rem;
}

.erp-ui-scale-ultra-compact .sidebar__link,
.erp-ui-scale-compact .sidebar__link {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

.erp-ui-scale-ultra-compact .card__title {
    font-size: 1rem;
}

/* — ERP settings sub-nav — */
.erp-settings-layout {
    display: grid;
    gap: 1.25rem;
    align-items: start;
}

@media (min-width: 900px) {
    .erp-settings-layout {
        grid-template-columns: 220px minmax(0, 1fr);
    }
}

@media (min-width: 900px) {
    .erp-settings-layout {
        grid-template-columns: 260px minmax(0, 1fr);
    }
}

.erp-settings-panel {
    border-radius: var(--erp-border-radius, 16px);
}

.erp-settings-panel .card__title {
    font-size: 1.25rem;
}

.erp-settings-form__grid {
    display: grid;
    gap: 1rem 1.25rem;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .erp-settings-form__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .erp-settings-form__grid .form-group--full {
        grid-column: 1 / -1;
    }
}

.form-label--caps {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--erp-text-muted);
}

.form-select--highlight:focus,
.form-select--highlight {
    border-color: rgba(250, 204, 21, 0.55);
    box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.25);
}

.erp-combobox {
    position: relative;
}

.erp-combobox__icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--erp-text-muted);
    pointer-events: none;
    display: flex;
}

.erp-combobox__icon svg {
    width: 16px;
    height: 16px;
}

.erp-combobox__input {
    padding-left: 2.5rem;
}

.staff-edit-token-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: stretch;
}

.staff-edit-token-row .form-input {
    flex: 1 1 12rem;
    min-width: 0;
}

.staff-edit-form.is-readonly .form-input:disabled,
.staff-edit-form.is-readonly .form-select:disabled,
.staff-edit-form.is-readonly textarea:disabled {
    opacity: 0.85;
    cursor: not-allowed;
}

.btn--gradient-save {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    background: linear-gradient(90deg, #facc15 0%, #c084fc 55%, #a855f7 100%);
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.35);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn--gradient-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(168, 85, 247, 0.45);
}

.erp-settings-advanced {
    margin-top: 1rem;
}

.erp-settings-advanced__summary {
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--erp-text-muted);
    padding: 0.25rem 0;
    list-style: none;
}

.erp-settings-advanced__summary::-webkit-details-marker {
    display: none;
}

.erp-settings-advanced__body {
    margin-top: 1rem;
}

[data-theme="light"] .erp-settings-sidecard {
    background: #fff;
    border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .erp-settings-brand {
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .erp-settings-brand__logo-slot {
    border-color: rgba(15, 23, 42, 0.15);
    background: #f8fafc;
}

.erp-settings-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.erp-settings-nav__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.875rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--erp-text-muted);
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-decoration: none;
}

.erp-settings-nav__link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--erp-text);
}

.erp-settings-nav__link--active {
    background: rgba(124, 58, 237, 0.12);
    border-color: rgba(167, 139, 250, 0.45);
    color: #f8fafc;
    box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.15);
}

.erp-settings-nav__icon {
    display: flex;
    flex-shrink: 0;
    opacity: 0.85;
}

.erp-settings-nav__link--active .erp-settings-nav__icon {
    color: #c4b5fd;
}

.erp-settings-main {
    min-width: 0;
}

[data-theme="light"] .erp-settings-nav__link {
    color: #64748b;
}

[data-theme="light"] .erp-settings-nav__link:hover {
    background: #f1f5f9;
    color: #0f172a;
}

[data-theme="light"] .erp-settings-nav__link--active {
    background: #f5f3ff;
    border-color: #c4b5fd;
    color: #5b21b6;
}

/* — Sidebar (layout only; colors from ERP block) — */

.admin-shell .sidebar__brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 0.875rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.admin-shell .sidebar__logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    box-shadow: none;
}

.admin-shell .sidebar__brand-text {
    min-width: 0;
    flex: 1;
}

.admin-shell .sidebar__title {
    font-size: 13px;
    font-weight: var(--font-weight-semibold);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.admin-shell .sidebar__badge {
    display: inline-block;
    margin-top: 3px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.65);
}

.admin-shell .sidebar__nav {
    flex: 1;
    padding: 0.5rem 0.5rem 0.25rem;
    overflow-y: auto;
}

.admin-shell .sidebar__nav-label {
    font-size: 10px;
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.38;
    padding: 0.625rem 0.625rem 0.25rem;
    margin: 0;
}

.admin-shell .sidebar__nav-label:not(:first-child) {
    margin-top: 0.25rem;
}

.admin-shell .sidebar__nav-label {
    padding: 0.4rem 0.625rem 0.15rem;
    font-size: 9px;
    letter-spacing: 0.1em;
}

.admin-shell .sidebar__link {
    gap: 0.625rem;
    padding: 0.4375rem 0.625rem;
    margin-bottom: 1px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    min-height: 0;
    opacity: 0.78;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.admin-shell .sidebar__link:hover {
    opacity: 1;
    transform: none;
    background: rgba(255, 255, 255, 0.07);
}

.admin-shell .sidebar__link--active {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
    box-shadow: inset 2px 0 0 var(--primary-color);
}

.admin-shell .sidebar__link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.admin-shell .sidebar__link-icon svg {
    width: 17px;
    height: 17px;
}

.admin-shell .sidebar__link--active .sidebar__link-icon {
    background: rgba(37, 99, 235, 0.35);
    color: #fff;
}

.admin-shell .sidebar__bottom {
    padding: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}

.admin-shell .sidebar__quick-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.375rem;
    margin-bottom: 0.375rem;
}

.admin-shell .sidebar__quick-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.375rem 0.5rem;
    border-radius: 6px;
    font-size: 11px;
    font-weight: var(--font-weight-medium);
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: background 0.15s ease, color 0.15s ease;
}

.admin-shell .sidebar__quick-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.admin-shell .sidebar__quick-link svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.admin-shell .sidebar__logout {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.4375rem 0.625rem;
    border-radius: 7px;
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    color: rgba(255, 255, 255, 0.72);
    transition: background 0.15s ease, color 0.15s ease;
}

.admin-shell .sidebar__logout:hover {
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
}

/* — Header — */
.admin-shell .header {
    height: var(--header-height);
    padding: 0 1.25rem;
    background: var(--admin-surface);
    border-bottom: 1px solid var(--admin-border);
    box-shadow: var(--admin-shadow-sm);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.admin-shell .header__page-title {
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.admin-shell .header__icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 34px;
    padding: 0 0.625rem;
    border-radius: 7px;
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--admin-border);
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.admin-shell .header__icon-btn:hover {
    color: var(--primary-color);
    border-color: rgba(37, 99, 235, 0.25);
    background: var(--primary-light);
}

.admin-shell .header__icon-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.admin-shell .header__user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0.625rem 0.2rem 0.2rem;
    border-radius: 999px;
    background: var(--background-color);
    border: 1px solid var(--admin-border);
}

.admin-shell .header__user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: var(--font-weight-bold);
}

.admin-shell .header__user-name {
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    color: var(--text-color);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-shell .theme-toggle {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    font-size: 15px;
    background: transparent;
    border: 1px solid var(--admin-border);
    box-shadow: none;
}

.admin-shell .header__right {
    gap: 0.5rem;
}

/* — Page content — */
.admin-shell .page-content {
    max-width: 1200px;
    padding: 1.25rem;
    padding-bottom: 1.5rem;
}

.admin-shell .page-content > .card + .card,
.admin-shell .page-content > .card + .dashboard-grid,
.admin-shell .page-content > .alert + .card {
    margin-top: 1rem;
}

.admin-shell .footer--admin {
    padding: 0.625rem 1.25rem;
    font-size: 11px;
    color: var(--text-light);
    border-top: 1px solid var(--admin-border);
    background: transparent;
}

/* — Cards — */
.admin-shell .card {
    border: 1px solid var(--admin-border);
    border-radius: var(--erp-border-radius, var(--admin-radius));
    box-shadow: var(--admin-shadow-sm);
    padding: var(--erp-card-padding, 1.125rem 1.25rem);
}

.admin-shell .card__header {
    margin-bottom: 1rem;
}

.admin-shell .card__title {
    font-size: 1.125rem;
    font-weight: var(--font-weight-semibold);
    letter-spacing: -0.02em;
    margin-bottom: 0.125rem;
}

.admin-shell .card__subtitle {
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-muted);
}

/* — Stat cards — */
.admin-shell .stat-grid {
    gap: 0.75rem;
}

.admin-shell .stat-card {
    padding: 0.875rem 1rem;
    border-radius: var(--admin-radius);
    border: 1px solid var(--admin-border);
    box-shadow: none;
}

.admin-shell .stat-card:hover {
    transform: none;
    box-shadow: var(--admin-shadow-sm);
    border-color: rgba(37, 99, 235, 0.15);
}

.admin-shell .stat-card::before {
    height: 2px;
}

.admin-shell .stat-card__value {
    font-size: 1.5rem;
    letter-spacing: -0.03em;
}

.admin-shell .stat-card__label {
    margin-top: 0.25rem;
    font-size: 11px;
}

/* — Buttons — */
.admin-shell .btn {
    font-size: 13px;
    padding: 0.5rem 0.875rem;
    border-radius: calc(var(--erp-border-radius, 12px) * 0.65);
}

.admin-shell .btn--primary {
    background: var(--primary-color);
    box-shadow: none;
    border: none;
}

.admin-shell .btn--primary:hover {
    background: var(--primary-hover);
    filter: none;
}

.admin-shell .btn--secondary {
    background: var(--admin-surface);
    border-color: var(--admin-border);
    box-shadow: none;
}

/* — Tables — */
.admin-shell .table-wrap {
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    box-shadow: none;
}

.admin-shell .data-table th {
    background: rgba(15, 23, 42, 0.025);
    font-size: 10px;
    padding: 0.625rem 0.875rem;
}

[data-theme="dark"] .admin-shell .data-table th {
    background: rgba(255, 255, 255, 0.03);
}

.admin-shell .data-table td {
    padding: 0.625rem 0.875rem;
    font-size: 13px;
}

.admin-shell .data-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.03);
}

/* — Forms — */
.admin-shell .form-label {
    font-size: 13px;
    margin-bottom: 0.35rem;
}

.admin-shell .form-input,
.admin-shell .form-select,
.admin-shell .form-textarea {
    font-size: 13px;
    padding: 0.5rem 0.75rem;
    border-radius: calc(var(--erp-border-radius, 12px) * 0.65);
    box-shadow: none;
}

.admin-shell .form-input,
.admin-shell .form-select {
    min-height: var(--erp-input-height, 40px);
}

.admin-shell .form-section-title {
    font-size: 11px;
    letter-spacing: 0.06em;
    padding-bottom: 0.5rem;
    margin-bottom: 0.875rem;
}

.admin-shell .form-hint {
    font-size: 12px;
    margin-top: 0.35rem;
}

/* Admin forms (style.css is not loaded in the ERP shell) */
.admin-shell .form-grid,
.admin-shell .erp-settings-form__grid {
    display: grid;
    gap: 0.875rem 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .admin-shell .form-grid,
    .admin-shell .erp-settings-form__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.admin-shell .form-grid .form-group--full,
.admin-shell .form-grid .form-section-title,
.admin-shell .form-grid .form-actions,
.admin-shell .erp-settings-form__grid .form-group--full {
    grid-column: 1 / -1;
}

.admin-shell .settings-form,
.admin-shell .erp-settings-form,
.admin-shell .admin-form-compact {
    max-width: 42rem;
    width: 100%;
}

.admin-shell .form-actions,
.admin-shell .form-actions--end {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.admin-shell .form-actions .btn,
.admin-shell .form-actions--end .btn,
.admin-shell .staff-edit-actions-bar .btn {
    width: auto;
    max-width: none;
    flex: 0 0 auto;
}

.admin-shell a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.admin-shell .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-shell .copy-field {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: stretch;
}

.admin-shell .copy-field__input {
    flex: 1 1 12rem;
    min-width: 0;
    font-size: 0.75rem;
    word-break: break-all;
}

.admin-shell .copy-field__btn {
    flex: 0 0 auto;
}

.admin-shell .staff-edit-layout .card__header--row {
    align-items: flex-start;
}

.admin-shell .staff-edit-layout .card__header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.admin-shell .staff-edit-actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--admin-border, rgba(148, 163, 184, 0.25));
    max-width: 42rem;
}

/* — Staff directory: fit viewport, no sideways scroll — */
.admin-shell .table-wrap--fit {
    overflow-x: auto;
    max-width: 100%;
}

.admin-shell .data-table--staff-dir {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
}

.admin-shell .data-table--staff-dir .col-name { width: 18%; }
.admin-shell .data-table--staff-dir .col-email { width: 34%; min-width: 14rem; }
.admin-shell .data-table--staff-dir .col-actions { width: 18%; }
.admin-shell .data-table--staff-dir .col-profile { width: 10%; }
.admin-shell .data-table--staff-dir .col-shifts { width: 14%; }
.admin-shell .data-table--staff-dir .col-account { width: 10%; }

.admin-shell .data-table--staff-dir th,
.admin-shell .data-table--staff-dir td {
    padding: 0.5rem 0.5rem;
    font-size: 12px;
    vertical-align: top;
}

.admin-shell .data-table--staff-dir .staff-dir-email {
    word-break: break-all;
    line-height: 1.4;
    font-size: 13px;
}

/* High contrast — theme primary (purple) must not win over readable email text */
.admin-shell .data-table--staff-dir td.staff-dir-email a,
.admin-shell .data-table--staff-dir td.staff-dir-email a:link,
.admin-shell .data-table--staff-dir td.staff-dir-email a:visited {
    color: #f8fafc !important;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: rgba(148, 163, 184, 0.75);
}

.admin-shell .data-table--staff-dir td.staff-dir-email a:hover,
.admin-shell .data-table--staff-dir td.staff-dir-email a:focus {
    color: #ffffff !important;
    text-decoration-color: #93c5fd;
}

.admin-shell .data-table a.staff-dir-email,
.admin-shell .data-table a.staff-dir-email:link,
.admin-shell .data-table a.staff-dir-email:visited {
    color: #f8fafc !important;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: rgba(148, 163, 184, 0.75);
}

.admin-shell .data-table a.staff-dir-email:hover,
.admin-shell .data-table a.staff-dir-email:focus {
    color: #ffffff !important;
    text-decoration-color: #93c5fd;
}

.admin-shell .data-table--staff-dir .staff-dir-shifts a {
    color: #cbd5e1 !important;
    text-decoration: none;
    font-weight: 600;
}

.admin-shell .data-table--staff-dir .staff-dir-shifts a:hover {
    color: #f8fafc !important;
    text-decoration: underline;
}

.admin-shell .staff-dir-name strong {
    display: block;
    font-size: 13px;
}

.admin-shell .staff-dir-meta {
    display: block;
    font-size: 11px;
    color: var(--erp-text-muted);
    margin-top: 0.15rem;
    line-height: 1.3;
    word-break: break-word;
}

.admin-shell .staff-dir-shifts {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.admin-shell .staff-dir-shifts__sep {
    color: var(--erp-text-muted);
    margin: 0 0.1rem;
}

.admin-shell .staff-dir-shifts__hint {
    display: block;
    font-size: 9px;
    color: var(--erp-text-muted);
    margin-top: 0.15rem;
    letter-spacing: 0.02em;
}

.admin-shell .data-table--staff-dir .col-actions {
    position: sticky;
    right: 0;
    z-index: 2;
    background: var(--erp-card, var(--admin-surface));
    box-shadow: -6px 0 10px rgba(0, 0, 0, 0.12);
}

.admin-shell .table-actions--stack {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: stretch;
}

.admin-shell .table-actions--stack .btn {
    width: 100%;
    padding: 0.35rem 0.5rem;
    font-size: 11px;
}

.admin-shell .table-actions--stack form {
    margin: 0;
}

.admin-shell .staff-dir-portal-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--admin-radius);
    border: 1px solid var(--admin-border);
    background: var(--erp-card, var(--admin-surface));
}

.admin-shell .staff-dir-bulk-form {
    margin: 0;
}

.admin-shell .staff-dir-email-preview {
    margin-bottom: 1rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    background: rgba(255, 255, 255, 0.02);
}

.admin-shell .staff-dir-email-preview summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
}

.admin-shell .staff-dir-email-preview__body {
    margin-top: 0.65rem;
}

.admin-shell .staff-dir-email-preview__sample {
    margin: 0.5rem 0;
    padding: 0.75rem;
    border-radius: 8px;
    background: #0a0f1a;
    border: 1px solid var(--admin-border);
    color: #f1f5f9;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.admin-shell .admin-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    background: var(--admin-surface);
}

.admin-shell .admin-pagination--multi {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.06);
}

.admin-shell .admin-pagination__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.admin-shell .admin-pagination__current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.35rem 0.5rem;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--admin-radius);
    background: var(--admin-primary, #3b82f6);
    color: #fff;
}

.admin-shell .admin-pagination__summary {
    margin: 0;
    font-size: 13px;
    color: var(--erp-text, #e2e8f0);
}

[data-theme="light"] .admin-shell .admin-pagination__summary {
    color: #334155;
}

.admin-shell .staff-dir-portal-banner__text {
    flex: 1 1 12rem;
    min-width: 0;
}

.admin-shell .staff-dir-portal-banner__text strong {
    display: block;
    font-size: 13px;
}

.admin-shell .staff-dir-portal-banner__copy {
    flex: 2 1 16rem;
    min-width: 0;
    max-width: 100%;
}

.admin-shell .filter-bar--compact {
    margin-bottom: 0.75rem;
}

@media (max-width: 900px) {
    .admin-shell .data-table--staff-dir .col-name { width: 22%; }
    .admin-shell .data-table--staff-dir .col-email { width: 28%; }
    .admin-shell .data-table--staff-dir .col-actions { width: 24%; }
}

/* — Toolbar & filters — */
.admin-shell .toolbar {
    gap: 0.625rem;
    margin-bottom: 0.875rem;
}

.admin-shell .filter-bar {
    padding: 0.75rem;
    border-radius: var(--admin-radius);
    gap: 0.625rem;
}

/* — Alerts — */
.admin-shell .alert {
    border-radius: 7px;
    padding: 0.625rem 0.875rem;
    font-size: 13px;
    margin-bottom: 1rem;
}

/* — Login — */
.admin-shell.login-page {
    background: var(--background-color);
}

.admin-shell .login-card {
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
    padding: 1.75rem 1.5rem;
    max-width: 400px;
}

.admin-shell .login-card__logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    margin-bottom: 0.875rem;
}

.admin-shell .login-card .card__title {
    font-size: 1.25rem;
}

/* — Section sub-navigation — */
.admin-section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1rem;
}

.admin-section-nav__link {
    padding: 0.35rem 0.75rem;
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    border-radius: 6px;
    color: var(--text-muted);
    border: 1px solid var(--admin-border);
    background: var(--admin-surface);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.admin-section-nav__link:hover {
    color: var(--primary-color);
    border-color: rgba(37, 99, 235, 0.25);
}

.admin-section-nav__link--active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.admin-form-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-form-list__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    background: rgba(15, 23, 42, 0.02);
}

[data-theme="dark"] .admin-form-list__item {
    background: rgba(255, 255, 255, 0.03);
}

.admin-form-list__title {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.admin-form-list__desc {
    margin: 0 0 0.35rem;
    font-size: 13px;
    color: var(--text-muted);
}

.admin-form-list__url {
    margin: 0;
    font-size: 12px;
}

.admin-form-list__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

/* — Website tabs (legacy) — */
.website-tabs {
    gap: 0.375rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
}

.website-tabs__link {
    padding: 0.35rem 0.75rem;
    font-size: 12px;
    border-radius: 6px;
}

/* — URL format guide — */
.url-format-guide {
    padding: 0.875rem 1rem;
    border-radius: var(--admin-radius);
    margin-bottom: 1rem;
}

.url-format-guide__title {
    font-size: 11px;
    margin-bottom: 0.5rem;
}

.url-format-guide__table {
    font-size: 12px;
}

/* — Form share cards — */
.form-share-card {
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    padding: 1rem;
    background: rgba(15, 23, 42, 0.02);
}

[data-theme="dark"] .form-share-card {
    background: rgba(255, 255, 255, 0.03);
}

.form-share-card__head {
    margin-bottom: 0.75rem;
}

.form-share-card__title {
    font-size: 1rem;
}

.logo-upload-preview {
    padding: 1rem;
    border: 1px dashed var(--admin-border);
    border-radius: var(--admin-radius);
    background: rgba(15, 23, 42, 0.02);
    text-align: center;
}

.logo-upload-preview__img {
    max-width: 220px;
    max-height: 120px;
    object-fit: contain;
}

.logo-upload-preview__placeholder {
    font-size: 13px;
    color: var(--text-muted);
    padding: 1.5rem;
}

.admin-shell .status-badge {
    font-size: 11px;
    padding: 0.2rem 0.5rem;
}

.admin-shell .detail-list__row {
    padding: 0.5rem 0;
    font-size: 13px;
}

@media (max-width: 768px) {
    .admin-shell {
        --sidebar-width: 0px;
    }

    .admin-shell .sidebar {
        width: min(260px, 88vw);
    }

    .admin-shell .header__icon-btn--install .header__icon-btn-label {
        display: none;
    }

    .admin-shell .header__icon-btn-label {
        display: none;
    }

    .admin-shell .header__icon-btn {
        width: 34px;
        padding: 0;
        justify-content: center;
    }

    .admin-shell .header__user-name {
        display: none;
    }

    .admin-shell .header__user {
        padding: 0.15rem;
        border: none;
        background: transparent;
    }

    .admin-shell .page-content {
        padding: 1rem;
    }

    .admin-section-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.25rem;
    }

    .website-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }
}

.sensitive-field {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.sensitive-field .js-sensitive-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.92em;
    word-break: break-all;
}

.bulk-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    background: var(--surface-muted, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
}

.bulk-toolbar__label {
    font-size: 0.875rem;
    color: var(--text-muted, #64748b);
    margin-right: auto;
}

.data-table__check {
    width: 42px;
}

.events-sheet-cell {
    min-width: 12rem;
    vertical-align: top;
}

.events-sheet-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.events-sheet-picker__select {
    flex: 1 1 10rem;
    min-width: 8rem;
    max-width: 14rem;
    font-size: 0.8125rem;
    padding: 0.35rem 0.5rem;
}

.attendance-live__stamp {
    color: var(--erp-text-muted, #94a3b8);
    font-size: 0.875rem;
}

.attendance-capacity {
    margin: 0 0 1.25rem;
}

.attendance-capacity__label {
    font-size: 0.875rem;
    margin: 0 0 0.5rem;
    color: var(--erp-text-muted, #94a3b8);
}

.attendance-capacity__track {
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

[data-theme="light"] .admin-shell .attendance-capacity__track {
    background: #e2e8f0;
}

.attendance-capacity__bar {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #16a34a);
    border-radius: 999px;
    transition: width 0.35s ease;
}

.attendance-live__recent-wrap {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--erp-card-border, var(--admin-border, rgba(59, 130, 246, 0.12)));
}

.attendance-live__recent-title {
    font-size: 0.95rem;
    margin: 0 0 0.75rem;
    color: var(--erp-text, #e2e8f0);
}

.attendance-live__recent {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.attendance-live__item {
    display: grid;
    grid-template-columns: 1.4fr 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.65rem 0.85rem;
    background: var(--erp-bg-elevated, #0d1321);
    border: 1px solid var(--erp-card-border, var(--admin-border, rgba(59, 130, 246, 0.12)));
    border-radius: 10px;
    font-size: 0.875rem;
    color: var(--erp-text, #e2e8f0);
}

.attendance-live__item strong {
    color: var(--erp-text, #e2e8f0);
    font-weight: 600;
}

.attendance-live__item span {
    color: var(--erp-text-muted, #94a3b8);
}

.attendance-live__item time {
    color: var(--erp-text-muted, #94a3b8);
    font-variant-numeric: tabular-nums;
}

.attendance-live__empty {
    color: var(--erp-text-muted, #94a3b8);
    font-size: 0.875rem;
}

.attendance-live__event-meta {
    margin: 0 0 1rem;
}

.rich-text-editor {
    margin-bottom: 0.25rem;
}

.rich-text-editor__surface,
.rich-text-editor .ql-container.ql-snow {
    min-height: 140px;
}

.rich-text-editor .ql-editor {
    min-height: 140px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.55;
}

.rich-text-editor .ql-toolbar.ql-snow {
    border-radius: 10px 10px 0 0;
}

.rich-text-editor .ql-container.ql-snow {
    border-radius: 0 0 10px 10px;
    font-family: inherit;
}

/* Light theme — white editor surface, dark text */
[data-theme="light"] .rich-text-editor__surface,
[data-theme="light"] .rich-text-editor .ql-container.ql-snow {
    background: #ffffff;
}

[data-theme="light"] .rich-text-editor .ql-editor {
    color: #0f172a;
}

[data-theme="light"] .rich-text-editor .ql-editor.ql-blank::before {
    color: #94a3b8;
}

[data-theme="light"] .rich-text-editor .ql-toolbar.ql-snow,
[data-theme="light"] .rich-text-editor .ql-container.ql-snow {
    border-color: #cbd5e1;
}

/* Dark theme — match ERP inputs; avoid inherited light-on-white */
[data-theme="dark"] .rich-text-editor__surface,
[data-theme="dark"] .rich-text-editor .ql-container.ql-snow {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .rich-text-editor .ql-editor {
    color: var(--erp-text);
}

[data-theme="dark"] .rich-text-editor .ql-editor.ql-blank::before {
    color: var(--erp-text-muted);
}

[data-theme="dark"] .rich-text-editor .ql-toolbar.ql-snow,
[data-theme="dark"] .rich-text-editor .ql-container.ql-snow {
    border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .rich-text-editor .ql-toolbar.ql-snow {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .rich-text-editor .ql-snow .ql-stroke {
    stroke: #cbd5e1;
}

[data-theme="dark"] .rich-text-editor .ql-snow .ql-fill {
    fill: #cbd5e1;
}

[data-theme="dark"] .rich-text-editor .ql-snow .ql-picker-label,
[data-theme="dark"] .rich-text-editor .ql-snow .ql-picker-item {
    color: #cbd5e1;
}

[data-theme="dark"] .rich-text-editor .ql-snow .ql-picker-options {
    background-color: #1e293b;
    border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .rich-text-editor .ql-snow .ql-picker.ql-expanded .ql-picker-label {
    border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .rich-text-editor .ql-snow a {
    color: #93c5fd;
}

.share-preview-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-top: 1rem;
}

.share-preview-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.share-preview-card__image {
    aspect-ratio: 1.91 / 1;
    background: #0f172a center/cover no-repeat;
}

.share-preview-card__body {
    padding: 0.85rem 1rem 1rem;
}

.share-preview-card__title {
    font-weight: 600;
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
}

.share-preview-card__desc {
    margin: 0;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.45;
}

.readiness-list {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.readiness-item {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    background: var(--readiness-item-bg, #fff);
}

.readiness-item--pass { border-left: 4px solid #16a34a; }
.readiness-item--warn { border-left: 4px solid #d97706; }
.readiness-item--fail { border-left: 4px solid #dc2626; }
.readiness-item--pending { border-left: 4px solid #64748b; }

.go-live-section__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    padding-top: 0.25rem;
    border-top: 1px solid #e2e8f0;
}

.go-live-section__title:first-of-type {
    margin-top: 0;
    border-top: none;
}

.readiness-item--manual {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.readiness-item__manual-label {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.readiness-item__head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.35rem;
}

.readiness-item__badge {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.readiness-item__title {
    margin: 0;
    font-size: 1rem;
}

.readiness-item__detail {
    margin: 0 0 0.35rem;
    color: var(--text-muted, #64748b);
    font-size: 0.875rem;
}

.readiness-item__link {
    font-size: 0.875rem;
}

.go-live-manual__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.go-live-manual__item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.2));
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.2);
}

.go-live-manual__label {
    flex: 1;
    align-items: flex-start !important;
}

.go-live-manual__link {
    white-space: nowrap;
    font-size: 0.875rem;
}

.readiness-checklist {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
    line-height: 1.7;
}

.scan-checkin {
    margin-top: 1.25rem;
}

.scan-checkin__reader {
    max-width: 420px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border, #e2e8f0);
    background: #0f172a;
}

.scan-checkin__result {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 0.9375rem;
    line-height: 1.45;
}

.scan-checkin__result--success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.scan-checkin__result--warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.scan-checkin__result--error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.scan-checkin__recent {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border, #e2e8f0);
}

.scan-checkin__recent-title {
    margin: 0 0 0.65rem;
    font-size: 0.95rem;
}

.scan-checkin__recent-list {
    margin: 0;
    padding-left: 1.25rem;
    line-height: 1.7;
    font-size: 0.875rem;
    color: var(--text-muted, #64748b);
}

/* — Work hours ledger — */
.work-hours-edit {
    position: relative;
}

.work-hours-edit summary {
    list-style: none;
    cursor: pointer;
}

.work-hours-edit summary::-webkit-details-marker {
    display: none;
}

.work-hours-edit__form {
    position: absolute;
    right: 0;
    z-index: 20;
    min-width: 240px;
    margin-top: 0.35rem;
    padding: 0.875rem;
    border-radius: 12px;
    border: 1px solid var(--admin-border, rgba(255,255,255,0.1));
    background: var(--erp-card, #111827);
    box-shadow: var(--admin-shadow, 0 8px 24px rgba(0,0,0,0.35));
}

.work-hours-edit__form .form-label {
    margin-top: 0.5rem;
}

.work-hours-edit__form .btn {
    margin-top: 0.65rem;
}

.data-table__foot td {
    background: rgba(255, 255, 255, 0.03);
    border-top: 2px solid var(--admin-border, rgba(255,255,255,0.08));
}

[data-theme="light"] .work-hours-edit__form {
    background: #fff;
    border-color: #e2e8f0;
}

[data-theme="light"] .data-table__foot td {
    background: #f8fafc;
}

/* — Public staff profile (no admin shell) — */
.staff-profile-page {
    background: #f1f5f9;
    color: #0f172a;
    min-height: 100vh;
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.staff-profile-page__wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem 1rem 2.5rem;
}

.staff-profile-page .card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem 1.5rem 1.5rem;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

.staff-profile-page .form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

.staff-profile-page .form-input,
.staff-profile-page .form-select,
.staff-profile-page textarea.form-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
}

.staff-profile-page .form-input:disabled {
    background: #f8fafc;
    color: #64748b;
}

.staff-profile-page .form-hint {
    font-size: 12px;
    color: #64748b;
    margin-top: 0.35rem;
}

.staff-profile-page .form-grid {
    display: grid;
    gap: 0.875rem 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 560px) {
    .staff-profile-page .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .staff-profile-page .form-group--full {
        grid-column: 1 / -1;
    }
}

.staff-profile-page .form-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    margin: 0 0 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

/* — Premium dashboard — */
.erp-dash-hero {
    position: relative;
    display: grid;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    padding: 1.75rem 1.5rem;
    border-radius: var(--erp-radius-lg, 16px);
    border: 1px solid rgba(99, 102, 241, 0.25);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.92) 45%, rgba(49, 46, 129, 0.35) 100%);
    overflow: hidden;
}

@media (min-width: 960px) {
    .erp-dash-hero {
        grid-template-columns: 1fr minmax(220px, 280px);
        align-items: stretch;
        padding: 2rem 2.25rem;
    }
}

.erp-dash-hero__glow {
    position: absolute;
    top: -40%;
    right: -10%;
    width: 55%;
    height: 140%;
    background: radial-gradient(ellipse, rgba(59, 130, 246, 0.22) 0%, transparent 68%);
    pointer-events: none;
}

.erp-dash-hero__content {
    position: relative;
    z-index: 1;
}

.erp-dash-hero__eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #93c5fd;
}

.erp-dash-hero__title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #f8fafc;
}

.erp-dash-hero__subtitle {
    margin: 0 0 1.25rem;
    max-width: 36rem;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #94a3b8;
}

.erp-dash-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.erp-dash-hero__status {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.15rem 1.25rem;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    backdrop-filter: blur(8px);
}

.erp-dash-hero__metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1rem 0 0;
    padding: 0;
}

@media (max-width: 480px) {
    .erp-dash-hero {
        padding: 1.25rem 1rem;
    }

    .erp-dash-hero__metrics {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .erp-dash-hero__metrics > div {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.35rem 0;
        border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    }

    .erp-dash-hero__metrics > div:last-child {
        border-bottom: none;
    }

    .erp-dash-hero__metrics dd {
        font-size: 1.15rem;
    }
}

.erp-dash-hero__metrics dt {
    margin: 0;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.erp-dash-hero__metrics dd {
    margin: 0.15rem 0 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: #f1f5f9;
}

.erp-dash-kpis {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
    .erp-dash-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }
}

@media (min-width: 1100px) {
    .erp-dash-kpis {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.erp-dash-kpi {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    padding: 1rem 1.1rem;
    background: var(--erp-card, rgba(30, 41, 59, 0.65));
    border: 1px solid var(--erp-card-border, rgba(148, 163, 184, 0.12));
    border-radius: 14px;
    transition: border-color 0.2s ease, transform 0.2s ease;
    contain: layout style;
}

a.erp-dash-kpi--link {
    color: inherit;
    text-decoration: none;
}

.erp-dash-kpi:hover,
a.erp-dash-kpi--link:hover {
    border-color: rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}

.erp-dash-kpi__body {
    min-width: 0;
    flex: 1;
}

.erp-dash-kpi__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    flex-shrink: 0;
}

.erp-dash-kpi__icon--blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.erp-dash-kpi__icon--indigo { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.erp-dash-kpi__icon--amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.erp-dash-kpi__icon--green { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.erp-dash-kpi__icon--violet { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }

.erp-dash-kpi__value {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #f8fafc;
    line-height: 1.1;
}

.erp-dash-kpi__label {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: var(--erp-text-muted, #94a3b8);
}

.erp-dash-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 1100px) {
    .erp-dash-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .erp-dash-panel--wide {
        grid-column: 1 / -1;
    }
}

.erp-dash-panel {
    margin-bottom: 0;
}

.data-table--compact th,
.data-table--compact td {
    padding: 0.55rem 0.65rem;
    font-size: 0.875rem;
}

.erp-dash-events {
    display: grid;
    gap: 0.5rem;
}

.erp-dash-event {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.75rem 0.85rem;
    text-decoration: none;
    color: inherit;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 10px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.erp-dash-event:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.25);
}

.erp-dash-event__name {
    font-weight: 600;
    color: #f1f5f9;
}

.erp-dash-event__meta {
    font-size: 0.8rem;
    color: #94a3b8;
}

.erp-dash-quick {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

@media (min-width: 700px) {
    .erp-dash-quick {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.erp-dash-quick__item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.65rem 0.85rem;
    text-align: center;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 10px;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.erp-dash-quick__item:hover {
    color: #fff;
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(59, 130, 246, 0.35);
}

.staff-app__tile--messages .staff-app__tile-icon {
    color: #6366f1;
}

/* Personal invoice — job lines & saved-job picker */
.admin-shell .personal-invoice-lines__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0 0.75rem;
    flex-wrap: wrap;
}

.admin-shell .personal-invoice-line {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--erp-bg-elevated);
}

.admin-shell .personal-invoice-line__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    align-items: end;
}

.admin-shell .card.card--nested.personal-invoice-nested {
    margin: 1.25rem 0;
    padding: 1rem 1.125rem;
    background: var(--erp-bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--admin-radius);
}

.admin-shell .personal-work-log-picker {
    display: grid;
    gap: 0.5rem;
}

.admin-shell .personal-work-log-picker__item {
    display: flex;
    gap: 0.625rem;
    align-items: flex-start;
    padding: 0.625rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    color: var(--erp-text);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.admin-shell .personal-work-log-picker__item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(59, 130, 246, 0.25);
}

.admin-shell .personal-work-log-picker__item input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.admin-shell .personal-work-log-picker__item strong {
    color: var(--erp-text);
}

[data-theme="light"] .admin-shell .personal-invoice-line,
[data-theme="light"] .admin-shell .card.card--nested.personal-invoice-nested {
    background: #f8fafc;
    border-color: #e2e8f0;
}

[data-theme="light"] .admin-shell .personal-work-log-picker__item {
    background: #fff;
    border-color: #e2e8f0;
    color: #0f172a;
}

[data-theme="light"] .admin-shell .personal-work-log-picker__item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* ============================================
   WORKFORCE OS — collapsible robotic sidebar
   ============================================ */

.erp-admin,
.admin-shell {
    --wf-cyan: #22d3ee;
    --wf-cyan-dim: rgba(34, 211, 238, 0.14);
    --wf-amber: #fbbf24;
    --wf-amber-dim: rgba(251, 191, 36, 0.14);
    --wf-grid: rgba(34, 211, 238, 0.04);
    --sidebar-width: 232px;
}

.admin-shell .sidebar--workforce {
    position: relative;
    isolation: isolate;
    background: linear-gradient(180deg, #0b1018 0%, #05080e 100%);
    border-right: 1px solid rgba(34, 211, 238, 0.12);
    box-shadow:
        4px 0 28px rgba(0, 0, 0, 0.45),
        inset -1px 0 0 rgba(251, 191, 36, 0.06);
}

.admin-shell .sidebar--workforce::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(var(--wf-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--wf-grid) 1px, transparent 1px);
    background-size: 14px 14px;
    opacity: 0.65;
}

.admin-shell .sidebar--workforce::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--wf-cyan), var(--wf-amber), transparent);
    opacity: 0.55;
    animation: wf-scanline 6s linear infinite;
}

@keyframes wf-scanline {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.admin-shell .sidebar--workforce > * {
    position: relative;
    z-index: 2;
}

.admin-shell .sidebar--workforce .sidebar__brand {
    padding: 0.75rem 0.75rem 0.65rem;
    border-bottom: 1px solid rgba(34, 211, 238, 0.1);
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.06), transparent);
}

.admin-shell .sidebar--workforce .sidebar__logo {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    background: linear-gradient(135deg, #0891b2 0%, #1d4ed8 55%, #b45309 100%);
    box-shadow: 0 0 16px rgba(34, 211, 238, 0.25);
    border: 1px solid rgba(34, 211, 238, 0.35);
}

.admin-shell .sidebar--workforce .sidebar__badge {
    margin-top: 3px;
    padding: 2px 7px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--wf-cyan-dim), var(--wf-amber-dim));
    border: 1px solid rgba(34, 211, 238, 0.28);
    color: #a5f3fc;
}

.admin-shell .sidebar__status {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.admin-shell .sidebar__status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.75);
    animation: wf-pulse 2.4s ease-in-out infinite;
}

@keyframes wf-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.85); }
}

.admin-shell .sidebar__status-text {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(148, 163, 184, 0.75);
}

.admin-shell .sidebar--workforce .sidebar__nav {
    padding: 0.4rem 0.35rem 0.25rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 211, 238, 0.25) transparent;
}

.admin-shell .sidebar__section {
    margin: 0 0 0.3rem;
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.45);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-shell .sidebar__section[open] {
    border-color: rgba(34, 211, 238, 0.22);
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.06);
}

.admin-shell .sidebar__section--amber[open] {
    border-color: rgba(251, 191, 36, 0.24);
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.06);
}

.admin-shell .sidebar__section-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.5rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(203, 213, 225, 0.82);
    transition: background 0.15s ease, color 0.15s ease;
}

.admin-shell .sidebar__section-head::-webkit-details-marker {
    display: none;
}

.admin-shell .sidebar__section-head:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #f8fafc;
}

.admin-shell .sidebar__section-code {
    flex-shrink: 0;
    min-width: 3.1rem;
    color: var(--wf-cyan);
}

.admin-shell .sidebar__section--amber .sidebar__section-code {
    color: var(--wf-amber);
}

.admin-shell .sidebar__section--slate .sidebar__section-code {
    color: #94a3b8;
}

.admin-shell .sidebar__section-title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-shell .sidebar__section-count {
    flex-shrink: 0;
    min-width: 1rem;
    padding: 0 0.25rem;
    border-radius: 4px;
    font-size: 9px;
    text-align: center;
    color: rgba(148, 163, 184, 0.85);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-shell .sidebar__section-chevron {
    flex-shrink: 0;
    width: 0.45rem;
    height: 0.45rem;
    margin-left: 0.15rem;
    border-right: 2px solid rgba(148, 163, 184, 0.65);
    border-bottom: 2px solid rgba(148, 163, 184, 0.65);
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
}

.admin-shell .sidebar__section[open] .sidebar__section-chevron {
    transform: rotate(45deg);
}

.admin-shell .sidebar__section-body {
    padding: 0.1rem 0.2rem 0.3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.admin-shell .sidebar--workforce .sidebar__link {
    gap: 0.5rem;
    margin: 1px 0.15rem;
    padding: 0.38rem 0.45rem;
    border-radius: 6px;
    font-size: 12px;
    opacity: 0.82;
    border: 1px solid transparent;
}

.admin-shell .sidebar--workforce .sidebar__link:hover {
    opacity: 1;
    background: rgba(34, 211, 238, 0.08);
    border-color: rgba(34, 211, 238, 0.12);
}

.admin-shell .sidebar--workforce .sidebar__link--active {
    opacity: 1;
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.16), rgba(251, 191, 36, 0.08));
    border-color: rgba(34, 211, 238, 0.22);
    box-shadow: inset 2px 0 0 var(--wf-cyan);
}

.admin-shell .sidebar--workforce .sidebar__link-icon {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    background: rgba(34, 211, 238, 0.08);
    color: #67e8f9;
}

.admin-shell .sidebar--workforce .sidebar__link--active .sidebar__link-icon {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.35), rgba(251, 191, 36, 0.2));
    color: #fff;
}

.admin-shell .sidebar--workforce .sidebar__bottom {
    padding: 0.45rem;
    border-top: 1px solid rgba(34, 211, 238, 0.1);
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.65), transparent);
}

.admin-shell .sidebar--workforce .sidebar__quick-link {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 10px;
    letter-spacing: 0.03em;
    border-color: rgba(34, 211, 238, 0.12);
}

.admin-shell .sidebar--workforce .sidebar__logout {
    font-size: 12px;
}

@media (max-width: 768px) {
    .admin-shell .sidebar--workforce {
        width: min(88vw, 260px);
    }
}
