@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0b1a13;
    --bg-2: #0f2119;
    --surface: rgba(15, 33, 25, 0.6);
    --surface-solid: #132a20;
    --surface-2: #163024;
    --surface-3: #1b3a2c;
    --border: rgba(16, 185, 129, 0.12);
    --border-hover: rgba(16, 185, 129, 0.25);
    --border-subtle: rgba(255,255,255,0.06);
    --text: #e8f0ec;
    --text-dim: #8fa99c;
    --text-muted: #4a6b5a;
    --accent: #10b981;
    --accent-hover: #34d399;
    --accent-dim: rgba(16, 185, 129, 0.1);
    --accent-border: rgba(16, 185, 129, 0.2);
    --accent-glow: rgba(16, 185, 129, 0.15);
    --red: #ef4444;
    --red-dim: rgba(239, 68, 68, 0.08);
    --red-border: rgba(239, 68, 68, 0.15);
    --amber: #f59e0b;
    --amber-dim: rgba(245, 158, 11, 0.08);
    --blue: #3b82f6;
    --blue-dim: rgba(59, 130, 246, 0.08);
    --blue-border: rgba(59, 130, 246, 0.15);
    --radius: 24px;
    --radius-lg: 28px;
    --radius-sm: 14px;
    --radius-xs: 8px;
    --font: 'Outfit', system-ui, -apple-system, sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', monospace;
}

/* ===== LIGHT MODE ===== */
[data-theme="light"] {
    --bg: #f3f6f5;
    --bg-2: #eaf0ed;
    --surface: rgba(255, 255, 255, 0.8);
    --surface-solid: #ffffff;
    --surface-2: #f0f4f2;
    --surface-3: #e4ebe7;
    --border: rgba(16, 185, 129, 0.15);
    --border-hover: rgba(16, 185, 129, 0.3);
    --border-subtle: rgba(0,0,0,0.06);
    --text: #0f2419;
    --text-dim: #4a6b5a;
    --text-muted: #93a89d;
    --accent: #059669;
    --accent-hover: #10b981;
    --accent-dim: rgba(5, 150, 105, 0.07);
    --accent-border: rgba(5, 150, 105, 0.2);
    --accent-glow: rgba(5, 150, 105, 0.1);
}
[data-theme="light"] .deco-blob { opacity: 0.4; }
[data-theme="light"] .btn-primary,
[data-theme="light"] .dl-btn,
[data-theme="light"] .nav-logo,
[data-theme="light"] .tab-btn.active { color: #fff; }
[data-theme="light"] .dl-card { backdrop-filter: blur(24px); border-color: rgba(0,0,0,0.08); }
[data-theme="light"] tr:hover td { background: rgba(0,0,0,0.02); }
[data-theme="light"] .step-icon { background: var(--accent-dim); }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Decorative blobs */
.deco-blob {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(120px);
}
.blob-1 {
    top: -15%;
    left: -10%;
    width: 45%;
    height: 45%;
    background: var(--accent);
    opacity: 0.07;
}
.blob-2 {
    bottom: -15%;
    right: -10%;
    width: 40%;
    height: 40%;
    background: var(--accent);
    opacity: 0.04;
}

.page-wrapper {
    position: relative;
    z-index: 2;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ===== NAV ===== */
.site-nav {
    padding: 24px 24px 0;
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
}

.nav-logo .material-symbols-outlined {
    font-size: 22px;
    font-weight: 700;
}

.nav-name {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    font-style: italic;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--accent);
}

/* ===== HERO ===== */
.hero {
    padding: 80px 24px 0;
    text-align: center;
}

.hero-inner {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(40px, 7vw, 72px);
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1.08;
    margin-bottom: 20px;
}

.accent-text {
    color: var(--accent);
}

.hero-desc {
    font-size: 17px;
    color: var(--text-dim);
    max-width: 560px;
    margin: 0 auto 36px;
    line-height: 1.7;
    font-weight: 400;
}

/* Tags */
.tag-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 48px;
}

.tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    background: var(--surface-solid);
    border: 1px solid var(--border-subtle);
    color: var(--text-dim);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
}

.tag .material-symbols-outlined {
    font-size: 18px;
}

.tag-active,
.tag:hover {
    background: var(--accent-dim);
    border-color: var(--accent-border);
    color: var(--accent);
}

/* ===== DOWNLOAD CARD ===== */
.dl-section {
    padding: 0 24px 80px;
    display: flex;
    justify-content: center;
}

