:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --text: #1a1f2b;
    --muted: #5c667a;
    --border: #d5dbe5;
    --accent: #1e5fb8;
    --accent-hover: #174b91;
    --error-bg: #fde8e8;
    --error-text: #8a1c1c;
    --success-bg: #e6f7ea;
    --success-text: #166534;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 1rem;
}

.admin-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    max-width: 1320px;
}

.admin-sidebar {
    position: sticky;
    top: 1rem;
}

.admin-content {
    min-width: 0;
}

.admin-nav {
    display: grid;
    gap: 0.55rem;
}

.admin-nav a {
    display: block;
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
}

.admin-nav a:hover {
    background: #eef3fb;
    text-decoration: none;
}

.admin-nav-group {
    border-top: 1px solid var(--border);
    padding-top: 0.55rem;
}

.admin-nav-group summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    padding: 0.2rem 0.5rem;
    list-style: none;
}

.admin-nav-group summary::-webkit-details-marker {
    display: none;
}

.admin-nav-group summary::before {
    content: "\25B8";
    display: inline-block;
    margin-right: 0.4rem;
    transition: transform 0.15s ease;
}

.admin-nav-group[open] summary::before {
    transform: rotate(90deg);
}

.admin-nav-group-links {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.admin-nav-group-links a {
    padding-left: 1.3rem;
    font-size: 0.95rem;
}

.quick-link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.7rem;
}

.quick-link {
    display: block;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    background: #f8fbff;
    color: var(--accent);
    font-weight: 600;
}

.quick-link:hover {
    background: #eef3fb;
    text-decoration: none;
}

.dashboard-steps {
    margin: 0.55rem 0 0;
    padding-left: 1.2rem;
}

.dashboard-steps li {
    margin-bottom: 0.45rem;
}

.dashboard-steps li:last-child {
    margin-bottom: 0;
}

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.language-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.25rem;
    border: 2px solid var(--accent);
    border-radius: 999px;
    background: var(--surface);
    font-size: 1.05rem;
    font-weight: 700;
}

.language-toggle a {
    min-width: 2.5rem;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    text-align: center;
    text-decoration: none;
}

.language-toggle a[aria-current="true"] {
    background: var(--accent);
    color: #fff;
}

.brand-lockup {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    min-width: 0;
}

.brand-slogan {
    font-style: italic !important;
    font-weight: 400;
    color: var(--muted);
    white-space: nowrap;
    font-size: 1.02rem;
    line-height: 1;
    display: inline-block;
}

.logo-strip {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    flex-wrap: nowrap;
    max-width: none;
    overflow: visible;
}

.logo-wrg-lockup {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.logo-strip img {
    display: block;
    width: auto;
    height: 56px !important;
    max-width: 260px !important;
    max-height: 56px !important;
    object-fit: contain;
}

.logo-strip .logo-rlw {
    height: 71px !important;
    max-height: 71px !important;
}

.brand {
    font-size: 0.9rem;
    margin: 0.4rem 0 0;
    line-height: 1.1;
}

nav a {
    margin-left: 1rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.narrow {
    max-width: 480px;
}

.form-stack {
    display: grid;
    gap: 0.8rem;
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
}

label {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
}

input,
select,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.55rem 0.6rem;
}

textarea {
    resize: vertical;
}

button {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
}

button:hover {
    background: var(--accent-hover);
}

.button-link {
    background: transparent;
    color: var(--accent);
    padding: 0;
}

.button-link.danger {
    color: #b71c1c;
}

.dependent-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.dependent-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding: 0.45rem 0;
}

.plan-group {
    margin-bottom: 1.2rem;
}

.plan-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
}

.plan-detail-panel {
    border-left: 6px solid #1b5ea8;
    background: #f8fbff;
}

.plan-detail-message {
    margin: 0 0 0.75rem;
    font-weight: 600;
    line-height: 1.45;
}

.plan-detail-items-table {
    margin-top: 0.4rem;
}

.detail-item-list {
    margin: 0;
    padding-left: 1.15rem;
}

.detail-item-list li + li {
    margin-top: 0.25rem;
}

.plan-detail-items-editor {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.85rem;
    background: #fbfdff;
}

.plan-detail-items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.plan-detail-item-list {
    display: grid;
    gap: 0.75rem;
}

.plan-detail-item-row {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem;
    background: #fff;
}

.plan-detail-item-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.75rem;
}

.plan-detail-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.enrollment-message-banner {
    border-left: 6px solid var(--accent);
    background: #eef3fb;
}

.enrollment-message-label {
    margin: 0 0 0.45rem;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #204f8f;
    font-weight: 700;
}

.enrollment-message-body {
    margin: 0;
    white-space: pre-line;
    line-height: 1.45;
}

.message-copy-box {
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 0.7rem;
    background: #fbfdff;
}

.message-textarea {
    min-height: 220px;
}

fieldset {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.6rem;
    margin-top: 0.7rem;
}

.inline-option {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 400;
}

.inline-option input {
    width: auto;
}

