/* ═══════════════════════════════════════════════════════════════
   IDI Platform — Modern design system
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* Brand — refined from spec */
    --brand-navy: #0f172a;
    --brand-navy-soft: #1e293b;
    --brand-teal: #14b8a6;
    --brand-teal-deep: #0d9488;
    --brand-teal-glow: rgba(20, 184, 166, 0.35);
    --brand-amber: #f59e0b;
    --brand-coral: #f97316;
    --brand-violet: #8b5cf6;
    --brand-red: #ef4444;

    /* Surfaces */
    --surface: #f1f5f9;
    --surface-elevated: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.72);

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    /* Layout */
    --sidebar-width: 272px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 8px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 12px 24px -4px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 8px 16px -4px rgba(15, 23, 42, 0.08), 0 24px 48px -8px rgba(15, 23, 42, 0.12);
    --shadow-glow: 0 0 40px var(--brand-teal-glow);

    /* Typography */
    --font-display: "Plus Jakarta Sans", system-ui, sans-serif;
    --font-body: "Inter", system-ui, -apple-system, sans-serif;

    /* Motion */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --duration: 0.25s;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--surface);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ─── App shell ─────────────────────────────────────────────── */

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

.app-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(165deg, #0c1222 0%, var(--brand-navy) 40%, #162032 100%);
    color: #e2e8f0;
    position: relative;
    overflow: hidden;
}

.app-sidebar::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -60%;
    width: 100%;
    height: 80%;
    background: radial-gradient(circle, var(--brand-teal-glow) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0.5;
}

.app-sidebar::after {
    content: "";
    position: absolute;
    bottom: -20%;
    left: -30%;
    width: 80%;
    height: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.sidebar-brand {
    position: relative;
    z-index: 1;
    padding: 1.75rem 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.sidebar-brand__mark {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--brand-teal) 0%, var(--brand-violet) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #fff;
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

.sidebar-brand__text h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

.sidebar-brand__text p {
    margin: 0.15rem 0 0;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(148, 163, 184, 0.9);
}

.sidebar-nav {
    position: relative;
    z-index: 1;
    flex: 1;
    padding: 0.5rem 0.75rem 1rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.nav-section-label {
    display: block;
    padding: 1rem 0.75rem 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(148, 163, 184, 0.7);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.875rem;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: rgba(226, 232, 240, 0.85);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background var(--duration) var(--ease-out),
                color var(--duration) var(--ease-out),
                transform var(--duration) var(--ease-out);
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateX(2px);
}

.sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(20, 184, 166, 0.25) 0%, rgba(20, 184, 166, 0.08) 100%);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--brand-teal);
}

.sidebar-footer {
    position: relative;
    z-index: 1;
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.8rem;
}

.sidebar-footer__school {
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.15rem;
}

.sidebar-footer__year {
    color: rgba(148, 163, 184, 0.8);
    font-size: 0.75rem;
}

/* ─── Main area ─────────────────────────────────────────────── */

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background:
        radial-gradient(ellipse 80% 50% at 100% -20%, rgba(20, 184, 166, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 0% 100%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        var(--surface);
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    padding: 0.875rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.topbar-context {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.context-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface-elevated);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    padding: 0.35rem 0.875rem 0.35rem 0.65rem;
    box-shadow: var(--shadow-sm);
}

.context-pill label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0;
}

.context-pill select {
    border: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0.15rem 1.5rem 0.15rem 0.25rem;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-teal) 0%, var(--brand-violet) 100%);
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-pill__name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.app-content {
    padding: 1.75rem 2rem 2.5rem;
    flex: 1;
}

/* ─── Page header ───────────────────────────────────────────── */

.page-header {
    margin-bottom: 2rem;
}

.page-header h2 {
    margin: 0 0 0.35rem;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--brand-navy-soft) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 42rem;
}

/* ─── Cards ─────────────────────────────────────────────────── */

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

.dashboard-card {
    background: var(--surface-elevated);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--duration) var(--ease-out),
                box-shadow var(--duration) var(--ease-out),
                border-color var(--duration) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-teal), var(--brand-violet));
    opacity: 0;
    transition: opacity var(--duration) var(--ease-out);
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(20, 184, 166, 0.15);
}

.dashboard-card:hover::before { opacity: 1; }

