/* ============================================
   Shell Design System — HR Power Planning
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,500;0,9..40,700;1,9..40,400&display=swap');

:root {
    --shell-width: 232px;
    --shell-bg: #0f172a;
    --shell-bg-hover: #1e293b;
    --shell-text: #94a3b8;
    --shell-text-active: #f8fafc;
    --shell-accent: #f59e0b;
    --shell-border: #1e293b;
    --shell-section: #64748b;

    --page-bg: #f1f5f9;
    --card-bg: #ffffff;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --card-radius: 10px;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --accent: #f59e0b;
    --accent-hover: #d97706;
}

/* ---- Layout Shell ---- */

body.has-shell {
    margin: 0;
    padding: 0;
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    background: var(--page-bg);
    color: var(--text-primary);
    min-height: 100vh;
}

.shell-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--shell-width);
    background: var(--shell-bg);
    color: var(--shell-text);
    display: flex;
    flex-direction: column;
    z-index: 900;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.shell-content {
    margin-left: var(--shell-width);
    min-height: 100vh;
    padding: 0;
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Sidebar Brand ---- */

.shell-brand {
    padding: 20px 18px 16px;
    border-bottom: 1px solid var(--shell-border);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--shell-text-active);
}

.shell-brand-icon {
    width: 32px;
    height: 32px;
    background: var(--shell-accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--shell-bg);
    flex-shrink: 0;
}

.shell-brand-text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.shell-brand-sub {
    font-size: 11px;
    font-weight: 400;
    color: var(--shell-text);
    letter-spacing: 0;
}

/* ---- Sidebar Navigation ---- */

.shell-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.shell-nav-section {
    padding: 12px 18px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--shell-section);
}

.shell-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    color: var(--shell-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

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

.shell-nav .nav-icon svg,
.shell-footer .nav-icon svg {
    display: block;
}

.shell-nav-link:hover {
    background: var(--shell-bg-hover);
    color: var(--shell-text-active);
}

.shell-nav-link.active {
    color: var(--shell-text-active);
    background: var(--shell-bg-hover);
    border-left-color: var(--shell-accent);
}

.shell-nav-link .nav-icon {
    width: 18px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
    opacity: 0.7;
}

.shell-nav-link.active .nav-icon {
    opacity: 1;
}

.shell-nav-tag {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #065f46;
    color: #6ee7b7;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: auto;
}

.shell-nav-tag.legacy {
    background: #44403c;
    color: #a8a29e;
}

/* ---- Sidebar Footer ---- */

.shell-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--shell-border);
}

.shell-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    width: 100%;
    background: transparent;
    border: 1px solid var(--shell-border);
    border-radius: 6px;
    color: var(--shell-text);
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.15s ease;
}

.shell-logout:hover {
    background: #7f1d1d;
    border-color: #991b1b;
    color: #fca5a5;
}

.shell-env {
    font-size: 10px;
    color: var(--shell-section);
    text-align: center;
    padding: 6px 0 2px;
}

/* ---- Mobile Hamburger ---- */

.shell-mobile-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: var(--shell-bg);
    z-index: 910;
    align-items: center;
    padding: 0 14px;
    gap: 12px;
}

.shell-hamburger {
    background: none;
    border: none;
    color: var(--shell-text-active);
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.shell-mobile-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--shell-text-active);
    font-family: 'DM Sans', system-ui, sans-serif;
}

.shell-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 899;
}

/* ---- Collapse Toggle ---- */

.shell-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 8px 0;
    background: transparent;
    border: none;
    border-top: 1px solid var(--shell-border);
    color: var(--shell-section);
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: color 0.15s ease;
}

.shell-collapse-btn:hover {
    color: var(--shell-text-active);
}

/* ---- Collapsed State ---- */

body.has-shell.shell-collapsed .shell-sidebar {
    width: 56px;
}

body.has-shell.shell-collapsed .shell-content {
    margin-left: 56px;
}

body.has-shell.shell-collapsed .shell-brand-text,
body.has-shell.shell-collapsed .shell-brand-sub,
body.has-shell.shell-collapsed .shell-nav-section,
body.has-shell.shell-collapsed .shell-nav-tag,
body.has-shell.shell-collapsed .shell-env,
body.has-shell.shell-collapsed .shell-nav-link .nav-label,
body.has-shell.shell-collapsed .shell-logout .nav-label {
    display: none;
}

body.has-shell.shell-collapsed .shell-brand {
    justify-content: center;
    padding: 16px 0;
}

body.has-shell.shell-collapsed .shell-nav-link {
    justify-content: center;
    padding: 10px 0;
    border-left: none;
}

body.has-shell.shell-collapsed .shell-nav-link .nav-icon {
    width: auto;
    opacity: 0.8;
}

