/* SNIKAZ Admin Theme */
/* ------------------  GLOBAL THEME VARS  ------------------ */

:root {
    --bg-main: #f3f3f7;
    --bg-elevated: rgba(255,255,255,0.9);
    --bg-elevated-strong: #ffffff;
    --border-soft: rgba(0,0,0,0.08);
    --accent: #e30613;
    --accent-soft: rgba(227,6,19,0.12);
    --accent-strong: #ff3344;
    --text-main: #111111;
    --text-muted: #666666;
    --sidebar-bg: #050505;
    --sidebar-border: rgba(255,255,255,0.06);
    --sidebar-text: #f8f8f8;
    --sidebar-muted: #a0a0a0;
    --header-bg: #ffffff;
    --input-bg: rgba(255,255,255,0.9);
    --shadow-soft: 0 18px 45px rgba(15,15,35,0.12);
    --shadow-card: 0 10px 30px rgba(0,0,0,0.07);
    --radius-card: 18px;
}

[data-theme="dark"] {
    --bg-main: #050509;
    --bg-elevated: rgba(18,18,26,0.95);
    --bg-elevated-strong: #14141c;
    --border-soft: rgba(255,255,255,0.07);
    --accent: #ff3344;
    --accent-soft: rgba(255,51,68,0.13);
    --accent-strong: #ff4f5f;
    --text-main: #f7f7ff;
    --text-muted: #9a9ab1;
    --sidebar-bg: #050509;
    --sidebar-border: rgba(255,255,255,0.08);
    --sidebar-text: #f7f7ff;
    --sidebar-muted: #9a9ab1;
    --header-bg: rgba(12,12,20,0.98);
    --input-bg: rgba(15,15,25,0.95);
    --shadow-soft: 0 18px 45px rgba(0,0,0,0.7);
    --shadow-card: 0 10px 30px rgba(0,0,0,0.6);
}

/* ------------------  GLOBAL RESET  ------------------ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    background: radial-gradient(circle at top, #191919, #000);
    color: var(--text-main);
}

/* Glass overlay behind main content */
.admin-bg-layer {
    min-height: 100vh;
    background:
      radial-gradient(circle at 0% 0%, rgba(227,6,19,0.18), transparent 55%),
      radial-gradient(circle at 100% 0%, rgba(255,255,255,0.08), transparent 50%),
      radial-gradient(circle at 50% 100%, rgba(227,6,19,0.22), transparent 60%);
}

/* ------------------  LAYOUT: SIDEBAR + MAIN  ------------------ */

.admin-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 240px;
    background: linear-gradient(160deg, #000, #111);
    border-right: 1px solid var(--sidebar-border);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px 16px 4px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 6px;
}

.sidebar-logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    background: radial-gradient(circle at 30% 20%, #fff, #e30613);
    box-shadow: 0 0 20px rgba(227,6,19,0.9);
}

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
}
.sidebar-logo-text span:first-child {
    font-size: 17px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #fff;
    font-weight: 700;
}
.sidebar-logo-text span:last-child {
    font-size: 12px;
    color: #aaa;
}

/* Sidebar nav */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
}
.sidebar-nav a {
    text-decoration: none;
    padding: 9px 10px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--sidebar-muted);
    transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
}
.sidebar-nav a .icon-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(255,255,255,0.3);
}
.sidebar-nav a.active,
.sidebar-nav a:hover {
    background: linear-gradient(90deg, rgba(227,6,19,0.28), transparent);
    color: var(--sidebar-text);
    transform: translateX(3px);
}
.sidebar-nav a.active .icon-dot {
    background: #ff3344;
}

/* Sidebar footer */
.sidebar-footer {
    margin-top: auto;
    font-size: 11px;
    color: var(--sidebar-muted);
    opacity: 0.8;
}

/* ------------------  MAIN AREA  ------------------ */

.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    backdrop-filter: blur(28px);
    background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(0,0,0,0.4));
}