.dashboard-card h3 {
    margin: 0 0 0.5rem;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.dashboard-card--accent-teal::before { opacity: 1; background: linear-gradient(90deg, var(--brand-teal), var(--brand-teal-deep)); }
.dashboard-card--accent-amber::before { opacity: 1; background: linear-gradient(90deg, var(--brand-amber), var(--brand-coral)); }
.dashboard-card--accent-violet::before { opacity: 1; background: linear-gradient(90deg, var(--brand-violet), #a78bfa); }
.dashboard-card--accent-coral::before { opacity: 1; background: linear-gradient(90deg, var(--brand-coral), var(--brand-amber)); }

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin: 0.25rem 0 0.15rem;
    line-height: 1.1;
}

.dashboard-card .text-muted {
    color: var(--text-secondary) !important;
    font-size: 0.85rem;
}

/* ─── Status pills ──────────────────────────────────────────── */

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.status-pill--teal {
    background: rgba(20, 184, 166, 0.12);
    color: var(--brand-teal-deep);
}

.status-pill--amber {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.status-pill--navy {
    background: rgba(15, 23, 42, 0.08);
    color: var(--brand-navy-soft);
}

.status-pill--red {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.status-pill--violet {
    background: rgba(139, 92, 246, 0.12);
    color: #7c3aed;
}

.status-overdue {
    background: rgba(239, 68, 68, 0.04) !important;
}

.status-overdue .governance-timeline__title,
.status-overdue td:first-child {
    color: var(--brand-red);
}

tr.status-overdue td {
    border-left: 3px solid var(--brand-red);
}

/* ─── Tables & forms ────────────────────────────────────────── */

.table-card,
.form-card,
.thread-panel {
    background: var(--surface-elevated);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-card__header {
    padding: 1.125rem 1.5rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.data-table {
    margin: 0;
}

.data-table thead th {
    background: transparent;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    padding: 0.875rem 1.25rem;
}

.data-table tbody td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    border-bottom: 1px solid rgba(15, 23, 42, 0.04);
    font-size: 0.9rem;
}

.data-table tbody tr:hover td {
    background: rgba(20, 184, 166, 0.03);
}

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

.form-card {
    padding: 1.75rem;
    max-width: 720px;
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1px solid rgba(15, 23, 42, 0.12);
    padding: 0.6rem 0.875rem;
    font-size: 0.9rem;
    transition: border-color var(--duration), box-shadow var(--duration);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 3px var(--brand-teal-glow);
}

/* ─── Buttons ───────────────────────────────────────────────── */

.btn {
    font-family: var(--font-display);
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}

.btn:active { transform: scale(0.98); }

.btn-primary,
.btn-primary-custom {
    background: linear-gradient(135deg, var(--brand-teal) 0%, var(--brand-teal-deep) 100%);
    border: none;
    color: #fff;
    box-shadow: 0 2px 8px var(--brand-teal-glow);
}

.btn-primary:hover,
.btn-primary-custom:hover {
    background: linear-gradient(135deg, #2dd4bf 0%, var(--brand-teal) 100%);
    box-shadow: 0 4px 16px var(--brand-teal-glow);
    color: #fff;
}

.btn-outline-primary {
    border-color: rgba(20, 184, 166, 0.4);
    color: var(--brand-teal-deep);
}

.btn-outline-primary:hover {
    background: rgba(20, 184, 166, 0.08);
    border-color: var(--brand-teal);
    color: var(--brand-teal-deep);
}

.btn-outline-secondary {
    border-color: rgba(15, 23, 42, 0.12);
    color: var(--text-secondary);
}

.btn-outline-secondary:hover {
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-primary);
}

.btn-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0.75rem 0;
    font-size: 0.85rem;
}

/* ─── Compliance ring ───────────────────────────────────────── */

.compliance-ring {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 108px;
    height: 108px;
    border-radius: 50%;
    background: conic-gradient(
        var(--ring-color, var(--brand-teal)) calc(var(--percent, 0) * 1%),
        rgba(15, 23, 42, 0.06) 0
    );
    margin: 0.75rem 0;
    position: relative;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 12px rgba(20, 184, 166, 0.2));
}

.compliance-ring--low { --ring-color: var(--brand-red); filter: drop-shadow(0 4px 12px rgba(239, 68, 68, 0.2)); }
.compliance-ring--mid { --ring-color: var(--brand-amber); }
.compliance-ring--high { --ring-color: var(--brand-teal); }

.compliance-ring::before {
    content: "";
    position: absolute;
    inset: 10px;
    background: var(--surface-elevated);
    border-radius: 50%;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.compliance-ring__value,
.compliance-ring__label {
    position: relative;
    z-index: 1;
    line-height: 1.2;
}

.compliance-ring__value {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
}

.compliance-ring__label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

/* ─── Timeline & threads ────────────────────────────────────── */

.governance-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.governance-timeline__item {
    display: flex;
    gap: 1.25rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    transition: background var(--duration);
}

.governance-timeline__item:hover {
    background: rgba(20, 184, 166, 0.02);
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: var(--radius-sm);
}

.governance-timeline__item:last-child { border-bottom: none; }

.governance-timeline__date {
    flex-shrink: 0;
    width: 4.5rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--brand-teal-deep);
}

.governance-timeline__title {
    font-weight: 600;
    color: var(--text-primary);
}

.governance-timeline__meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.thread-panel { padding: 1.5rem; }

.thread-message {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.thread-message:last-child { border-bottom: none; }

.thread-message--own .thread-message__body {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.08) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-radius: var(--radius-md);
    padding: 1rem;
    border: 1px solid rgba(20, 184, 166, 0.12);
}

.thread-message__meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.thread-message__body {
    white-space: pre-wrap;
    font-size: 0.925rem;
    line-height: 1.55;
}

/* ─── Alerts & empty states ─────────────────────────────────── */

.alert {
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: rgba(20, 184, 166, 0.1);
    color: var(--brand-teal-deep);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.empty-state {
    text-align: center;
    padding: 3.5rem 2rem;
    color: var(--text-secondary);
    background: var(--surface-elevated);
    border: 2px dashed rgba(15, 23, 42, 0.08);
    border-radius: var(--radius-lg);
}

.empty-state h3 {
    font-family: var(--font-display);
    color: var(--text-primary);
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    font-weight: 700;
}

.empty-state p {
    margin: 0 auto;
    max-width: 28rem;
    line-height: 1.6;
}

.empty-state a {
    color: var(--brand-teal-deep);
    font-weight: 600;
}

.unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand-coral), var(--brand-amber));
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.35);
}

