/* static/style.css - FINAL */

/* ════════════════════════════════════════════════════════════════════════════
   SECURIN ORCHESTRATOR — Append to bottom of style.css
   ════════════════════════════════════════════════════════════════════════════ */

/* Fixed top navigation bar — 64px (4rem) tall */
.page-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
}

/* Push content-container below the 64px fixed header */
.content-container {
    margin-top: calc(64px + var(--spacing-6, 24px)) !important;
}

/* Admin panel layout wrapper also needs pushing */
.admin-layout {
    margin-top: 64px;
}

/* ---------------------------------- */
/* :root (Design System & Variables)
/* ---------------------------------- */
:root {
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;

    /* Brand Colors */
    --brand-purple: #635bff;
    --brand-purple-dark: #5048cc;
    --brand-purple-light: #e0dfff;

    /* Action Colors */
    --color-primary: #0d6efd;
    --color-success: #198754;
    --color-danger: #dc3545;
    --color-danger-dark: #c62828;
    --color-danger-light: #ffebee;
    --color-warning: #ffc107;
    --color-info: #0dcaf0;

    /* Neutral Colors */
    --color-text: #212529;
    --color-text-muted: #6c757d;
    --color-bg: #f8f9fa;         /* Main page background */
    --color-bg-card: #ffffff;    /* Card background */
    --color-border: #dee2e6;
    --color-border-light: #e9ecef;

    /* Sizing & Shadows */
    --spacing-1: 0.25rem; /* 4px */
    --spacing-2: 0.5rem;  /* 8px */
    --spacing-3: 0.75rem; /* 12px */
    --spacing-4: 1rem;    /* 16px */
    --spacing-5: 1.5rem;  /* 24px */
    --spacing-6: 2rem;    /* 32px */

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.07);
    
    --border-radius-sm: 0.25rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
}

/* ---------------------------------- */
/* Global Reset & Page Layout
/* ---------------------------------- */
body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    margin: 0;
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 0.75em;
    line-height: 1.3;
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; margin-top: var(--spacing-6); margin-bottom: var(--spacing-4); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

a {
    color: var(--brand-purple);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: var(--brand-purple-dark);
}

/* Utility to hide "No jobs" messages by default */
.no-jobs-message {
    display: none;
    color: var(--color-text-muted);
    padding: var(--spacing-6);
    background: var(--color-bg-card);
    border: 2px dashed var(--color-border);
    border-radius: var(--border-radius-md);
    text-align: center;
    font-weight: 500;
}

/* ---------------------------------- */
/* Header & Navigation
/* ---------------------------------- */
.page-header {
    background-color: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
    padding: 0 var(--spacing-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem; /* 64px */
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-5);
}

.header-logo {
    height: 28px;
    width: auto;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: color 0.2s ease;
    position: relative;
    padding: var(--spacing-2) 0;
}

.nav-link::after {
    content: attr(data-text);
    display: block;
    font-weight: 600;
    height: 1px;
    overflow: hidden;
    visibility: hidden;
}

.nav-link:hover {
    color: var(--color-text);
}

.nav-link.active {
    color: var(--brand-purple);
    font-weight: 600;
    border-bottom: 2px solid var(--brand-purple);
}

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

/* ---------------------------------- */
/* Main Content & Cards
/* ---------------------------------- */
.content-container {
    max-width: 1024px;
    margin: var(--spacing-6) auto;
    padding: 0 var(--spacing-5);
    /* Page Load Animation */
    opacity: 0;
    animation: fadeIn 0.6s ease-out forwards;
}

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

.card {
    background-color: var(--color-bg-card);
    padding: var(--spacing-6);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--spacing-5);
}

/* ---------------------------------- */
/* Main Menu Styles
/* ---------------------------------- */
.module-menu-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-top: -0.5rem;
    margin-bottom: 2.5rem;
}

.module-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-6);
}

.module-card {
    background: var(--color-bg-card);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-6);
    text-align: center;
    text-decoration: none;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.module-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-purple);
}

.module-card .module-icon {
    font-size: 2.5rem;
    color: var(--brand-purple);
    background: var(--brand-purple-light);
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    margin: 0 auto var(--spacing-5) auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.module-card h2 {
    margin: 0 0 var(--spacing-2) 0;
    font-size: 1.3rem;
    color: var(--color-text);
}

.module-card p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* ---------------------------------- */
/* Workspace Shell Navigation
/* ---------------------------------- */
.workspace-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1200;
    background: #f8fafc;
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    color: #0f172a;
}

.workspace-sidebar-expanded { width: 320px; }
.workspace-sidebar-compact { width: 70px; }

.workspace-sidebar-toggle {
    position: absolute;
    top: 19px;
    right: -18px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--color-border);
    border-radius: 9px;
    background: #fff;
    color: #111827;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    box-shadow: var(--shadow-sm);
}

.workspace-sidebar-toggle:hover {
    background: #f8fafc;
    border-color: var(--brand-purple);
    color: var(--brand-purple);
}

.workspace-sidebar-compact .workspace-sidebar-toggle {
    right: -18px;
}

.workspace-brand {
    min-height: 80px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--color-border-light);
    box-sizing: border-box;
}

.workspace-sidebar-compact .workspace-brand {
    min-height: 76px;
    justify-content: center;
    padding: 16px 0;
}

.workspace-brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--brand-purple);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    box-shadow: 0 8px 18px rgba(99, 91, 255, .18);
}

