:root {
    --primary: #1a6fd4;
    --primary-mid: #1a6fd4;
    --primary-light: #dbeafe;
    --manager-color: #d97706;
    --manager-bg: #fffbeb;
    --manager-icon-bg: #fef3c7;
    --devops-color: #7c3aed;
    --devops-bg: #f5f3ff;
    --devops-icon-bg: #ede9fe;
    --success: #059669;
    --success-bg: #ecfdf5;
    --success-icon-bg: #d1fae5;
    --all-color: #2563eb;
    --all-bg: #eff6ff;
    --all-icon-bg: #dbeafe;
    --danger: #dc2626;
    --danger-bg: #fff5f5;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-700: #334155;
    --gray-900: #0f172a;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 16px rgba(0,0,0,0.07), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.06);
    --radius: 14px;
    --radius-sm: 9px;
    --ease: 0.18s ease;

    /* ── Background Image ──────────────────────────────────────────
       To set a page background image, change --page-bg-image to:
         url('https://your-cdn.com/your-background.jpg')
       or point to a local file:
         url('/images/bg.jpg')
       Leave as "none" for the default solid colour background.
    ─────────────────────────────────────────────────────────────── */
    --page-bg-image: none;
    --page-bg-color: #eef2f7;
    --page-bg-overlay: rgba(241, 245, 249, 0.82);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--page-bg-color);
    background-image: var(--page-bg-image);
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

/* Frosted overlay when a background image is active */
body::before {
    content: '';
    display: block;
    position: fixed;
    inset: 0;
    background: var(--page-bg-overlay);
    pointer-events: none;
    z-index: 0;
}

.page-wrapper,
.email-action-banner { position: relative; z-index: 1; }

/* ─── HEADER ──────────────────────────────────────────── */

.site-header {
    background: #ffffff;
    padding: 0;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    width: 100%;
    padding: 0 28px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand-logo {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #0f2040 0%, #1a6fd4 100%);
    border-radius: 10px;
    padding: 8px 14px;
    box-shadow: 0 2px 8px rgba(26, 111, 212, 0.25);
}

.brand-logo img {
    height: 30px;
    width: auto;
}

.brand-divider {
    width: 1px;
    height: 38px;
    background: #e2e8f0;
}

.brand-text h1 {
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.brand-text p {
    color: #94a3b8;
    font-size: 0.73rem;
    margin-top: 2px;
    letter-spacing: 0.03em;
    font-weight: 400;
    text-transform: uppercase;
}

.header-metrics {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 4px;
    gap: 0;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
}

.metric-value {
    color: #0f172a;
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.metric-value.warning { color: #d97706; }
.metric-value.success { color: #059669; }

.metric-label {
    color: #94a3b8;
    font-size: 0.65rem;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.metric-divider {
    width: 1px;
    height: 30px;
    background: #e2e8f0;
    flex-shrink: 0;
}

/* ─── PAGE WRAPPER ────────────────────────────────────── */

.page-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 28px 56px;
}

/* ─── EMAIL ACTION BANNER ────────────────────────────── */

.email-action-banner {
    max-width: 1280px;
    margin: 20px auto 0;
    padding: 0 28px;
}

.email-action-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 2px solid #1a6fd4;
    border-radius: var(--radius);
    padding: 18px 22px;
    box-shadow: 0 4px 20px rgba(26,111,212,0.12);
}

.email-action-inner.email-action-done {
    border-color: var(--success);
    box-shadow: 0 4px 20px rgba(5,150,105,0.12);
}

.email-action-icon { font-size: 1.8rem; flex-shrink: 0; }

.email-action-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.email-action-text strong {
    font-size: 0.95rem;
    color: var(--gray-900);
}

.email-action-text span {
    font-size: 0.82rem;
    color: var(--gray-500);
}

.email-action-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ─── TAB NAV ─────────────────────────────────────────── */

.tab-nav {
    margin: 26px 0 22px;
}

.tab-nav-inner {
    display: flex;
    gap: 4px;
    background: white;
    border-radius: var(--radius);
    padding: 5px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow-x: auto;
}

.tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    transition: all var(--ease);
    position: relative;
    white-space: nowrap;
    font-family: inherit;
    letter-spacing: -0.01em;
}

.tab:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 10px rgba(30, 58, 95, 0.35);
    font-weight: 600;
}

.tab-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    opacity: 0.85;
}

.tab-nav-spacer { flex: 1; }

.btn-staff-login {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    transition: all var(--ease);
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-staff-login:hover {
    background: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.btn-staff-login.staff-btn-loading {
    opacity: 0.6;
    cursor: not-allowed;
    animation: pulse-opacity 1s infinite;
}

@keyframes pulse-opacity {
    0%, 100% { opacity: 0.6; }
    50%       { opacity: 0.9; }
}

.btn-staff-login.staff-btn-signed-in {
    background: var(--primary-light);
    border-color: #bfdbfe;
    color: var(--primary);
    font-weight: 600;
    gap: 8px;
    cursor: default;
}

.staff-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-left: 2px;
    opacity: 0.6;
    transition: all var(--ease);
    cursor: pointer;
}

.staff-logout:hover {
    background: rgba(0,0,0,0.12);
    opacity: 1;
}

.staff-role-chip {
    background: var(--primary);
    color: white;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-left: 2px;
}

.staff-tab {
    border-left: 1.5px solid var(--gray-200);
    margin-left: 4px;
    padding-left: 16px;
}

.readonly-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-400);
    flex-shrink: 0;
}

