:root {
    --color-background: #f4f6fb;
    --color-surface: #ffffff;
    --color-primary: #4460f7;
    --color-primary-dark: #2f3fd3;
    --color-accent: #ff9f43;
    --color-text: #1f2532;
    --color-muted: #6b7285;
    --color-border: #d7dce8;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 8px;
    --shadow-soft: 0 25px 50px -20px rgba(31, 37, 50, 0.35);
    --shadow-card: 0 18px 35px -22px rgba(31, 37, 50, 0.4);
    --transition-base: 180ms ease;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--color-text);
    background: linear-gradient(160deg, #eef1ff 0%, #f8f9ff 50%, #eef5ff 100%);
    min-height: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover,
a:focus-visible {
    color: var(--color-primary);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(18px);
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid rgba(215, 220, 232, 0.6);
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
    gap: 1.5rem;
}

.brand {
    font-weight: 700;
    letter-spacing: -0.01em;
    font-size: 1.05rem;
    color: var(--color-primary);
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: var(--radius-sm);
    background: rgba(68, 96, 247, 0.08);
    padding: 10px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: var(--color-primary);
    transition: var(--transition-base);
}

.nav-toggle.is-open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex: 1;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--color-muted);
    font-weight: 500;
    transition: var(--transition-base);
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.active {
    color: var(--color-primary);
    background: rgba(68, 96, 247, 0.12);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-base);
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 10px 30px -15px rgba(68, 96, 247, 0.9);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

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

.btn-outline:hover,
.btn-outline:focus-visible {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-link,
.table-actions .btn-link {
    background: none;
    border: none;
    color: var(--color-primary);
    padding: 0;
    font-weight: 500;
    cursor: pointer;
}

.btn-link:hover,
.btn-link:focus-visible {
    text-decoration: underline;
}

.btn.btn-link {
    padding: 0;
}

.btn.btn-outline {
    padding-inline: 1.1rem;
}

.btn.btn-primary:focus-visible,
.btn.btn-outline:focus-visible,
.btn.btn-link:focus-visible {
    outline: 2px solid rgba(68, 96, 247, 0.45);
    outline-offset: 3px;
}

.lead {
    color: var(--color-muted);
    margin-top: 0.5rem;
}

.eyebrow {
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
}

.hero {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3rem;
    align-items: center;
    max-width: 1100px;
    margin: 2.5rem auto;
    padding: 3.5rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(130deg, rgba(68, 96, 247, 0.15), rgba(255, 255, 255, 0.9));
    box-shadow: var(--shadow-soft);
}

.hero h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-content .lead {
    font-size: 1rem;
    max-width: 32rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.8rem;
    flex-wrap: wrap;
}

.action-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.hero-visual {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero-card {
    display: grid;
    gap: 0.6rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 1.8rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-card);
}

.hero-highlight {
    background: rgba(255, 255, 255, 0.75);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    color: var(--color-muted);
    font-size: 0.95rem;
}

.feature-grid {
    max-width: 1100px;
    margin: 2.5rem auto 4rem;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.feature-card {
    padding: 1.6rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-card);
}

.feature-card h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.page-header,
.dashboard-header {
    max-width: 1100px;
    margin: 2.5rem auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.dashboard-header {
    flex-direction: column;
    align-items: flex-start;
}

.stats-grid {
    max-width: 1100px;
    margin: 0 auto 2rem;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.stats-grid.compact {
    margin-top: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.92);
    border-radius: var(--radius-md);
    padding: 1.4rem;
    box-shadow: var(--shadow-card);
}

.stat-label {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.4rem 0;
}

.stat-caption {
    color: var(--color-muted);
    margin: 0;
}

.visual-grid {
    max-width: 1100px;
    margin: 0 auto 2.5rem;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.visual-grid.compact {
    margin-top: 1.5rem;
}

.chart-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 320px;
    border: 1px solid rgba(215, 220, 232, 0.6);
}

.chart-card-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.chart-card-header p {
    margin: 0.35rem 0 0;
    color: var(--color-muted);
}

.chart-wrapper {
    position: relative;
    flex: 1;
    min-height: 240px;
}

.chart-empty {
    margin: auto 0;
    color: var(--color-muted);
}

.filter-card,
.content-card,
.auth-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-md);
    max-width: 1100px;
    margin: 0 auto 2rem;
    box-shadow: var(--shadow-card);
    padding: 1.75rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
}

.filter-card input.has-value,
.filter-card select.has-value {
    border-color: var(--color-primary);
}

.form-grid {
    display: grid;
    gap: 1.25rem;
}

