:root {
    --bg: #0f1115;
    --bg-2: #151922;
    --bg-3: #1b202b;
    --panel: rgba(24, 29, 39, 0.96);
    --panel-soft: rgba(30, 36, 48, 0.92);
    --card: #171b24;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);
    --text: #f4f6fb;
    --muted: #a8b0c2;
    --muted-2: #8b93a6;
    --primary: #ff8a3d;
    --primary-2: #ffb36b;
    --accent: #7ee0c6;
    --danger: #ff6f7d;
    --success: #7fd29a;
    --warning: #f0bc62;
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.34);
    --shadow-md: 0 14px 36px rgba(0, 0, 0, 0.22);
    --container: 1280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255, 138, 61, 0.09), transparent 28%),
        radial-gradient(circle at top right, rgba(126, 224, 198, 0.06), transparent 24%),
        linear-gradient(180deg, #0f1115 0%, #11141b 34%, #0e1117 100%);
    letter-spacing: 0.01em;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }

.container {
    width: min(var(--container), calc(100% - 36px));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 16, 22, 0.82);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
}

.nav {
    display: grid;
    grid-template-columns: 240px minmax(320px, 1fr) auto;
    gap: 18px;
    align-items: center;
    min-height: 82px;
    padding: 14px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand > span:last-child {
    min-width: 0;
}

.brand > span:last-child div {
    font-weight: 800;
    line-height: 1.05;
    font-size: 1.55rem;
}

.brand-badge {
    width: 50px;
    height: 50px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), #ff6d2d 55%, #ffca7a 100%);
    color: #161616;
    font-size: 1.15rem;
    box-shadow: 0 10px 25px rgba(255, 138, 61, 0.3);
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-links a,
.nav-actions > a,
.nav-actions > button {
    color: var(--muted);
    padding: 10px 14px;
    border-radius: 999px;
    transition: 0.2s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-actions > a:hover,
.nav-actions > button:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
}

.nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 340px;
    padding: 7px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.search-box input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    padding: 0 10px;
}

.search-box input::placeholder {
    color: var(--muted-2);
}

.hero {
    padding: 36px 0 16px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.75fr);
    gap: 22px;
    align-items: stretch;
}

.hero-card,
.panel,
.card,
.sidebar,
.item-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)), var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.hero-card {
    padding: 34px;
    overflow: hidden;
    position: relative;
    background:
        linear-gradient(135deg, rgba(255, 138, 61, 0.12), rgba(255, 255, 255, 0.02) 40%, rgba(126, 224, 198, 0.06) 100%),
        var(--panel);
}

.hero-card::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,179,107,0.16), transparent 70%);
    pointer-events: none;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255,255,255,0.06);
    color: #ffe5d2;
    font-size: 13px;
    font-weight: 600;
}

.hero h1 {
    margin: 18px 0 14px;
    font-size: clamp(38px, 5vw, 72px);
    line-height: 0.98;
    letter-spacing: -0.03em;
    max-width: 12ch;
}

.hero p {
    margin: 0;
    font-size: 18px;
    line-height: 1.75;
    color: var(--muted);
    max-width: 58ch;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.btn,
button,
input[type=submit] {
    border: 0;
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 16px;
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    font-weight: 700;
}

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

.btn-primary {
    color: #1d1308;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 12px 26px rgba(255, 138, 61, 0.25);
}

.btn-secondary {
    color: var(--text);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--line-strong);
}

