/* ══════════════════════════════════════════════════════════════════════════════
   ShiftHR — Shared Components
   ──────────────────────────────────────────────────────────────────────────────
   Reusable UI primitives used across multiple domains: forms, progress bars,
   toggle switches, banners, and helper text (a badge is the kit's Badge). No page- or feature-specific
   rules belong here. The button family moved into the kit (ShiftHR.UI
   css/kit-buttons.css, linked directly before this file, C6 (a)).
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-row label { font-size: .8rem; font-weight: 600; color: var(--color-neutral-700); }
.form-input {
    padding: 8px 12px; border: 1px solid var(--color-neutral-200); border-radius: var(--radius-sm);
    font-size: .875rem; font-family: inherit;
}
.form-input:focus { outline: none; border-color: var(--color-brand); box-shadow: 0 0 0 2px rgba(var(--color-brand-rgb),.15); }
/* Placeholder ink routes through the shared control token — with no rule here the
   UA default renders too dim on dark controls (#889 follow-up). */
.form-input::placeholder { color: var(--control-placeholder); }
.form-input-sm { padding: 6px 10px; font-size: .85rem; }
.form-actions { display: flex; gap: 8px; margin-top: 14px; }
/* A save bar: its undo, then the act, bottom right (PF-8 (a); BO-4 (a)). */
.form-actions--end { justify-content: flex-end; }
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-label { font-size: .8rem; font-weight: 600; color: var(--color-neutral-700); }

textarea.form-input {
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

.form-hint {
    display: block;
    font-size: .78rem;
    color: var(--color-neutral-500);
    margin-top: 4px;
    line-height: 1.4;
}

.form-hint-warning {
    color: var(--color-warning-text, #92400e);
}

/* ── Progress Bar ──────────────────────────────────────────────────────────── */
.progress-bar-wrap {
    display: flex; align-items: center; gap: 8px; margin: 8px 0;
}
.progress-bar-label {
    font-size: .75rem; font-weight: 600; color: var(--color-neutral-700);
    white-space: nowrap;
}
.progress-bar {
    display: flex; /* was inherited from bootstrap's .progress-bar pre-#648 */
    flex: 1; height: 8px; border-radius: 4px;
    background: var(--color-neutral-100); overflow: hidden;
    min-width: 60px;
}
.progress-bar-fill-brand { height: 100%; border-radius: 4px; background: var(--color-brand); transition: width .3s ease; }
.progress-bar-fill-green { height: 100%; border-radius: 4px; background: var(--progress-green); transition: width .3s ease; }
.progress-bar-fill-yellow { height: 100%; border-radius: 4px; background: var(--progress-yellow); transition: width .3s ease; }
.progress-bar-fill-red { height: 100%; border-radius: 4px; background: var(--progress-red); transition: width .3s ease; }
.progress-bar-value {
    font-size: .75rem; font-weight: 600; color: var(--color-neutral-500);
    min-width: 32px; text-align: right;
}

/* The toggle switch is the kit's .shui-switch (kit-globals.css); the page-local one retired unused (#1040). */

/* Stub Placeholder retired — every empty state now renders the kit EmptyState
   (ShiftHR.UI); the last .stub-placeholder consumers migrated in the Phase 3
   surface re-platforming (#648). */

/* ── The error surfaces (R8 (a), 5L) ──────────────────────────────────────────
   The error page, the error boundary's card and the not-found page are the kit's ProblemCard; this row
   is the boundary's Dismiss under its other cards (unavailable, the contract, refusals). */
.boundary-actions { display: flex; justify-content: center; gap: var(--space-3); }

/* ── Auto-Promote Prompt ───────────────────────────────────────────────────── */
.auto-promote-prompt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin: 12px 0;
    border-radius: 8px;
    background: var(--color-warning-light);
    border: 1px solid var(--color-warning-border);
    color: var(--color-warning-text);
    font-size: .85rem;
    line-height: 1.4;
}
/* ── Page Header Row ───────────────────────────────────────────────────────── */
.page-header-row {
    display: flex; justify-content: space-between; align-items: flex-start;
}
.page-header-actions { display: flex; gap: 8px; }

/* ── Helper Text ───────────────────────────────────────────────────────────── */
/* .muted-note replaced bootstrap's .text-muted at the #648 retirement —
   token-backed, theme-correct in both registers (see gotchas_ui_features.md). */
.muted-note { color: var(--color-neutral-500); font-size: .8rem; }

/* ── DataTable ────────────────────────────────────────────────────────────── */
.data-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--color-neutral-200);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.data-table thead {
    background: var(--color-neutral-50);
    border-bottom: 1px solid var(--color-neutral-200);
}
.data-table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: .8rem;
    color: var(--color-neutral-700);
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}
.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-neutral-100);
    color: var(--color-neutral-800);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--color-neutral-50); }

.data-table-sortable {
    cursor: pointer;
    transition: color .15s;
}
.data-table-sortable:hover { color: var(--color-brand); }
.data-table-sortable::after {
    content: "\2195";
    margin-left: 4px;
    font-size: .7rem;
    opacity: .4;
}
.data-table-sortable.sort-asc::after {
    content: "\2191";
    opacity: 1;
    color: var(--color-brand);
}
.data-table-sortable.sort-desc::after {
    content: "\2193";
    opacity: 1;
    color: var(--color-brand);
}

.data-table-row-clickable { cursor: pointer; }
.data-table-row-clickable:hover { background: var(--color-brand-light); }

.data-table-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--color-neutral-500);
}
.data-table-empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-neutral-600);
    margin: 0 0 6px;
}
.data-table-empty-description {
    font-size: .85rem;
    margin: 0;
}

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 200;
    animation: modal-fade-in .15s ease-out;
}
.modal-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 201;
    max-width: 480px;
    width: 90%;
    animation: modal-scale-in .15s ease-out;
}
.modal-panel-sm { max-width: 360px; }
.modal-panel-md { max-width: 480px; }
.modal-panel-lg { max-width: 640px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 0;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-neutral-900);
}
.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--color-neutral-500);
    font-size: 1rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background .15s, color .15s;
}
.modal-close:hover {
    background: var(--color-neutral-100);
    color: var(--color-neutral-800);
}
.modal-body {
    padding: 16px 24px;
    font-size: .9rem;
    color: var(--color-neutral-700);
    line-height: 1.5;
}
.modal-footer {
    padding: 0 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes modal-scale-in {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.96); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* The kit's Badge, Spinner, Skeleton and error-block classes (.shui-badge, .shui-spinner,
   .shui-skel, .shui-error-*) live in ShiftHR.UI/wwwroot/css/kit-controls.css (#1017), which
   App.razor links directly after this file so the cascade is unchanged. */