.dl-card {
    width: 100%;
    max-width: 740px;
    background: var(--surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    box-shadow: 0 24px 80px -12px var(--accent-glow);
    position: relative;
}

.dl-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.04);
    pointer-events: none;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 10px;
    margin-left: 2px;
}

.input-wrap {
    position: relative;
}

.input-wrap .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.3s;
    font-size: 20px;
}

.input-field {
    width: 100%;
    padding: 16px 16px 16px 48px;
    background: var(--bg);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

.input-field:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
    background: var(--surface-2);
}

.input-field:focus ~ .input-icon {
    color: var(--accent);
}

.input-field::placeholder {
    color: var(--text-muted);
}

.dl-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    text-decoration: none;
    line-height: 1;
}

.btn:active { transform: scale(0.98) translateY(1px); }

.btn-block { width: 100%; }

.btn-lg {
    padding: 20px 32px;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.5px;
    border-radius: 16px;
}

.btn-lg .material-symbols-outlined {
    font-size: 24px;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg);
    box-shadow: 0 8px 32px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.25);
}

.btn-primary:disabled {
    background: var(--surface-3);
    color: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 12px;
    border-radius: var(--radius-xs);
}

.btn-ghost {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border-subtle);
}
.btn-ghost:hover {
    border-color: var(--border-hover);
    color: var(--text);
    background: var(--surface-2);
}

.btn-danger {
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red-border);
}
.btn-danger:hover { background: var(--red-dim); }

.btn-accent-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent-border);
}
.btn-accent-outline:hover { background: var(--accent-dim); }

.btn-text-state {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-loading-state {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    background: currentColor;
    border-radius: 50%;
    animation: pulse-bounce 1.4s ease-in-out infinite;
}
.pulse-dot:nth-child(2) { animation-delay: 0.2s; }
.pulse-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse-bounce {
    0%, 80%, 100% { transform: scale(0.5); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

/* Links */
.link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    border-bottom: 1px solid var(--accent-border);
    transition: all 0.2s;
}
.link:hover {
    border-bottom-color: var(--accent);
}

/* ===== STATUS / RESULT ===== */
.msg {
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    display: none;
    animation: msg-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.msg.is-info {
    display: block;
    background: var(--blue-dim);
    border: 1px solid var(--blue-border);
    color: var(--blue);
}
.msg.is-error {
    display: block;
    background: var(--red-dim);
    border: 1px solid var(--red-border);
    color: var(--red);
}

.result-box {
    margin-top: 20px;
    padding: 28px;
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    border-radius: 16px;
    text-align: center;
    display: none;
    animation: msg-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.result-box p {
    color: var(--accent);
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 16px;
}

.dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    background: var(--accent);
    color: var(--bg);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 14px;
    font-family: var(--font);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.dl-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}
.dl-btn .material-symbols-outlined { font-size: 20px; }

/* ===== STEPS SECTION ===== */
.steps-section {
    padding: 0 24px 80px;
}

.steps-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h3 {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
}

.header-line {
    width: 56px;
    height: 4px;
    background: var(--accent);
    margin: 0 auto;
    border-radius: 4px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.step-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 8px;
}

.step-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid var(--accent-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.step-icon span {
    font-size: 22px;
    font-weight: 900;
    font-family: var(--mono);
}

.step-card:hover .step-icon {
    background: var(--accent);
    color: var(--bg);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.step-card h4 {
    font-size: 15px;
    font-weight: 700;
}

.step-card p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ===== FOOTER ===== */
.site-footer {
    margin-top: auto;
    background: var(--surface-solid);
    border-top: 1px solid var(--border-subtle);
    padding: 56px 24px;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.footer-left h5 {
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 12px;
}

.footer-left p {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 20px;
    max-width: 480px;
}

.compat-row {
    display: flex;
    gap: 10px;
}

.compat-badge {
    padding: 8px 14px;
    background: var(--bg);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
}

.footer-shop {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-copy {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
    line-height: 1.8;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    width: 42px;
    height: 42px;
    background: var(--surface-solid);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--text-dim);
    padding: 0;
    font-family: var(--font);
}
.theme-toggle:hover {
    border-color: var(--border-hover);
    color: var(--text);
    transform: scale(1.05);
}
.theme-toggle:active { transform: scale(0.95); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ===== ENTRANCE ANIMATIONS ===== */
.fade-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fade-up-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.fade-up:nth-child(1) { animation-delay: 0ms; }
.fade-up:nth-child(2) { animation-delay: 100ms; }
.fade-up:nth-child(3) { animation-delay: 200ms; }
.fade-up:nth-child(4) { animation-delay: 300ms; }

@keyframes fade-up-in {
    to { opacity: 1; transform: translateY(0); }
}

/* ===== LOGIN PAGE ===== */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface-solid);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    position: relative;
}

.login-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.03);
    pointer-events: none;
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-icon {
    width: 64px;
    height: 64px;
    background: var(--accent);
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
    margin-bottom: 20px;
    box-shadow: 0 8px 32px var(--accent-glow);
}

.login-icon .material-symbols-outlined {
    font-size: 30px;
}

.login-header h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-muted);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
}

.login-footer .link {
    font-size: 13px;
    font-weight: 600;
}

/* ========================================
   ADMIN STYLES
   ======================================== */

.admin-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 6px;
    background: var(--surface-solid);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 6px;
    margin-bottom: 32px;
}

.admin-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: none;
    border: none;
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-tab .material-symbols-outlined {
    font-size: 18px;
}

.admin-tab.active {
    background: var(--accent);
    color: var(--bg);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.admin-tab:not(.active):hover {
    color: var(--text-dim);
    background: var(--surface-2);
}

/* Admin Stats */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.astat {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--surface-solid);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 20px 24px;
    transition: border-color 0.3s;
}

.astat:hover {
    border-color: var(--border-hover);
}

.astat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.astat-icon .material-symbols-outlined {
    font-size: 22px;
}

.astat-icon-green {
    background: var(--accent-dim);
    color: var(--accent);
}

.astat-icon-red {
    background: var(--red-dim);
    color: var(--red);
}

.astat-body {
    min-width: 0;
}

.astat-num {
    font-size: 28px;
    font-weight: 800;
    font-family: var(--mono);
    letter-spacing: -1px;
    line-height: 1.2;
}

.astat-lbl {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
}

/* Admin Panel (unified card for each section) */
.admin-panel {
    background: var(--surface-solid);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.admin-panel:hover {
    border-color: var(--border-hover);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.panel-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
}

.panel-header h3 .material-symbols-outlined {
    font-size: 20px;
    color: var(--accent);
}

.panel-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--surface-2);
    padding: 4px 12px;
    border-radius: 20px;
}