.staff-modal-content {
    max-width: 380px !important;
    text-align: center;
    padding: 44px 36px !important;
}

.staff-modal-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-light);
    color: var(--primary-mid);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
}

.staff-modal-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
}

.staff-modal-content > p {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 22px;
    line-height: 1.5;
}

.tab-badge {
    display: none;
    background: #ef4444;
    color: white;
    border-radius: 20px;
    padding: 1px 7px;
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    line-height: 1.6;
}

.tab-badge.visible { display: inline-block; }
.tab.active .tab-badge { background: rgba(255,255,255,0.28); }

/* ─── TAB CONTENT ────────────────────────────────────── */

.tab-content { display: none; }

.tab-content.active {
    display: block;
    animation: fadeUp 0.2s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── PIPELINE CARD ──────────────────────────────────── */

.pipeline-card {
    background: white;
    border-radius: var(--radius);
    padding: 26px 28px 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    margin-bottom: 18px;
}

.pipeline-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 22px;
}

.pipeline-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.pipeline-subtitle {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-top: 3px;
}

.btn-refresh {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    transition: all var(--ease);
    font-family: inherit;
    flex-shrink: 0;
}

.btn-refresh:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.pipeline-stages {
    display: flex;
    align-items: center;
    gap: 0;
}

.pipeline-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px 16px;
    border-radius: var(--radius-sm);
    position: relative;
    transition: all var(--ease);
}

.clickable-stage {
    cursor: pointer;
}

.clickable-stage:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.stage-all       { background: var(--all-bg); }
.stage-manager   { background: var(--manager-bg); }
.stage-devops    { background: var(--devops-bg); }
.stage-done      { background: var(--success-bg); }

/* pulse dot for stages with pending items */
.stage-pulse {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    animation: pulse 1.8s infinite;
}

.stage-pulse.active { display: block; }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(1.5); }
}

.stage-icon-wrap {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stage-icon-wrap svg { width: 22px; height: 22px; }

.stage-all     .stage-icon-wrap { background: var(--all-icon-bg);     color: var(--all-color); }
.stage-manager .stage-icon-wrap { background: var(--manager-icon-bg); color: var(--manager-color); }
.stage-devops  .stage-icon-wrap { background: var(--devops-icon-bg);  color: var(--devops-color); }
.stage-done    .stage-icon-wrap { background: var(--success-icon-bg); color: var(--success); }

.stage-num {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.stage-all     .stage-num { color: var(--all-color); }
.stage-manager .stage-num { color: var(--manager-color); }
.stage-devops  .stage-num { color: var(--devops-color); }
.stage-done    .stage-num { color: var(--success); }

.stage-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: center;
}

.stage-cta {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(0,0,0,0.07);
    color: var(--gray-400);
    transition: all var(--ease);
    opacity: 0;
}

.clickable-stage:hover .stage-cta { opacity: 1; }
.stage-manager:hover .stage-cta { background: var(--manager-color); color: white; }
.stage-devops:hover  .stage-cta { background: var(--devops-color);  color: white; }

.pipeline-connector {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 0 6px;
    color: var(--gray-300);
}

/* ─── CARDS ──────────────────────────────────────────── */

.card {
    background: white;
    border-radius: var(--radius);
    padding: 28px 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    margin-bottom: 18px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--gray-200);
    gap: 16px;
}

