/* CSBuilds — AMXservera-style portal */
:root, [data-theme="dark"] {
    --bg: #0f1115;
    --bg2: #161920;
    --card: #1c1f27;
    --card-hover: #22262f;
    --border: #2a2e38;
    --text: #e8eaed;
    --text-muted: #9aa0a6;
    --accent: #3ddc84;
    --accent-hover: #35c977;
    --accent-dim: rgba(61, 220, 132, 0.12);
    --header-bg: #12141a;
    --sidebar-bg: #161920;
    --radius: 12px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: system-ui, -apple-system, "Segoe UI", sans-serif;
    --shadow: 0 4px 24px rgba(0,0,0,.35);
}
[data-theme="light"] {
    --bg: #eef0f3;
    --bg2: #e4e7ec;
    --card: #ffffff;
    --card-hover: #f7f8fa;
    --border: #d0d5dd;
    --text: #1a1d24;
    --text-muted: #667085;
    --accent: #12b76a;
    --accent-dim: rgba(18, 183, 106, 0.1);
    --header-bg: #ffffff;
    --sidebar-bg: #ffffff;
    --shadow: 0 2px 12px rgba(0,0,0,.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent); opacity: 0.9; }
img { max-width: 100%; display: block; }

/* Header */
.header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.logo {
    font-weight: 800;
    font-size: 18px;
    color: var(--text) !important;
    letter-spacing: -0.02em;
    white-space: nowrap;
}
.logo span { color: var(--accent); }
.nav { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.nav a {
    color: var(--text-muted) !important;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}
.nav a:hover { background: var(--accent-dim); color: var(--accent) !important; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lang-select {
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 13px;
}

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; border-radius: 999px; border: none; cursor: pointer;
    font-weight: 700; font-size: 13px; text-decoration: none !important;
    transition: .15s ease;
}
.btn-primary { background: var(--accent); color: #0a1a10 !important; }
.btn-primary:hover { filter: brightness(1.08); opacity: 1; }
.btn-secondary {
    background: transparent; color: var(--text) !important;
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent) !important; }
.btn-sm { padding: 7px 14px; font-size: 12px; }

/* Layout shell */
.main { max-width: 1280px; margin: 0 auto; padding: 20px; }
.portal {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 900px) {
    .portal { grid-template-columns: 1fr; }
    .sidebar { order: 2; }
}

/* Sidebar */
.sidebar {
    background: var(--sidebar-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    position: sticky;
    top: 72px;
}
.sidebar-title {
    font-size: 15px; font-weight: 800; margin: 0 0 12px;
    display: flex; align-items: center; gap: 8px;
}
.sidebar-group {
    font-size: 12px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .04em;
    margin: 14px 0 8px; padding: 6px 10px;
    background: var(--bg2); border-radius: 8px;
}
.sidebar-nav { list-style: none; margin: 0; padding: 0; }
.sidebar-nav a {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 10px; border-radius: 8px;
    color: var(--text) !important; font-size: 14px;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    background: var(--accent-dim); color: var(--accent) !important;
}
.sidebar-nav .cnt {
    background: var(--bg2); color: var(--text-muted);
    font-size: 11px; font-weight: 700;
    min-width: 28px; text-align: center;
    padding: 2px 7px; border-radius: 999px;
}

/* Content panels */
.content-block, .panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}
.section-title {
    font-size: 18px; font-weight: 800; margin: 0 0 14px;
}

/* Horizontal post cards (amx style) */
.post-list { display: flex; flex-direction: column; gap: 14px; }
.post-card {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    transition: .15s ease;
}
.post-card:hover { background: var(--card-hover); border-color: #3a404c; }
@media (max-width: 640px) {
    .post-card { grid-template-columns: 1fr; }
}
.post-thumb {
    border-radius: 10px; overflow: hidden;
    background: var(--bg2);
    aspect-ratio: 16/10;
    max-height: 140px;
}
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-body { display: flex; flex-direction: column; min-width: 0; }
.post-cat {
    font-size: 12px; color: var(--accent); font-weight: 600; margin-bottom: 4px;
}
.post-title {
    font-size: 16px; font-weight: 800; margin: 0 0 8px; line-height: 1.3;
}
.post-title a { color: var(--text) !important; }
.post-title a:hover { color: var(--accent) !important; }
.post-desc {
    font-size: 13px; color: var(--text-muted);
    margin: 0 0 12px; display: -webkit-box;
    -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-foot {
    margin-top: auto;
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    font-size: 12px; color: var(--text-muted);
}
.post-foot .btn { margin-left: auto; }

/* Compact grid (optional) */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-poster { aspect-ratio: 16/9; background: var(--bg2); position: relative; max-height: 110px; }
.card-poster img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 10px 12px 12px; }
.card-title { font-size: 13px; margin: 0 0 6px; line-height: 1.3; }
.card-title a { color: var(--text) !important; }
.card-meta { font-size: 11px; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; }
.home-card { position: relative; }
.card-num {
    position: absolute; top: 6px; right: 6px; z-index: 2;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--accent); color: #0a1a10; font-weight: 800; font-size: 11px;
    display: flex; align-items: center; justify-content: center;
}
.card-no-poster {
    width: 100%; height: 100%; min-height: 90px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 12px;
}

/* Home hero */
.home-hero {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
}
.home-hero-title { font-size: 22px; font-weight: 800; margin: 0 0 8px; }
.home-hero-sub { color: var(--text-muted); margin: 0 0 16px; font-size: 14px; }
.home-hero ul { margin: 0; padding-left: 18px; color: var(--text-muted); font-size: 14px; }
.home-hero li { margin-bottom: 6px; }
.home-hero li::marker { color: var(--accent); }
.home-search { display: flex; gap: 10px; margin-top: 16px; max-width: 480px; }
.home-search input {
    flex: 1; padding: 11px 14px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.home-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.home-cat-pill {
    padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
    background: var(--card); color: var(--text) !important; font-size: 13px; font-weight: 600;
}
.home-cat-pill:hover, .home-cat-pill.is-active {
    border-color: var(--accent); color: var(--accent) !important; background: var(--accent-dim);
}
.home-section { margin-bottom: 28px; }
.home-section-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px;
}
.home-cat-count {
    display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
    background: var(--accent-dim); color: var(--accent); font-size: 12px;
}
.home-more { color: var(--accent) !important; font-weight: 700; font-size: 13px; }

/* Material page */
.material-page { }
.material-hero {
    display: grid; grid-template-columns: 320px 1fr; gap: 24px;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; margin-bottom: 16px;
}
@media (max-width: 768px) { .material-hero { grid-template-columns: 1fr; } }
.material-poster { border-radius: 10px; overflow: hidden; background: var(--bg2); }
.material-poster img { width: 100%; object-fit: cover; }
.material-info h1 { font-size: 22px; margin: 0 0 12px; }
.material-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--text-muted); font-size: 13px; margin-bottom: 12px; }
.dl-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.dl-buttons .btn { border-radius: 10px; }
.sysreq-box {
    background: var(--bg2); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px;
}
.sysreq-box h4 { margin: 0 0 6px; font-size: 12px; color: var(--accent); text-transform: uppercase; }
.sysreq-box pre { margin: 0; white-space: pre-wrap; font-size: 13px; color: var(--text-muted); font-family: inherit; }
.screens-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px;
}
.screens-grid img { border-radius: 8px; width: 100%; height: 100px; object-fit: cover; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block; font-size: 12px; font-weight: 700; color: var(--text-muted);
    margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em;
}
input[type="text"], input[type="url"], input[type="email"], input[type="password"],
input[type="number"], select, textarea {
    width: 100%; padding: 10px 12px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--bg); color: var(--text);
    font: inherit;
}
textarea { min-height: 100px; resize: vertical; }
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 12px; font-size: 14px; }
.alert-success { background: var(--accent-dim); color: var(--accent); }
.alert-error { background: rgba(255,80,80,.12); color: #ff6b6b; }
.empty { text-align: center; color: var(--text-muted); padding: 40px; }

/* Rating */
.rating-box { margin: 12px 0; }
.star { color: #444; font-size: 18px; }
.star.on { color: #f5c518; }

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    margin-top: 40px; padding: 20px;
    color: var(--text-muted); font-size: 13px;
}
.footer-inner {
    max-width: 1280px; margin: 0 auto;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}

/* Admin keep usable */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 20px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

/* ========== ADMIN (classic panel, separate from portal) ========== */
.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
    background: var(--bg);
}
.admin-sidebar {
    background: #141820;
    border-right: 1px solid var(--border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
[data-theme="light"] .admin-sidebar {
    background: #1a2332;
    color: #e8eaed;
}
.admin-sidebar .logo {
    font-weight: 800;
    font-size: 16px;
    color: var(--accent);
    letter-spacing: 0.04em;
}
.admin-sidebar a {
    display: block;
    padding: 10px 18px;
    color: #c5cad3 !important;
    font-size: 14px;
    font-weight: 600;
    border-left: 3px solid transparent;
}
.admin-sidebar a:hover {
    background: rgba(61, 220, 132, 0.08);
    color: var(--accent) !important;
    border-left-color: var(--accent);
    opacity: 1;
}
.admin-content {
    padding: 28px 32px;
    max-width: 1100px;
}
.admin-content h1 {
    margin: 0 0 24px;
    font-size: 22px;
    font-weight: 800;
}
.admin-content .content-block,
.admin-content .panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
}
.admin-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.admin-content th,
.admin-content td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.admin-content th {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge-notify {
    display: inline-block;
    background: #ff4757;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    margin-left: 6px;
}
.notif-panel {
    background: rgba(255, 180, 0, 0.1);
    border: 1px solid rgba(255, 180, 0, 0.35);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
}
.notif-panel h3 { margin: 0 0 8px; font-size: 14px; }
@media (max-width: 800px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { position: relative; height: auto; }
}
