:root {
    --bg: #0a0d14;
    --bg-alt: #111826;
    --panel: #151e2e;
    --panel-soft: #1b2638;
    --text: #e6ebf5;
    --text-soft: #9aa7bf;
    --line: #28344c;
    --accent: #bf9c4a;
    --accent-soft: #d6be7a;
    --danger: #b85a63;
    --success: #3c9e73;
    --info: #4879b8;
    --radius: 12px;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

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

html,
body {
    margin: 0;
    padding: 0;
}

body.site-body {
    min-height: 100vh;
    color: var(--text);
    font-family: "Bahnschrift", "Segoe UI", "Trebuchet MS", sans-serif;
    background:
        radial-gradient(1200px 600px at 100% -20%, rgba(191, 156, 74, 0.12), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(88, 39, 46, 0.32), transparent 55%),
        linear-gradient(165deg, #06080d 0%, #0f1624 55%, #0b1220 100%);
    line-height: 1.45;
}

a {
    color: inherit;
}

.container {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(11, 16, 26, 0.85);
    border-bottom: 1px solid rgba(214, 190, 122, 0.15);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
    gap: 1rem;
}

.brand {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
}

.brand-tag {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 0.92rem;
    letter-spacing: 0.12em;
    color: #16120a;
    font-weight: 800;
    background: linear-gradient(145deg, #f0d796 0%, #a78239 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 8px 20px rgba(0, 0, 0, 0.35);
}

.brand-name {
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.menu-toggle {
    display: none;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    padding: 0.55rem;
    border-radius: 10px;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 4px 0;
    background: var(--text);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.main-nav a,
.logout-form .btn-link {
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: var(--text-soft);
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    font-size: 0.92rem;
}

.main-nav a:hover,
.logout-form .btn-link:hover,
.main-nav a.active {
    border-color: rgba(214, 190, 122, 0.24);
    color: var(--text);
    background: rgba(214, 190, 122, 0.08);
}

.logout-form {
    margin: 0;
}

.page-content {
    padding: 1.4rem 0 2.5rem;
}

.hero {
    margin-top: 0.8rem;
    padding: 3rem 2rem;
    border-radius: 18px;
    background: linear-gradient(150deg, rgba(29, 38, 58, 0.86) 0%, rgba(14, 19, 32, 0.92) 70%);
    border: 1px solid rgba(214, 190, 122, 0.22);
    box-shadow: var(--shadow);
}

.hero h1 {
    margin: 0 0 0.8rem;
    font-size: clamp(1.8rem, 3.8vw, 2.7rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero p {
    margin: 0;
    max-width: 760px;
    color: var(--text-soft);
}

.hero-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.grid {
    display: grid;
    gap: 1rem;
}

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

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

.card {
    background: linear-gradient(180deg, rgba(26, 35, 52, 0.92) 0%, rgba(18, 25, 39, 0.95) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.card h2,
.card h3 {
    margin-top: 0;
    font-weight: 620;
    letter-spacing: 0.03em;
}

.muted {
    color: var(--text-soft);
}

.value {
    font-size: 1.55rem;
    font-weight: 700;
    margin: 0.2rem 0 0;
}

.section-title {
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
    font-size: 1.08rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-soft);
}

.table-wrap {
    overflow: auto;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(15, 21, 33, 0.9);
}

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

th,
td {
    text-align: left;
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid rgba(40, 52, 76, 0.7);
    font-size: 0.92rem;
}

th {
    color: var(--accent-soft);
    text-transform: uppercase;
    font-size: 0.76rem;
    letter-spacing: 0.1em;
    background: rgba(21, 30, 46, 0.8);
}

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

.form-card {
    max-width: 760px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.field label {
    font-size: 0.82rem;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #30425f;
    border-radius: 10px;
    background: #0f1726;
    color: var(--text);
    padding: 0.68rem 0.72rem;
    font-size: 0.96rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #5e7aa7;
    box-shadow: 0 0 0 3px rgba(72, 121, 184, 0.2);
}

.btn {
    border: 0;
    border-radius: 10px;
    padding: 0.64rem 1rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.79rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.btn-primary {
    color: #17130b;
    background: linear-gradient(145deg, #f0d796 0%, #ad8742 100%);
}

.btn-secondary {
    color: var(--text);
    border: 1px solid #40567b;
    background: linear-gradient(160deg, #22314c 0%, #182338 100%);
}

.btn-danger {
    color: #ffd8dd;
    background: linear-gradient(140deg, #7a2633 0%, #5d1a25 100%);
}

.btn-link {
    background: transparent;
    border: 1px solid transparent;
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.92rem;
    padding: 0.45rem 0.65rem;
}

.btn.danger {
    color: #f1aeb5;
}

.btn:hover {
    filter: brightness(1.06);
}

.inline-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 0.22rem 0.45rem;
    border-radius: 999px;
    font-size: 0.76rem;
    border: 1px solid transparent;
}

.badge-admin {
    background: rgba(191, 156, 74, 0.14);
    border-color: rgba(191, 156, 74, 0.45);
    color: #e8d2a0;
}

.badge-member {
    background: rgba(72, 121, 184, 0.12);
    border-color: rgba(72, 121, 184, 0.45);
    color: #b7cae5;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    margin-right: 0.4rem;
}

.status-online {
    background: #5fc79a;
}

.status-offline {
    background: #d16f79;
}

.alert {
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    margin-bottom: 0.8rem;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(60, 158, 115, 0.12);
    border-color: rgba(60, 158, 115, 0.35);
    color: #8addb6;
}

.alert-error {
    background: rgba(184, 90, 99, 0.15);
    border-color: rgba(184, 90, 99, 0.35);
    color: #f2b7bd;
}

.alert-info {
    background: rgba(72, 121, 184, 0.15);
    border-color: rgba(72, 121, 184, 0.35);
    color: #bfd5f4;
}

.alert-warning {
    background: rgba(191, 156, 74, 0.15);
    border-color: rgba(191, 156, 74, 0.35);
    color: #e8d7aa;
}

.site-footer {
    border-top: 1px solid rgba(214, 190, 122, 0.15);
    background: rgba(10, 13, 20, 0.8);
}

.footer-inner {
    padding: 1rem 0;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--text-soft);
    font-size: 0.85rem;
}

.number-positive {
    color: #89ddb5;
}

.number-negative {
    color: #f0acb2;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.small {
    font-size: 0.84rem;
}

@media (max-width: 980px) {
    .grid.cards-3 {
        grid-template-columns: 1fr;
    }

    .grid.cards-2 {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 840px) {
    .menu-toggle {
        display: inline-block;
    }

    .main-nav {
        position: absolute;
        top: 74px;
        right: 1rem;
        left: 1rem;
        display: none;
        flex-direction: column;
        align-items: stretch;
        background: #111a2a;
        border: 1px solid var(--line);
        border-radius: 12px;
        padding: 0.6rem;
        box-shadow: var(--shadow);
    }

    .main-nav.open {
        display: flex;
    }

    .main-nav a,
    .logout-form .btn-link {
        width: 100%;
        text-align: left;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(1180px, calc(100% - 1rem));
    }

    .hero {
        padding: 1.6rem 1rem;
    }

    .footer-inner {
        flex-direction: column;
    }
}