.form-grid.two-columns {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.form-grid.three-columns {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-weight: 600;
    color: var(--color-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.75rem;
    background: rgba(249, 251, 255, 0.9);
    transition: var(--transition-base);
}

.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(68, 96, 247, 0.15);
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group textarea {
    resize: vertical;
}

.form-divider {
    margin: 2rem auto 1.25rem;
    text-align: center;
    position: relative;
    color: var(--color-muted);
}

.form-divider::before {
    content: '';
    position: absolute;
    inset: 50% 0 auto;
    border-top: 1px solid var(--color-border);
    z-index: -1;
}

.form-divider span {
    background: rgba(255, 255, 255, 0.95);
    padding: 0 1rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
}

.form-check {
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.validation-summary {
    background: rgba(244, 67, 54, 0.08);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(244, 67, 54, 0.2);
    color: #b91c1c;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.text-danger {
    color: #c62828;
    font-size: 0.85rem;
}

.table-responsive {
    max-width: 1100px;
    margin: 0 auto 3rem;
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

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

.data-table th,
.data-table td {
    padding: 1rem 1.25rem;
    text-align: left;
}

.data-table thead th {
    color: var(--color-muted);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(215, 220, 232, 0.7);
}

.data-table tbody tr + tr {
    border-top: 1px solid rgba(215, 220, 232, 0.5);
}

.table-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.inline-form {
    display: inline;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-applied {
    background: rgba(68, 96, 247, 0.12);
    color: var(--color-primary);
}

.status-interview {
    background: rgba(0, 184, 148, 0.16);
    color: #009f84;
}

.status-offer {
    background: rgba(255, 159, 67, 0.18);
    color: #d97706;
}

.status-rejected {
    background: rgba(244, 67, 54, 0.16);
    color: #c62828;
}

.empty-state {
    max-width: 1100px;
    margin: 2.5rem auto 4rem;
    padding: 2.5rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-card);
    text-align: center;
}

.empty-state p {
    margin-bottom: 1rem;
    font-weight: 600;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.section-header h2,
.section-header h1 {
    margin: 0;
}

.link {
    color: var(--color-primary);
    font-weight: 600;
}

.link:hover,
.link:focus-visible {
    text-decoration: underline;
}

.recent-applications .data-table td:last-child {
    text-align: right;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.detail-card {
    background: rgba(249, 251, 255, 0.9);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.detail-card h2 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.detail-card dl {
    margin: 0;
    display: grid;
    gap: 0.8rem;
}

.detail-card dt {
    font-weight: 600;
    color: var(--color-muted);
    font-size: 0.9rem;
}

.detail-card dd {
    margin: 0.2rem 0 0;
    font-weight: 500;
}

.muted {
    color: var(--color-muted);
}

.auth-container {
    display: flex;
    justify-content: center;
    padding: 4rem 1.5rem;
}

.auth-card {
    max-width: 460px;
    width: 100%;
}

.auth-card h1 {
    margin-top: 0;
}

.auth-switch {
    margin-top: 2rem;
    text-align: center;
    color: var(--color-muted);
}

.flash-container {
    position: fixed;
    inset: 1rem auto auto 50%;
    transform: translateX(-50%);
    z-index: 120;
}

.flash-message {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    padding: 0.75rem 1.15rem;
    box-shadow: var(--shadow-soft);
    min-width: 280px;
    transition: opacity var(--transition-base), transform var(--transition-base);
}

.flash-message.success {
    border-color: rgba(68, 96, 247, 0.35);
}

.flash-message.error {
    border-color: rgba(244, 67, 54, 0.25);
}

.flash-message.is-hidden {
    opacity: 0;
    transform: translateY(-12px);
}

.flash-close {
    border: none;
    background: transparent;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-muted);
}

.site-main {
    padding: 0 1.5rem 4rem;
}

.site-footer {
    margin-top: auto;
    padding: 2rem 1.5rem 3rem;
    background: transparent;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--color-muted);
}

.footer-links {
    display: flex;
    gap: 1.25rem;
}

@media (max-width: 920px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 2.5rem;
    }

    .hero-visual {
        order: -1;
    }

    .page-header,
    .stats-grid,
    .filter-card,
    .content-card,
    .table-responsive,
    .feature-grid,
    .visual-grid,
    .dashboard-header {
        margin-left: 0.75rem;
        margin-right: 0.75rem;
    }

    .site-main {
        padding-inline: 0.75rem;
    }
}

@media (max-width: 760px) {
    .main-nav {
        flex-wrap: wrap;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-menu {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
        margin-top: 1rem;
        display: none;
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
    }

    .nav-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .nav-actions form {
        width: 100%;
    }

    .nav-actions .btn,
    .nav-actions .btn-link {
        width: 100%;
        justify-content: center;
    }

    .hero {
        padding: 2rem;
    }

    .flash-container {
        inset: auto 0 1rem 0;
        transform: none;
        display: flex;
        justify-content: center;
    }

    .flash-message {
        width: calc(100% - 1.5rem);
    }

    .chart-card {
        min-height: 280px;
        padding: 1.5rem;
    }
}

@media (max-width: 540px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .form-actions .btn,
    .form-actions .btn-outline {
        width: 100%;
    }

    .chart-wrapper {
        min-height: 200px;
    }
}