.btn-success {
    color: #0f1b15;
    background: linear-gradient(135deg, #74cf96, #a6e4b8);
}

.btn-danger {
    color: white;
    background: linear-gradient(135deg, #ff6e7c, #ff98a4);
}

.section {
    padding: 18px 0 34px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 18px;
}

.section-title h2 {
    margin: 0;
    font-size: clamp(28px, 3vw, 40px);
    letter-spacing: -0.02em;
}

.section-title p,
.meta,
.muted {
    color: var(--muted);
}

.section-title p {
    margin: 8px 0 0;
}

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

.card { overflow: hidden; }
.card:hover,
.item-card:hover,
.panel:hover { border-color: rgba(255,255,255,0.12); }

.cover-wrap {
    aspect-ratio: 16 / 9;
    background: linear-gradient(180deg, #181d27, #10141b);
    overflow: hidden;
}

.cover-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body { padding: 18px; }
.card h3, .card h4 { margin: 0 0 10px; line-height: 1.35; }
.meta { font-size: 13px; display: flex; flex-wrap: wrap; gap: 12px; }

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

.stat,
.kpi {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--line);
}

.stat strong,
.kpi strong {
    display: block;
    margin-top: 8px;
    font-size: 32px;
    letter-spacing: -0.03em;
}

.layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    padding: 22px 0 40px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    padding: 22px 0 40px;
}

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

.sidebar {
    position: sticky;
    top: 104px;
    align-self: start;
    padding: 18px;
}

.sidebar a {
    display: block;
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: 14px;
    color: var(--muted);
    border: 1px solid transparent;
}

.sidebar a:hover,
.sidebar a.active {
    background: rgba(255,255,255,0.045);
    color: var(--text);
    border-color: var(--line);
}

.content { min-width: 0; }
.panel { padding: 24px; }

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

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.field label {
    font-weight: 700;
    font-size: 0.96rem;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    border-radius: 16px;
    padding: 14px 15px;
    border: 1px solid var(--line);
    background: #11161f;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.search-box:focus-within {
    border-color: rgba(255, 179, 107, 0.38);
    box-shadow: 0 0 0 4px rgba(255, 138, 61, 0.08);
}

.field textarea { min-height: 140px; resize: vertical; }

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

table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

th, td {
    padding: 13px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    font-size: 14px;
    color: #e8ecf8;
}

.badge,
.tag {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid var(--line);
}

.badge {
    background: rgba(255,255,255,0.05);
    color: #eef1fa;
}

.badge.success { background: rgba(127, 210, 154, 0.12); color: #bdecc9; border-color: rgba(127,210,154,0.22); }
.badge.warning { background: rgba(240,188,98,0.12); color: #ffdfa7; border-color: rgba(240,188,98,0.22); }
.badge.danger { background: rgba(255,111,125,0.12); color: #ffbdc4; border-color: rgba(255,111,125,0.22); }

.flash-wrap { display: grid; gap: 12px; margin-bottom: 16px; }
.flash {
    padding: 15px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
}
.flash.success { border-color: rgba(127,210,154,0.24); background: rgba(127,210,154,0.08); }
.flash.error { border-color: rgba(255,111,125,0.24); background: rgba(255,111,125,0.08); }
.flash.info { border-color: rgba(255,179,107,0.24); background: rgba(255,179,107,0.08); }

.tags,
.mini-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: rgba(255,255,255,0.045);
    color: #edf1fb;
}

.post-content,
.richtext {
    line-height: 1.85;
    color: #dbe1f0;
}

.two-col-detail {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 22px;
}

.comment-box {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.comment-box:last-child { border-bottom: 0; }

.profile-head {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 18px;
    align-items: center;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 26px;
    object-fit: cover;
    background: #11161f;
    border: 1px solid var(--line);
}

.small-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    object-fit: cover;
    background: #11161f;
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.item-card {
    padding: 18px;
    background: linear-gradient(180deg, rgba(255,179,107,0.04), rgba(255,255,255,0.015)), var(--panel-soft);
}

.footer {
    margin-top: 56px;
    padding: 28px 0 58px;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
}

.mobile-nav-toggle { display: none; }

@media (max-width: 1320px) {
    .nav {
        grid-template-columns: 220px 1fr;
    }

    .nav-actions {
        grid-column: 1 / -1;
        justify-content: space-between;
        padding-top: 4px;
    }
}

@media (max-width: 1120px) {
    .hero-grid,
    .layout,
    .dashboard-grid,
    .two-col-detail,
    .grid-4,
    .grid-3,
    .grid-2,
    .form-grid,
    .item-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

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

@media (max-width: 860px) {
    .container { width: min(100% - 22px, var(--container)); }

    .nav {
        grid-template-columns: 1fr;
        gap: 14px;
        align-items: stretch;
    }

    .nav-links,
    .nav-actions {
        justify-content: flex-start;
    }

    .search-box {
        min-width: 0;
        width: 100%;
    }

    .search-box input {
        min-width: 0;
    }

    .hero {
        padding-top: 24px;
    }

    .hero-card,
    .panel,
    .card,
    .sidebar,
    .item-card {
        border-radius: 22px;
    }

    .hero-card {
        padding: 24px;
    }

    .hero h1 {
        max-width: none;
        font-size: clamp(34px, 10vw, 52px);
    }

    .profile-head {
        grid-template-columns: 1fr;
    }

    .stat-grid,
    .kpis {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 580px) {
    .nav-links,
    .nav-actions {
        gap: 6px;
    }

    .nav-links a,
    .nav-actions > a,
    .nav-actions > button {
        padding: 9px 12px;
        font-size: 14px;
    }

    .hero p {
        font-size: 16px;
    }

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

    .btn {
        width: 100%;
    }

    .stat-grid,
    .kpis,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* Header refinement 2026-04-23 */
.header-shell {
    display: grid;
    grid-template-columns: 260px max-content minmax(300px, 1fr) max-content;
    gap: 16px;
    align-items: center;
    min-height: 88px;
    padding: 14px 0;
}

.nav-primary,
.nav-user {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.nav-primary {
    justify-content: center;
}

.nav-primary a,
.nav-user a {
    color: var(--muted);
    padding: 10px 13px;
    border-radius: 14px;
    border: 1px solid transparent;
    white-space: nowrap;
    font-weight: 600;
    transition: 0.2s ease;
}

.nav-primary a:hover,
.nav-user a:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
    border-color: var(--line);
}

.header-search {
    width: 100%;
    min-width: 0;
    max-width: 420px;
    justify-self: center;
}

.nav-user {
    justify-content: flex-end;
}

.nav-user .btn {
    min-height: 44px;
    padding-inline: 16px;
}

.logout-link {
    color: #ffcfb7 !important;
}

@media (max-width: 1500px) {
    .header-shell {
        grid-template-columns: 240px 1fr 360px;
    }

    .nav-primary {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .nav-user {
        grid-column: 2 / 4;
        justify-content: flex-start;
        padding-top: 2px;
    }
}

@media (max-width: 1080px) {
    .header-shell {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 14px 0 16px;
    }

    .nav-primary,
    .nav-user {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .header-search {
        max-width: none;
        justify-self: stretch;
    }
}


/* Steam/Nexus single-row header rebuild */
.header-shell {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: nowrap;
    min-height: 78px;
    padding: 10px 0;
}

.brand {
    flex: 0 0 auto;
    gap: 12px;
}

.brand-badge {
    width: 48px;
    height: 48px;
    border-radius: 16px;
}

.brand > span:last-child {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand > span:last-child div {
    font-size: 18px;
    line-height: 1;
    white-space: nowrap;
    letter-spacing: -0.02em;
}

.brand small {
    margin-top: 5px;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

.nav-primary {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    flex-wrap: nowrap;
    min-width: 0;
}

.nav-primary a {
    padding: 9px 10px;
    font-size: 15px;
    border-radius: 12px;
}

.header-search {
    flex: 1 1 320px;
    width: auto;
    min-width: 260px;
    max-width: 360px;
    margin-left: auto;
    margin-right: 0;
}

.header-search .btn {
    min-height: 42px;
    padding-inline: 16px;
    border-radius: 14px;
}

.nav-user {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    flex-wrap: nowrap;
}

.nav-user a {
    padding: 9px 10px;
    font-size: 14px;
    border-radius: 12px;
}

.nav-user .logout-link {
    padding-inline: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}

@media (max-width: 1460px) {
    .header-shell {
        gap: 12px;
    }

    .nav-primary a,
    .nav-user a {
        padding: 8px 9px;
        font-size: 14px;
    }

    .header-search {
        max-width: 320px;
        min-width: 220px;
    }
}

@media (max-width: 1280px) {
    .header-shell {
        flex-wrap: wrap;
        align-items: center;
    }

    .nav-primary {
        order: 2;
        width: 100%;
    }

    .header-search {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
        width: 100%;
    }

    .nav-user {
        order: 4;
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 780px) {
    .header-shell {
        gap: 10px;
    }

    .brand > span:last-child div {
        font-size: 16px;
    }

    .brand small {
        display: none;
    }

    .nav-primary,
    .nav-user {
        flex-wrap: wrap;
    }
}

.avatar-xl {
    width: 136px;
    height: 136px;
    border-radius: 30px;
}

.profile-settings-panel {
    padding: 28px;
}

.profile-settings-grid {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.profile-avatar-upload {
    display: grid;
    gap: 14px;
}

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

@media (max-width: 920px) {
    .profile-settings-grid,
    .profile-contact-grid,
    .profile-head {
        grid-template-columns: 1fr;
    }
}



/* ===== Dashboard/layout hotfix ===== */
.dashboard-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    padding: 22px 0 40px;
}

.dashboard-layout > * {
    min-width: 0;
}

.dashboard-layout > .panel.sidebar,
.dashboard-layout > aside.panel.sidebar {
    position: sticky;
    top: 92px;
    align-self: start;
    padding: 20px;
}

.dashboard-layout > .panel:not(.sidebar),
.dashboard-layout > div,
.dashboard-layout > section,
.dashboard-layout > main {
    min-width: 0;
}

.dashboard-layout .sidebar h3 {
    margin: 0 0 16px;
}

.dashboard-layout .sidebar a {
    display: block;
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: 14px;
    color: var(--muted);
    border: 1px solid transparent;
    transition: .2s ease;
}

.dashboard-layout .sidebar a:hover,
.dashboard-layout .sidebar a.active {
    background: rgba(255,255,255,0.045);
    color: var(--text);
    border-color: var(--line);
}

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

    .dashboard-layout > .panel.sidebar,
    .dashboard-layout > aside.panel.sidebar {
        position: static;
        top: auto;
    }
}
/* ===== /Dashboard/layout hotfix ===== */



/* ===== Dashboard sidebar overlay fix ===== */
.dashboard-layout {
    display: grid !important;
    grid-template-columns: 280px minmax(0, 1fr) !important;
    gap: 24px !important;
    align-items: start !important;
}

.dashboard-layout > .panel.sidebar,
.dashboard-layout > aside.panel.sidebar,
.dashboard-layout > .sidebar {
    grid-column: 1 !important;
    width: 100% !important;
    max-width: 280px !important;
    margin: 0 !important;
    position: sticky !important;
    top: 92px !important;
    align-self: start !important;
    z-index: 2 !important;
}

.dashboard-layout > .panel:not(.sidebar),
.dashboard-layout > div:not(.sidebar),
.dashboard-layout > section:not(.sidebar),
.dashboard-layout > main:not(.sidebar) {
    grid-column: 2 !important;
    min-width: 0 !important;
    width: auto !important;
}

.dashboard-layout .sidebar::before,
.dashboard-layout .sidebar::after {
    display: none !important;
}

@media (max-width: 980px) {
    .dashboard-layout {
        grid-template-columns: 1fr !important;
    }

    .dashboard-layout > .panel.sidebar,
    .dashboard-layout > aside.panel.sidebar,
    .dashboard-layout > .sidebar,
    .dashboard-layout > .panel:not(.sidebar),
    .dashboard-layout > div:not(.sidebar),
    .dashboard-layout > section:not(.sidebar),
    .dashboard-layout > main:not(.sidebar) {
        grid-column: auto !important;
        max-width: none !important;
        width: 100% !important;
        position: static !important;
        top: auto !important;
    }
}
/* ===== /Dashboard sidebar overlay fix ===== */
