:root {
    --bg: #07111f;
    --panel: rgba(10, 20, 36, 0.78);
    --border: rgba(255, 255, 255, 0.1);
    --text: #eef4ff;
    --muted: #99abc6;
    --muted-strong: #c8d6ea;
    --accent: #ff7a59;
    --accent-strong: #ff5a34;
    --accent-cool: #57d3c8;
    --accent-cool-strong: #25b2a6;
    --success: #56d68d;
    --warning: #ffb85c;
    --danger: #ff7f7f;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --transition: 180ms ease;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Plus Jakarta Sans", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255, 122, 89, 0.2), transparent 34%),
        radial-gradient(circle at top right, rgba(87, 211, 200, 0.15), transparent 32%),
        linear-gradient(145deg, #07111f 0%, #0a1627 38%, #101b2f 100%);
    color: var(--text);
    overflow-x: hidden;
    position: relative;
}

a {
    color: inherit;
}

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

.page-backdrop {
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    position: fixed;
}

.bg-orb {
    border-radius: 999px;
    filter: blur(12px);
    opacity: 0.8;
    position: absolute;
}

.bg-orb-a {
    background: rgba(255, 122, 89, 0.18);
    height: 24rem;
    left: -6rem;
    top: -4rem;
    width: 24rem;
    animation: drift 14s ease-in-out infinite;
}

.bg-orb-b {
    background: rgba(87, 211, 200, 0.15);
    bottom: -6rem;
    height: 28rem;
    right: -7rem;
    width: 28rem;
    animation: drift 16s ease-in-out infinite reverse;
}

.bg-grid {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-position: center;
    background-size: 80px 80px;
    inset: 0;
    mask-image: radial-gradient(circle at center, black 35%, transparent 90%);
    opacity: 0.15;
    position: absolute;
}

.page-shell {
    margin: 0 auto;
    max-width: 1480px;
    padding: 32px 20px 48px;
    position: relative;
    width: 100%;
    z-index: 1;
}

.workspace-shell,
.dashboard-shell {
    display: grid;
    gap: 24px;
}

.workspace-shell {
    align-items: start;
    grid-template-columns: minmax(380px, 520px) minmax(0, 1fr);
}

.panel,
.hero-panel,
.auth-card,
.admin-hero {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
    backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.hero-panel,
.admin-hero,
.auth-card,
.panel {
    padding: 28px;
}

.hero-panel::before,
.admin-hero::before,
.auth-card::before,
.panel::before {
    background: linear-gradient(135deg, rgba(255, 122, 89, 0.18), transparent 38%, rgba(87, 211, 200, 0.12));
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.hero-panel > *,
.admin-hero > *,
.auth-card > *,
.panel > * {
    min-width: 0;
    position: relative;
    z-index: 1;
}

.eyebrow,
.chip,
.meta-chip {
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: var(--muted-strong);
    display: inline-flex;
    flex-wrap: wrap;
    font-size: 0.82rem;
    gap: 8px;
    letter-spacing: 0.02em;
    max-width: 100%;
    padding: 8px 14px;
}

.chip-dot {
    background: var(--accent-cool);
    border-radius: 999px;
    box-shadow: 0 0 18px rgba(87, 211, 200, 0.65);
    height: 8px;
    width: 8px;
}

.display-title,
.section-title,
.auth-title,
.error-title {
    font-family: "Space Grotesk", sans-serif;
    letter-spacing: -0.04em;
    margin: 0;
    overflow-wrap: anywhere;
}

.display-title {
    font-size: clamp(2.2rem, 4.2vw, 4rem);
    line-height: 0.96;
    margin-top: 18px;
}

.section-title {
    font-size: clamp(1.5rem, 2.8vw, 2.2rem);
    line-height: 1.05;
}

.auth-title,
.error-title {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
}

.lead,
.section-copy,
.auth-copy,
.muted-text {
    color: var(--muted);
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.lead {
    font-size: 1rem;
    margin: 18px 0 24px;
    max-width: 34rem;
}

.hero-points,
.detail-list,
.auth-list,
.flash-stack,
.workspace-main,
.dashboard-main,
.form-stack,
.stack-cell {
    display: grid;
    gap: 16px;
}

.hero-metrics,
.stats-grid,
.dashboard-stats,
.mini-stats,
.admin-grid {
    display: grid;
    gap: 14px;
}

.hero-metrics,
.dashboard-stats,
.mini-stats {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

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

.hero-point,
.detail-item,
.metric-card,
.stat-card,
.mini-stat {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 16px 18px;
}

.hero-panel .hero-points,
.hero-panel .detail-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.hero-point strong,
.detail-item strong {
    color: var(--text);
    display: block;
    margin-bottom: 4px;
}

.metric-label,
.stat-label,
.mini-stat-label {
    color: var(--muted);
    display: block;
    font-size: 0.82rem;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.metric-value,
.stat-value,
.mini-stat-value {
    color: var(--text);
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.2rem, 2vw, 2rem);
    font-weight: 700;
}

.topbar,
.panel-header,
.actions-row,
.inline-actions,
.admin-topbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
}

.topbar-copy,
.panel-header > div {
    min-width: 0;
}

.topbar-copy h2,
.topbar-copy p,
.panel-header p,
.panel-header h3,
.panel-header h2 {
    margin: 0;
    min-width: 0;
}

.topbar-copy p,
.panel-header p {
    color: var(--muted);
    margin-top: 8px;
}

.tabs {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    display: inline-flex;
    gap: 8px;
    max-width: 100%;
    padding: 8px;
}

.tab-link {
    border-radius: 999px;
    color: var(--muted-strong);
    flex: 1 1 0;
    padding: 12px 18px;
    text-align: center;
    text-decoration: none;
    transition: background var(--transition), color var(--transition), transform var(--transition);
}

.tab-link:hover,
.tab-link:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    outline: none;
    transform: translateY(-1px);
}

.tab-link.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 12px 24px rgba(255, 90, 52, 0.22);
    color: white;
}

.field-group {
    display: grid;
    gap: 8px;
}

.field-group label {
    color: var(--muted-strong);
    font-size: 0.9rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.field-hint,
.form-footer,
.results-copy {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

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

.input-field,
.file-input {
    background: rgba(4, 11, 21, 0.52);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    color: var(--text);
    max-width: 100%;
    min-height: 56px;
    padding: 16px 18px;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
    width: 100%;
}

.file-input {
    padding: 14px 18px;
}

.input-field::placeholder {
    color: #7f94b2;
}

.input-field:focus,
.file-input:focus {
    border-color: rgba(87, 211, 200, 0.8);
    box-shadow: 0 0 0 4px rgba(87, 211, 200, 0.14);
    outline: none;
    transform: translateY(-1px);
}

.btn {
    align-items: center;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    font-weight: 700;
    gap: 10px;
    justify-content: center;
    max-width: 100%;
    min-height: 52px;
    padding: 0 22px;
    text-decoration: none;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
    white-space: normal;
}

.btn:hover,
.btn:focus-visible {
    outline: none;
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 16px 32px rgba(255, 90, 52, 0.25);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--accent-cool), var(--accent-cool-strong));
    box-shadow: 0 16px 32px rgba(37, 178, 166, 0.25);
    color: #04131f;
}

.btn-outline {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text);
}

.btn-danger {
    background: rgba(255, 127, 127, 0.12);
    border: 1px solid rgba(255, 127, 127, 0.34);
    color: #ffd2d2;
}

.btn-warning {
    background: rgba(255, 184, 92, 0.14);
    border: 1px solid rgba(255, 184, 92, 0.32);
    color: #ffe1ab;
}

.btn-success {
    background: rgba(86, 214, 141, 0.14);
    border: 1px solid rgba(86, 214, 141, 0.32);
    color: #d8ffe8;
}

.btn-sm {
    min-height: 42px;
    padding: 0 16px;
}

.flash {
    border-radius: var(--radius-md);
    font-weight: 600;
    padding: 14px 16px;
}

.flash-error {
    background: rgba(255, 127, 127, 0.12);
    border: 1px solid rgba(255, 127, 127, 0.3);
    color: #ffd0d0;
}

.flash-success {
    background: rgba(86, 214, 141, 0.12);
    border: 1px solid rgba(86, 214, 141, 0.28);
    color: #d5ffe5;
}

.flash-message,
.flash-info {
    background: rgba(87, 211, 200, 0.12);
    border: 1px solid rgba(87, 211, 200, 0.28);
    color: #d3fffb;
}

.auth-shell,
.error-shell {
    align-items: center;
    display: grid;
    min-height: calc(100vh - 80px);
}

.auth-shell {
    grid-template-columns: minmax(280px, 460px) minmax(280px, 480px);
    justify-content: center;
}

.auth-list-item {
    align-items: start;
    display: flex;
    gap: 12px;
}

.auth-list-marker {
    align-items: center;
    background: rgba(87, 211, 200, 0.14);
    border: 1px solid rgba(87, 211, 200, 0.25);
    border-radius: 12px;
    color: var(--accent-cool);
    display: inline-flex;
    flex: 0 0 32px;
    font-family: "Space Grotesk", sans-serif;
    height: 32px;
    justify-content: center;
    margin-top: 2px;
}

.auth-list p {
    color: var(--muted);
    margin: 4px 0 0;
}

.dashboard-shell {
    grid-template-columns: 1fr;
}

.table-wrap {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    max-width: 100%;
    overflow: auto;
}

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

.data-table th,
.data-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.inline-form {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.inline-form .input-field {
    min-height: 42px;
    min-width: 170px;
    padding: 10px 14px;
}

.data-table td::before {
    content: none;
}

.badge {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 8px 12px;
}

.badge-admin {
    background: rgba(255, 122, 89, 0.14);
    border: 1px solid rgba(255, 122, 89, 0.26);
    color: #ffd8cf;
}

.badge-user {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--muted-strong);
}

.badge-active {
    background: rgba(86, 214, 141, 0.14);
    border: 1px solid rgba(86, 214, 141, 0.26);
    color: #d7ffeb;
}

.badge-inactive {
    background: rgba(255, 127, 127, 0.12);
    border: 1px solid rgba(255, 127, 127, 0.24);
    color: #ffd4d4;
}

.error-shell {
    justify-content: center;
}

.error-card {
    max-width: 760px;
    text-align: center;
}

.error-code {
    color: rgba(255, 255, 255, 0.3);
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(4.5rem, 12vw, 8rem);
    line-height: 0.9;
    margin: 0 0 14px;
}

.fade-in {
    animation: fadeUp 0.65s ease both;
}

.delay-1 {
    animation-delay: 0.08s;
}

.delay-2 {
    animation-delay: 0.14s;
}

.delay-3 {
    animation-delay: 0.2s;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes drift {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(22px, -18px, 0) scale(1.06);
    }
}

@media (max-width: 1100px) {
    .workspace-shell,
    .auth-shell {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 860px) {
    .table-wrap {
        border: none;
        overflow: visible;
    }

    .data-table {
        min-width: 0;
    }

    .data-table,
    .data-table thead,
    .data-table tbody,
    .data-table tr,
    .data-table th,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table thead {
        left: -9999px;
        position: absolute;
        top: -9999px;
    }

    .data-table tbody {
        display: grid;
        gap: 14px;
    }

    .data-table tr {
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: var(--radius-md);
        overflow: hidden;
    }

    .data-table td {
        align-items: start;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        display: grid;
        gap: 10px;
        grid-template-columns: minmax(88px, 110px) minmax(0, 1fr);
        padding: 14px 16px;
    }

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

    .data-table td::before {
        color: var(--muted);
        content: attr(data-label);
        font-size: 0.76rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .data-table td strong,
    .data-table td span,
    .data-table td form,
    .data-table td div {
        min-width: 0;
    }

    .stack-cell,
    .inline-actions {
        width: 100%;
    }
}

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

    .hero-panel,
    .panel,
    .auth-card,
    .admin-hero,
    .error-card {
        border-radius: 24px;
        padding: 24px;
    }

    .tabs {
        display: grid;
        width: 100%;
    }

    .topbar,
    .panel-header,
    .actions-row,
    .inline-actions,
    .admin-topbar,
    .inline-form {
        align-items: stretch;
        flex-direction: column;
    }

    .btn,
    .btn-sm {
        width: 100%;
    }

    .inline-form .input-field {
        min-width: 0;
        width: 100%;
    }
}

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

    .hero-panel,
    .panel,
    .auth-card,
    .admin-hero,
    .error-card {
        border-radius: 20px;
        padding: 20px;
    }

    .data-table td {
        gap: 6px;
        grid-template-columns: 1fr;
    }

    .data-table td::before {
        margin-bottom: 2px;
    }
}


@media (min-width: 1101px) and (max-height: 980px) {
    .page-shell {
        padding-top: 20px;
    }

    .hero-panel,
    .panel {
        padding: 24px;
    }

    .display-title {
        font-size: clamp(2rem, 3.4vw, 3.3rem);
    }

    .hero-panel .hero-points,
    .hero-panel .detail-list {
        gap: 12px;
    }
}
