/* ===========================================================================
   Employee Status Dashboard — Styles
   Dark-themed UI with glassmorphism (based on gws-groups-manager).
   =========================================================================== */

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Real Brand — Primary */
    --bg: #050E3D;
    /* Cobalt */
    --bg-elevated: #0a1648;
    --bg-card: rgba(10, 22, 72, 0.7);
    /* Opaque equivalent of --bg-card composited over --bg. Sticky table cells
       need this: the translucent version lets scrolled content bleed through. */
    --bg-card-solid: #091445;
    --bg-card-hover: rgba(15, 30, 90, 0.8);
    --border: rgba(191, 221, 219, 0.1);
    /* Seaglass-tinted */
    --border-focus: rgba(0, 251, 240, 0.5);
    /* Aqua */
    --text: #FFFFFF;
    /* Chalk */
    --text-muted: #BFDDDB;
    /* Seaglass */
    --text-dim: #615B56;
    /* Slate */
    /* Real Brand — Accents */
    --accent: #00FBF0;
    /* Aqua */
    --accent-hover: #33fcf3;
    --accent-glow: rgba(0, 251, 240, 0.15);
    --success: #00FBF0;
    /* Aqua */
    --success-bg: rgba(0, 251, 240, 0.1);
    --warning: #FF557E;
    /* Coral */
    --warning-bg: rgba(255, 85, 126, 0.1);
    --danger: #FF557E;
    /* Coral */
    --danger-bg: rgba(255, 85, 126, 0.1);
    --info: #05C3F9;
    /* Legacy Blue */
    --info-bg: rgba(5, 195, 249, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --transition: 0.2s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    font-size: 15px;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* --- Navbar --- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 60px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text);
}

.nav-logo {
    height: 24px;
    width: auto;
    object-fit: contain;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--border);
}

.nav-email {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --- Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.container.has-sidebar {
    margin-left: 200px;
}

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: 56px;
    /* below navbar */
    left: 0;
    bottom: 0;
    width: 200px;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    z-index: 500;
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
}

.sidebar-version {
    margin-top: auto;
    padding: 0.75rem 1rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.4;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.sidebar-link:hover {
    background: rgba(0, 251, 240, 0.06);
    color: var(--text);
}

.sidebar-link.active {
    background: rgba(0, 251, 240, 0.10);
    color: var(--accent);
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.4rem;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
}

.btn-sm {
    padding: 0.35rem 0.9rem;
    font-size: 0.8rem;
}

.btn-xs {
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    gap: 0.3rem;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 2px 12px rgba(248, 113, 113, 0.2);
}

.btn-danger:hover {
    background: #ef4444;
    box-shadow: 0 4px 20px rgba(248, 113, 113, 0.3);
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--warning);
    color: #1a1a2e;
    box-shadow: 0 2px 12px rgba(251, 191, 36, 0.2);
}

.btn-warning:hover {
    background: #f59e0b;
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.3);
    transform: translateY(-1px);
}

/* --- Card Grid --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

/* --- Stacked Forms --- */
.form-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-field label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.label-hint {
    font-weight: 400;
    color: var(--text-dim);
    font-size: 0.8rem;
}

.inline-form {
    display: inline;
}

.btn-google {
    background: #fff;
    color: #3c4043;
    font-weight: 500;
    padding: 0.7rem 1.6rem;
    border: 1px solid #dadce0;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-google:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.google-logo {
    width: 20px;
    height: 20px;
}

/* --- Login Page --- */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 60px);
    padding: 2rem;
}

.login-card {
    text-align: center;
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow);
    animation: fadeUp 0.5s ease;
}

.login-icon {
    margin-bottom: 1.2rem;
}

.login-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.login-card h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* --- Error / Forbidden Page --- */
.error-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 60px);
    padding: 2rem;
}

.error-card {
    text-align: center;
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow);
    animation: fadeUp 0.5s ease;
}

.error-icon svg {
    width: 56px;
    height: 56px;
    color: var(--danger);
    margin-bottom: 1.2rem;
}

.error-card h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--danger);
}