/* ─── Login page ────────────────────────────────────────────── */

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.login-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 4rem;
    background: linear-gradient(145deg, #0c1222 0%, var(--brand-navy) 35%, #1a2744 70%, #0f172a 100%);
    overflow: hidden;
}

.login-hero::before {
    content: "";
    position: absolute;
    width: 600px;
    height: 600px;
    top: -200px;
    right: -200px;
    background: radial-gradient(circle, var(--brand-teal-glow) 0%, transparent 65%);
    animation: float 12s ease-in-out infinite;
}

.login-hero::after {
    content: "";
    position: absolute;
    width: 400px;
    height: 400px;
    bottom: -100px;
    left: -100px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 65%);
    animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -20px) scale(1.05); }
}

.login-hero__content {
    position: relative;
    z-index: 1;
    max-width: 28rem;
}

.login-hero__mark {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--brand-teal), var(--brand-violet));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.85rem;
    color: #fff;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-glow);
}

.login-hero h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
    margin: 0 0 1rem;
    line-height: 1.15;
}

.login-hero p {
    font-size: 1.05rem;
    color: rgba(203, 213, 225, 0.9);
    line-height: 1.65;
    margin: 0;
}

.login-hero__features {
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-hero__feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: rgba(203, 213, 225, 0.85);
}

.login-hero__feature::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-teal);
    box-shadow: 0 0 8px var(--brand-teal);
    flex-shrink: 0;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(20, 184, 166, 0.06) 0%, transparent 50%),
        var(--surface);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface-elevated);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.login-card h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0 0 0.35rem;
}

.login-card .subtitle {
    margin: 0 0 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Legacy login-page wrapper (fallback) */
.login-page {
    min-height: 100vh;
}

/* Standalone pages (access denied, error) */
.standalone-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(20, 184, 166, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 100% 100%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        var(--surface);
}

.standalone-page__inner {
    width: 100%;
    max-width: 520px;
}

/* ─── Responsive ────────────────────────────────────────────── */

@media (max-width: 900px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-hero { display: none; }
    .login-panel { min-height: 100vh; }

    .app-sidebar { display: none; }
    .app-content { padding: 1.25rem; }
}

@media (max-width: 600px) {
    .page-header h2 { font-size: 1.4rem; }
    .card-grid { grid-template-columns: 1fr; }
}