:root {
    --bg: #0b1715;
    --surface: #11231f;
    --surface-alt: #17312c;
    --line: rgba(180, 230, 219, 0.14);
    --line-strong: rgba(180, 230, 219, 0.28);
    --text: #eff8f6;
    --muted: #9ab4ae;
    --accent: #85ddd1;
    --accent-deep: #0e7f73;
    --danger: #ff7c7c;
    --warning: #f7b955;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "SF Pro Display", "Segoe UI", Tahoma, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(133, 221, 209, 0.12), transparent 22%),
        radial-gradient(circle at left center, rgba(53, 116, 104, 0.18), transparent 26%),
        var(--bg);
    color: var(--text);
}

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

button {
    transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

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

button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
}

textarea {
    resize: vertical;
    min-height: 96px;
}

hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 20px 0;
}

.hidden {
    display: none !important;
}

.flash {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    min-width: min(92vw, 420px);
    padding: 14px 18px;
    border-radius: 18px;
    box-shadow: var(--shadow);
    text-align: center;
    font-weight: 600;
}

.flash.info {
    background: rgba(133, 221, 209, 0.16);
    color: var(--text);
}

.flash.success {
    background: rgba(62, 204, 161, 0.22);
    color: #dffef4;
}

.flash.error {
    background: rgba(255, 124, 124, 0.18);
    color: #ffe3e3;
}

.flash.warning {
    background: rgba(247, 185, 85, 0.16);
    color: #fff0cf;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
}

.auth-card {
    width: min(94vw, 560px);
    background: rgba(17, 35, 31, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    border-radius: 30px;
    box-shadow: var(--shadow);
    padding: 32px;
    display: grid;
    gap: 20px;
}

.auth-card h1,
.brand-block h2,
.topbar h1,
.card-head h3 {
    margin: 0;
}

.auth-copy,
.muted {
    color: var(--muted);
}

.helper-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.helper-grid > div {
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
}

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

.sidebar {
    padding: 26px 18px;
    border-left: 1px solid var(--line);
    background: rgba(9, 20, 17, 0.92);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.brand-block {
    padding: 20px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(133, 221, 209, 0.14), rgba(133, 221, 209, 0.04));
    border: 1px solid var(--line);
}

.eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
}

.nav-stack {
    display: grid;
    gap: 8px;
}

.nav-link,
.primary-button,
.secondary-button,
.ghost-button {
    border: 0;
    border-radius: 18px;
    padding: 12px 16px;
    cursor: pointer;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    color: var(--text);
    text-align: right;
}

.nav-link.active {
    background: rgba(133, 221, 209, 0.14);
    color: #dffef8;
}

.badge {
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: rgba(247, 185, 85, 0.18);
    color: #ffdea0;
    font-size: 0.82rem;
}

.main-shell {
    padding: 24px;
    display: grid;
    gap: 18px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.toolbar-inline {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}

.toolbar-field {
    min-width: 180px;
}

.toolbar-field span,
.stack-form label span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.content-stack {
    display: grid;
    gap: 18px;
}

.view-section {
    display: none;
    gap: 18px;
}

.view-section.active {
    display: grid;
}

.card {
    background: rgba(17, 35, 31, 0.92);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.card-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.card-head.between {
    align-items: center;
}

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

.slim-grid {
    margin-bottom: 18px;
}

.stat-card {
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

.stat-card .label {
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 12px;
}

.stat-card .value {
    font-size: 1.6rem;
    font-weight: 700;
}

.two-column-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 18px;
}

.wide-card {
    min-width: 0;
}

.sticky-card {
    position: sticky;
    top: 24px;
    align-self: start;
}

.stack-form {
    display: grid;
    gap: 14px;
}

.compact-form {
    gap: 12px;
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
}

.checkbox-field input {
    width: auto;
    margin: 0;
}

.full-width {
    width: 100%;
}

.primary-button {
    background: linear-gradient(135deg, var(--accent), #4fc3b4);
    color: #072824;
    font-weight: 700;
}

.secondary-button {
    background: rgba(133, 221, 209, 0.14);
    color: var(--text);
    border: 1px solid var(--line);
}

.ghost-button {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line-strong);
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
 td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: right;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.84rem;
    background: rgba(255, 255, 255, 0.03);
}

tr:last-child td {
    border-bottom: 0;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.84rem;
}

.pill.success {
    background: rgba(62, 204, 161, 0.16);
    color: #c9fff0;
}

.pill.warning {
    background: rgba(247, 185, 85, 0.16);
    color: #ffe6b3;
}

.pill.danger {
    background: rgba(255, 124, 124, 0.16);
    color: #ffd3d3;
}

.list-stack {
    display: grid;
    gap: 12px;
}

.list-card {
    padding: 16px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.025);
    display: grid;
    gap: 10px;
}

.list-card .meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.9rem;
}

.list-card .actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.empty-state {
    padding: 20px;
    border-radius: 18px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--line-strong);
}

.link-button {
    color: var(--accent);
    text-decoration: none;
}

@media (max-width: 1180px) {
    .panel-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-left: 0;
        border-bottom: 1px solid var(--line);
    }

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

    .sticky-card {
        position: static;
    }
}

@media (max-width: 760px) {
    .auth-shell,
    .main-shell,
    .sidebar {
        padding: 16px;
    }

    .helper-grid,
    .topbar {
        grid-template-columns: 1fr;
        display: grid;
    }

    .toolbar-inline {
        width: 100%;
    }

    .toolbar-field,
    .toolbar-inline button {
        width: 100%;
    }
}
