* {
    box-sizing: border-box;
}

:root {
    --bg: #0b1220;
    --panel: #111827;
    --panel-2: #0f172a;
    --line: #253047;
    --line-soft: #334155;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --muted-2: #9ca3af;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #374151;
    --success: #0f766e;
    --warning: #7c2d12;
    --danger: #b91c1c;
    --shadow: 0 10px 30px rgba(0,0,0,0.35);
    --radius: 18px;
}

html, body {
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at top, #0f172a 0%, #0b1220 45%);
    color: var(--text);
    font-family: Arial, sans-serif;
    min-height: 100%;
}

a {
    text-decoration: none;
}

.page-shell {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(17, 24, 39, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.topbar-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    color: white;
}

.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    display: grid;
    place-items: center;
    font-weight: bold;
    font-size: 18px;
    box-shadow: var(--shadow);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--muted);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-menu a {
    color: #dbeafe;
    padding: 10px 12px;
    border-radius: 10px;
    transition: 0.2s ease;
}

.nav-menu a:hover {
    background: rgba(255,255,255,0.05);
}

.nav-btn {
    background: var(--primary);
    color: white !important;
}

.main-wrapper {
    max-width: 1240px;
    margin: 0 auto;
    padding: 36px 20px 60px;
}

.flash-stack {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.flash,
.status,
.notice {
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 15px;
    border: 1px solid transparent;
}

.flash.success,
.status.success {
    background: rgba(15, 118, 110, 0.18);
    border-color: rgba(15, 118, 110, 0.35);
    color: #ccfbf1;
}

.flash.error,
.status.error,
.notice.warning {
    background: rgba(124, 45, 18, 0.18);
    border-color: rgba(124, 45, 18, 0.35);
    color: #ffedd5;
}

.status.info {
    background: rgba(37, 99, 235, 0.16);
    border-color: rgba(37, 99, 235, 0.35);
    color: #dbeafe;
}

.hero-section,
.auth-section,
.dashboard-section {
    display: flex;
    justify-content: center;
}

.hero-panel,
.auth-card,
.table-panel,
.panel-box {
    width: 100%;
    background: rgba(17, 24, 39, 0.96);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.hero-panel {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
    padding: 32px;
    align-items: start;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-copy h1,
.auth-card h1,
.section-header h1 {
    margin: 0;
    font-size: 38px;
    line-height: 1.1;
    color: #fff;
}

.hero-text,
.auth-card p,
.section-header p {
    margin: 0;
    color: var(--muted-2);
    line-height: 1.7;
    font-size: 15px;
}

.eyebrow {
    display: inline-flex;
    width: fit-content;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.14);
    border: 1px solid rgba(37, 99, 235, 0.25);
    padding: 8px 12px;
    border-radius: 999px;
}

.hero-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-tags span {
    font-size: 13px;
    color: #cbd5e1;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--line);
    padding: 10px 12px;
    border-radius: 999px;
}

.hero-side {
    display: flex;
    align-items: stretch;
}

.feature-card,
.search-panel {
    width: 100%;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 24px;
}

.feature-card h3,
.panel-header h2,
.section-title-row h3,
.panel-box h3 {
    margin: 0 0 10px;
    color: #fff;
}

.feature-card p,
.panel-header p,
.panel-box p {
    margin: 0;
    color: var(--muted-2);
    line-height: 1.7;
}

.warning-card {
    border-color: rgba(124, 45, 18, 0.35);
}

.section-header {
    text-align: center;
    margin-bottom: 26px;
    max-width: 800px;
}

.auth-card {
    max-width: 820px;
    padding: 30px;
}

.auth-card-wide {
    max-width: 980px;
}

.auth-card-head {
    text-align: center;
    margin-bottom: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-grid.single {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 14px;
    color: #cbd5e1;
    font-weight: 600;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--line-soft);
    background: #1f2937;
    color: white;
    font-size: 15px;
    outline: none;
    transition: 0.2s ease;
}

.input-group input:focus,
.input-group select:focus {
    border-color: rgba(37, 99, 235, 0.8);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.full,
.full-width {
    grid-column: 1 / -1;
}

.search-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: end;
}

button,
.btn,
.btn-small {
    border: 0;
    cursor: pointer;
    transition: 0.2s ease;
    text-decoration: none;
    font-weight: 600;
}

.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 18px;
    border-radius: 14px;
    background: var(--primary);
    color: white;
}

.btn:hover,
button:hover {
    background: var(--primary-hover);
}

.btn-full {
    width: 100%;
}

.btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    font-size: 14px;
}

.secondary {
    background: var(--secondary) !important;
}

.secondary:hover {
    background: #4b5563 !important;
}

.danger {
    background: var(--danger) !important;
}

.danger:hover {
    background: #991b1b !important;
}

.actions,
.result-actions,
.auth-footer {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    flex-wrap: wrap;
    align-items: center;
}

.auth-footer {
    justify-content: center;
    color: var(--muted);
    margin-top: 24px;
}

.auth-footer a {
    color: #93c5fd;
    font-weight: 600;
}

.hidden {
    display: none !important;
}

.results {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.stat-card {
    background: #0b1324;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.stat-card strong {
    font-size: 18px;
    color: #fff;
    word-break: break-word;
}

.table-panel {
    padding: 18px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    background: #0f172a;
    border: 1px solid var(--line);
    border-radius: 18px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

thead th {
    background: rgba(255,255,255,0.02);
    color: #cbd5e1;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

th, td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 28px !important;
}

.mono {
    font-family: monospace;
    color: #cbd5e1;
}

@media (max-width: 1024px) {
    .hero-panel {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .topbar-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-menu {
        justify-content: center;
    }

    .hero-copy h1,
    .auth-card h1,
    .section-header h1 {
        font-size: 30px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .search-form {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .main-wrapper {
        padding: 24px 14px 50px;
    }

    .hero-panel,
    .auth-card,
    .table-panel {
        padding: 20px;
    }
}

.helper {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.5;
}

.center-actions {
    justify-content: center;
}