/* ResumeBuilder web app. Plain CSS, no framework, per WEB_PORT_PLAN.md section 6.3. Readable at
   1280px and on a tablet (breakpoint below). No em or en dashes in any UI text. */

:root {
    --rb-bg: #f4f5f7;
    --rb-surface: #ffffff;
    --rb-border: #d9dce1;
    --rb-text: #1f2328;
    --rb-text-muted: #5b636e;
    --rb-primary: #1f4e8c;
    --rb-primary-dark: #163a68;
    --rb-danger: #b3261e;
    --rb-danger-bg: #fbeaea;
    --rb-success: #1e7d32;
    --rb-nav-bg: #1c2733;
    --rb-nav-text: #d7dee6;
    --rb-nav-text-active: #ffffff;
    --rb-nav-border: #2c3a49;
    --rb-focus: #4a90d9;
    --rb-radius: 6px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    color: var(--rb-text);
    background: var(--rb-bg);
}

h1, h2, h3, h4 {
    font-weight: 600;
    color: var(--rb-text);
    margin-top: 0;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

a {
    color: var(--rb-primary);
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

/* --- generic form controls -------------------------------------------------------------- */

label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin: 0.75rem 0 0.25rem;
    color: var(--rb-text-muted);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    background: var(--rb-surface);
}

input:focus, select:focus, textarea:focus, button:focus-visible {
    outline: 2px solid var(--rb-focus);
    outline-offset: 1px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0;
    font-size: 0.9rem;
}

.checkbox-row label {
    margin: 0;
    font-weight: 400;
    color: var(--rb-text);
}

button, .btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--rb-primary);
    border-radius: var(--rb-radius);
    background: var(--rb-primary);
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

button:hover, .btn:hover {
    background: var(--rb-primary-dark);
    border-color: var(--rb-primary-dark);
}

button.btn-secondary, .btn.btn-secondary {
    background: var(--rb-surface);
    color: var(--rb-primary);
}

button.btn-secondary:hover, .btn.btn-secondary:hover {
    background: var(--rb-bg);
}

button.btn-danger, .btn.btn-danger {
    background: var(--rb-danger);
    border-color: var(--rb-danger);
}

button:disabled {
    opacity: 0.55;
    cursor: default;
}

.field-error, .login-error, .form-error {
    color: var(--rb-danger);
    background: var(--rb-danger-bg);
    border: 1px solid var(--rb-danger);
    border-radius: var(--rb-radius);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.form-success {
    color: var(--rb-success);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

/* --- tables ------------------------------------------------------------------------------ */

table.rb-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--rb-surface);
    font-size: 0.9rem;
}

table.rb-table th, table.rb-table td {
    text-align: left;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--rb-border);
}

