:root {
    color-scheme: light;
    --bg: #f8fafc;
    --bg-accent: #eef4ff;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-strong: #ffffff;
    --sidebar: rgba(247, 250, 248, 0.94);
    --header: rgba(255, 255, 255, 0.82);
    --border: #d9e2ef;
    --text: #1b1f27;
    --muted: #647084;
    --muted-strong: #3f4a5b;
    --accent: #2563eb;
    --accent-strong: #1d4ed8;
    --accent-soft: #e8f0ff;
    --accent-text: #1e40af;
    --secondary: #f1f5f9;
    --secondary-hover: #e2e8f0;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --warning: #b7791f;
    --success: #0f766e;
    --info: #2563eb;
    --shadow-card: 0 16px 36px rgba(37, 99, 235, 0.08);
    --shadow-panel: 0 22px 52px rgba(27, 31, 39, 0.12);
}

html.dark {
    color-scheme: dark;
    --bg: #111318;
    --bg-accent: #171b22;
    --surface: rgba(25, 29, 37, 0.92);
    --surface-strong: #1b2029;
    --sidebar: rgba(18, 21, 28, 0.96);
    --header: rgba(19, 22, 29, 0.88);
    --border: #303844;
    --text: #f4f7fb;
    --muted: #a7b0bf;
    --muted-strong: #d5dbe5;
    --accent: #7dd3fc;
    --accent-strong: #bae6fd;
    --accent-soft: rgba(125, 211, 252, 0.14);
    --accent-text: #e0f2fe;
    --secondary: #242b35;
    --secondary-hover: #303847;
    --danger: #f87171;
    --danger-hover: #fca5a5;
    --warning: #facc15;
    --success: #34d399;
    --info: #60a5fa;
    --shadow-card: 0 24px 70px rgba(0, 0, 0, 0.3);
    --shadow-panel: 0 24px 60px rgba(0, 0, 0, 0.38);
}

body {
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 28%),
        radial-gradient(circle at bottom left, rgba(15, 118, 110, 0.06), transparent 24%),
        linear-gradient(180deg, var(--bg-accent) 0%, var(--bg) 34%, var(--bg) 100%) !important;
    color: var(--text);
}

html.dark body {
    background:
        radial-gradient(circle at top right, rgba(125, 211, 252, 0.1), transparent 30%),
        radial-gradient(circle at bottom left, rgba(45, 212, 191, 0.05), transparent 24%),
        linear-gradient(180deg, var(--bg-accent) 0%, var(--bg) 42%, var(--bg) 100%) !important;
}

[class*="#f5f0ff"] {
    background: linear-gradient(145deg, #ffffff 0%, #f4f7fb 48%, #eef4ff 100%) !important;
}

html.dark [class*="#110e1f"] {
    background: linear-gradient(135deg, #111318 0%, #171b22 58%, #1b2029 100%) !important;
}

.card,
.soft-panel,
.modal-box,
.metric-card,
.btn-primary,
.btn-secondary,
.btn-danger,
.auth-input,
.input-field,
.rounded-xl,
.rounded-2xl,
.rounded-3xl,
[class~="rounded-[0.95rem]"],
[class~="rounded-[1.5rem]"],
[class~="rounded-[2rem]"] {
    border-radius: 8px !important;
}

.btn-primary {
    background: var(--accent-strong) !important;
}

.btn-primary,
.from-blue-600,
.via-blue-600,
.to-teal-700 {
    --tw-gradient-from: var(--accent-strong) var(--tw-gradient-from-position) !important;
    --tw-gradient-to: rgba(29, 78, 216, 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), #2563eb var(--tw-gradient-via-position), #0f766e var(--tw-gradient-to-position) !important;
}

.auth-input,
.input-field {
    background: rgba(255, 255, 255, 0.82) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

html.dark .auth-input,
html.dark .input-field {
    background: rgba(27, 32, 41, 0.9) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.auth-input:focus,
.input-field:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14) !important;
}

.bg-white,
.bg-white\/80,
.bg-white\/95 {
    background-color: var(--surface) !important;
}

::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.36) !important;
}

html.dark ::-webkit-scrollbar-thumb {
    background: rgba(94, 234, 212, 0.32) !important;
}

.card {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 30px rgba(15, 23, 42, 0.06) !important;
}

.metric-card,
.soft-panel {
    border-color: var(--border) !important;
}

.table-scroll table {
    border-collapse: separate;
    border-spacing: 0;
}

.table-scroll th {
    color: var(--muted-strong);
    background: rgba(248, 250, 252, 0.82);
    font-weight: 700;
}

.table-scroll td,
.table-scroll th {
    border-color: var(--border) !important;
}

html.dark .table-scroll th {
    background: rgba(27, 32, 41, 0.82);
}

.modal-box,
[class*="shadow-2xl"] {
    box-shadow: var(--shadow-panel) !important;
}

[class*="border-dashed"] {
    border-color: color-mix(in srgb, var(--border) 78%, var(--muted)) !important;
}

.status-neutral {
    background: #f1f5f9;
    color: #475569;
}

.status-info {
    background: #dbeafe;
    color: #1d4ed8;
}

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

.status-warning {
    background: #fef3c7;
    color: #92400e;
}

.status-danger {
    background: #fee2e2;
    color: #991b1b;
}

html.dark .status-neutral {
    background: rgba(148, 163, 184, 0.16);
    color: #cbd5e1;
}

