:root {
    color-scheme: dark;
    --bg: #090b12;
    --bg-soft: #0f1320;
    --surface: rgba(15, 18, 28, 0.92);
    --surface-strong: rgba(10, 12, 19, 0.96);
    --border: rgba(255, 255, 255, 0.08);
    --accent: #4aa87f;
    --accent-strong: #3d9065;
    --accent-soft: rgba(74, 168, 127, 0.18);
    --accent-blue: #5abdff;
    --danger: #ff5a5a;
    --text: #e6e9f3;
    --text-muted: #a4afc4;
    --shadow: 0 20px 80px rgba(0, 0, 0, 0.35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
    background: radial-gradient(circle at top, rgba(74, 168, 127, 0.18), transparent 18%),
                radial-gradient(circle at 20% 10%, rgba(90, 186, 255, 0.12), transparent 18%),
                linear-gradient(180deg, #07090f 0%, #0a0d17 65%, #06080f 100%);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    min-height: 100vh;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-blue);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.app-sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    padding: 30px 22px;
    background: rgba(9, 11, 18, 0.96);
    backdrop-filter: blur(18px);
    border-right: 1px solid var(--border);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.sidebar-profile {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.avatar-wrapper {
    min-width: 64px;
    min-height: 64px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(74, 168, 127, 0.3);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.avatar-wrapper img {
    width: 64px;
    height: 64px;
    object-fit: cover;
}

.profile-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.profile-level {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sidebar-nav {
    display: grid;
    gap: 10px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    color: var(--text-muted);
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
    border: 1px solid transparent;
}

.sidebar-link i {
    min-width: 20px;
    text-align: center;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(74, 168, 127, 0.12);
    color: var(--text);
    transform: translateX(2px);
    border-color: rgba(74, 168, 127, 0.2);
}

.sidebar-panel {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-panel h3 {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.sidebar-panel ul {
    list-style: none;
    display: grid;
    gap: 10px;
}

.sidebar-panel li {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.label-soft {
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    background: rgba(74, 168, 127, 0.12);
    color: var(--accent);
}

.app-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 30px 32px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(9, 11, 18, 0.9);
    backdrop-filter: blur(18px);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(74, 168, 127, 0.2), rgba(74, 168, 127, 0.08));
    color: var(--accent);
    font-weight: 700;
    font-size: 0.95rem;
}

.topbar-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.topbar-brand h1 {
    font-size: 1.45rem;
    color: var(--text);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-user {
    color: var(--text-muted);
    font-weight: 600;
}

.topbar-timer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-weight: 600;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 14px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.button:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.button-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.app-content {
    flex: 1;
    padding: 32px;
    display: grid;
    gap: 28px;
}

.page-grid {
    display: grid;
    gap: 24px;
}

.app-card,
.login-box,
.auth-panel {
    width: 100%;
    background: rgba(16, 20, 32, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 28px;
    box-shadow: var(--shadow);
    padding: 32px;
}

.app-card h2,
.login-box h2,
.auth-panel h2 {
    font-size: 1.75rem;
    color: var(--text);
    margin-bottom: 24px;
}

.grid-2 {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-group {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.form-group label {
    color: var(--text-muted);
    font-size: 0.95rem;
}

input,
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    outline: none;
    transition: border-color 0.25s ease, background 0.25s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(74, 168, 127, 0.6);
    background: rgba(255, 255, 255, 0.06);
}

textarea {
    min-height: 180px;
}

button[type="submit"],
.button-primary {
    width: fit-content;
    padding: 14px 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-blue));
    color: #fff;
    border: none;
    transition: filter 0.25s ease;
}

button[type="submit"]:hover,
.button-primary:hover {
    filter: brightness(1.05);
}

.alert {
    padding: 18px 22px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 600;
}

.alert-info {
    background: rgba(90, 186, 255, 0.12);
    color: var(--text);
}

.alert-success {
    background: rgba(74, 168, 127, 0.16);
    color: var(--accent);
}

.alert-danger {
    background: rgba(255, 90, 90, 0.14);
    color: var(--danger);
}

.card-grid {
    display: grid;
    gap: 22px;
}

.card-row {
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.news-grid,
.data-table {
    display: grid;
    gap: 20px;
}

.news-card {
    padding: 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.news-card h3 {
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.news-card small {
    color: var(--text-muted);
    display: block;
    margin-top: 16px;
}

.content-image {
    width: 100%;
    border-radius: 16px;
    margin: 18px 0;
}

.quote-block {
    padding: 18px 20px;
    border-left: 4px solid rgba(74, 168, 127, 0.9);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    color: var(--text-muted);
}

.code-block {
    padding: 18px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 18px;
    overflow-x: auto;
    color: var(--text);
}

.video-embed {
    position: relative;
    padding-top: 56.25%;
    margin: 18px 0;
    overflow: hidden;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.55);
}

.video-embed iframe {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    border: 0;
    border-radius: 20px;
}

.content-list {
    list-style: disc inside;
    padding-left: 12px;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

th, td {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}

th {
    color: var(--text-muted);
    font-size: 0.92rem;
}

td {
    color: var(--text);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(74, 168, 127, 0.12);
    color: var(--accent);
    font-size: 0.9rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.section-header h2 {
    font-size: 1.35rem;
}

.section-note {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.field-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: -10px;
    margin-bottom: 16px;
}

@media (max-width: 1160px) {
    .app-shell {
        grid-template-columns: 1fr;
    }
    .app-sidebar {
        position: relative;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    .app-topbar {
        padding-top: 22px;
    }
}

@media (max-width: 760px) {
    .app-content {
        padding: 22px 18px 28px;
    }
    .app-topbar {
        flex-direction: column;
        align-items: stretch;
    }
    .topbar-actions {
        justify-content: space-between;
        width: 100%;
    }
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}
