@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Space+Grotesk:wght@600&display=swap');

:root {
    --primary: #004aad;
    --primary-dark: #00357a;
    --bg: #f4f7fb;
    --sidebar: #0f172a;
    --text: #0f172a;
    --text-muted: #5f6b84;
    --card-bg: #ffffff;
    --border: rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 25px 50px rgba(15, 23, 42, 0.08);
    --radius: 1.25rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f6f9ff 0%, #e8f1ff 45%, #fdfdff 100%);
    padding: clamp(1.5rem, 4vw, 3rem);
}

.auth-content {
    width: 100%;
    display: flex;
    justify-content: center;
}

.auth-wrapper {
    position: relative;
    width: min(1100px, 100%);
    background: #fff;
    border-radius: 1.75rem;
    padding: clamp(1.5rem, 3vw, 3rem);
    border: 1px solid rgba(15, 23, 42, 0.08);
    display: grid;
    grid-template-columns: minmax(320px, 1.1fr) minmax(320px, 1fr);
    gap: 2.25rem;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.12);
}

.auth-highlight {
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-highlight {
    background: linear-gradient(135deg, #004aad 0%, #002b84 100%);
    padding: clamp(1.25rem, 3vw, 2rem);
    border-radius: 1.5rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-highlight img {
    width: clamp(120px, 12vw, 150px);
    margin-bottom: 1rem;
    max-width: 100%;
}

.auth-trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.auth-trust-badges span {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
}

.auth-highlight h1 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin: 0;
    line-height: 1.2;
}

.auth-highlight p {
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.6;
    margin: 0;
}

.auth-highlight ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.auth-highlight li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
}

.auth-highlight li::before {
    content: '';
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: linear-gradient(120deg, #7fd2ff, #9ce5ff);
    display: inline-block;
    flex-shrink: 0;
}

.auth-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: auto;
}

.auth-metrics div {
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-metrics strong {
    display: block;
    font-size: 1.35rem;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

.auth-metrics small {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

.auth-panel {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: clamp(1.75rem, 3vw, 2.5rem);
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.auth-panel h2 {
    margin: 0;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: 1.8rem;
}

.auth-panel p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.5;
}

 .auth-panel form {
    width: 100%;
 }

.auth-panel label {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.auth-panel input {
    background: #f8fafc;
    border-radius: 0.9rem;
}

.auth-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.auth-benefits span {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.85rem;
    color: #f8fafc;
}

.auth-panel .btn {
    width: 100%;
    margin-top: 0.25rem;
}

.auth-panel-footer {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.95rem;
}

.auth-extra-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.95rem;
}

.auth-extra-links a {
    color: var(--primary);
    font-weight: 500;
}

.auth-panel small {
    color: var(--text-muted);
}

.auth-safe {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-safe::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #00c48c;
    box-shadow: 0 0 0 4px rgba(0, 196, 140, 0.25);
}

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

.sidebar {
    width: 260px;
    background: #004aad;
    color: #e2e8f0;
    padding: 2rem 1.5rem;
    position: sticky;
    top: 0;
    min-height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.sidebar-brand img {
    width: 150px;
    filter: drop-shadow(0 12px 24px rgba(15, 23, 42, 0.4));
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar nav a {
    padding: 0.6rem 0.85rem;
    border-radius: 0.75rem;
    color: #cbd5f5;
    font-weight: 500;
}

.sidebar nav a:hover {
    background: rgba(148, 163, 240, 0.2);
    color: #fff;
}

.sidebar small {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.65rem;
    color: rgba(226, 232, 240, 0.7);
    margin-top: 1rem;
}

.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2.25rem;
    border-bottom: 1px solid var(--border);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar h1 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-chip {
    background: var(--bg);
    padding: 0.6rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

main {
    padding: 2rem;
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.admin-page {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-bottom: 2.5rem;
}

.admin-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.admin-card {
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 1.25rem;
    padding: 1.25rem;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.35rem 1.5rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: var(--shadow-soft);
    margin-bottom: 1.5rem;
}

.card.warning {
    border-color: rgba(255, 196, 0, 0.5);
    background: #fff8e6;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.card-grid {
    display: grid;
    gap: 1rem;
}

.card-grid.cols-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.project-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.project-card h3 {
    margin: 0;
    font-size: 1.15rem;
}

.project-card .project-url {
    font-size: 0.9rem;
    color: var(--text-muted);
    word-break: break-word;
}

.project-card-actions {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
    background: #e2e8f0;
    color: #111;
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.7;
}

.status-badge.status-active { background: #e7f8ee; color: #0f8e47; }
.status-badge.status-paused { background: #fff6db; color: #8b5d00; }
.status-badge.status-archived { background: #e2e8f0; color: #475569; }
.status-badge.status-pending { background: #fef3c7; color: #8a5700; }
.status-badge.status-running { background: #e0f2ff; color: #0c66a1; }
.status-badge.status-completed { background: #e6f4ff; color: #0f5c2e; }
.status-badge.status-error { background: #ffe4e6; color: #a30d37; }

.alert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.alert-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: 0 20px 35px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.alert-card.severity-high { border-color: rgba(255, 99, 71, 0.5); background: #fff0f0; }
.alert-card.severity-medium { border-color: rgba(255, 182, 72, 0.5); background: #fff8eb; }
.alert-card.severity-low { border-color: rgba(59, 130, 246, 0.4); background: #eff6ff; }

.alert-card small {
    color: var(--text-muted);
}

.module-hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    align-items: flex-start;
}

.module-hero-block {
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(15, 23, 42, 0.04);
    box-shadow: 0 20px 35px rgba(15, 23, 42, 0.06);
}

.module-hero-block h2 {
    margin: 0;
    font-size: 1.35rem;
}

.module-hero-block.ctas {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.module-hero form select {
    width: 100%;
    margin-top: 0.35rem;
}

.quick-actions,
.quick-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.module-cards {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.module-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.module-card header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.module-card header small {
    color: var(--text-muted);
}

.module-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

.metric-cell {
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.05);
    border-radius: 0.9rem;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.metric-cell span {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.metric-cell strong {
    font-size: 1.05rem;
    color: var(--text);
}

.module-actions {
    margin-top: 0.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.module-actions .btn-link {
    padding: 0;
    font-weight: 600;
}

.panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 1.25rem;
    background: #fff;
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.05);
}

.panel .table-wrapper {
    margin: 0;
}

.panel .helper-text {
    color: #64748b;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.badge-pill {
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    background: #edf2ff;
    color: #1d3b8b;
    font-weight: 600;
}

.badge-pill.success { background: #dcfce7; color: #166534; }
.badge-pill.warning { background: #fef3c7; color: #92400e; }
.badge-pill.muted { background: #e2e8f0; color: #475569; }

.admin-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.admin-plan-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1.25rem;
    padding: 1.25rem;
    background: #fff;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-plan-card header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.admin-plan-card header strong {
    color: var(--primary);
    font-size: 1.1rem;
}

.admin-plan-card header small {
    color: #94a3b8;
}

.admin-plan-card ul {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.admin-plan-card ul li {
    display: flex;
    justify-content: space-between;
    color: #475569;
    font-size: 0.92rem;
}

.integration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.integration-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1.25rem;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #fff;
}

.integration-card header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.admin-form-grid label.toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.admin-panels .status-chip,
.integration-card .status-chip {
    text-transform: uppercase;
    font-size: 0.75rem;
}

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

.table-actions form {
    margin: 0;
}

.table-actions .btn {
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
}

.admin-form-grid input,
.admin-form-grid select {
    width: 100%;
}

.admin-form-grid .helper-text {
    font-size: 0.75rem;
    color: #94a3b8;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.92rem;
    color: var(--text-muted);
}

.metric-row strong {
    color: var(--text);
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.status-grid div {
    background: #f7f9fc;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 1rem;
}

.queue-item {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.05);
}

.queue-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.queue-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.5rem;
    font-size: 0.9rem;
}

.queue-meta span {
    color: var(--text-muted);
}

.alert {
    padding: 0.95rem 1rem;
    border-radius: 0.95rem;
    background: rgba(0, 74, 173, 0.08);
    border: 1px solid rgba(0, 74, 173, 0.15);
    color: var(--text);
    margin-bottom: 1rem;
}

.alert.error-text {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.3);
    color: #7a1126;
}

.alert.warning {
    background: #fff7e0;
    border-color: rgba(255, 165, 0, 0.4);
    color: #7a4d00;
}

.alert.info {
    background: rgba(0, 74, 173, 0.08);
    border-color: rgba(0, 74, 173, 0.2);
    color: #0a357d;
}

.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-5 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 1.5rem; }

.stat-card {
    background: rgba(0, 74, 173, 0.07);
    border-radius: 1rem;
    padding: 1rem;
}

.stat-card h3 {
    color: var(--text-muted);
    margin: 0 0 0.2rem;
}

.stat-card strong {
    font-size: 1.7rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 1.4rem;
    border-radius: 0.85rem;
    border: 1px solid transparent;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 20px 35px rgba(0, 74, 173, 0.25);
}

.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { border: 1px solid rgba(15, 23, 42, 0.2); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-link { background: transparent; border: none; color: var(--primary); padding: 0; }
.btn-small { font-size: 0.85rem; padding: 0.4rem 0.8rem; }
.btn-disabled,
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}
.btn-danger { background: #f97070; color: #fff; }
.btn-danger:hover { background: #c24141; }

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.filters label {
    flex: 1 1 180px;
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.note {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.alert {
    border-radius: 0.85rem;
    padding: 1rem 1.2rem;
    margin-top: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fafc;
    color: var(--text);
}
.alert-success { border-color: rgba(16, 185, 129, 0.35); background: #ecfdf5; color: #065f46; }
.alert-error { border-color: rgba(239, 68, 68, 0.4); background: #fef2f2; color: #991b1b; }
.alert-warning { border-color: rgba(251, 191, 36, 0.45); background: #fffbeb; color: #92400e; }

.performance-card {
    gap: 1.5rem;
    display: flex;
    flex-direction: column;
}

.performance-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.performance-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.psi-row {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    background: #fff;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.psi-row header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.psi-url {
    margin: 0;
    font-weight: 600;
    word-break: break-all;
}

.psi-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.psi-metrics span {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.psi-metrics strong {
    display: block;
    font-size: 1.1rem;
}

.psi-summary ul {
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
    color: var(--text);
    font-size: 0.95rem;
}

.psi-summary p {
    margin: 0;
    font-weight: 600;
    color: var(--text);
}

.psi-error-text {
    color: #b91c1c;
    font-weight: 600;
    margin-top: 0.5rem;
}

.psi-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.psi-actions form {
    width: 100%;
}

.psi-actions .btn {
    width: 100%;
}

.psi-success { background: rgba(16, 185, 129, 0.12); color: #065f46; }
.psi-pending { background: rgba(59, 130, 246, 0.15); color: #1d4ed8; }
.psi-running { background: rgba(251, 191, 36, 0.2); color: #92400e; }
.psi-error { background: rgba(239, 68, 68, 0.18); color: #991b1b; }
.psi-idle { background: rgba(15, 23, 42, 0.08); color: var(--text); }

.insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.insight-item {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    padding: 1rem;
    background: #fff;
}

.insight-item header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.insight-explanation {
    margin: 0 0 0.5rem;
    color: var(--text-muted);
}

.insight-action {
    margin: 0;
    font-weight: 600;
}

.page-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.page-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    padding: 1.25rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.page-card header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-card .page-subtitle {
    margin: 0.2rem 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.page-pill {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.page-pill span {
    background: rgba(15, 23, 42, 0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.page-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.page-card-grid section {
    background: #f8fafc;
    border-radius: 0.8rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.page-card-grid section h4 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.page-card-grid section p {
    margin: 0.2rem 0;
    font-size: 0.95rem;
}

.page-card footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.badge-ok {
    background: rgba(16, 185, 129, 0.15);
    color: #065f46;
    border-radius: 999px;
    padding: 0.2rem 0.8rem;
    font-size: 0.85rem;
}

.badge-warning {
    background: rgba(251, 191, 36, 0.2);
    color: #92400e;
    border-radius: 999px;
    padding: 0.2rem 0.8rem;
    font-size: 0.85rem;
}

.psi-report-head {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.psi-report-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0 0 0.3rem;
}

.psi-report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.psi-report-summary {
    margin-top: 1.5rem;
}

.psi-report-summary ul {
    margin-top: 0.5rem;
    padding-left: 1.25rem;
}

.psi-report-grid {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.psi-report-grid > div {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.8rem;
    padding: 0.9rem 1rem;
    background: #f8fafc;
}

.psi-report-grid p {
    margin: 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.psi-report-grid strong {
    display: block;
    font-size: 1.4rem;
    margin: 0.2rem 0;
}

.psi-report-grid small {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.psi-report-link {
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px dashed rgba(0, 74, 173, 0.3);
    border-radius: 1rem;
    background: rgba(0, 74, 173, 0.04);
}

input,
select,
textarea {
    font-family: inherit;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 0.85rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.95rem;
    background: #fff;
    margin-top: 0.35rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 74, 173, 0.15);
}

.table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    display: block;
    scrollbar-color: var(--primary) rgba(148, 163, 184, 0.25);
}

.table-wrapper::-webkit-scrollbar { height: 8px; width: 8px; }
.table-wrapper::-webkit-scrollbar-track { background: rgba(148, 163, 184, 0.25); border-radius: 999px; }
.table-wrapper::-webkit-scrollbar-thumb { background: rgba(0, 74, 173, 0.65); border-radius: 999px; }
.table-wrapper::-webkit-scrollbar-thumb:vertical { min-height: 30px; }
.table-wrapper.tall-scroll { max-height: 520px; }

.table-hint { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.4rem; }

table.table {
    width: max-content;
    min-width: 1800px;
    display: inline-table;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

table.table thead th {
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fff;
    background: #004aad;
    padding: 0.75rem 0.8rem;
    position: sticky;
    top: 0;
    line-height: 1.3;
    word-break: break-word;
}

table.table tbody tr {
    background: #fff;
    box-shadow: 0 15px 25px rgba(15, 23, 42, 0.05);
    border-radius: 1rem;
}

table.table tbody td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    font-size: 0.9rem;
    white-space: normal;
    line-height: 1.35;
    max-width: 320px;
    word-break: break-word;
}

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

.table-wrapper table.table th:first-child,
.table-wrapper table.table td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    box-shadow: 8px 0 12px rgba(15, 23, 42, 0.05);
}

.table-wrapper table.table th:first-child { background: #004aad; color: #fff; }
.table-wrapper table.table td:first-child { background: var(--card-bg); }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
}

.badge.success { background: #e6f4ff; color: #0f3f8c; }
.badge.warning { background: #fff2cc; color: #8a5700; }
.badge.muted { background: #e2e8f0; color: #475569; }
.badge.severity-critical { background: #ffe0e0; color: #8b0c0c; }
.badge.severity-high { background: #ffe9cc; color: #8a5700; }
.badge.severity-medium { background: #fff7d9; color: #684600; }
.badge.severity-low { background: #e7f7ff; color: #004aad; }
.badge.severity-info { background: #dbeafe; color: #004aad; }

.report-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
}

.report-hero__main {
    flex: 1 1 320px;
}

.report-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0 0 0.25rem;
}

.report-hero__main h1 {
    margin: 0;
    font-size: clamp(1.5rem, 4vw, 2.3rem);
}

.report-domain {
    margin: 0.25rem 0 0.65rem;
    color: var(--text-muted);
}

.report-description {
    margin: 0;
    color: var(--text-muted);
    max-width: 540px;
}

.report-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    min-width: 220px;
}

.report-hero__meta div {
    min-width: 120px;
    background: #f8fafc;
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.report-hero__meta span {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.report-hero__meta strong {
    font-size: 1.4rem;
}

.report-hero__actions {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.report-hero__buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.report-hero__downloads {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.report-hero__downloads a {
    color: var(--primary);
    font-weight: 500;
}

.report-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.report-stat-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    background: #fff;
}

.report-stat-card p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.report-stat-card strong {
    display: block;
    font-size: 1.8rem;
    margin: 0.35rem 0;
}

.report-stat-card small {
    color: var(--text-muted);
}

.report-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.report-panel header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.issue-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.issue-list li {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
}

.issue-list p {
    margin: 0.1rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.metric-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.metric-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    padding: 0.35rem 0;
}

.metric-list strong {
    font-size: 1rem;
}

.sitemap-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sitemap-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.sitemap-list a {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.85rem;
}

.empty-copy {
    margin: 0;
    color: var(--text-muted);
}

.next-steps p {
    margin: 0 0 0.75rem;
    color: var(--text-muted);
}

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

.table-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.table-actions form { margin: 0; }
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.status-grid small { color: var(--text-muted); }

.text-wrap { white-space: normal; line-height: 1.4; }

.filters .btn { align-self: flex-end; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 1rem; }
.auth-panel .form-grid { grid-template-columns: 1fr; }

.form-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.25rem;
}

.form-section {
    background: #f8fafc;
    border-radius: 1.25rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 20px 35px rgba(15, 23, 42, 0.05);
}

.form-section h3 {
    margin: 0;
    font-size: 1.1rem;
}

.helper-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: var(--primary);
    margin: 0 0 0.35rem;
}

.sidebar-toggle { border: none; background: transparent; color: #fff; font-size: 1.2rem; display: none; }

.project-layout {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.2fr);
    gap: 1.5rem;
}

.project-meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-url {
    font-size: 0.9rem;
    color: var(--text-muted);
    word-break: break-word;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.project-runs {
    grid-column: span 2;
}

.project-runs .table-wrapper {
    margin-top: 1rem;
}

.form-hero {
    background: linear-gradient(135deg, rgba(0, 74, 173, 0.1), rgba(0, 74, 173, 0.03));
}

.form-hero p {
    color: #334155;
    margin: 0.4rem 0;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(320px, 1.6fr) minmax(260px, 1fr);
    gap: 1.75rem;
    align-items: stretch;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(0, 74, 173, 0.12), rgba(0, 74, 173, 0.02));
    border-radius: 1.5rem;
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.dashboard-hero .hero-copy h1 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    margin: 0 0 0.4rem;
}

.hero-copy > p {
    color: #475569;
    margin: 0.5rem 0 1.25rem;
}

.hero-metrics {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.hero-metrics div {
    background: #f7f9fc;
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
    min-width: 140px;
}

.hero-metrics span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.hero-metrics strong {
    display: block;
    font-size: 1.4rem;
    margin-top: 0.25rem;
}

.hero-plan {
    background: #fff;
    border-radius: 1.25rem;
    border: 1px solid rgba(15, 23, 42, 0.05);
    padding: 1.5rem;
    box-shadow: 0 25px 40px rgba(15, 23, 42, 0.08);
}

.hero-plan ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    color: #475569;
}

.hero-plan li {
    margin-bottom: 0.35rem;
}

.quick-actions-card {
    margin-bottom: 2rem;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
}

.quick-grid .btn {
    width: 100%;
    justify-content: center;
}

.dashboard-panels,
.admin-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.75rem;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.panel-header p {
    margin: 0.25rem 0 0;
    color: #64748b;
}

.panel-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.panel-list li {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

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

.panel-list span {
    display: block;
    color: #64748b;
    font-size: 0.87rem;
}

.panel-list .btn {
    white-space: nowrap;
}

.status-chip {
    padding: 0.2rem 0.8rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: #e2e8f0;
    color: #1e293b;
    text-transform: capitalize;
}

.status-chip.status-completed {
    background: #dcfce7;
    color: #166534;
}

.status-chip.status-running,
.status-chip.status-processing {
    background: #fef3c7;
    color: #92400e;
}

.status-chip.status-paused {
    background: #e0f2fe;
    color: #075985;
}

.table-wrapper.compact {
    margin: 0;
    overflow-x: auto;
}

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

.mini-table th,
.mini-table td {
    padding: 0.55rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.mini-table th {
    background: #f8fafc;
    font-weight: 600;
}

.plan-card .list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.plan-card .list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #475569;
}

.plan-card .list span {
    font-size: 0.9rem;
}

.plan-card .list strong {
    font-size: 1.1rem;
    color: var(--text);
}

.panel .btn-link {
    padding: 0;
}

@media (max-width: 960px) {
    .dashboard-hero {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }

    .panel-list li {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .panel-list .btn {
        justify-self: flex-start;
    }

    .admin-plan-grid,
    .integration-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform 0.3s ease; z-index: 50; }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-toggle { display: block; }
    main { padding: 1.25rem; }
    .topbar { padding: 1rem 1.25rem; }
    .project-layout { grid-template-columns: 1fr; }
    .project-runs { grid-column: span 1; }
}

@media (max-width: 960px) {
    .auth-wrapper {
        grid-template-columns: 1fr;
        padding: 2rem;
    }
    .auth-highlight {
        text-align: center;
        align-items: center;
    }
    .auth-trust-badges { justify-content: center; }
    .auth-shell { padding: 1.25rem; }
}

@media (max-width: 640px) {
    .auth-panel { padding: 1.5rem; }
    .auth-highlight img { width: 150px; }
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.badge-pill {
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    background: #edf2ff;
    color: #1d3b8b;
    font-weight: 600;
}

.badge-pill.success { background: #dcfce7; color: #166534; }
.badge-pill.warning { background: #fef3c7; color: #92400e; }
.badge-pill.muted { background: #e2e8f0; color: #475569; }

.admin-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.admin-plan-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1.25rem;
    padding: 1.25rem;
    background: #fff;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-plan-card header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.admin-plan-card header small {
    color: #94a3b8;
}

.admin-plan-card ul {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.admin-plan-card ul li {
    display: flex;
    justify-content: space-between;
    color: #475569;
}

.admin-plan-card ul span { font-size: 0.9rem; }

.integration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.integration-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1.25rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #fff;
}

.integration-card header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.admin-form-grid label.toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.admin-panels .status-chip {
    text-transform: uppercase;
    font-size: 0.75rem;
}