body.has-shell.shell-collapsed .shell-nav-link.active {
    border-left: none;
    border-right: 3px solid var(--shell-accent);
}

body.has-shell.shell-collapsed .shell-nav-link.active .nav-icon {
    opacity: 1;
}

body.has-shell.shell-collapsed .shell-logout {
    justify-content: center;
    padding: 8px 0;
    border: none;
}

body.has-shell.shell-collapsed .shell-footer {
    padding: 8px 0;
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .shell-mobile-bar {
        display: flex;
    }

    .shell-sidebar {
        transform: translateX(-100%);
    }

    .shell-sidebar.open {
        transform: translateX(0);
    }

    .shell-content {
        margin-left: 0;
        padding-top: 52px;
    }

    .shell-overlay.open {
        display: block;
    }

    .shell-collapse-btn {
        display: none;
    }

    /* Override collapsed state on mobile */
    body.has-shell.shell-collapsed .shell-sidebar {
        width: var(--shell-width);
        transform: translateX(-100%);
    }

    body.has-shell.shell-collapsed .shell-sidebar.open {
        transform: translateX(0);
    }

    body.has-shell.shell-collapsed .shell-content {
        margin-left: 0;
    }

    body.has-shell.shell-collapsed .shell-brand-text,
    body.has-shell.shell-collapsed .shell-brand-sub,
    body.has-shell.shell-collapsed .shell-nav-section,
    body.has-shell.shell-collapsed .shell-nav-tag,
    body.has-shell.shell-collapsed .shell-env,
    body.has-shell.shell-collapsed .shell-logout span:last-child {
        display: revert;
    }

    body.has-shell.shell-collapsed .shell-brand {
        justify-content: flex-start;
        padding: 20px 18px 16px;
    }

    body.has-shell.shell-collapsed .shell-nav-link {
        justify-content: flex-start;
        padding: 8px 18px;
        border-left: 3px solid transparent;
    }

    body.has-shell.shell-collapsed .shell-nav-link .nav-label,
    body.has-shell.shell-collapsed .shell-logout .nav-label {
        display: inline;
    }

    body.has-shell.shell-collapsed .shell-nav-link.active {
        border-right: none;
        border-left-color: var(--shell-accent);
    }

    body.has-shell.shell-collapsed .shell-nav-link .nav-icon {
        font-size: 14px;
        width: 18px;
    }

    body.has-shell.shell-collapsed .shell-logout {
        justify-content: flex-start;
        padding: 8px 12px;
        border: 1px solid var(--shell-border);
    }

    body.has-shell.shell-collapsed .shell-footer {
        padding: 12px 18px;
    }
}

/* ---- Page Utilities ---- */

.page-header {
    padding: 24px 28px 0;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.page-body {
    padding: 20px 28px 28px;
}

.page-card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 24px;
}

.page-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* ---- Dashboard Specific ---- */

.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.dash-kpi {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dash-kpi-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1;
}

.dash-kpi-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dash-kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 8px;
}

.dash-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.dash-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s ease;
    box-shadow: var(--card-shadow);
}

.dash-action:hover {
    border-color: var(--shell-accent);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12);
    transform: translateY(-1px);
}

.dash-action-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.dash-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dash-chip {
    padding: 4px 12px;
    background: #f0fdf4;
    color: #166534;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #bbf7d0;
}

.dash-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin: 28px 0 12px;
}

.dash-section-title:first-child {
    margin-top: 0;
}

/* ============================================
   Shared Design System — Buttons, Tables, Forms
   Modals, Toasts, Badges (used across all pages)
   ============================================ */

/* ---- Buttons ---- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    min-height: 36px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
    background: #fff;
    color: var(--text-primary);
}

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn:disabled, .btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn svg { flex-shrink: 0; }

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

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

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

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.btn-danger {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.btn-success {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}

.btn-success:hover {
    background: #15803d;
    border-color: #15803d;
}

.btn-sm {
    padding: 5px 10px;
    min-height: 28px;
    font-size: 12.5px;
    border-radius: 6px;
}

.btn-lg {
    padding: 12px 20px;
    min-height: 44px;
    font-size: 15px;
}

.btn-icon {
    width: 36px;
    min-height: 36px;
    padding: 0;
    justify-content: center;
}

.btn-icon.btn-sm {
    width: 28px;
    min-height: 28px;
}

/* Icon buttons inside tables: muted by default, colored on hover */
.btn-icon-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border-radius: 6px;
}

.btn-icon-ghost:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.btn-icon-ghost.danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* ---- Data Table ---- */

