:root {
    --bg: #050d22;
    --panel: #0b1a3a;
    --panel-2: #102248;
    --line: #27427a;
    --text: #e8f2ff;
    --muted: #8aa4d6;
    --blue: #005bff;
    --cyan: #4db8ff;
    --red: #e31c23;
    --green: #7cffb2;
    --gold: #ffd63a;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", Arial, sans-serif;
    background: radial-gradient(circle at top, #102a5c 0%, var(--bg) 55%);
    color: var(--text);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(77, 184, 255, 0.2);
    background: rgba(5, 13, 34, 0.85);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand { display: flex; gap: 0.75rem; align-items: baseline; }
.brand-mark { color: var(--red); font-weight: 900; letter-spacing: 0.08em; }
.brand-title { font-weight: 700; color: var(--text); }

.app-nav { display: flex; gap: 1rem; }
.app-nav a {
    color: var(--muted);
    font-weight: 600;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
}
.app-nav a.active {
    color: #fff;
    background: rgba(0, 91, 255, 0.35);
    text-decoration: none;
}

.app-main {
    width: min(1200px, calc(100% - 2rem));
    margin: 1.5rem auto 2.5rem;
}

.hero-card, .results-page {
    background: linear-gradient(180deg, rgba(16, 34, 72, 0.95), rgba(11, 26, 58, 0.95));
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.hero-card h1, .page-heading h1 {
    margin: 0 0 0.5rem;
    font-size: 2rem;
}

.hero-card p, .page-heading p {
    color: var(--muted);
    margin: 0 0 1.25rem;
    max-width: 60ch;
}

.api-hint {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px dashed var(--line);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.api-hint code {
    color: var(--gold);
    font-size: 0.95rem;
}

.btn-primary, .btn-secondary, .sort-btn {
    border: 0;
    cursor: pointer;
    font-weight: 700;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--blue);
    color: #fff;
    border-radius: 10px;
    padding: 0.7rem 1.1rem;
}

.btn-secondary {
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.65rem 1rem;
}

.btn-primary:disabled, .btn-secondary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.85rem;
    margin: 1.25rem 0 1rem;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-field label {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.filter-field select,
.filter-field input,
.filter-field .form-control {
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #071329;
    color: var(--text);
    padding: 0 0.75rem;
}

.filter-actions {
    display: flex;
    align-items: end;
    gap: 0.6rem;
}

.table-meta {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.table-wrap {
    position: relative;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.18);
    min-height: 220px;
}

.table-wrap.is-loading {
    opacity: 0.85;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.data-table th,
.data-table td {
    padding: 0.85rem 0.9rem;
    border-bottom: 1px solid rgba(39, 66, 122, 0.65);
    text-align: left;
    white-space: nowrap;
}

.data-table th {
    background: rgba(0, 91, 255, 0.16);
    position: sticky;
    top: 0;
}

.data-table tbody tr:hover {
    background: rgba(77, 184, 255, 0.08);
}

.sort-btn {
    background: transparent;
    color: var(--text);
    padding: 0;
    font: inherit;
    font-weight: 700;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
}

.badge-normal { background: rgba(138, 164, 214, 0.2); color: #c5d5f5; }
.badge-good { background: rgba(77, 184, 255, 0.2); color: #9fd8ff; }
.badge-stronger { background: rgba(227, 28, 35, 0.22); color: #ff9a9e; }

.pager {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
}

.pager-status {
    min-width: 72px;
    text-align: center;
    color: var(--muted);
    font-weight: 700;
}

.loading-panel, .empty-panel {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--muted);
}

.loading-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(5, 13, 34, 0.45);
    color: #fff;
    font-weight: 700;
}

#blazor-error-ui {
    background: #b32121;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #fff;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

h1:focus { outline: none; }

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.login-card {
    width: min(420px, 100%);
    background: linear-gradient(180deg, rgba(16, 34, 72, 0.97), rgba(11, 26, 58, 0.97));
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1.75rem;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.login-brand {
    text-align: center;
    margin-bottom: 1.25rem;
}

.login-brand h1 {
    margin: 0.35rem 0 0.25rem;
    font-size: 1.6rem;
}

.login-brand p {
    margin: 0;
    color: var(--muted);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.login-form label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.login-form input {
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #071329;
    color: var(--text);
    padding: 0 0.85rem;
    font-size: 1rem;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
}

.login-submit {
    width: 100%;
    margin-top: 0.35rem;
    border: 0;
}

.login-error {
    background: rgba(227, 28, 35, 0.18);
    border: 1px solid rgba(227, 28, 35, 0.45);
    color: #ffb4b7;
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.nav-user {
    color: var(--muted);
    font-weight: 600;
}

.nav-logout {
    color: #fff !important;
    background: rgba(227, 28, 35, 0.35);
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none !important;
}