table.rb-table th {
    color: var(--rb-text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* --- cards --------------------------------------------------------------------------------- */

.rb-card {
    background: var(--rb-surface);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

/* --- app shell: left nav plus content ------------------------------------------------------ */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-nav {
    display: flex;
    flex-direction: column;
    width: 220px;
    flex-shrink: 0;
    background: var(--rb-nav-bg);
    color: var(--rb-nav-text);
    padding: 1rem 0.75rem;
    gap: 0.15rem;
}

.app-nav-brand {
    color: var(--rb-nav-text-active);
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.4rem 0.6rem 1rem;
}

.app-nav-link {
    display: block;
    padding: 0.55rem 0.6rem;
    border-radius: var(--rb-radius);
    color: var(--rb-nav-text);
    text-decoration: none;
    font-weight: 500;
}

.app-nav-link:hover {
    background: var(--rb-nav-border);
    color: var(--rb-nav-text-active);
}

.app-nav-link.active {
    background: var(--rb-primary);
    color: var(--rb-nav-text-active);
}

.app-nav-spacer {
    flex: 1 1 auto;
}

.app-nav-user {
    border-top: 1px solid var(--rb-nav-border);
    padding-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.app-nav-user-name {
    color: var(--rb-nav-text-active);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0 0.6rem;
}

.app-nav-link-small {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
}

.app-nav-user form {
    margin: 0;
}

.app-nav-signout {
    width: 100%;
    background: transparent;
    border: 1px solid var(--rb-nav-border);
    color: var(--rb-nav-text);
    text-align: left;
}

.app-nav-signout:hover {
    background: var(--rb-nav-border);
    color: var(--rb-nav-text-active);
    border-color: var(--rb-nav-border);
}

.app-content {
    flex: 1 1 auto;
    padding: 1.5rem 2rem;
    min-width: 0;
}

/* --- login page ---------------------------------------------------------------------------- */

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rb-nav-bg);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 360px;
    background: var(--rb-surface);
    border-radius: var(--rb-radius);
    padding: 2rem 1.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.login-card h1 {
    font-size: 1.3rem;
    margin-bottom: 0.1rem;
}

.login-subtitle {
    color: var(--rb-text-muted);
    margin-top: 0;
    font-size: 0.9rem;
}

.login-card button[type="submit"] {
    width: 100%;
    margin-top: 1rem;
}

/* --- tablet breakpoint ---------------------------------------------------------------------- */

@media (max-width: 900px) {
    .app-shell {
        flex-direction: column;
    }

    .app-nav {
        width: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .app-nav-brand {
        padding: 0.4rem 0.6rem;
    }

    .app-nav-spacer {
        flex-basis: 100%;
        height: 0;
    }

    .app-nav-user {
        border-top: none;
        flex-direction: row;
        align-items: center;
        padding-top: 0;
        flex-wrap: wrap;
    }

    .app-content {
        padding: 1.25rem;
    }
}

/* --- stage E: stat cards (Dashboard) ------------------------------------------------------- */

.rb-total {
    color: var(--rb-text-muted);
    font-weight: 600;
    margin-top: -0.5rem;
}

.rb-stat-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.rb-stat-card {
    min-width: 118px;
    border-radius: var(--rb-radius);
    color: #ffffff;
    text-align: center;
    padding: 0.6rem 0.4rem;
}

.rb-stat-card.rb-stat-large {
    min-width: 150px;
    padding: 0.9rem 0.5rem;
}

.rb-stat-count {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.rb-stat-card.rb-stat-large .rb-stat-count {
    font-size: 2.1rem;
}

.rb-stat-label {
    font-size: 0.75rem;
    margin-top: 0.15rem;
}

/* --- stage E: band colours, shared by the Tracker grid and Job detail ---------------------- */

.rb-c-strong, .rb-c-best { color: #2E8B57; }
.rb-c-solid, .rb-c-good { color: #4682B4; }
.rb-c-mixed, .rb-c-fair { color: #696969; }
.rb-c-sparse, .rb-c-weak { color: #808080; }
.rb-c-open { color: #2E8B57; }
.rb-c-closed { color: #B22222; font-weight: 600; }
.rb-c-review { color: #FF8C00; font-weight: 600; }
.rb-c-highrisk { color: #B22222; font-weight: 600; }
.rb-c-muted { color: var(--rb-text-muted); }

/* --- stage E: Tracker grid ------------------------------------------------------------------ */

.rb-filters {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 0.5rem;
}

.rb-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.rb-filter-group label {
    margin: 0;
}

.rb-filter-checks {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--rb-text);
    max-width: 420px;
}

.rb-filter-checks label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 400;
    color: var(--rb-text);
    margin: 0;
}

.rb-toolbar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin: 0.75rem 0;
}

.rb-toolbar .rb-count {
    color: var(--rb-text-muted);
    font-size: 0.85rem;
    margin-left: 0.25rem;
}

.rb-grid-wrap {
    overflow-x: auto;
    background: var(--rb-surface);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
}

table.rb-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}

table.rb-grid th, table.rb-grid td {
    padding: 0.4rem 0.55rem;
    border-bottom: 1px solid var(--rb-border);
    white-space: nowrap;
}

table.rb-grid th {
    cursor: pointer;
    user-select: none;
    color: var(--rb-text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background: var(--rb-bg);
    position: sticky;
    top: 0;
}

table.rb-grid th.rb-nosort {
    cursor: default;
}

table.rb-grid tbody tr:hover {
    background: #f8fafc;
}

table.rb-grid tbody tr.rb-row-selected {
    background: #e7f0fb;
}

table.rb-grid td.rb-wrap {
    white-space: normal;
    max-width: 260px;
}

.rb-files-badge {
    display: inline-block;
    background: var(--rb-primary);
    color: #ffffff;
    border-radius: 999px;
    padding: 0.05rem 0.5rem;
    font-size: 0.72rem;
    text-decoration: none;
    margin-left: 0.35rem;
    white-space: nowrap;
}

.rb-files-badge:hover {
    background: var(--rb-primary-dark);
}

/* --- stage E: inline confirm / action panels (replace desktop MessageBox confirms) ---------- */

.rb-panel {
    background: #fff7e6;
    border: 1px solid #e0b64c;
    border-radius: var(--rb-radius);
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
}

.rb-panel.rb-panel-danger {
    background: var(--rb-danger-bg);
    border-color: var(--rb-danger);
}

.rb-panel h3 {
    margin-top: 0;
    font-size: 0.95rem;
}

.rb-panel-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

/* --- stage E: Prepare page ------------------------------------------------------------------- */

.rb-progress-track {
    width: 100%;
    max-width: 480px;
    background: var(--rb-border);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.rb-progress-fill {
    height: 100%;
    background: var(--rb-primary);
    transition: width 0.3s ease;
}

.rb-alpha-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.rb-alpha-row input[type="range"] {
    width: 300px;
}

.rb-warn-list {
    color: #8a5c00;
    font-size: 0.85rem;
    margin: 0.25rem 0;
    padding-left: 1.1rem;
}

.rb-warn-list li {
    margin-bottom: 0.1rem;
}

.rb-status-line {
    font-weight: 600;
    margin: 0.5rem 0;
}

/* --- stage P2-D: Tailoring editor (markdown + rendered preview side by side) ----------------- */

.rb-editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}

.rb-editor-box {
    width: 100%;
    min-height: 60vh;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.85rem;
    resize: vertical;
}

.rb-preview-box {
    min-height: 60vh;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--rb-surface);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    padding: 0.75rem 1rem;
}

.rb-preview-box :first-child {
    margin-top: 0;
}

@media (max-width: 900px) {
    .rb-editor-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Blazor's built-in error UI (see MainLayout.razor.css for placement/box styling) --------- */

.blazor-error-boundary {
    background: var(--rb-danger-bg);
    border: 1px solid var(--rb-danger);
    border-radius: var(--rb-radius);
    padding: 1rem 1rem 1rem 1.25rem;
    color: var(--rb-danger);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

#blazor-error-ui .reload {
    color: var(--rb-primary);
    margin-left: 0.5rem;
}

/* --- stage P2-E: Attributes page, position list + bullet grid split ------------------------- */

.rb-attr-shell {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.rb-attr-positions {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.rb-attr-position-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    width: 100%;
    background: var(--rb-surface);
    color: var(--rb-text);
    border: 1px solid var(--rb-border);
    text-align: left;
    font-weight: 400;
    padding: 0.5rem 0.65rem;
}

.rb-attr-position-item:hover {
    background: var(--rb-bg);
}

.rb-attr-position-item.rb-attr-position-selected {
    border-color: var(--rb-primary);
    background: #e7f0fb;
}

.rb-attr-position-name {
    font-weight: 600;
}

.rb-attr-position-count {
    font-size: 0.78rem;
    color: var(--rb-text-muted);
}

.rb-attr-detail {
    flex: 1 1 auto;
    min-width: 0;
}

.rb-attr-actions {
    white-space: nowrap;
}

@media (max-width: 900px) {
    .rb-attr-shell {
        flex-direction: column;
    }

    .rb-attr-positions {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* --- phase 3 (9-16-26): Generator profile editor, Base documents preview ------------------- */
.rb-weight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.4rem 1rem;
    margin: 0.25rem 0 0.75rem;
}

.rb-weight-grid label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
}

.rb-weight-grid input {
    width: 80px;
}

.rb-pre {
    white-space: pre-wrap;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.82rem;
    max-height: 60vh;
    overflow: auto;
    background: var(--rb-surface);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    padding: 0.75rem;
}

/* --- Microsoft sign-in (9-16-26): the Login page's second way in ------------------------- */
.login-divider {
    margin: 1rem 0 0.75rem;
    text-align: center;
    color: var(--rb-muted, #666);
    font-size: 0.85rem;
}

a.btn-microsoft {
    display: block;
    text-align: center;
    padding: 0.6rem 1rem;
    border: 1px solid var(--rb-border, #8c8c8c);
    border-radius: var(--rb-radius, 4px);
    background: var(--rb-surface, #fff);
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

a.btn-microsoft:hover {
    background: var(--rb-surface-2, #f3f3f3);
}

/* --- tracker Salary column (9-16-26) ------------------------------------------------------ */
td.rb-num {
    text-align: right;
    white-space: nowrap;
}

/* --- DevExpress jobs grid (9-16-26) ------------------------------------------------------- */
.rb-dxgrid-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.4rem 0 0.5rem;
    font-size: 0.85rem;
}

.rb-dxgrid {
    font-size: 0.85rem;
}

.rb-dxgrid-tall {
    height: calc(100vh - 340px);
    min-height: 420px;
}