.panel-body {
    padding: 20px 24px;
}

.panel-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--blue-dim);
    border: 1px solid var(--blue-border);
    border-radius: 12px;
    font-size: 13px;
    color: var(--blue);
    font-weight: 500;
}

.panel-notice .material-symbols-outlined {
    font-size: 18px;
    flex-shrink: 0;
}

/* Settings form in panel */
.settings-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.settings-form .input-wrap {
    flex: 1;
}

.settings-form .input-field {
    width: 100%;
}

.container {
    max-width: 560px;
    margin: 0 auto;
    padding: 80px 24px 60px;
}
.container.admin {
    max-width: 960px;
    padding: 48px 24px;
}

.brand {
    margin-bottom: 48px;
}
.brand h1 {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1;
    margin-bottom: 10px;
}
.brand p {
    font-size: 15px;
    color: var(--text-dim);
}

.card {
    background: var(--surface-solid);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 16px;
    position: relative;
    transition: border-color 0.3s;
}
.card:hover { border-color: var(--border-hover); }

.input-hint {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
}

/* Admin layout */
.admin-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}
.admin-bar h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.tab-nav {
    display: flex;
    gap: 2px;
    background: var(--surface-solid);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 28px;
}
.tab-btn {
    flex: 1;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: var(--radius-xs);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
}
.tab-btn.active {
    background: var(--accent);
    color: var(--bg);
}
.tab-btn:not(.active):hover {
    color: var(--text-dim);
    background: var(--surface-2);
}
.tab-panel { display: none; }
.tab-panel.active {
    display: block;
    animation: msg-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 520px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
.stat-tile {
    background: var(--surface-solid);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    transition: border-color 0.3s;
}
.stat-tile:hover { border-color: var(--border-hover); }
.stat-num {
    font-size: 32px;
    font-weight: 800;
    font-family: var(--mono);
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 6px;
}
.stat-num.c-accent { color: var(--accent); }
.stat-num.c-red { color: var(--red); }
.stat-num.c-text { color: var(--text); }
.stat-lbl {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.gen-box {
    background: var(--surface-solid);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 20px;
}
.gen-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.gen-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.gen-field label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.gen-field input {
    width: 110px;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-size: 14px;
    font-family: var(--mono);
    outline: none;
    transition: border-color 0.3s;
}
.gen-field input:focus { border-color: var(--accent-border); }
.gen-output {
    margin-top: 16px;
    background: var(--bg);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: none;
    animation: msg-in 0.3s;
}
.gen-output h4 {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.gen-output pre {
    background: var(--surface-solid);
    padding: 16px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 2.2;
    margin-bottom: 12px;
    font-family: var(--mono);
    border: 1px solid var(--border-subtle);
}
.gen-output .btn-row { display: flex; gap: 8px; }

.actions-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.tbl-wrap {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
th {
    padding: 12px 16px;
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--surface-solid);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
}
td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 400;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.015); }
.mono-cell {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text);
    font-weight: 500;
}