.card-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.card-subtitle {
    color: var(--gray-400);
    font-size: 0.84rem;
    margin-top: 3px;
}

/* ─── FORM ────────────────────────────────────────────── */

.form-card {
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* When department is hidden, entity spans the full row */
.form-row .form-group.full-width {
    grid-column: 1 / -1;
}

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: 0.84rem;
    color: var(--gray-700);
    letter-spacing: -0.01em;
}

.required { color: #ef4444; }

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--gray-900);
    background: var(--gray-50);
    transition: all var(--ease);
    appearance: none;
    -webkit-appearance: none;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2394a3b8'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 15px;
    padding-right: 36px;
    cursor: pointer;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-mid);
    background: white;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--gray-400); }

.field-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
}

.form-group input[readonly] {
    background: var(--gray-50);
    color: var(--gray-600);
    cursor: default;
    border-color: var(--gray-200);
}

.sso-identity-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 18px;
    padding: 9px 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: #1e40af;
}


.form-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 4px;
    border-top: 1px solid var(--gray-100);
    margin-top: 4px;
}

/* ─── BUTTONS ────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--ease);
    font-family: inherit;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #1a3460 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(37,99,235,0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(37,99,235,0.45);
}

.btn-large { padding: 13px 26px; font-size: 0.9rem; }

.btn-success {
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(16,185,129,0.25);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(16,185,129,0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #991b1b 0%, #ef4444 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(239,68,68,0.25);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(239,68,68,0.4);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1.5px solid var(--gray-200);
}

.btn-secondary:hover { background: var(--gray-200); }

/* ─── REQUEST LIST ───────────────────────────────────── */

.request-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.request-item {
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 16px 18px 16px 22px;
    cursor: pointer;
    transition: all var(--ease);
    position: relative;
    overflow: hidden;
}

.request-item::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--gray-200);
    transition: background var(--ease);
}

.request-item.status-pending_manager::before { background: var(--manager-color); }
.request-item.status-pending_devops::before  { background: var(--devops-color); }
.request-item.status-completed::before       { background: var(--success); }
.request-item.status-rejected_by_manager::before,
.request-item.status-rejected_by_devops::before { background: var(--danger); }

.request-item:hover {
    border-color: var(--primary-mid);
    background: white;
    box-shadow: var(--shadow);
    transform: translateX(3px);
}

.request-item:hover::before { background: var(--primary-mid); }

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 7px;
    gap: 12px;
}

.request-title {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.9rem;
    letter-spacing: -0.01em;
}

.status-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-pending_manager  { background: #fef3c7; color: #92400e; }
.status-pending_devops   { background: #ede9fe; color: #5b21b6; }
.status-completed        { background: #d1fae5; color: #065f46; }
.status-rejected_by_manager,
.status-rejected_by_devops { background: #fee2e2; color: #991b1b; }

.request-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.8rem;
    color: var(--gray-400);
}

.meta-entity {
    font-weight: 600;
    color: var(--primary);
    background: #eff6ff;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.request-justification {
    margin-top: 10px;
    padding: 10px 14px;
    background: var(--gray-50);
    border-left: 3px solid var(--gray-200);
    border-radius: 0 6px 6px 0;
    font-size: 0.82rem;
    color: var(--gray-500);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ─── FILTER BAR ─────────────────────────────────────── */

.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.filter-bar label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-400);
    white-space: nowrap;
}

.filter-bar select {
    padding: 7px 30px 7px 11px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-family: inherit;
    color: var(--gray-700);
    background: white;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2394a3b8'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 13px;
    transition: border-color var(--ease);
}

.filter-bar select:focus { outline: none; border-color: var(--primary-mid); }

/* ─── MODAL ──────────────────────────────────────────── */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 18, 38, 0.65);
    backdrop-filter: blur(5px);
    z-index: 1000;
    overflow-y: auto;
    padding: 48px 20px;
}

.modal-content {
    background: white;
    max-width: 680px;
    margin: 0 auto;
    border-radius: 18px;
    padding: 36px;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.22s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(-8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--gray-100);
    border: none;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-400);
    transition: all var(--ease);
}

.modal-close:hover { background: var(--gray-200); color: var(--gray-900); }