.alert {
    border-radius: 8px;
    padding: 0.8rem;
    margin-bottom: 1rem;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid #f5b8b8;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid #b5e3c2;
}

.alert-warning {
    background: #fff8e6;
    color: #7a5b00;
    border: 1px solid #f0d68a;
}

.list-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.list-filter-search {
    flex: 1 1 260px;
    max-width: 360px;
    padding: 0.45rem 0.6rem;
}

.list-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.list-filter-count {
    margin-left: auto;
    white-space: nowrap;
}

.collapsible-list > summary {
    cursor: pointer;
    display: inline-block;
    padding: 0.45rem 0.8rem;
    background: var(--accent, #1f6feb);
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    user-select: none;
    list-style: none;
}

.collapsible-list > summary::-webkit-details-marker {
    display: none;
}

.collapsible-list > summary::before {
    content: "\25B6  ";  /* right-pointing triangle when collapsed */
    font-size: 0.8em;
}

.collapsible-list[open] > summary::before {
    content: "\25BC  ";  /* down-pointing triangle when expanded */
}

.collapsible-list[open] > summary {
    margin-bottom: 0.8rem;
}

.banner {
    border-radius: 8px;
    padding: 0.8rem;
    margin-bottom: 1rem;
}

.banner.error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid #f5b8b8;
}

.banner.success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid #b5e3c2;
}

.button {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
}

.button:hover {
    background: var(--accent-hover);
    text-decoration: none;
}

.button-secondary {
    background: #eef2f8;
    color: #22304a;
    border: 1px solid #ccd5e3;
}

.button-secondary:hover {
    background: #dfe7f3;
}

.button-danger {
    background: #b42323;
    color: #fff;
}

.button-danger:hover {
    background: #8f1d1d;
}

.wizard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.wizard-progress {
    margin-bottom: 1rem;
}

.wizard-progress-track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

.wizard-progress-step {
    background: #f0f3f8;
    color: #50607a;
    border: 1px solid #d6deea;
    border-radius: 999px;
    font-size: 0.82rem;
    padding: 0.45rem 0.6rem;
    text-align: center;
}

.wizard-progress-step.current {
    background: #d8e6fb;
    color: #163f7a;
    border-color: #86aee8;
    font-weight: 700;
}

.wizard-progress-step.complete {
    background: #e6f7ea;
    color: #166534;
    border-color: #8bd5a2;
}

.wizard-running-total {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 20;
    min-width: 240px;
    background: #132941;
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
    padding: 0.7rem 0.9rem;
    display: grid;
    gap: 0.2rem;
}

.wizard-running-total span {
    font-size: 0.78rem;
    opacity: 0.9;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.wizard-running-total strong {
    font-size: 1.25rem;
    font-variant-numeric: tabular-nums;
}

.subtle {
    color: var(--muted);
}

.bundled-badge {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.14rem 0.45rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #155e75;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
}

.employer-paid-badge {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.14rem 0.45rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #365314;
    background: #ecfccb;
    border: 1px solid #d9f99d;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

table {
    width: 100%;
    border-collapse: collapse;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.15rem;
}

.table-scroll table {
    min-width: 960px;
}

.admin-table {
    font-size: 0.95rem;
}

.admin-table th {
    background: #f8fbff;
    white-space: nowrap;
}

.admin-table th,
.admin-table td {
    vertical-align: top;
}

.admin-table .number-cell,
.admin-table .money-cell,
.admin-table .percent-cell {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.admin-table .date-cell {
    white-space: nowrap;
}

.admin-table .actions-cell {
    white-space: nowrap;
}

.employee-admin-table .sticky-col {
    position: sticky;
    background: var(--surface);
    z-index: 2;
}

.employee-admin-table th.sticky-col {
    background: #f8fbff;
    z-index: 3;
}

.employee-admin-table .sticky-col-id {
    left: 0;
    min-width: 4.25rem;
}

.employee-admin-table .sticky-col-bamboo {
    left: 4.25rem;
    min-width: 8.25rem;
}

.employee-admin-table .sticky-col-name {
    left: 12.5rem;
    min-width: 12rem;
    box-shadow: 2px 0 0 var(--border);
}

.employee-admin-table .table-action-form {
    margin-left: 0;
}

.json-debug-block {
    max-width: 44rem;
    max-height: 18rem;
    overflow: auto;
    margin: 0;
    white-space: pre-wrap;
    font-size: 0.82rem;
}

.employee-table th {
    background: #f8fbff;
}

.employee-table th,
.employee-table td {
    vertical-align: top;
}

.employee-table .date-cell,
.employee-table .actions-cell {
    white-space: nowrap;
}

ul {
    margin: 0.4rem 0;
    padding-left: 1.2rem;
}

th,
td {
    border: 1px solid var(--border);
    padding: 0.5rem;
    text-align: left;
}

.inline-form {
    display: inline;
    margin-left: 0.5rem;
}

@media (max-width: 700px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
    }

    .wizard-progress-track {
        grid-template-columns: 1fr 1fr;
    }

    .wizard-running-total {
        position: static;
        margin-top: 1rem;
        width: 100%;
    }
}
