:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #0f172a;
    --muted: #475569;
    --line: #dbe5f0;
    --brand: #1456d9;
    --brand-dark: #0f3ea0;
    --accent: #0e9488;
    --danger: #b91c1c;
    --success-bg: #e7f8ef;
    --success-border: #86efac;
    --error-bg: #fee2e2;
    --error-border: #fca5a5;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    background:
        radial-gradient(1200px 600px at 15% -20%, #d9e8ff, transparent 55%),
        radial-gradient(1000px 550px at 100% 0%, #d8f7f3, transparent 50%),
        var(--bg);
}

h1, h2, h3 {
    margin-top: 0;
    font-family: Georgia, "Times New Roman", serif;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.brand-logo {
    width: 44px;
    height: 44px;
}

.brand-title {
    margin: 0;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.2px;
}

.brand-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.topnav {
    justify-self: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

.topnav-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
    border: 1px solid transparent;
}

.topnav-link:hover {
    background: #edf4ff;
    border-color: #c8dcff;
}

.topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.user-meta p {
    margin: 0;
}

.user-label {
    color: var(--muted);
    font-size: 0.75rem;
}

.user-name {
    font-size: 0.92rem;
    font-weight: 700;
}

.container {
    max-width: 980px;
    margin: 26px auto 40px;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 22px 40px rgba(15, 23, 42, 0.05);
}

.hint {
    color: var(--muted);
    margin-bottom: 18px;
}

.hint.center {
    text-align: center;
}

.message {
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 14px;
}

.message.success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
}

.message.error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--danger);
}

.auth-card {
    max-width: 480px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px;
}

.google-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: #0f172a;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-weight: 700;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.google-btn:hover {
    background: #f8fafc;
}

.profile-form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 6px;
    font-weight: 700;
    color: #1e293b;
}

fieldset {
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

legend {
    font-weight: 800;
    padding: 0 8px;
}

input,
textarea,
select,
button {
    font: inherit;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}

textarea {
    resize: vertical;
}

.inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.inline input {
    width: auto;
}

button {
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    cursor: pointer;
    font-weight: 800;
}

button:hover {
    opacity: 0.96;
}

.secondary-btn {
    background: linear-gradient(135deg, #64748b, #475569);
    color: #fff;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.chip-group {
    display: grid;
    gap: 10px;
}

.chip-option {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    gap: 8px;
    font-weight: 700;
    background: #fff;
    border: 1px solid #d9e4ef;
    border-radius: 999px;
    padding: 7px 12px;
    margin: 2px 8px 2px 0;
}

.chip-option input {
    width: auto;
}

.card {
    margin-top: 24px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.jobs-filter-form {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.jobs-grid {
    display: grid;
    gap: 14px;
}

.job-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    background: #fff;
}

.score-badge {
    display: inline-block;
    margin: 0 0 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-weight: 800;
}

.job-meta {
    color: var(--muted);
    font-weight: 800;
    margin: 0 0 8px;
}

.job-link {
    color: #0f56c9;
    font-weight: 800;
    text-decoration: none;
}

.job-link:hover {
    text-decoration: underline;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    border: 1px solid #94a3b8;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.85rem;
    background: #f8fafc;
}

.tag-failed {
    border-color: #fca5a5;
    color: #b91c1c;
    background: #fee2e2;
}

.reason-list {
    margin: 8px 0 0;
    padding-left: 20px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 12px;
}

.stat-label {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.stat-value {
    margin: 6px 0 0;
    font-size: 1.4rem;
    font-weight: 800;
}

.table-wrap {
    overflow-x: auto;
}

.alerts-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.alerts-table th,
.alerts-table td {
    border-bottom: 1px solid var(--line);
    text-align: left;
    padding: 10px;
    vertical-align: top;
    font-size: 0.95rem;
}

.alerts-table th {
    background: #eff4fb;
}

@media (max-width: 900px) {
    .topbar-inner {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .topnav {
        justify-self: start;
    }

    .topbar-user {
        justify-self: start;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .container {
        margin: 12px 8px 22px;
        padding: 16px;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }
}
