:root {
    --bg: #eef5ff;
    --bg-alt: #f8fbff;
    --surface: rgba(255, 255, 255, 0.62);
    --surface-strong: rgba(255, 255, 255, 0.82);
    --border: rgba(117, 170, 255, 0.22);
    --border-strong: rgba(44, 119, 255, 0.26);
    --text: #14233b;
    --muted: #5c6d8a;
    --primary: #1565ff;
    --primary-soft: #dce8ff;
    --primary-deep: #0a4de0;
    --accent: #4cc9ff;
    --success: #0f9f74;
    --danger: #dc4c64;
    --shadow: 0 22px 55px rgba(36, 90, 182, 0.12);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: 'Inter', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(102, 193, 255, 0.25), transparent 28%),
        radial-gradient(circle at top right, rgba(21, 101, 255, 0.18), transparent 24%),
        linear-gradient(180deg, #f8fbff 0%, #eef5ff 55%, #f6faff 100%);
    color: var(--text);
}

body {
    position: relative;
}

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

button,
input,
select,
textarea {
    font: inherit;
}

.page-shell {
    position: relative;
    padding: 24px;
}

.background-orb {
    position: fixed;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    filter: blur(18px);
    opacity: 0.5;
    pointer-events: none;
}

.orb-one {
    top: 12%;
    right: -70px;
    background: radial-gradient(circle, rgba(76, 201, 255, 0.45), rgba(76, 201, 255, 0));
}

.orb-two {
    left: -80px;
    bottom: 14%;
    background: radial-gradient(circle, rgba(21, 101, 255, 0.25), rgba(21, 101, 255, 0));
}

.glass {
    background: var(--surface);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
}

.topbar {
    position: sticky;
    top: 24px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 1240px;
    margin: 0 auto 28px;
    padding: 16px 22px;
    border-radius: var(--radius-xl);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--text);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.brand small,
.user-chip small,
.stat-card small,
.list-row small,
.empty-state,
.field span,
.panel-head .eyebrow,
.eyebrow {
    color: var(--muted);
}

.brand strong,
.brand small {
    display: block;
}

.nav-links,
.topbar-actions,
.card-actions,
.hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-links a {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted);
    transition: 0.2s ease;
}

.nav-links a.active,
.nav-links a:hover {
    background: rgba(255, 255, 255, 0.72);
    color: var(--primary-deep);
}

.user-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.main-content {
    max-width: 1240px;
    margin: 0 auto;
}

.flash,
.inline-error {
    margin-bottom: 20px;
    padding: 14px 18px;
    border-radius: 16px;
}

.flash-success {
    color: var(--success);
}

.flash-error,
.inline-error,
.field-error {
    color: var(--danger);
}

.hero-panel,
.panel-card,
.auth-card,
.auth-copy {
    border-radius: var(--radius-xl);
}

.hero-panel,
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.hero-panel {
    padding: 30px;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1.05;
    margin-bottom: 10px;
}

h2 {
    font-size: 1.35rem;
    margin-bottom: 8px;
}

p {
    color: var(--muted);
    line-height: 1.6;
}

.button,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover,
.button-link:hover {
    transform: translateY(-1px);
}

.button-primary {
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 14px 30px rgba(21, 101, 255, 0.22);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.72);
    color: var(--primary-deep);
    border: 1px solid var(--border-strong);
}

.button-ghost,
.button-link {
    background: transparent;
    color: var(--muted);
}

.button-block {
    width: 100%;
}

.stats-grid,
.content-grid,
.auth-layout {
    display: grid;
    gap: 20px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 24px;
}

.content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.single-column {
    grid-template-columns: 1fr;
}

.stat-card,
.panel-card {
    padding: 24px;
}

.stat-card strong {
    display: block;
    font-size: 2rem;
    margin: 6px 0;
}

.panel-head,
.list-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.compact-table .list-row + .list-row {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(117, 170, 255, 0.16);
}

.align-right {
    text-align: right;
}

.section-head {
    margin-top: 8px;
}

.filter-grid,
.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(117, 170, 255, 0.2);
    background: rgba(255, 255, 255, 0.8);
    color: var(--text);
    outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: rgba(21, 101, 255, 0.52);
    box-shadow: 0 0 0 4px rgba(21, 101, 255, 0.1);
}

.stack-md,
.stack-lg {
    display: flex;
    flex-direction: column;
}

.stack-md {
    gap: 16px;
}

.stack-lg {
    gap: 22px;
}

.price-preview {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 18px 20px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(21, 101, 255, 0.08), rgba(76, 201, 255, 0.08));
}

.price-preview strong {
    font-size: 1.5rem;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(117, 170, 255, 0.14);
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.data-table td small {
    display: block;
    margin-top: 4px;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pill,
.status-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 0.85rem;
    font-weight: 600;
}

.doc-card p {
    margin: 18px 0;
}

.prose-card {
    padding: 28px;
    line-height: 1.75;
    white-space: normal;
}

.auth-layout {
    min-height: calc(100vh - 180px);
    grid-template-columns: 1.2fr 0.9fr;
    align-items: center;
}

.auth-copy,
.auth-card {
    padding: 32px;
}

.auth-highlights {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.76rem;
    font-weight: 700;
}

.empty-state {
    padding: 20px 0;
}

@media (max-width: 1024px) {
    .stats-grid,
    .content-grid,
    .auth-layout,
    .filter-grid,
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topbar,
    .hero-panel,
    .section-head {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 720px) {
    .page-shell {
        padding: 16px;
    }

    .stats-grid,
    .content-grid,
    .auth-layout,
    .filter-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .nav-links,
    .topbar-actions,
    .card-actions,
    .hero-actions,
    .filter-actions,
    .table-actions {
        flex-wrap: wrap;
    }

    .topbar {
        top: 16px;
        padding: 18px;
    }

    .auth-layout {
        min-height: auto;
    }
}
