:root {
    --bg: #0b0f19;
    --panel: #111827;
    --card: #111827;
    --card-border: #1f2937;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --accent: #dc2626;
    --accent-dark: #b91c1c;
    --accent-light: #ef4444;
    --ok: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 10px 30px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent-light); }

/* Topbar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    padding: 0 32px;
    background: var(--bg);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.brand a { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand .logo-icon {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 0.85rem; color: #fff;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.topbar nav a {
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.topbar nav a:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.topbar nav a.active { color: var(--accent); }
.topbar nav a.active::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: var(--accent);
    margin-top: 4px;
    border-radius: 2px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1f2937;
    border: 1px solid var(--card-border);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: #1f2937;
    border: 1px solid var(--card-border);
    padding: 6px 12px 6px 6px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.user-menu .avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, #374151, #111827);
    display: flex; align-items: center; justify-content: center;
    color: var(--muted); font-size: 0.75rem;
}

.user-menu:hover { border-color: #374151; }

.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 180px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    overflow: hidden;
    z-index: 1001;
}

.dropdown-content a {
    display: block;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--text);
    border-bottom: 1px solid var(--card-border);
}

.dropdown-content a:last-child { border-bottom: none; }
.dropdown-content a:hover { background: rgba(255,255,255,0.04); color: var(--accent-light); }

.dropdown:hover .dropdown-content { display: block; }

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 60px;
    min-height: calc(100vh - 68px - 80px);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #991b1b 0%, #dc2626 50%, #b91c1c 100%);
    border-radius: 24px;
    padding: 40px 48px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 50%, rgba(0,0,0,0.25) 0%, transparent 60%);
    pointer-events: none;
}

.hero-content { position: relative; z-index: 2; max-width: 50%; }

.hero h1 {
    margin: 0;
    font-size: 2.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.1;
}

.hero h1 span {
    display: block;
    font-size: 1.6rem;
    font-weight: 600;
    opacity: 0.95;
    margin-top: 6px;
}

.hero-balance {
    margin-top: 20px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-balance a {
    color: #fff;
    text-decoration: underline;
    font-weight: 600;
}

.hero-prices {
    position: relative;
    z-index: 2;
    min-width: 240px;
}

.hero-prices-title {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 12px;
    font-weight: 600;
}

.price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    margin-bottom: 10px;
    font-weight: 600;
}

.price-row span:last-child { font-size: 1.3rem; font-weight: 800; }

.hero-figure {
    position: absolute;
    right: 40px;
    bottom: 0;
    height: 110%;
    z-index: 1;
    opacity: 0.95;
    pointer-events: none;
}

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.18);
}

.card h2, .card h3 {
    margin-top: 0;
    font-weight: 700;
}

.card h2 { font-size: 1.25rem; margin-bottom: 16px; }
.card h3 { font-size: 1.05rem; margin-bottom: 12px; }

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.item {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.item:hover { transform: translateY(-3px); border-color: #374151; }

.item .price { color: var(--accent-light); font-weight: 800; font-size: 1.35rem; margin: 10px 0; }
.item .small { color: var(--muted); font-size: 0.85rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background 0.15s ease, transform 0.1s ease;
}

.btn:hover { background: var(--accent-light); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }

.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text);
}

.btn-outline:hover { background: rgba(255,255,255,0.05); color: var(--text); }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #f87171; }

/* Forms */
form label {
    display: block;
    margin: 12px 0 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

input, select, textarea {
    width: 100%;
    padding: 11px 14px;
    background: #0b0f19;
    border: 1px solid var(--card-border);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.12);
}

input[type=file] { padding: 8px; }
input[type=checkbox], input[type=radio] { width: auto; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}

th {
    color: var(--muted);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(255,255,255,0.02);
}

tr:hover td { background: rgba(255,255,255,0.02); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #374151;
    color: var(--text);
}

.badge-personal { background: #374151; }
.badge-basic { background: #1e3a8a; }
.badge-premium { background: #581c87; }
.badge-business { background: #7c2d12; }
.badge-paid { background: #14532d; color: #86efac; }
.badge-pending { background: #713f12; color: #fde047; }
.badge-expired, .badge-cancelled { background: #450a0a; color: #fca5a5; }

/* Pagination */
.pagination {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

.pagination a:hover { border-color: var(--accent); color: var(--accent-light); }

/* Flash / Toasts */
.flash {
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.25);
    color: #86efac;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-weight: 600;
}

.flash-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.25);
    color: #fca5a5;
}

.toast {
    position: fixed;
    top: 86px;
    right: 24px;
    max-width: 360px;
    background: var(--accent-dark);
    color: #fff;
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 2000;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    animation: slideIn 0.25s ease;
}

@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast-icon {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-title { font-weight: 800; margin-bottom: 4px; }
.toast-body { font-size: 0.88rem; opacity: 0.95; }

/* Footer */
.footer {
    text-align: center;
    padding: 30px 24px;
    font-size: 0.82rem;
    color: var(--muted);
    border-top: 1px solid var(--card-border);
    background: var(--bg);
}

/* Utilities */
.mono { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; word-break: break-all; }
.danger { color: var(--danger); }
.ok { color: var(--ok); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 12px; }
.mt-1 { margin-top: 12px; }
.mt-2 { margin-top: 20px; }
.mb-1 { margin-bottom: 12px; }

/* QR */
.qr { background: #fff; padding: 12px; display: inline-block; border-radius: var(--radius-sm); margin: 10px 0; }

/* Admin */
.admin-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-nav a {
    background: var(--card);
    border: 1px solid var(--card-border);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
}

.admin-nav a:hover { border-color: var(--accent); color: var(--accent-light); }

/* Login/Register center card */
.auth-card {
    max-width: 420px;
    margin: 60px auto;
}

/* Catalog search panel */
.search-panel {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.search-panel .form-row { align-items: flex-end; }
.search-panel button { height: 44px; }

/* Domain / notice cards row */
.info-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.domain-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1f2937;
    border: 1px solid var(--card-border);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin: 0 8px 8px 0;
    font-size: 0.9rem;
}

.domain-link:hover { border-color: var(--accent); }

/* Mobile */
@media (max-width: 900px) {
    .topbar nav {
        position: static;
        transform: none;
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    .topbar { flex-wrap: wrap; height: auto; padding: 14px 18px; }
    .hero { flex-direction: column; text-align: center; padding: 30px; }
    .hero-content { max-width: 100%; }
    .hero-figure { display: none; }
    .container { padding: 20px 16px 40px; }
}

@media (max-width: 600px) {
    .topbar nav { gap: 4px; }
    .topbar nav a { padding: 6px 10px; font-size: 0.75rem; }
    .grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}