#modalBody h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.detail-section { margin-bottom: 22px; }

.detail-section h3 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--gray-400);
    margin-bottom: 11px;
}

.detail-row {
    display: flex;
    align-items: baseline;
    margin-bottom: 8px;
    gap: 12px;
}

.detail-label {
    font-weight: 600;
    color: var(--gray-500);
    font-size: 0.84rem;
    width: 140px;
    flex-shrink: 0;
}

.detail-value {
    color: var(--gray-900);
    font-size: 0.88rem;
}

.justification-text {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    color: var(--gray-700);
    font-size: 0.88rem;
    line-height: 1.75;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.approval-form {
    margin-top: 20px;
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
}

.approval-form h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 16px;
}

.approval-history { margin-top: 20px; }

.approval-history h3 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--gray-400);
    margin-bottom: 11px;
}

.approval-item {
    padding: 13px 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border-left: 4px solid var(--gray-200);
    background: var(--gray-50);
    font-size: 0.85rem;
    line-height: 1.6;
}

.approval-item.approved { border-left-color: #10b981; background: #f0fdf4; }
.approval-item.rejected { border-left-color: #ef4444; background: #fef2f2; }

/* ─── TOAST ──────────────────────────────────────────── */

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 13px 18px;
    background: var(--gray-900);
    color: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1001;
    font-size: 0.875rem;
    font-weight: 500;
    max-width: 340px;
}

.toast.show   { transform: translateY(0); opacity: 1; }
.toast.success { background: #047857; }
.toast.error   { background: #dc2626; }

/* ─── ADMIN SUMMARY CARDS ────────────────────────────── */

.admin-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

.summary-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.summary-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.summary-icon-blue   { background: var(--all-icon-bg);     color: var(--all-color); }
.summary-icon-purple { background: var(--devops-icon-bg);  color: var(--devops-color); }
.summary-icon-amber  { background: var(--manager-icon-bg); color: var(--manager-color); }
.summary-icon-green  { background: var(--success-icon-bg); color: var(--success); }

.summary-num {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.summary-label {
    font-size: 0.78rem;
    color: var(--gray-500);
    font-weight: 600;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ─── ADMIN TOOLBAR ──────────────────────────────────── */

.admin-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 10px;
    color: var(--gray-400);
    pointer-events: none;
}

.search-input {
    padding: 8px 12px 8px 32px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-family: inherit;
    color: var(--gray-900);
    background: var(--gray-50);
    width: 200px;
    transition: all var(--ease);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-mid);
    background: white;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.filter-select {
    padding: 8px 28px 8px 10px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-family: inherit;
    color: var(--gray-700);
    background: white;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2394a3b8'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 13px;
    transition: border-color var(--ease);
}

.filter-select:focus { outline: none; border-color: var(--primary-mid); }

.btn-export {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--ease);
    font-family: inherit;
    white-space: nowrap;
}

.btn-export:hover {
    background: #047857;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5,150,105,0.3);
}

/* ─── ACCESS TABLE ───────────────────────────────────── */

.table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 1240px;   /* ~25 rows + header */
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
}

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

.access-table thead tr {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
}

.access-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--gray-50);
}

.access-table th {
    padding: 11px 14px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
    white-space: nowrap;
}

.access-table tbody tr {
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--ease);
}