html.dark .status-info {
    background: rgba(96, 165, 250, 0.18);
    color: #bfdbfe;
}

html.dark .status-success {
    background: rgba(52, 211, 153, 0.16);
    color: #bbf7d0;
}

html.dark .status-warning {
    background: rgba(250, 204, 21, 0.16);
    color: #fde68a;
}

html.dark .status-danger {
    background: rgba(248, 113, 113, 0.18);
    color: #fecaca;
}

.auth-page {
    position: relative;
    isolation: isolate;
    padding: 1rem;
}

.auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(37, 99, 235, 0.045) 1px, transparent 1px),
        linear-gradient(180deg, rgba(37, 99, 235, 0.045) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 70%);
}

.auth-shell {
    width: 100%;
    align-items: stretch;
}

.auth-login .auth-shell {
    max-width: 460px !important;
    display: block !important;
}

.auth-register .auth-shell {
    max-width: 620px !important;
    display: block !important;
}

.auth-login .auth-hero,
.auth-register .auth-hero {
    display: none !important;
}

.auth-hero,
.auth-card {
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    box-shadow: var(--shadow-panel) !important;
}

.auth-hero {
    min-height: 680px;
    background:
        linear-gradient(135deg, rgba(29, 78, 216, 0.96) 0%, rgba(37, 99, 235, 0.94) 58%, rgba(15, 118, 110, 0.9) 100%) !important;
    color: #ffffff;
}

.auth-hero-light {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.94) 0%, rgba(248, 250, 252, 0.96) 50%, rgba(238, 244, 255, 0.88) 100%) !important;
    color: var(--text);
}

html.dark .auth-hero-light {
    background:
        linear-gradient(145deg, rgba(17, 19, 24, 0.96) 0%, rgba(23, 27, 34, 0.94) 54%, rgba(27, 32, 41, 0.96) 100%) !important;
}

.auth-hero-inner {
    position: relative;
    overflow: hidden;
}

.auth-hero-inner::after {
    content: "";
    position: absolute;
    inset: auto -18% -18% auto;
    width: 280px;
    height: 280px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    transform: rotate(18deg);
}

.auth-hero-light .auth-hero-inner::after {
    border-color: rgba(37, 99, 235, 0.16);
}

.auth-logo {
    border-radius: 8px !important;
    background: linear-gradient(135deg, var(--accent-strong), #2563eb 58%, #0f766e) !important;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18) !important;
}

.auth-hero .auth-logo {
    background: rgba(255, 255, 255, 0.15) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
}

.auth-card {
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 1.5rem !important;
}

html.dark .auth-card {
    background: rgba(22, 35, 31, 0.94) !important;
}

.auth-pill {
    border: 1px solid rgba(37, 99, 235, 0.16) !important;
    background: var(--accent-soft) !important;
    color: var(--accent-text) !important;
}

.auth-section {
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.56) !important;
    padding: 1rem !important;
}

.auth-section-featured {
    background: linear-gradient(180deg, rgba(232, 240, 255, 0.72) 0%, rgba(255, 255, 255, 0.62) 100%) !important;
}

html.dark .auth-section,
html.dark .auth-section-featured {
    background: rgba(30, 41, 59, 0.42) !important;
}

.auth-feature-card {
    border-radius: 8px !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    background: rgba(255, 255, 255, 0.12) !important;
}

.auth-hero-light .auth-feature-card {
    border-color: var(--border) !important;
    background: rgba(255, 255, 255, 0.68) !important;
}

html.dark .auth-hero-light .auth-feature-card {
    background: rgba(30, 41, 59, 0.36) !important;
}

.auth-input {
    min-height: 48px;
}

.auth-button {
    min-height: 44px;
    border-radius: 8px !important;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
}

.auth-button:focus-visible,
.auth-input:focus-visible,
.auth-link:focus-visible,
.auth-card a:focus-visible,
.auth-card button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.38);
    outline-offset: 3px;
}

html.dark .auth-button:focus-visible,
html.dark .auth-input:focus-visible,
html.dark .auth-link:focus-visible,
html.dark .auth-card a:focus-visible,
html.dark .auth-card button:focus-visible {
    outline-color: rgba(94, 234, 212, 0.5);
}

.auth-alert {
    border-radius: 8px !important;
    font-weight: 600;
}

.auth-card button,
.auth-card a {
    border-radius: 8px;
}

.auth-card button {
    min-height: 40px;
}

.auth-card summary {
    list-style: none;
}

.auth-card summary::-webkit-details-marker {
    display: none;
}

.auth-card summary::after {
    content: "+";
    float: left;
    font-weight: 800;
    color: var(--accent-text);
}

.auth-card details[open] summary::after {
    content: "-";
}

.auth-card label {
    color: var(--muted-strong) !important;
}

.auth-card h1,
.auth-card h2 {
    letter-spacing: 0;
}

.auth-card h1 {
    font-size: 1.65rem !important;
    line-height: 1.2 !important;
}

.auth-card h2 {
    font-size: 1rem !important;
}

.auth-card .text-center.mb-8 {
    margin-bottom: 1.25rem !important;
}

.auth-card .space-y-5 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.9rem !important;
}

.auth-card .mt-6 {
    margin-top: 1rem !important;
}

.auth-card .pt-5 {
    padding-top: 1rem !important;
}

@media (max-width: 640px) {
    .auth-page {
        padding: 0.75rem;
    }

    .auth-card {
        padding: 1.25rem !important;
    }
}