/* Top Header */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 26px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-header-title {
    display: flex;
    flex-direction: column;
}
.admin-header-title span:first-child {
    font-size: 20px;
    font-weight: 700;
}
.admin-header-title span:last-child {
    font-size: 12px;
    color: var(--text-muted);
}

/* Header right controls */
.admin-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle {
    font-size: 20px;
    background: transparent;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover {
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.admin-pill-link {
    text-decoration: none;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    color: var(--text-main);
    background: rgba(255,255,255,0.8);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}
[data-theme="dark"] .admin-pill-link {
    background: rgba(12,12,20,0.95);
    color: var(--text-main);
}
.admin-pill-link:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

/* Logout button variant */
.admin-pill-link.logout {
    border-color: rgba(255,255,255,0.08);
    background: var(--accent);
    color: #fff;
}
.admin-pill-link.logout:hover {
    background: var(--accent-strong);
}

/* ------------------  CONTENT AREA  ------------------ */

.admin-content {
    padding: 24px 26px 40px;
    color: var(--text-main);
}

/* Metrics row */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-card);
    padding: 14px 16px;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}
.metric-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}
.metric-value {
    font-size: 22px;
    font-weight: 700;
    margin-top: 6px;
}
.metric-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.metric-chip {
    position: absolute;
    right: 10px;
    bottom: 12px;
    font-size: 11px;
    color: #fff;
    background: var(--accent);
    padding: 4px 8px;
    border-radius: 999px;
}

/* Two-column layout */
.flex-row {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

/* Card generic */
.card {
    background: var(--bg-elevated);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-soft);
    padding: 18px 18px 20px 18px;
    box-shadow: var(--shadow-card);
}
.card h3 {
    margin: 0 0 4px;
    font-size: 16px;
}
.card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

/* Settings form */
.admin-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
}

.admin-form label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}
.admin-form input {
    margin-top: 5px;
    padding: 9px 11px;
    border-radius: 9px;
    border: 1px solid var(--border-soft);
    background: var(--input-bg);
    color: var(--text-main);
    font-size: 14px;
}
.admin-form small {
    font-size: 11px;
    color: var(--text-muted);
}

.admin-form button {
    margin-top: 8px;
    padding: 11px 18px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(130deg, var(--accent), var(--accent-strong));
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(227,6,19,0.5);
    transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}
.admin-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(227,6,19,0.7);
    opacity: 0.98;
}

/* Stats table */
.stats-table-wrapper {
    max-height: 340px;
    overflow: auto;
}
.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.stats-table thead {
    background: rgba(0,0,0,0.03);
}
[data-theme="dark"] .stats-table thead {
    background: rgba(255,255,255,0.04);
}
.stats-table th,
.stats-table td {
    padding: 6px 8px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
[data-theme="dark"] .stats-table th,
[data-theme="dark"] .stats-table td {
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.stats-table th {
    text-align: left;
    font-weight: 600;
    font-size: 12px;
}

/* Login page reuse */
.login-box {
    max-width: 360px;
    margin: 80px auto;
    background: var(--bg-elevated);
    border-radius: var(--radius-card);
    padding: 24px 22px 26px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-soft);
}
.login-box h2 {
    margin: 0 0 14px;
}
.login-box input {
    width: 100%;
    padding: 10px 11px;
    margin-bottom: 10px;
    border-radius: 9px;
    border: 1px solid var(--border-soft);
    background: var(--input-bg);
    color: var(--text-main);
}
.login-box button {
    width: 100%;
    padding: 11px 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    border-radius: 999px;
    border: none;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    margin-top: 6px;
}
.error {
    color: #ff5555;
    font-size: 13px;
    margin-bottom: 8px;
}

/* Small helpers */
.badge-pill {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    border-radius: 999px;
    padding: 3px 8px;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

/* Responsive */
@media (max-width: 960px) {
    .admin-sidebar {
        display: none;
    }
    .admin-shell {
        display: block;
    }
    .metrics-row {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
    .flex-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .metrics-row {
        grid-template-columns: minmax(0,1fr);
    }
    .admin-content {
        padding: 18px 16px 30px;
    }
}