.workspace-brand-mark:hover { color: #fff; background: var(--brand-purple-dark); }
.workspace-brand-logo-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.workspace-brand-logo {
    display: block;
    height: 25px;
    width: auto;
    max-width: 146px;
    object-fit: contain;
}

.workspace-brand-logo-wrap span {
    font-size: 11px;
    letter-spacing: .35px;
    color: #475569;
}

.workspace-nav {
    flex: 1;
    overflow-y: auto;
    padding: 18px 14px;
    scrollbar-width: thin;
}

.workspace-sidebar-compact .workspace-nav {
    padding: 16px 10px;
    overflow-x: hidden;
}

.workspace-nav-section { margin-bottom: 26px; }
.workspace-sidebar-compact .workspace-nav-section { margin-bottom: 12px; }

.workspace-nav-label {
    font-size: 11px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .45px;
    font-weight: 700;
    margin: 0 10px 10px;
}

.workspace-nav-item {
    min-height: 40px;
    border-radius: 8px;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    box-sizing: border-box;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 4px;
}

.workspace-nav-item i {
    width: 20px;
    text-align: center;
    color: #1f2937;
    flex: 0 0 20px;
}

.workspace-nav-item:hover {
    background: #eef2ff;
    color: #312e81;
}

.workspace-nav-item.active {
    background: #e9e9ff;
    color: #312e81;
    font-weight: 700;
}

.workspace-nav-item.active i { color: var(--brand-purple); }

.workspace-sidebar-compact .workspace-nav-item {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    justify-content: center;
    margin: 0 auto 12px;
}

.workspace-sidebar-compact .workspace-nav-item span { display: none; }
.workspace-sidebar-compact .workspace-brand-logo-wrap,
.workspace-sidebar-compact .workspace-user-mini div,
.workspace-sidebar-compact .workspace-nav-label { display: none !important; }

.workspace-sidebar-compact .workspace-brand-logo-wrap {
    visibility: hidden !important;
    width: 0 !important;
    max-width: 0 !important;
    overflow: hidden !important;
}

.workspace-user-mini {
    min-height: 78px;
    padding: 16px 20px;
    border-top: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
}

.workspace-sidebar-compact .workspace-user-mini {
    justify-content: center;
    padding: 14px 0;
}

.workspace-user-initials {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    color: #312e81;
    font-size: 13px;
    font-weight: 800;
    flex: 0 0 auto;
}

.workspace-user-mini strong {
    display: block;
    font-size: 13px;
    color: #0f172a;
    line-height: 1.15;
}

.workspace-user-mini span:not(.workspace-user-initials) {
    display: block;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    color: #475569;
    margin-top: 2px;
}

.workspace-topbar {
    position: fixed;
    top: 0;
    left: 320px;
    right: 0;
    height: 70px;
    z-index: 1100;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 22px;
    box-sizing: border-box;
}

.workspace-topbar-left,
.workspace-topbar-right,
.workspace-breadcrumb {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.workspace-topbar-right { gap: 10px; }

.workspace-toggle {
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: #111827;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
}

.workspace-toggle:hover { background: #f1f5f9; }

.workspace-divider {
    width: 1px;
    height: 28px;
    background: var(--color-border-light);
}

.workspace-breadcrumb {
    color: #64748b;
    font-size: 15px;
    white-space: nowrap;
}

.workspace-breadcrumb strong { color: #111827; font-weight: 700; }

.workspace-secondary-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.workspace-secondary-separator {
    color: #64748b;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}

.workspace-secondary-link {
    height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: #fff;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.workspace-secondary-link:hover {
    background: #f8fafc;
    border-color: var(--brand-purple);
    color: var(--brand-purple);
}

.workspace-secondary-link.active {
    background: var(--brand-purple-light);
    border-color: #c4b5fd;
    color: var(--brand-purple);
}

.workspace-secondary-link.as-text {
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #64748b;
    gap: 0;
    font-size: 15px;
    font-weight: 700;
    animation: workspaceTextPulse 1.8s ease-in-out infinite;
}

.workspace-secondary-link.as-text:hover,
.workspace-secondary-link.as-text.active {
    background: transparent;
    border-color: transparent;
    color: var(--brand-purple);
    animation: none;
}

@keyframes workspaceTextPulse {
    0%, 100% { color: #64748b; }
    50% { color: var(--brand-purple); }
}

.workspace-search {
    width: min(420px, 26vw);
    height: 42px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    box-sizing: border-box;
}

.workspace-search-between {
    justify-self: center;
    flex: 0 1 500px;
    width: min(500px, 100%);
    margin-left: auto;
    margin-right: auto;
}

.workspace-search i { color: #64748b; }
.workspace-search input {
    border: 0;
    outline: 0;
    min-width: 0;
    flex: 1;
    font-size: 14px;
    color: var(--color-text);
}

.workspace-kbd {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: #f8fafc;
    color: #64748b;
    padding: 2px 7px;
    font-size: 11px;
    font-family: var(--font-mono);
}

.workspace-google-pill {
    border: 1px solid #fca5a5;
    background: #fff1f2;
    color: #e60012;
    border-radius: 999px;
    padding: 7px 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.workspace-google-pill.ok {
    border-color: #86efac;
    background: #ecfdf5;
    color: #047857;
}

.workspace-google-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.workspace-bell {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #111827;
    border-radius: 8px;
}

.workspace-bell:hover { background: #f1f5f9; color: #111827; }

.workspace-avatar-mini {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #eeeafe;
    color: var(--brand-purple);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
}

.workspace-main {
    margin-left: 320px;
    padding: 82px 60px 40px;
    box-sizing: border-box;
    min-height: 100vh;
}

body.workspace-shell-compact .workspace-topbar { left: 70px; }
body.workspace-shell-compact .workspace-main { margin-left: 70px; }
body.workspace-shell-compact .workspace-sidebar .workspace-brand-logo-wrap,
body.workspace-shell-compact .workspace-sidebar .workspace-nav-label,
body.workspace-shell-compact .workspace-sidebar .workspace-nav-item span,
body.workspace-shell-compact .workspace-sidebar .workspace-user-mini div {
    display: none !important;
}
body.workspace-shell-compact .workspace-sidebar .workspace-brand-logo-wrap {
    visibility: hidden !important;
    width: 0 !important;
    max-width: 0 !important;
    overflow: hidden !important;
}
body.workspace-shell-compact .workspace-sidebar .workspace-brand,
body.workspace-shell-compact .workspace-sidebar .workspace-user-mini {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}
body.workspace-shell-compact .workspace-sidebar .workspace-nav {
    padding: 16px 10px;
}
body.workspace-shell-compact .workspace-sidebar .workspace-nav-section {
    margin-bottom: 12px;
}
body.workspace-shell-compact .workspace-sidebar .workspace-nav-item {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    justify-content: center;
    margin: 0 auto 12px;
}

.workspace-module-panel {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.workspace-welcome {
    font-size: 22px;
    font-weight: 500;
    color: #020617;
    margin: 0 0 26px;
}

.workspace-summary-panel {
    position: relative;
    margin: 0 0 18px;
    padding: 28px 34px 34px;
    min-height: 270px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background:
        linear-gradient(120deg, rgba(255,255,255,.96), rgba(248,250,252,.9)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='104' height='90' viewBox='0 0 104 90'%3E%3Cg fill='none' stroke='%23cbd5e1' stroke-width='1.4' opacity='.55'%3E%3Cpath d='M26 1 51 15.5v29L26 59 1 44.5v-29z'/%3E%3Cpath d='M78 1l25 14.5v29L78 59 53 44.5v-29z'/%3E%3Cpath d='M52 45l25 14.5v29L52 103 27 88.5v-29z'/%3E%3C/g%3E%3C/svg%3E");
    background-size: auto, 104px 90px;
    background-position: center, center;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.workspace-summary-panel::before,
.workspace-summary-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.workspace-summary-panel::before {
    background: radial-gradient(circle at 50% 32%, rgba(99, 91, 255, .12), transparent 28%);
}

.workspace-summary-panel::after {
    background: linear-gradient(90deg, rgba(255,255,255,.94), transparent 24%, transparent 76%, rgba(255,255,255,.94));
}

.workspace-summary-visual {
    position: relative;
    z-index: 1;
    min-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.workspace-summary-shield {
    width: 104px;
    height: 104px;
    border-radius: 28px 28px 38px 38px;
    background: linear-gradient(145deg, #6d5dfc, #4338ca);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 46px;
    box-shadow: 0 18px 36px rgba(67, 56, 202, .22), inset 0 0 0 8px rgba(255,255,255,.16);
    clip-path: polygon(50% 0, 91% 15%, 86% 68%, 50% 100%, 14% 68%, 9% 15%);
}

.workspace-hex-summary {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 64px;
    padding-top: 28px;
    border-top: 1px solid rgba(203, 213, 225, .72);
}

.workspace-hex-metric {
    min-width: 220px;
    display: grid;
    grid-template-columns: 70px auto;
    grid-template-rows: auto auto;
    column-gap: 14px;
    align-items: center;
    color: #0f172a;
    text-decoration: none;
    transition: transform .16s ease;
}

.workspace-hex-metric:hover {
    transform: translateY(-2px);
}

.workspace-hex-badge {
    position: relative;
    grid-row: 1 / span 2;
    width: 70px;
    height: 62px;
    display: inline-flex;
}

.workspace-hex-icon {
    position: relative;
    width: 70px;
    height: 62px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    --hex-color: #168f70;
    color: var(--hex-color);
    font-size: 16px;
    background: transparent;
    border: 0;
    filter: drop-shadow(0 10px 14px rgba(15, 23, 42, .08));
}

.workspace-hex-icon::before,
.workspace-hex-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
}

.workspace-hex-icon::before {
    background: var(--hex-color);
}

.workspace-hex-icon::after {
    inset: 3px;
    background: #fff;
}

.workspace-hex-icon i {
    position: relative;
    z-index: 1;
}

.workspace-hex-icon.onboarding { --hex-color: #2563eb; color: #2563eb; }
.workspace-hex-icon.offboarding { --hex-color: #f59e0b; color: #b45309; }
.workspace-hex-icon.vault { --hex-color: #635bff; color: #4f46e5; }

.workspace-hex-ok {
    position: absolute;
    right: -2px;
    bottom: -5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    border: 3px solid #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    clip-path: none;
}

.workspace-hex-number {
    font-size: 32px;
    line-height: 1;
    font-weight: 600;
    color: #24272f;
}

.workspace-hex-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.workspace-hex-copy strong {
    font-size: 14px;
    font-weight: 500;
    color: #303846;
    letter-spacing: 0;
}

.workspace-hex-copy span {
    font-size: 14px;
    color: #53657d;
    white-space: nowrap;
}

.workspace-panel-head {
    padding: 18px 20px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--color-border-light);
}

.workspace-panel-title h1,
.workspace-panel-title h2 {
    margin: 0;
    font-size: 17px;
    color: #020617;
}

.workspace-panel-title p {
    margin: 4px 0 0;
    color: #475569;
    font-size: 13px;
}

.workspace-filter {
    width: 400px;
    max-width: 100%;
    height: 44px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 13px;
    box-sizing: border-box;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.workspace-filter i { color: #64748b; }
.workspace-filter input {
    border: 0;
    outline: 0;
    min-width: 0;
    flex: 1;
    font-size: 14px;
    color: var(--color-text);
}

.workspace-group-label {
    height: 38px;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .45px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--color-border-light);
}

.workspace-module-row {
    min-height: 76px;
    padding: 14px 20px;
    box-sizing: border-box;
    border-bottom: 1px solid var(--color-border-light);
    display: grid;
    grid-template-columns: 46px minmax(220px, 1fr) auto 24px;
    align-items: center;
    gap: 18px;
    color: #020617;
}

.workspace-module-row:last-child { border-bottom: 0; }
.workspace-module-row:hover { background: #fbfcff; color: #020617; }

.workspace-module-icon {
    width: 44px;
    height: 44px;
    border: 1px solid var(--color-border);
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.workspace-module-main strong {
    font-size: 15px;
    color: #020617;
}

.workspace-module-main p {
    margin: 3px 0 0;
    color: #475569;
    font-size: 13px;
}

.workspace-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
    margin-left: 8px;
}

.workspace-status.ok { color: #059669; background: #dff7ef; border-color: #a7f3d0; }
.workspace-status.warn { color: #92400e; background: #fff7ed; border-color: #fed7aa; }
.workspace-status.bad { color: #e60012; background: #fff1f2; border-color: #fca5a5; }
.workspace-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.workspace-module-meta {
    color: #334155;
    font-size: 13px;
    font-family: var(--font-mono);
    white-space: nowrap;
}

.workspace-module-chevron { color: #64748b; }

.workspace-alert {
    border: 1px solid #ff8a8a;
    background: #fff4f4;
    color: #e60012;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 30px;
}

.workspace-alert i { font-size: 22px; }
.workspace-alert strong { display: block; margin-bottom: 4px; }
.workspace-alert span { color: #475569; }
.workspace-alert .auth-connect-btn { margin-left: auto; background: #e60012; }

.workspace-auth-bar {
    min-height: 50px;
    border-radius: 10px;
    border: 1px solid;
    padding: 9px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-sizing: border-box;
    margin-bottom: 30px;
}

.workspace-auth-bar.connected {
    background: #e8f5e9;
    border-color: #a5d6a7;
    color: #1e4620;
}

.workspace-auth-bar.disconnected {
    background: #fff4f4;
    border-color: #ff8a8a;
    color: #e60012;
}

.workspace-auth-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    flex: 0 0 auto;
    opacity: .85;
}

.workspace-auth-message {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.workspace-auth-message strong {
    font-size: 14px;
    font-weight: 500;
}

.workspace-auth-message span {
    font-size: 13px;
    color: #475569;
}

.workspace-auth-countdown {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #315c39;
    font-size: 13px;
    white-space: nowrap;
    margin-left: auto;
}

.workspace-auth-countdown i { font-size: 12px; }

.workspace-auth-bar.connected .auth-revoke-btn {
    border-color: #fecaca;
    color: #e11d48;
    background: transparent;
}

.workspace-auth-bar.connected .auth-revoke-btn:hover {
    background: #fff1f2;
    color: #be123c;
}

.workspace-auth-bar.disconnected .auth-connect-btn {
    margin-left: auto;
    background: #e60012;
}

/* Keep module-specific legacy button rules from changing the shared banner. */
.workspace-auth-bar .auth-connect-btn {
    font-size: 13px;
    padding: 7px 16px;
    border-radius: 8px;
    color: #fff;
    border: none;
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.workspace-auth-bar.disconnected .auth-connect-btn:hover {
    background: #c70010;
    color: #fff;
    box-shadow: 0 8px 20px rgba(230, 0, 18, .18);
}

.workspace-auth-bar .auth-revoke-btn {
    font-size: 12px;
    padding: 6px 13px;
    border-radius: 999px;
    font-weight: 700;
}

.auth-connect-btn {
    font-size: 13px;
    padding: 7px 16px;
    border-radius: 8px;
    background: var(--brand-purple);
    color: #fff;
    border: none;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.auth-connect-btn:hover {
    background: var(--brand-purple-dark);
    color: #fff;
    box-shadow: 0 8px 20px rgba(99, 91, 255, .2);
}

.auth-revoke-btn {
    font-size: 12px;
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid #fecaca;
    background: #fff;
    cursor: pointer;
    color: var(--color-danger);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.auth-revoke-btn:hover {
    background: var(--color-danger);
    color: #fff;
    border-color: var(--color-danger);
}

.workspace-sidebar-compact ~ .page-header {
    left: 70px !important;
    width: calc(100% - 70px) !important;
}

.workspace-sidebar-compact ~ .workspace-topbar {
    left: 70px !important;
}

.workspace-sidebar-expanded ~ .workspace-topbar {
    left: 320px !important;
}

.workspace-topbar ~ .page-header {
    display: none !important;
}

.workspace-sidebar-compact ~ .page-header .nav-left .header-logo,
.workspace-sidebar-compact ~ .page-header .nav-left .nav-link:first-of-type {
    display: none !important;
}

.workspace-sidebar-compact ~ .content-container,
.workspace-sidebar-compact ~ main.content-container,
.workspace-sidebar-compact ~ .admin-layout {
    margin-left: 70px !important;
    margin-right: 0 !important;
    width: calc(100% - 70px) !important;
    max-width: none !important;
    box-sizing: border-box;
}

.workspace-sidebar-expanded ~ .content-container,
.workspace-sidebar-expanded ~ main.content-container,
.workspace-sidebar-expanded ~ .admin-layout {
    margin-left: 320px !important;
    margin-right: 0 !important;
    width: calc(100% - 320px) !important;
    max-width: none !important;
    box-sizing: border-box;
}

body.workspace-shell-compact .content-container,
body.workspace-shell-compact main.content-container,
body.workspace-shell-compact .admin-layout {
    margin-left: 70px !important;
    margin-right: 0 !important;
    width: calc(100% - 70px) !important;
    max-width: none !important;
    box-sizing: border-box;
}

@media (max-width: 1100px) {
    .workspace-sidebar-expanded { width: 260px; }
    .workspace-topbar { left: 260px; }
    .workspace-main { margin-left: 260px; padding-left: 28px; padding-right: 28px; }
    .workspace-summary-panel { padding-left: 24px; padding-right: 24px; }
    .workspace-hex-summary { gap: 24px; justify-content: space-between; }
    .workspace-hex-metric { min-width: 0; grid-template-columns: 62px auto; column-gap: 12px; }
    .workspace-hex-badge,
    .workspace-hex-icon { width: 62px; height: 55px; }
    .workspace-hex-number { font-size: 28px; }
    .workspace-hex-copy span { white-space: normal; }
}

@media (max-width: 760px) {
    .workspace-sidebar-expanded,
    .workspace-sidebar-compact { width: 70px; }
    .workspace-sidebar-expanded .workspace-brand-logo-wrap,
    .workspace-sidebar-expanded .workspace-nav-label,
    .workspace-sidebar-expanded .workspace-nav-item span,
    .workspace-sidebar-expanded .workspace-user-mini div { display: none; }
    .workspace-sidebar-expanded .workspace-brand,
    .workspace-sidebar-expanded .workspace-user-mini { justify-content: center; padding-left: 0; padding-right: 0; }
    .workspace-sidebar-expanded .workspace-nav { padding: 16px 10px; }
    .workspace-sidebar-expanded .workspace-nav-item {
        width: 40px;
        height: 40px;
        min-height: 40px;
        padding: 0;
        justify-content: center;
        margin: 0 auto 12px;
    }
    .workspace-topbar { left: 70px; }
    .workspace-search { display: none; }
    .workspace-search-between { display: none; }
    .workspace-main { margin-left: 70px; padding: 86px 16px 24px; }
    .workspace-welcome { margin-bottom: 18px; }
    .workspace-summary-panel { min-height: 0; padding: 18px; }
    .workspace-summary-visual { min-height: 72px; }
    .workspace-summary-shield { width: 70px; height: 70px; font-size: 30px; }
    .workspace-hex-summary { flex-direction: column; align-items: stretch; gap: 14px; }
    .workspace-hex-metric { grid-template-columns: 58px auto; }
    .workspace-hex-badge,
    .workspace-hex-icon { width: 58px; height: 51px; }
    .workspace-hex-copy span { white-space: normal; }
    .workspace-module-row { grid-template-columns: 40px minmax(0, 1fr) 18px; }
    .workspace-module-meta { display: none; }
    .workspace-panel-head { align-items: stretch; flex-direction: column; }
    .workspace-filter { width: 100%; }
}

/* ---------------------------------- */
/* Form & Input Styling
/* ---------------------------------- */
.input-group {
    position: relative;
    margin-bottom: var(--spacing-5);
}

.input-group label {
    position: absolute;
    top: 0.95rem;
    left: 1rem;
    font-size: 1rem;
    color: var(--color-text-muted);
    transition: all 0.2s ease;
    pointer-events: none;
    background: var(--color-bg-card);
    padding: 0 var(--spacing-1);
}

.input-group input[type="text"],
.input-group input[type="email"],
.input-group input[type="password"],
.input-group textarea {
    width: 100%;
    padding: 1.25rem var(--spacing-4);
    font-size: 1rem;
    font-family: var(--font-sans);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group textarea {
    height: 140px;
    resize: vertical;
    padding-top: 1.5rem;
}

/* Floating label effect */
.input-group input[type="text"]:focus + label,
.input-group input[type="text"]:not(:placeholder-shown) + label,
.input-group input[type="email"]:focus + label,
.input-group input[type="email"]:not(:placeholder-shown) + label,
.input-group input[type="password"]:focus + label,
.input-group input[type="password"]:not(:placeholder-shown) + label,
.input-group textarea:focus + label,
.input-group textarea:not(:placeholder-shown) + label {
    top: -0.6rem;
    left: 0.75rem;
    font-size: 0.8rem;
}

.input-group input[type="text"]:focus,
.input-group input[type="email"]:focus,
.input-group input[type="password"]:focus,
.input-group textarea:focus {
    border-color: var(--brand-purple);
    outline: none;
    box-shadow: 0 0 0 3px var(--brand-purple-light);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    color: #333;
    /* --- MODIFIED: Enhanced professional look --- */
    background-color: var(--color-bg);
    padding: var(--spacing-3) var(--spacing-4);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--color-border-light);
}
.checkbox-group label {
    font-size: 1rem;
    color: var(--color-text); /* Made text darker */
    font-weight: 500;
    position: static;
    pointer-events: auto;
    background: none;
    padding: 0;
    margin: 0;
}
.checkbox-group input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    margin: 0;
    flex-shrink: 0; /* Prevent shrinking */
    accent-color: var(--brand-purple); /* Modern browser styling */
}

/* ---------------------------------- */
/* Button Styling
/* ---------------------------------- */
.button-base {
    width: auto;
    min-width: 120px;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative; /* For spinners */
}
.button-base:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Primary Button (e.g., Submit) */
.submit-btn {
    background-color: var(--brand-purple);
    color: white;
}
.submit-btn:hover:not(:disabled) {
    background-color: var(--brand-purple-dark);
    box-shadow: 0 4px 10px rgba(99, 91, 255, 0.25);
    transform: translateY(-2px);
    color: white; 
}
.submit-btn:active {
    transform: translateY(0);
}

/* Danger Button (e.g., Delete, Reset) */
.delete-btn {
    background: var(--color-danger);
    color: white;
}
.delete-btn:hover:not(:disabled) {
    background: var(--color-danger-dark);
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.25);
    transform: translateY(-2px);
    color: white; 
}

/* Secondary Button (e.g., Cancel) */
.secondary-btn {
    background: var(--color-bg-card);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}
.secondary-btn:hover:not(:disabled) {
    background-color: var(--color-bg);
    border-color: var(--color-text-muted);
    color: var(--color-text);
}

/* Action Button (e.g., Retry, Clear on Completed page) */
.action-btn {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
}
.action-btn.retry-btn {
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.action-btn.retry-btn:hover {
    background: var(--color-primary);
    color: white;
}
.action-btn.clear-btn {
    border-color: var(--color-danger);
    color: var(--color-danger);
}
.action-btn.clear-btn:hover {
    background: var(--color-danger);
    color: white;
}

/* Cancel Button (Job Item) */
.cancel-btn {
    background: var(--color-danger-light);
    color: var(--color-danger-dark);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    border: 1px solid var(--color-danger-light);
    font-weight: 600;
    font-size: 0.875rem;
}
.cancel-btn:hover {
    background: var(--color-danger);
    color: #ffffff;
    border-color: var(--color-danger);
}

/* Google Button */
.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    color: #333;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}
.google-btn:hover {
    background-color: var(--color-bg);
    border-color: #aaa;
    color: #333; 
}
.google-btn img {
    width: 18px;
    height: 18px;
    margin-right: 10px;
}


/* ---------------------------------- */
/* Index Page: Stat Cards
/* ---------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-5);
    margin-bottom: var(--spacing-6);
}

.stat-card {
    background: var(--color-bg-card);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-5);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-4);
    transition: all 0.2s ease-in-out;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.stat-card .icon {
    font-size: 24px;
    padding: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.stat-card .icon.total { background-color: var(--brand-purple); }
.stat-card .icon.pending { background-color: var(--color-warning); }
.stat-card .icon.in-progress { background-color: var(--color-primary); }
.stat-card .details h3 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}
.stat-card .details p {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-muted);
}

/* ---------------------------------- */
/* Index Page: Live Activity Feed
/* ---------------------------------- */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
}

.job-item {
    background: var(--color-bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-5);
    display: grid;
    grid-template-columns: 40px 1fr auto; /* Icon | Details | Actions */
    gap: var(--spacing-5);
    align-items: center;
    border: 1px solid var(--color-border);
    transition: all 0.4s ease-in-out;
    transform-origin: top;
    will-change: transform, opacity;
}
.job-item:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-purple);
}

/* List Animations */
.job-item.new-item-enter {
    opacity: 0;
    transform: translateY(-20px);
}
.job-item.new-item-enter-active {
    opacity: 1;
    transform: translateY(0);
}
.job-item.removing {
    opacity: 0;
    transform: scaleY(0.1);
    margin-bottom: -100px; /* Pull next item up */
    padding-top: 0;
    padding-bottom: 0;
    border: 0;
}

.job-icon {
    font-size: 1.5rem;
    text-align: center;
    color: var(--brand-purple);
    background: var(--brand-purple-light);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    line-height: 40px;
}

.job-details h4 {
    margin: 0 0 0.25rem 0;
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text);
}
.job-details p.timestamp {
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}
.job-actions { text-align: right; }

/* Job Status Badge (Pill) */
.job-status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: 0.5rem 1rem;
    margin: var(--spacing-2) 0;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
}
.job-status-badge .fas { font-size: 0.9em; }

/* Status Badge Colors */
.status-badge-QUEUED, .status-badge-PENDING {
    background-color: #f1f3f5; color: #495057;
}
.status-badge-DISCOVERY {
    background-color: #fff3cd; color: #856404;
}
.status-badge-EXPORTING {
    background-color: #d1ecf1; color: #0c5460;
}
.status-badge-READY_FOR_TRANSFER, .status-badge-TRANSFERRING {
    background-color: #ffe8d9; color: #8d4922;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--color-border-light);
    border-radius: 4px;
    overflow: hidden;
    margin-top: var(--spacing-3);
    display: none; /* Hidden by default */
}
.progress-bar-inner {
    width: 100%;
    height: 100%;
    background-color: var(--color-primary);
    border-radius: 4px;
    animation: indeterminate-progress 1.5s infinite ease-in-out;
}
.job-item.status-DISCOVERY .progress-bar,
.job-item.status-EXPORTING .progress-bar,
.job-item.status-TRANSFERRING .progress-bar {
    display: block;
}
@keyframes indeterminate-progress {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Spinner Animation */
.fa-spinner {
    animation: fa-spin 1s linear infinite;
}
@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ---------------------------------- */
/* Login Page
/* ---------------------------------- */
.login-card {
    max-width: 450px;
    margin: 5rem auto; /* More top margin */
}

/* MODIFIED: Login logo style */
.login-logo-container {
    text-align: center;
    margin-bottom: 1.5rem; /* Less space below logo */
}
.login-logo-container img {
    height: 36px; /* Slightly smaller logo */
    width: auto;
}

/* MODIFIED: Login prompt style */
.login-prompt {
    text-align: center;
    font-weight: 500;
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin-top: 0;
    margin-bottom: 2.5rem; /* More space before form */
}

/* THIS IS THE FIX for the 'OR' divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--color-text-muted);
    margin: 1.5rem 0;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--color-border);
}
.divider span {
    padding: 0 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}
/* END FIX */

.flash-error {
    padding: var(--spacing-4);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-5);
    font-weight: 500;
    background-color: var(--color-danger-light);
    color: var(--color-danger-dark);
    border: 1px solid var(--color-danger);
}

/* ---------------------------------- */
/* Admin Page
/* ---------------------------------- */
.admin-section {
    margin-bottom: var(--spacing-5);
}
.admin-section h2 {
    margin-top: 0;
    padding-bottom: var(--spacing-3);
    border-bottom: 1px solid var(--color-border-light);
}
.admin-section p {
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-5);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* --- KEPT Styles for the user form --- */
.user-form .input-group {
    max-width: 70%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--spacing-5); /* Keep existing bottom margin */
}
.user-form .checkbox-group {
    max-width: 70%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5rem; /* Keep existing bottom margin */
}
.user-form .button-base.submit-btn {
    display: block; /* Override inline-block */
    margin: var(--spacing-4) auto 0 auto; /* Center the button */
}


.status-box {
    padding: var(--spacing-4);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-4);
    font-weight: 500;
    border: 1px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.status-box.success {
    background-color: #e8f5e9;
    color: var(--color-success);
    border-color: #a5d6a7;
}
.status-box.warning {
    background-color: #fff8e1;
    color: #ff6f00;
    border-color: #ffe082;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--spacing-5);
    font-size: 0.95rem;
}
.user-table th, .user-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}
.user-table th {
    background-color: var(--color-bg);
    font-weight: 600;
    color: var(--color-text);
}
.user-table tr:hover {
    background-color: #fcfcfc;
}
.user-table td:last-child {
    text-align: right;
}

/* Confirmation Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background: var(--color-bg-card);
    padding: var(--spacing-6);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 500px;
    transform: scale(0.95);
    transition: all 0.3s ease;
}
.modal-overlay.visible .modal-content {
    transform: scale(1);
}
.modal-content h3 {
    font-size: 1.5rem;
    color: var(--color-danger);
    margin-top: 0;
    margin-bottom: var(--spacing-3);
    text-align: center;
}
.modal-content p {
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    text-align: center;
}
.modal-content .input-group {
    text-align: left;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}
.modal-actions {
    display: flex;
    gap: var(--spacing-3);
    justify-content: flex-end;
}

/* ---------------------------------- */
/* Completed Jobs Page
/* ---------------------------------- */
#completed-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-5);
}

.user-card {
    /* Uses the .card style */
    padding: 0; /* Remove default card padding */
    overflow: hidden; /* For nested borders */
}
.user-card-header {
    padding: var(--spacing-5) var(--spacing-6);
    border-bottom: 1px solid var(--color-border);
}
.user-card-header h3 {
    margin: 0;
    word-break: break-all;
}

.corpus-list {
    display: flex;
    flex-direction: column;
}
.corpus-item {
    display: grid;
    grid-template-columns: 30px 110px 1fr auto;
    gap: var(--spacing-5);
    align-items: center;
    padding: var(--spacing-4) var(--spacing-6);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--color-border-light);
    transition: all 0.2s ease;
}
.corpus-item:last-child {
    border-bottom: none;
}
.corpus-item:hover {
    background-color: #fcfcfc;
}
.corpus-item.removing {
    opacity: 0;
    transform: scaleY(0);
    padding: 0;
    margin: 0;
    border: 0;
    height: 0px;
}

.corpus-item .fas {
    font-size: 1.25rem;
    text-align: center;
}
.status-COMPLETE { color: var(--color-success); }
.status-DISCOVERY_FAILED, 
.status-EXPORT_FAILED, 
.status-TRANSFER_FAILED { color: var(--color-danger); }
.status-CANCELLED { color: var(--color-text-muted); }

.corpus-type-badge {
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    color: white;
}
.badge-MAIL { background-color: #007bff; }
.badge-DRIVE { background-color: #28a745; }
.badge-CHAT { background-color: #fd7e14; }
.badge-LINKED_DRIVE { background-color: #0eaae6; }

.timestamp {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

/* ---------------------------------- */
/* Success / Auth Pages
/* ---------------------------------- */
.success-page-container {
    text-align: center;
}
.success-animation-container {
    margin: 0 auto 1.5rem auto;
    width: 100px;
    height: 100px;
}
.checkmark {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: #fff;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px var(--color-success);
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}
.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: var(--color-success);
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}
@keyframes stroke {
    100% { stroke-dashoffset: 0; }
}
@keyframes scale {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}
@keyframes fill {
    100% { box-shadow: inset 0px 0px 0px 50px var(--color-success); }
}

.success-page-container h1 {
    color: var(--color-success);
}
.success-page-container p {
    font-size: 1.1rem;
    color: var(--color-text-muted);
}
.success-page-container .submit-btn {
    margin-top: 1rem;
    background-color: var(--color-success);
}
.success-page-container .submit-btn:hover {
    background-color: #146c43;
}

/* ---------------------------------- */
/* Admin Panel - Permissions
/* ---------------------------------- */
.permission-badges {
    display: flex;
    flex-wrap: wrap; /* Allow badges to wrap on small screens */
    gap: var(--spacing-2);
    justify-content: left;
    align-items: center;
}

.permission-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-1) var(--spacing-3);
    border-radius: var(--border-radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--color-border);
}

.permission-badge .fas {
    font-size: 0.9em;
}

/* Granted Access */
.permission-badge.access-granted {
    color: var(--color-success);
    background-color: #e8f5e9;
    border-color: #a5d6a7;
}

/* Denied Access */
.permission-badge.access-denied {
    color: var(--color-text-muted);
    background-color: var(--color-bg);
    opacity: 0.7;
}


/* ---------------------------------- */
/* Onboarding Dashboard Styles
/* ---------------------------------- */
.onboarding-log-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    justify-content: center;
}
.onboarding-log-modal.visible {
    display: flex;
    opacity: 1;
}
.onboarding-log-content {
    background-color: #1e1e1e; /* Dark background for log */
    color: #f0f0f0;
    margin: auto;
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 800px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}
.onboarding-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}
.onboarding-log-header h2 { margin: 0; color: #fff; }
.onboarding-log-header .close-btn {
    background: var(--color-danger);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-weight: 600;
}
.onboarding-log-header .close-btn:disabled {
    background: var(--color-text-muted);
    cursor: not-allowed;
}
#log-output {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    background: #111;
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
    white-space: pre-wrap;
    word-wrap: break-word;
    min-height: 200px;
    border: 1px solid #444;
}
.log-line.error { color: var(--color-danger); }
.log-line.success { color: #4caf50; }
.log-line.info { color: #0dcaf0; }
.log-line.header { color: var(--color-warning); font-weight: bold; }
.log-line.dim { color: #888; }

/* Form Layout */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.form-section-header {
    grid-column: 1 / -1;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--brand-purple);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

/* Phone Input Styles - FIXED HEIGHT */
.phone-composite-group {
    display: flex;
    align-items: stretch; /* Make children fill height */
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
    height: 58px; /* Enforce 58px height */
    min-height: 58px;
    box-sizing: border-box;
}
.phone-composite-group:focus-within {
     border-color: var(--brand-purple);
     box-shadow: 0 0 0 3px var(--brand-purple-light);
}

.phone-country-code {
    flex-shrink: 0;
    padding: 0 1rem; /* Horizontal padding only */
    font-size: 1rem;
    border: none;
    border-right: 1px solid var(--color-border);
    background-color: var(--color-bg);
    border-radius: var(--border-radius-md) 0 0 var(--border-radius-md);
    outline: none;
    font-family: var(--font-sans);
    color: var(--color-text-muted);
    cursor: pointer;
    height: 100%; /* Fill parent height */
}

.phone-input-group {
    position: relative;
    flex-grow: 1;
    margin-bottom: 0;
    height: 100%; /* Fill parent height */
}

.phone-number-input {
    width: 100%;
    border: none;
    padding: 1.25rem 1rem; /* Match other inputs */
    font-size: 1rem;
    font-family: var(--font-sans);
    border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
    outline: none;
    background: transparent;
    height: 100%; /* Fill parent height */
    box-sizing: border-box; /* Include padding in height */
}

.phone-number-label {
    position: absolute;
    top: 0.95rem;
    left: 1rem;
    font-size: 1rem;
    color: var(--color-text-muted);
    transition: all 0.2s ease;
    pointer-events: none;
    background: var(--color-bg-card);
    padding: 0 var(--spacing-1);
}
.phone-number-input:focus + .phone-number-label,
.phone-number-input:not(:placeholder-shown) + .phone-number-label {
    top: -0.6rem;
    left: 0.75rem;
    font-size: 0.8rem;
    color: var(--brand-purple);
}


/* Group Autocomplete Styles */
.groups-input-container {
    position: relative;
    grid-column: 1 / -1;
}

.autocomplete-suggestions {
    display: none; /* Hidden by default */
    position: absolute;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: var(--color-bg-card);
    border: 1px solid var(--brand-purple);
    border-top: none;
    border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 100;
    top: 100%; 
    left: 0;
    margin-top: -8px; /* Pull it up to meet the input box */
}

.suggestion-item {
    padding: 0.75rem 1rem;
    color: var(--color-text);
    cursor: pointer;
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background-color: var(--brand-purple);
    color: white;
}

.suggestion-item.loading {
    font-style: italic;
    color: var(--color-text-muted);
}

/* Groups (DL) Tag Input - FIXED HEIGHT */
.tags-input-wrapper {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    padding: 0.375rem 0.75rem; /* Adjusted padding for 58px height */
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    min-height: 58px; /* Match input height */
    box-sizing: border-box; /* Include padding/border in height */
    position: relative; /* For suggestion box positioning */
    z-index: 101; /* Sit above suggestions */
}
.tags-input-wrapper:focus-within {
    border-color: var(--brand-purple);
    box-shadow: 0 0 0 3px var(--brand-purple-light);
    border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
}
.tag-item {
    display: inline-flex;
    align-items: center;
    background-color: var(--brand-purple);
    color: white;
    padding: 0.3rem 0.75rem;
    border-radius: var(--border-radius-sm);
    margin: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}
.tag-remove-btn {
    font-size: 1.25rem;
    font-weight: bold;
    margin-left: 0.5rem;
    cursor: pointer;
    line-height: 1;
}
.tag-input {
    flex-grow: 1;
    border: none !important; /* <-- THIS IS THE FIX */
    outline: none !important; /* <-- THIS IS THE FIX */
    background: transparent;
    color: var(--color-text);
    font-size: 1rem;
    padding: 0.5rem;
    min-width: 200px;
}

.tag-input::placeholder {
    color: var(--color-text-muted);
    opacity: 1; /* For Firefox */
}

/* Responsive */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------------- */
/* Login Success Page
/* ---------------------------------- */
.product-tagline {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-top: -0.5rem; /* Pulls it closer to the h1 */
    margin-bottom: 2.5rem;
}

/* ---------------------------------- */
/* Professional Menu Button (NEW)
/* ---------------------------------- */
.nav-link-button {
    padding: 0.5rem 0.75rem !important; /* Give it button-like padding */
    border-radius: var(--border-radius-md);
    background-color: var(--color-bg);
    border: 1px solid var(--color-border-light);
    color: var(--color-text);
    font-weight: 500;
}
.nav-link-button:hover {
    background-color: #e9ecef; /* Slightly darker hover */
    color: var(--brand-purple);
    border-color: var(--color-border);
}

/* Override the 'active' underline style for this button */
.nav-link-button.active, .nav-link-button:active {
    border-bottom: 1px solid var(--color-border-light) !important;
}

/* ---------------------------------- */
/* Onboarding Label Hotfix
/* ---------------------------------- */

/* This specifically targets the "Add Group Emails" label 
  and lifts it *above* the input box wrapper.
*/
.groups-input-container .input-group label[for="groups_input_field"] {
    z-index: 102; /* Higher than the wrapper's z-index of 101 */
}

/* ---------------------------------- */
/* Offboarding Dashboard
/* ---------------------------------- */
.offboarding-group-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    background-color: var(--color-bg);
}

/* Make labels in the list less bold */
.offboarding-group-list .checkbox-group label {
    font-weight: 500;
}

/* ---------------------------------- */
/* Onboarding Centered Row (MODIFIED)
/* ---------------------------------- */
.input-group.centered-row {
    grid-column: 1 / -1; /* Make this field span both columns */
    
    /* ### THIS IS THE FIX ### */
    /* Make the input box the same width as one column */
    /* The grid-gap is 1.5rem */
    width: calc(50% - (1.5rem / 2)); 
    
    margin-left: auto;
    margin-right: auto;
}

/* User avatar pill */
.user-menu-wrap { position:relative; }
.user-avatar-btn {
    display:flex; align-items:center; gap:8px; cursor:pointer;
    padding:5px 10px 5px 5px; border-radius:24px;
    border:1px solid var(--color-border); background:#fff;
    transition:background .2s,border-color .2s,box-shadow .2s;
    user-select:none;
}
.user-avatar-btn:hover {
    background:var(--color-bg); border-color:var(--brand-purple);
    box-shadow:0 0 0 3px var(--brand-purple-light);
}
.user-avatar-initials {
    width:28px; height:28px; border-radius:50%;
    background:var(--brand-purple); color:#fff;
    font-size:11px; font-weight:700;
    display:flex; align-items:center; justify-content:center;
    flex-shrink:0; position:relative; overflow:hidden;
}
.user-avatar-photo {
    display:none; position:absolute; inset:0;
    width:100%; height:100%; object-fit:cover;
    border-radius:inherit; background:#f8fafc;
}
.user-avatar-initials.has-photo .user-avatar-photo,
.user-menu-avatar-lg.has-photo .user-avatar-photo { display:block; }
.user-avatar-email {
    font-size:12px; font-weight:500; color:var(--color-text);
    max-width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.user-avatar-chevron {
    font-size:10px; color:var(--color-text-muted);
    transition:transform .2s; flex-shrink:0;
}
.user-avatar-btn.open .user-avatar-chevron { transform:rotate(180deg); }

/* Dropdown */
.user-menu-dropdown {
    position:absolute; top:calc(100% + 10px); right:0; width:240px;
    background:#fff; border:1px solid var(--color-border);
    border-radius:var(--border-radius-lg); box-shadow:var(--shadow-lg);
    z-index:9000; display:none; overflow:hidden;
    animation:user-drop-in .2s ease;
}
.user-menu-dropdown.open { display:block; }
@keyframes user-drop-in { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:none} }

.user-menu-header {
    display:flex; align-items:center; gap:12px; padding:14px 16px;
    background:linear-gradient(135deg,#f3f2ff,#ebe9ff);
    border-bottom:1px solid var(--color-border-light);
}
.user-menu-avatar-lg {
    width:38px; height:38px; border-radius:50%;
    background:var(--brand-purple); color:#fff;
    font-size:14px; font-weight:700;
    display:flex; align-items:center; justify-content:center; flex-shrink:0;
    position:relative; overflow:hidden;
}
.user-menu-name {
    font-size:12px; font-weight:600; color:var(--color-text);
    word-break:break-all; line-height:1.3;
}
.user-menu-role {
    font-size:11px; color:var(--brand-purple); font-weight:500; margin-top:2px;
}

/* Sign out button */
.signout-btn {
    display:flex; align-items:center; gap:6px;
    padding:5px 12px; border-radius:20px;
    border:1px solid var(--color-border); background:#fff;
    font-size:12px; font-weight:600; color:var(--color-danger);
    cursor:pointer; text-decoration:none;
    transition:background .2s,border-color .2s,box-shadow .2s;
    white-space:nowrap; flex-shrink:0;
}
.signout-btn:hover {
    background:#fff5f5; border-color:var(--color-danger);
    box-shadow:0 0 0 3px rgba(220,53,69,.1); color:var(--color-danger);
}
.signout-btn i { font-size:11px; }

/* ---------------------------------- */
/* Global App Density
/* ---------------------------------- */
:root {
    --app-density-scale: 0.9;
}

@media screen {
    @supports (zoom: 1) {
        body {
            zoom: var(--app-density-scale);
        }
    }

    @supports not (zoom: 1) {
        html {
            font-size: calc(16px * var(--app-density-scale));
        }
    }
}