.data-table-wrap {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.data-table-wrap .data-table-scroll {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table thead th {
    background: #f8fafc;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table thead th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table thead th.sortable:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.data-table thead th.num, .data-table tbody td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.data-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-primary);
    vertical-align: middle;
}

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

.data-table tbody tr:hover {
    background: #fafbfc;
}

.data-table tbody tr.is-warning {
    background: #fffbeb;
}

.data-table tbody tr.is-warning:hover {
    background: #fef3c7;
}

.data-table tfoot td {
    padding: 10px 14px;
    background: #f8fafc;
    font-weight: 700;
    border-top: 1px solid var(--border-color);
}

.data-table .actions {
    white-space: nowrap;
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: flex-end;
}

.data-table .empty-row td {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-style: italic;
}

/* ---- Badges / Status chips ---- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.4;
    white-space: nowrap;
}

.badge-neutral { background: #f1f5f9; color: #475569; }
.badge-info    { background: #dbeafe; color: #1d4ed8; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-draft   { background: #f1f5f9; color: #64748b; }
.badge-ok      { background: #dcfce7; color: #15803d; }

.badge-dot::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ---- Forms ---- */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

@media (max-width: 640px) {
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field.col-span-2 { grid-column: span 2; }
@media (max-width: 640px) { .form-field.col-span-2 { grid-column: auto; } }

.form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.form-label .required {
    color: #dc2626;
    margin-left: 2px;
}

.form-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: #fff;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    line-height: 1.3;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.form-input:disabled, .form-select:disabled, .form-textarea:disabled {
    background: #f8fafc;
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-textarea { resize: vertical; min-height: 72px; }

.form-section {
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
}

.form-section:first-child { border-top: none; padding-top: 0; }

.form-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin: 0 0 10px;
}

.form-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.toolbar-spacer { flex: 1; }

/* ---- Generic Modal (hr-modal) ---- */

.hr-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
    animation: hrOverlayIn 0.15s ease;
}

@keyframes hrOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.hr-modal {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.22);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: hrModalIn 0.18s ease;
}

@keyframes hrModalIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

.hr-modal-sm {
    max-width: 440px;
    padding: 24px;
    display: grid;
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto;
    gap: 12px 16px;
    align-items: start;
}

.hr-modal-icon {
    grid-row: 1 / 3;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hr-modal-body {
    grid-column: 2;
    grid-row: 1;
}

.hr-modal-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text-primary);
}

.hr-modal-text {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.hr-modal-actions {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

/* Form modal (larger, with header/body/footer) */
.hr-modal-lg { max-width: 720px; }
.hr-modal-xl { max-width: 960px; }

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

.hr-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.hr-modal-header .hr-modal-close {
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hr-modal-header .hr-modal-close:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.hr-modal-content {
    padding: 20px 22px;
    overflow-y: auto;
    flex: 1;
}

.hr-modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: #fafbfc;
}

/* ---- Toast ---- */

.hr-toast-root {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    z-index: 2000;
    pointer-events: none;
}

.hr-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    font-size: 13.5px;
    color: var(--text-primary);
    min-width: 260px;
    max-width: 420px;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.hr-toast-in  { opacity: 1; transform: none; }
.hr-toast-out { opacity: 0; transform: translateX(12px); }

.hr-toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hr-toast-success { border-left: 3px solid #16a34a; }
.hr-toast-success .hr-toast-icon { background: #dcfce7; color: #15803d; }
.hr-toast-info    { border-left: 3px solid #2563eb; }
.hr-toast-info    .hr-toast-icon { background: #dbeafe; color: #1d4ed8; }
.hr-toast-warning { border-left: 3px solid #d97706; }
.hr-toast-warning .hr-toast-icon { background: #fef3c7; color: #b45309; }
.hr-toast-danger  { border-left: 3px solid #dc2626; }
.hr-toast-danger  .hr-toast-icon { background: #fee2e2; color: #b91c1c; }

.hr-toast-msg { flex: 1; line-height: 1.45; }

/* ---- Page card / section helpers ---- */

.page-card-flush {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.card-header h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.card-body {
    padding: 20px;
}

/* Alert banner */
.alert-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    border: 1px solid transparent;
}

.alert-banner svg { flex-shrink: 0; margin-top: 1px; }
.alert-info    { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-danger  { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* ---- Dashboard extensions ---- */

.dash-kpi-trend {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.dash-kpi-trend.up   { color: #15803d; }
.dash-kpi-trend.down { color: #b91c1c; }

.dash-kpi-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dash-kpi-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Clickable KPI gets a subtle affordance */
.dash-kpi-link .dash-kpi-icon {
    transition: transform 0.15s ease;
}

.dash-kpi-link:hover .dash-kpi-icon {
    transform: scale(1.05);
}
