:root {
    --bg: #0b0f1a;
    --bg-soft: #111827;
    --panel: #151c2c;
    --panel-2: #1b2336;
    --text: #e6e8ee;
    --muted: #9aa3b2;
    --accent: #38bdf8;
    --accent-2: #22d3ee;
    --danger: #ef4444;
    --warn: #f59e0b;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: rgba(8, 12, 20, 0.6);
}

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700;800&display=swap');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    background: radial-gradient(1200px 600px at 20% -10%, #1f2a44, transparent),
        radial-gradient(900px 500px at 90% 10%, #16324a, transparent),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.topbar,
.sidebar,
.card,
.stat-card,
.notice,
input,
select,
textarea,
button,
.btn {
    letter-spacing: 0.1px;
}

.content h1 {
    font-weight: 800;
}

.topbar {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    background: rgba(13, 18, 32, 0.85);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: 0.8px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #0b1220;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.35);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-title {
    font-size: 16px;
    text-transform: uppercase;
}

.brand-subtitle {
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.6px;
}

.user {
    color: var(--muted);
    font-size: 14px;
}

.sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    width: 230px;
    height: calc(100vh - 64px);
    background: linear-gradient(180deg, rgba(21, 28, 44, 0.96), rgba(12, 17, 27, 0.98));
    padding: 18px 14px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar a {
    color: var(--text);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 10px;
    background: transparent;
    font-size: 14px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar a:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.3);
}

.nav-icon {
    width: 26px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(56, 189, 248, 0.16);
    color: #e0f2fe;
    font-size: 10px;
    flex-shrink: 0;
}

.content {
    margin-left: 250px;
    padding: 24px 28px 70px;
}

.auth-page .content {
    margin-left: 0;
    min-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-page .content h1 {
    width: 100%;
    text-align: center;
}

h1 {
    margin-top: 8px;
    margin-bottom: 18px;
    font-size: 26px;
}

.card {
    background: linear-gradient(160deg, rgba(21, 28, 44, 0.9), rgba(17, 23, 36, 0.95));
    border: 1px solid var(--border);
    padding: 18px;
    border-radius: 14px;
    margin-bottom: 18px;
    box-shadow: 0 20px 45px var(--shadow);
    animation: fadeIn 0.4s ease-out;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px 0;
}

.card-subtitle {
    color: var(--muted);
    font-size: 12px;
    margin: 0 0 12px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-header h2 {
    font-size: 16px;
    margin: 0;
    font-weight: 700;
}

.section-header .section-hint {
    font-size: 12px;
    color: var(--muted);
}

.field-hint {
    font-size: 11px;
    color: var(--muted);
    margin-top: 6px;
}

.copy-success {
    color: #bbf7d0;
    font-weight: 700;
}

.split-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 16px;
}

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

.form-grid > div {
    min-width: 0;
}

label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(10, 14, 23, 0.9);
    color: var(--text);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.6);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

::placeholder {
    color: rgba(154, 163, 178, 0.6);
}

textarea {
    min-height: 90px;
}

.actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button, .btn {
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    color: #f8fafc;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 12px 25px rgba(56, 189, 248, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover, .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 30px rgba(56, 189, 248, 0.32);
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.3);
    color: var(--text);
    box-shadow: none;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

.btn-warn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #1f1402;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.table th, .table td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(148, 163, 184, 0.15);
    color: var(--muted);
}

.badge.green { background: rgba(34, 197, 94, 0.18); color: #bbf7d0; }
.badge.yellow { background: rgba(245, 158, 11, 0.2); color: #fde68a; }
.badge.red { background: rgba(239, 68, 68, 0.2); color: #fecaca; }

.notice {
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px dashed var(--border);
    border-radius: 10px;
    color: var(--muted);
    margin-bottom: 12px;
}

.notice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(56, 189, 248, 0.16);
    color: #e0f2fe;
    font-size: 12px;
    margin-right: 8px;
}

.notice strong {
    font-weight: 700;
}

.pending-indicator {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px dashed rgba(245, 158, 11, 0.4);
    background: rgba(120, 53, 15, 0.25);
    color: #fde68a;
    font-size: 12px;
    margin-bottom: 14px;
}

.pending-indicator.is-visible {
    display: inline-flex;
}

.footer-note {
    margin-top: 18px;
    font-size: 12px;
    color: var(--muted);
    text-align: right;
    letter-spacing: 0.3px;
}

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

.stat-card {
    background: linear-gradient(160deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 16px 35px var(--shadow);
    animation: fadeIn 0.45s ease-out;
}

.stat-card.primary {
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 20px 35px rgba(56, 189, 248, 0.15);
}

.stat-card.accent {
    border-color: rgba(34, 211, 238, 0.35);
    box-shadow: 0 20px 35px rgba(34, 211, 238, 0.12);
}

.stat-card.success {
    border-color: rgba(34, 197, 94, 0.3);
    box-shadow: 0 20px 35px rgba(34, 197, 94, 0.12);
}

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

.stat-value {
    font-size: 20px;
    font-weight: 700;
}

.empty-state {
    padding: 14px;
    border-radius: 12px;
    border: 1px dashed var(--border);
    color: var(--muted);
    background: rgba(12, 18, 30, 0.7);
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 18px 0;
}

.status-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.status-pill {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(12, 18, 30, 0.7);
    font-size: 12px;
    color: var(--muted);
}

.auth-wrap {
    max-width: 380px;
    margin: 60px auto 40px;
    background: linear-gradient(160deg, rgba(21, 28, 44, 0.9), rgba(17, 23, 36, 0.95));
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 45px var(--shadow);
}

.auth-wrap h1 {
    margin-bottom: 16px;
}

.auth-subtitle {
    color: var(--muted);
    font-size: 12px;
    margin: -6px 0 16px 0;
}

.auth-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    font-size: 12px;
}

.auth-actions a {
    color: var(--accent);
    text-decoration: none;
}

.auth-wrap a {
    color: var(--accent);
    text-decoration: none;
}

@media (max-width: 900px) {
    .sidebar {
        position: static;
        width: auto;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        border-right: none;
    }
    .content {
        margin-left: 0;
    }
}

@media (max-width: 720px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        height: auto;
        padding: 12px 18px;
    }

    .sidebar {
        gap: 6px;
    }

    .sidebar a {
        flex: 1 1 45%;
        justify-content: center;
    }

    .content {
        padding: 18px 16px 60px;
    }

    .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .actions .btn,
    .actions button {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 520px) {
    .brand-subtitle {
        display: none;
    }

    .sidebar {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 10px 12px;
        border-radius: 10px;
        background: rgba(15, 23, 42, 0.7);
        border: 1px solid var(--border);
    }

    .sidebar a {
        flex: 0 0 auto;
        min-width: 110px;
        font-size: 12px;
        padding: 8px 10px;
    }

    .nav-icon {
        width: 22px;
        height: 20px;
        font-size: 9px;
    }

    .content h1 {
        font-size: 22px;
    }

    .card {
        padding: 14px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