.error-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Two buttons on the 403 page when the user has a module to be sent to. */
.error-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* --- Dashboard --- */
.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--text), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}

/* --- Search Card --- */
.search-card {
    margin-bottom: 2rem;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: all var(--transition);
    animation: fadeUp 0.4s ease;
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.card-icon {
    width: 22px;
    height: 22px;
    color: var(--accent);
    flex-shrink: 0;
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

/* --- Forms --- */
.form-inline {
    display: flex;
    gap: 0;
}

.input-group {
    display: flex;
    width: 100%;
    gap: 0;
}

.input-group .input {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border-right: none;
    flex: 1;
}

.input-group .btn {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.input {
    width: 100%;
    padding: 0.6rem 0.9rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: all var(--transition);
    outline: none;
}

.input::placeholder {
    color: var(--text-dim);
}

.input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(255, 255, 255, 0.06);
}

/* --- Provider Results --- */
.results-section {
    animation: fadeUp 0.4s ease;
}

.generated-stamp {
    margin-top: -0.75rem;
    margin-bottom: 1.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Caveat on what was searched — legible, not decorative. It changes how the
   results should be read, so it must not fade into the chrome. */
.resolution-note {
    margin-top: -0.75rem;
    margin-bottom: 1.25rem;
    padding: 0.55rem 0.85rem;
    border-left: 2px solid var(--info);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--info-bg);
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.resolution-note strong {
    color: var(--text);
}

/* Amber, like .matrix-error: something we could not check, not a finding. */
.resolution-warning {
    border-left-color: #FFB020;
    background: rgba(255, 176, 32, 0.1);
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.results-title {
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
}

.export-actions {
    display: flex;
    gap: 0.5rem;
}

.provider-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.highlight {
    color: var(--accent);
}

/* --- Tab Navigation --- */
.tab-bar {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: -1px;
}

.tab-btn:hover {
    color: var(--text);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

/* --- Consolidated Matrix --- */
.consolidated-card {
    overflow: visible;
}

/* Size to content, but never narrower than the card. With width:100% the
   columns fought the 6.5rem provider min-width and squeezed the name column
   until it wrapped; at 7 providers the last one clipped instead of scrolling.
   .table-wrapper (overflow-x:auto) does the scrolling. */
.consolidated-table {
    width: max-content;
    min-width: 100%;
}

/* One cell carries the whole identity — name, address, job title, department.
   As separate columns those four cost 928px of the 1101px available, which
   pushed five of the seven provider columns off a 1440px screen; the badges
   are what this tab is for, so the text stacks instead. */
.consolidated-table .cell-name {
    white-space: normal;
    vertical-align: top;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.emp-name {
    white-space: nowrap;
    font-weight: 500;
}

.emp-mail {
    font-size: 0.78rem;
    color: var(--accent);
    white-space: nowrap;
}

/* The only line allowed to wrap — a long title would otherwise widen the
   sticky column and undo the space this layout just bought back. */
.emp-job {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.35;
    margin-top: 0.1rem;
    max-width: 20rem;
}

/* The employee name stays put while provider columns scroll, so a badge is
   never orphaned from the person it describes. Only column 0 is sticky —
   pinning the email column too would need a hardcoded left offset matching
   column 0's width, which a long name silently breaks. */
.consolidated-table .cell-name,
.consolidated-table th[data-col="0"] {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--bg-card-solid);
    /* Padding + rule so scrolled badges don't butt against the name. */
    padding-right: 1rem;
    border-right: 1px solid var(--border);
}

.consolidated-table th {
    white-space: nowrap;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.consolidated-table th.consolidated-provider-header {
    text-align: center !important;
    white-space: normal;
    line-height: 1.25;
    vertical-align: bottom;
    padding-bottom: 0.5rem;
}

/* The width cap lives on an inner block, not the th: max-width on a table cell
   is ignored under auto table layout, so "GOOGLE WORKSPACE" kept one line and
   ran into the next header. A block child respects it and wraps. */
.provider-header-label {
    display: block;
    max-width: 6rem;
    margin: 0 auto;
}

.cell-matrix {
    text-align: center;
    padding: 0.4rem 0.25rem;
}

.matrix-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.matrix-active {
    background: rgba(0, 251, 240, 0.12);
    color: #00FBF0;
    border: 1px solid rgba(0, 251, 240, 0.25);
}

/* Okta: the account is live but the person can't sign in right now. Aqua fill
   (still Active) with amber text and a dashed edge, so it reads as "active, needs
   attention" — distinct from solid amber .matrix-error/.matrix-unknown. */
.matrix-active---locked-out,
.matrix-active---password-expired,
.matrix-active---recovery {
    background: rgba(0, 251, 240, 0.12);
    color: #FFB020;
    border: 1px dashed rgba(255, 176, 32, 0.5);
}

/* Okta STAGED/PROVISIONED: account exists, never activated. */
.matrix-pending {
    background: rgba(5, 195, 249, 0.12);
    color: #05C3F9;
    border: 1px solid rgba(5, 195, 249, 0.25);
}

.matrix-count {
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: help;
}

.matrix-disabled {
    background: rgba(255, 85, 126, 0.12);
    color: #FF557E;
    border: 1px solid rgba(255, 85, 126, 0.25);
}

.matrix-not-found {
    background: rgba(97, 91, 86, 0.15);
    color: #8a8480;
    border: 1px solid rgba(97, 91, 86, 0.2);
}

/* Amber deliberately — NOT the coral used by .matrix-disabled. "We could not
   reach this provider" must never be mistaken for "access is disabled here". */
.matrix-error {
    background: rgba(255, 176, 32, 0.14);
    color: #FFB020;
    border: 1px solid rgba(255, 176, 32, 0.3);
}

.matrix-unknown {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.25);
}

.provider-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.provider-card {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    animation: fadeUp 0.4s ease;
}

/* Provider Details: every card renders the same category columns at fixed
   widths (providers/display.py), so the stacked tables line up vertically. */
.provider-table {
    table-layout: fixed;
    width: 100%;
}
/* .table th/td further down set white-space: nowrap; this needs the extra
   class to win, or long addresses spill into the next column. */
.table.provider-table td,
.table.provider-table th {
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: top;
}
.provider-table .pcol-name { width: 12%; }
.provider-table .pcol-account { width: 19%; }
.provider-table .pcol-status { width: 10%; }
.provider-table .pcol-org { width: 13%; }
.provider-table .pcol-created { width: 9%; }
.provider-table .pcol-last_signin { width: 9%; }
.provider-table .pcol-ended { width: 8%; }
.provider-table .pcol-details { width: 20%; }
/* Dates and status badges read badly when broken ("2024-" / "03-04"). */
.table.provider-table td.cell-date,
.table.provider-table .status-badge {
    white-space: nowrap;
}
.provider-table .cell-details {
    font-size: 0.75rem;
    line-height: 1.5;
}
.detail-pair {
    display: inline-block;
    margin: 0 0.6rem 0.15rem 0;
    color: var(--text);
}
.detail-label {
    color: var(--text-muted);
    text-transform: lowercase;
}

.provider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.provider-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.provider-icon {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.provider-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    color: var(--danger);
    font-size: 0.85rem;
    background: var(--danger-bg);
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 0.5rem;
    background: var(--accent-glow);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 999px;
}

.badge-error {
    background: var(--danger-bg);
    color: var(--danger);
}

/* --- Status Badges --- */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.status-active,
.status-activated,
.status-enabled {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(0, 251, 240, 0.25);
}

/* Access removed. Keep every provider's own word for it in this one bucket —
   banned is YouTrack's, inactive/blocked are Ramp's — so a revoked account
   reads the same colour no matter which system reported it. */
.status-terminated,
.status-deactivated,
.status-archived,
.status-suspended,
.status-disabled,
.status-banned,
.status-inactive,
.status-blocked {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(255, 85, 126, 0.25);
}

/* Account exists but access hasn't begun — not the same as revoked, and it
   must not read as if it were. */
.status-accepted,
.status-staged,
.status-pending,
.status-onboarding,
.status-draft,
.status-invited,
.status-invite-pending,
.status-invite-expired {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(5, 195, 249, 0.25);
}

.status-active---locked-out,
.status-active---password-expired,
.status-active---recovery {
    background: var(--success-bg);
    color: #FFB020;
    border: 1px dashed rgba(255, 176, 32, 0.5);
}

.status-unknown {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* --- Tables --- */
.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.table thead {
    background: rgba(255, 255, 255, 0.03);
}

.table th {
    text-align: left;
    padding: 0.7rem 1rem;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: color var(--transition);
}

.sortable-header:hover {
    color: var(--text);
}

.sortable-header[data-sort='asc'],
.sortable-header[data-sort='desc'] {
    color: var(--accent);
}

.sort-icon {
    font-size: 0.65rem;
    margin-left: 0.3rem;
    opacity: 0.5;
}

.sortable-header:hover .sort-icon,
.sortable-header[data-sort='asc'] .sort-icon,
.sortable-header[data-sort='desc'] .sort-icon {
    opacity: 1;
}

.table td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    white-space: nowrap;
}

.table tbody tr {
    transition: background var(--transition);
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

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

.cell-name {
    font-weight: 500;
}

.cell-email {
    color: var(--accent);
}

.empty-state {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --- Flash Messages --- */
.flash-container {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    animation: fadeUp 0.3s ease;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.flash-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.flash-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.flash-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.flash-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--transition);
    padding: 0 0.25rem;
    line-height: 1;
}

.flash-close:hover {
    opacity: 1;
}

/* --- Search Progress Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 14, 61, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5);
    animation: fadeUp 0.3s ease;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.modal-providers {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.modal-provider {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-dim);
    transition: color 0.3s ease;
}

.modal-provider.active {
    color: var(--accent);
}

.modal-provider.done {
    color: var(--text-muted);
}

.provider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-dim);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.modal-provider.active .provider-dot {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
    animation: pulse 1s ease infinite;
}

.modal-provider.done .provider-dot {
    background: var(--text-muted);
}

.modal-sub {
    color: var(--text-dim);
    font-size: 0.8rem;
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 1.25rem;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.3);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- Animations --- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
    }

    .nav-email {
        display: none;
    }

    .container {
        padding: 1.25rem 1rem;
    }

    .login-card,
    .error-card {
        padding: 2rem 1.5rem;
    }
}

/* --- GWS Detail Links --- */
.gws-detail-link {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed rgba(0, 251, 240, 0.35);
    transition: border-color 0.2s;
    cursor: pointer;
}

.gws-detail-link:hover {
    border-bottom-color: var(--accent);
}

/* --- GWS Detail Modal --- */
.gws-detail-card {
    max-width: 750px;
    position: relative;
    text-align: left;
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
    transition: color 0.15s;
}

.modal-close-btn:hover {
    color: var(--text);
}

#gws-detail-body {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 1rem;
}

.gws-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gws-list li {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text);
}

.gws-list li:last-child {
    border-bottom: none;
}

.gws-detail-table-wrap {
    overflow-x: auto;
}

.gws-detail-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.gws-detail-table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.gws-detail-table td {
    font-size: 0.8rem;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.gws-detail-table td:last-child {
    min-width: 5.5rem;
}

/* --- Role Badges --- */
.role-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.role-owner {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.role-manager {
    background: rgba(5, 195, 249, 0.12);
    color: #05c3f9;
    border: 1px solid rgba(5, 195, 249, 0.25);
}

.role-member {
    background: rgba(97, 91, 86, 0.15);
    color: #8a8480;
    border: 1px solid rgba(97, 91, 86, 0.2);
}

/* ===========================================================================
   BC User Access Review — Styles
   =========================================================================== */

/* --- UAR Controls --- */
.uar-controls {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.uar-company-select-wrap {
    flex: 1;
    min-width: 250px;
}

.uar-checkboxes-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

/* --- UAR Filters --- */
.uar-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.uar-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 160px;
}

.uar-filter-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.uar-filter-select {
    padding: 0.45rem 0.7rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.82rem;
    outline: none;
    cursor: pointer;
    transition: all var(--transition);
}

.uar-filter-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.uar-filter-select option {
    background: var(--bg-elevated);
    color: var(--text);
}

.uar-filter-count {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.uar-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    transition: background 0.15s;
    white-space: nowrap;
}

.uar-checkbox-label:hover {
    background: rgba(0, 251, 240, 0.06);
    color: var(--text);
}

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

.uar-checkbox-text {
    user-select: none;
}

/* --- UAR Stats --- */
.uar-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.uar-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    text-align: center;
    animation: fadeUp 0.4s ease;
}

.uar-stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.uar-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* --- Permission & Group Tags --- */
.uar-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.permission-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: rgba(5, 195, 249, 0.1);
    color: #05c3f9;
    border: 1px solid rgba(5, 195, 249, 0.2);
    white-space: nowrap;
}

.group-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.25);
    white-space: nowrap;
}

/* --- Security Group Cards --- */
.uar-group-card {
    padding: 0;
    overflow: hidden;
}

.uar-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.uar-group-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.uar-group-name svg {
    color: var(--accent);
    flex-shrink: 0;
}

.uar-group-members {
    padding: 1rem 1.25rem;
}

.uar-group-members-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.uar-group-permissions {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

.uar-group-perm-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* --- UAR Matrix Table --- */
.uar-matrix-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.uar-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
}

.uar-toggle-label input[type="checkbox"] {
    accent-color: var(--accent);
}

.matrix-col-header {
    text-align: center !important;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    min-width: 70px;
}

.matrix-cell {
    text-align: center !important;
    padding: 0.3rem 0.5rem !important;
}

.matrix-check {
    color: #34d399;
    font-weight: 700;
    font-size: 1rem;
}

.matrix-empty {
    color: var(--text-dim);
    opacity: 0.3;
}

.cell-mono {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.78rem;
    white-space: nowrap;
}

.uar-member-chip {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.text-muted {
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* --- UAR Wide Layout --- */
.container.has-sidebar.uar-wide {
    max-width: none;
    padding-right: 2rem;
}

/* --- Offboarding Schedule --- */
.queue-controls {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.control-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.control-check {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
}

.input-sm {
    padding: 0.45rem 0.7rem;
    font-size: 0.85rem;
    width: auto;
}

.queue-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.queue-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    text-align: center;
}

.queue-stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--text);
}

.queue-stat-label {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.queue-stat-warn {
    border-color: rgba(255, 85, 126, 0.35);
}

.queue-stat-warn .queue-stat-value,
.queue-stat-alert .queue-stat-value {
    color: var(--danger);
}

.queue-stat-alert {
    border-color: var(--danger);
    background: var(--danger-bg);
}

.section-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: -0.35rem 0 0.9rem;
    max-width: 70ch;
}

.cell-muted {
    color: var(--text-dim);
    font-size: 0.82rem;
    white-space: nowrap;
}

/* Every timestamp renders the same way: viewer's zone on top, UTC beneath. */
.cell-time {
    white-space: nowrap;
}

.time-primary {
    display: block;
}

.time-utc,
.time-utc-inline {
    font-size: 0.72rem;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

.time-utc {
    display: block;
}

/* A muted time cell dims its label, not its value — the time still has to be
   legible at a glance. */
.cell-muted .time-primary {
    color: var(--text-muted);
}

.queue-note {
    margin-top: 0.3rem;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    max-width: 44ch;
    white-space: normal;
}

.row-alert {
    background: var(--danger-bg);
}

.cancel-form {
    display: inline-block;
}

.tz-note {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-sub {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.7rem;
    color: var(--text-dim);
}

/* Neutral alias for the wide-table layout (same rules as .uar-wide). */
.container.has-sidebar.page-wide {
    max-width: none;
    padding-right: 2rem;
}

/* Offboarding page: each Okta account found for the person, one per line. */
.cell-okta { min-width: 16rem; }
.okta-account {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.25rem;
}
.okta-login {
    font-size: 0.8rem;
    color: var(--text);
    word-break: break-all;
}