.key-copyable {
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
}

.key-copyable:hover {
    color: var(--accent);
}

.key-copyable.copied {
    color: var(--accent) !important;
}
.url-cell {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 12px;
}
tr.row-dim { opacity: 0.35; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.badge-ok {
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid var(--accent-border);
}
.badge-no {
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid var(--red-border);
}
.badge-warn {
    background: var(--amber-dim);
    color: var(--amber);
    border: 1px solid rgba(245, 158, 11, 0.15);
}
.badge-info {
    background: var(--blue-dim);
    color: var(--blue);
    border: 1px solid var(--blue-border);
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
    font-size: 13px;
}

.settings-block {
    background: var(--surface-solid);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 12px;
}
.settings-block h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
}
.inline-form {
    display: flex;
    gap: 10px;
    align-items: center;
}
.inline-form input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.3s;
}
.inline-form input:focus { border-color: var(--accent-border); }

.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 12px 24px;
    border-radius: var(--radius-xs);
    font-weight: 600;
    font-size: 13px;
    font-family: var(--font);
    z-index: 9999;
    animation: toast-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid;
}
.toast-ok {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: var(--accent-border);
}
.toast-err {
    background: var(--red-dim);
    color: var(--red);
    border-color: var(--red-border);
}
@keyframes toast-in {
    from { opacity: 0; transform: translateY(-12px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    /* --- Frontend --- */
    .nav-links { display: none; }
    .hero { padding: 48px 20px 0; }
    .hero-title { font-size: 36px; letter-spacing: -1px; }
    .hero-desc { font-size: 15px; }
    .form-grid { grid-template-columns: 1fr; }
    .dl-card { padding: 28px 24px; }
    .steps-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .steps-grid .step-card:last-child { grid-column: 1 / -1; }
    .footer-inner { grid-template-columns: 1fr; gap: 32px; }
    .footer-right { align-items: flex-start; }
    .footer-copy { text-align: left; }
    .tag-row { gap: 6px; }
    .tag { padding: 6px 12px; font-size: 12px; }

    /* --- Admin: APP-like layout --- */
    .admin-main { padding: 16px 12px 80px; }
    .container { padding: 40px 16px; }
    .container.admin { padding: 20px 12px; }
    .card { padding: 20px 16px; }

    /* --- Admin: nav bar (sticky app header) --- */
    .site-nav { position: sticky; top: 0; z-index: 100; }
    .nav-inner { padding: 10px 16px; }
    .nav-name { font-size: 15px; }
    .nav-logo { width: 32px; height: 32px; border-radius: 8px; }
    .nav-logo .material-symbols-outlined { font-size: 18px; }

    /* --- Admin: top bar --- */
    .admin-bar { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
    .admin-bar h1 { font-size: 18px; }

    /* --- Admin: tabs (bottom tab bar style) --- */
    .admin-tabs {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 200;
        display: flex;
        flex-wrap: nowrap;
        gap: 0;
        padding: 6px 8px;
        margin-bottom: 0;
        border-radius: 0;
        border-top: 1px solid var(--border-subtle);
        border-left: none;
        border-right: none;
        border-bottom: none;
        background: var(--bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    .admin-tab {
        flex: 1;
        flex-direction: column;
        padding: 6px 4px;
        font-size: 10px;
        gap: 2px;
        border-radius: 8px;
    }
    .admin-tab .material-symbols-outlined { font-size: 20px; }
    .admin-tab.active {
        background: var(--accent-dim);
        color: var(--accent);
        box-shadow: none;
    }
    .tab-nav { flex-wrap: wrap; gap: 4px; }
    .tab-btn { flex: 1 1 45%; padding: 10px 8px; font-size: 12px; }
    .tab-panel.active { min-height: auto; }

    /* --- Admin: stats (horizontal scroll) --- */
    .admin-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-bottom: 16px;
    }
    .astat {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 12px 8px;
        gap: 8px;
        border-radius: 14px;
    }
    .astat-icon { width: 36px; height: 36px; border-radius: 10px; }
    .astat-icon .material-symbols-outlined { font-size: 16px; }
    .astat-num { font-size: 20px; }
    .astat-lbl { font-size: 10px; }
    .stats-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .stat-tile { padding: 12px 8px; }
    .stat-num { font-size: 22px; }

    /* --- Admin: panels --- */
    .admin-panel { border-radius: 14px; margin-bottom: 12px; }
    .panel-header {
        padding: 14px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .panel-header > div { width: 100%; display: flex; gap: 8px; }
    .panel-header h3 { font-size: 14px; gap: 8px; }
    .panel-header h3 .material-symbols-outlined { font-size: 18px; }
    .panel-body { padding: 14px 16px; }
    .panel-notice { padding: 12px 14px; font-size: 12px; border-radius: 10px; }

    /* --- Admin: generate keys --- */
    .gen-box { padding: 16px; border-radius: 12px; }
    .gen-row { flex-direction: column; gap: 10px; }
    .gen-field { width: 100%; }
    .gen-field input { width: 100% !important; box-sizing: border-box; }
    .gen-output { padding: 12px; }
    .gen-output pre { font-size: 11px; padding: 12px; line-height: 2; }
    .gen-output .btn-row { flex-direction: column; }

    /* --- Admin: tables → card layout --- */
    .tbl-wrap { border-radius: 12px; border: none; overflow: visible; }
    table, thead, tbody, th, td, tr { display: block; }
    thead { display: none; }
    tr {
        background: var(--surface-solid);
        border: 1px solid var(--border-subtle);
        border-radius: 12px;
        padding: 14px 16px;
        margin-bottom: 10px;
        position: relative;
    }
    tr:last-child td { border-bottom: none; }
    tr:hover td { background: none; }
    td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border-bottom: 1px solid var(--border-subtle) !important;
        font-size: 13px;
        gap: 8px;
    }
    td:last-child { border-bottom: none !important; }
    td::before {
        content: attr(data-label);
        font-size: 11px;
        color: var(--text-muted);
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        flex-shrink: 0;
        min-width: 60px;
    }
    .mono-cell { font-size: 12px; word-break: break-all; text-align: right; }
    .url-cell { max-width: none; white-space: normal; word-break: break-all; font-size: 12px; text-align: right; }
    .badge { font-size: 10px; padding: 3px 10px; }
    .row-dim { opacity: 0.4; }
    .empty-state { text-align: center; }
    td.empty-state::before { display: none; }
    .actions-row { gap: 6px; }

    /* --- Admin: settings --- */
    .settings-block { padding: 16px; border-radius: 12px; }
    .settings-block h4 { font-size: 13px; margin-bottom: 12px; }
    .settings-form { flex-direction: column; gap: 10px; }
    .inline-form { flex-direction: column; gap: 10px; }
    .inline-form input { width: 100%; }

    /* --- Admin: buttons --- */
    .btn { font-size: 13px; padding: 12px 16px; width: 100%; text-align: center; justify-content: center; }
    .btn-sm { font-size: 12px; padding: 10px 14px; }
    .panel-header .btn-sm { width: auto; }

    /* --- Admin login --- */
    .login-card { margin: 0 8px; }
    .login-icon { width: 56px; height: 56px; border-radius: 16px; }
    .login-icon .material-symbols-outlined { font-size: 28px; }
    .login-header h1 { font-size: 22px; }
    .btn-block { padding: 14px; }

    /* --- Toast (app style, bottom) --- */
    .toast {
        top: auto;
        bottom: 80px;
        left: 16px;
        right: 16px;
        text-align: center;
        border-radius: 12px;
    }

    /* --- Theme toggle --- */
    .theme-toggle { top: auto; bottom: 80px; right: 12px; z-index: 150; width: 36px; height: 36px; }
}

/* Extra small screens */
@media (max-width: 480px) {
    .hero-title { font-size: 28px; }
    .steps-grid { grid-template-columns: 1fr; }
    .steps-grid .step-card:last-child { grid-column: auto; }
    .admin-stats { grid-template-columns: repeat(3, 1fr); }
    .admin-bar h1 { font-size: 16px; }
}
