:root {
    --bg-main: #f6f9fc;
    --bg-soft: #eef4fb;
    --glass: rgba(255, 255, 255, 0.62);
    --glass-strong: rgba(255, 255, 255, 0.82);
    --border: rgba(255, 255, 255, 0.7);
    --text: #0f172a;
    --muted: #64748b;
    --primary: #0D47A1;
    --accent: #00796B;
    --shadow: 0 18px 50px rgba(15, 23, 42, 0.10);
    --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.08);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
    color: var(--text);
    background: linear-gradient(135deg, var(--bg-main), var(--bg-soft));
}

body {
    min-height: 100vh;
}

.page-bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(33, 150, 243, 0.12), transparent 30%),
        radial-gradient(circle at bottom right, rgba(0, 121, 107, 0.10), transparent 30%);
    pointer-events: none;
}

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

.layout {
    position: relative;
    display: grid;
    grid-template-columns: 290px 1fr;
    min-height: 100vh;
    gap: 24px;
    padding: 24px;
}

.sidebar {
    border-radius: var(--radius-xl);
    padding: 24px;
    display: flex;
    flex-direction: column;
/*    justify-content: space-between;*/
}

.sidebar-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 30px;
}

.logo-mark {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: 0 12px 30px rgba(13, 71, 161, 0.22);
}

.brand-title {
    font-size: 18px;
    font-weight: 700;
}

.brand-subtitle,
.small-label {
    color: var(--muted);
    font-size: 13px;
}

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

.nav-link {
    display: block;
    text-decoration: none;
    color: var(--text);
    padding: 14px 16px;
    border-radius: 14px;
    transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: var(--glass-strong);
    transform: translateX(2px);
}

.sidebar-card {
    margin-top: 24px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(255,255,255,0.7);
}

.sidebar-main {
    margin-top: 8px;
    font-weight: 600;
}

.content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.topbar {
    border-radius: var(--radius-xl);
    padding: 24px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar h1 {
    margin: 4px 0 0;
    font-size: 32px;
    line-height: 1.1;
}

.user-chip {
    padding: 12px 16px;
    border-radius: 999px;
    background: var(--glass-strong);
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.stat-card {
    border-radius: var(--radius-lg);
    padding: 20px;
}

.stat-value {
    margin-top: 10px;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.panel {
    border-radius: var(--radius-xl);
    padding: 22px;
}

.panel-head {
    margin-bottom: 16px;
}

.panel-head h2 {
    margin: 0;
    font-size: 20px;
}

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

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

.premium-table th,
.premium-table td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.premium-table th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.premium-table tr:hover td {
    background: rgba(255, 255, 255, 0.40);
}

.empty-state {
    text-align: center;
    padding: 60px 40px;
}

.auth-page {
    min-height: 100vh;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 38px;
    border-radius: 26px;
    background: rgba(255,255,255,0.68);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.75);
    box-shadow: var(--shadow);
}

.auth-card h1 {
    margin: 0 0 10px;
    font-size: 30px;
    color: var(--text);
}

.subtitle {
    color: var(--muted);
    margin: 0 0 24px;
}

.brand-badge {
    display: inline-block;
    margin-bottom: 16px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.85);
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

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

.auth-form {
    gap: 18px;
}

.field label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.field input {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.30);
    background: rgba(255,255,255,0.88);
    padding: 13px 14px;
    font-size: 15px;
    color: var(--text);
    outline: none;
    transition: 0.2s ease;
}

.field input:focus {
    border-color: rgba(33, 150, 243, 0.5);
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.12);
    transform: translateY(-1px);
}

.notice {
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
}

.notice-error {
    background: rgba(239, 68, 68, 0.10);
    color: #b91c1c;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    border-radius: 14px;
    font-weight: 700;
    transition: 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    padding: 14px 18px;
    box-shadow: 0 14px 28px rgba(13, 71, 161, 0.20);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(13, 71, 161, 0.24);
}

.full {
    width: 100%;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 2;
    }

    .content {
        order: 1;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .topbar h1 {
        font-size: 26px;
    }
}

.nav form {
    margin: 0;
}

.nav button.nav-link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

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

.topbar-center {
    display: flex;
    align-items: center;
}

.topbar-stats {
    display: flex;
    gap: 24px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-weight: 600;
    font-size: 14px;
}

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

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logout-btn {
    padding: 8px 14px;
    border-radius: 10px;
    border: none;

    background: rgba(255, 80, 80, 0.15);
    color: #ff5c5c;

    cursor: pointer;
    transition: 0.2s;
}

.logout-btn:hover {
    background: rgba(255, 80, 80, 0.3);
}