.access-table tbody tr:last-child { border-bottom: none; }
.access-table tbody tr:hover { background: #f8faff; }

.access-table td {
    padding: 12px 14px;
    vertical-align: middle;
    color: var(--gray-700);
}

.td-num {
    color: var(--gray-400);
    font-size: 0.8rem;
    font-weight: 600;
    width: 36px;
}

.td-user-name {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.88rem;
}

.td-user-email {
    font-size: 0.78rem;
    color: var(--gray-400);
    margin-top: 2px;
}

.td-approver {
    font-weight: 500;
    color: var(--gray-700);
}

.td-note {
    font-size: 0.78rem;
    color: var(--gray-400);
    margin-top: 2px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.td-date {
    font-size: 0.8rem;
    color: var(--gray-500);
    white-space: nowrap;
}

.td-granted {
    color: var(--success);
    font-weight: 600;
}

.dept-tag {
    display: inline-block;
    background: var(--gray-100);
    color: var(--gray-600, #4b5563);
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.role-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.role-tag.role-read-only    { background: #f1f5f9; color: #475569; }
.role-tag.role-developer    { background: #dbeafe; color: #1e40af; }
.role-tag.role-power-user   { background: #ede9fe; color: #5b21b6; }
.role-tag.role-admin        { background: #fef3c7; color: #92400e; }
.role-tag.role-super-admin  { background: #fee2e2; color: #991b1b; }

.table-loading,
.table-empty {
    text-align: center;
    padding: 52px;
    color: var(--gray-400);
    font-size: 0.875rem;
}

.admin-tab { color: #7c3aed !important; }
.tab.active.admin-tab { background: #7c3aed !important; color: white !important; }

@media (max-width: 900px) {
    .admin-summary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .admin-summary { grid-template-columns: 1fr; }
    .admin-actions { flex-direction: column; align-items: stretch; }
    .search-input  { width: 100%; }
}

/* ─── IDENTITY GATE ──────────────────────────────────── */

.identity-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 52px 24px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: 1.5px dashed var(--gray-200);
}

.gate-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--primary-light);
    color: var(--primary-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.identity-gate h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
}

.identity-gate > p {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 22px;
    max-width: 320px;
}

.gate-form {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 380px;
}

.gate-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--gray-900);
    background: white;
    transition: all var(--ease);
}

.gate-input:focus {
    outline: none;
    border-color: var(--primary-mid);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.gate-input-error {
    border-color: var(--danger) !important;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-6px); }
    75%       { transform: translateX(6px); }
}

.gate-hint {
    margin-top: 14px;
    font-size: 0.75rem;
    color: var(--gray-400);
}

.acting-as {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--gray-400);
    margin-left: 8px;
    font-style: italic;
}

/* ─── EMPTY / LOADING ────────────────────────────────── */

.loading {
    text-align: center;
    color: var(--gray-400);
    padding: 52px;
    font-size: 0.875rem;
}

.empty-state {
    text-align: center;
    color: var(--gray-400);
    padding: 52px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: 1.5px dashed var(--gray-200);
    font-size: 0.875rem;
}

/* ─── APPROVED MANAGERS ──────────────────────────────── */

.managers-card { margin-top: 24px; }

.add-manager-form {
    padding: 16px 24px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.add-manager-fields {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.add-manager-input {
    flex: 1;
    min-width: 180px;
    padding: 9px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--gray-900);
    background: #fff;
    transition: border-color var(--ease);
}

.add-manager-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,111,212,0.12);
}

.managers-table-btn-delete {
    background: none;
    border: 1.5px solid var(--gray-200);
    border-radius: 7px;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--danger);
    cursor: pointer;
    transition: background var(--ease), border-color var(--ease);
    white-space: nowrap;
}

.managers-table-btn-delete:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
}

/* ─── RESPONSIVE ─────────────────────────────────────── */

@media (max-width: 900px) {
    .pipeline-stages {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .pipeline-stage {
        flex-direction: row;
        gap: 14px;
        padding: 14px 16px;
        text-align: left;
    }

    .stage-num { font-size: 1.5rem; }

    .pipeline-connector {
        justify-content: center;
        transform: rotate(90deg);
        padding: 0;
    }

    .stage-cta { opacity: 1; }
}

@media (max-width: 768px) {
    .page-wrapper { padding: 0 16px 40px; }
    .header-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
    .header-metrics { width: 100%; justify-content: center; }
    .metric { padding: 0 14px; }
    .form-row { grid-template-columns: 1fr; }
    .card { padding: 20px; }
    .card-header { flex-direction: column; gap: 12px; }
    .modal-content { padding: 22px; }
    .detail-row { flex-direction: column; gap: 3px; }
    .detail-label { width: 100%; }
    .action-buttons { flex-direction: column; }
    .btn { width: 100%; justify-content: center; }
    .form-footer { justify-content: stretch; }
    .form-footer .btn { width: 100%; }
}

/* ── Login Wall ────────────────────────────────────────────── */
.login-wall {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wall-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 48px 52px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 24px 64px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-wall-logo {
    margin-bottom: 28px;
}

.login-wall-logo img {
    height: 40px;
    filter: invert(1) brightness(0);
}

.login-wall-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 10px;
}

.login-wall-sub {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin: 0 0 28px;
}

.login-wall-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--gray-500);
    font-size: 0.85rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.login-wall-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #0078d4;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.login-wall-btn:hover { background: #005fa3; }
