/* =========================
   RESET / BASE
========================= */
:root {
    color-scheme: light;
}

html,
body {
    background: #f4f7fb;
    color: #172033;
}
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family: Arial, Helvetica, sans-serif;
    background: #f4f7fb;
    color: #172033;
}

a {
    color: inherit;
}

main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 56px;
}

h1 {
    margin: 0 0 28px;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.1;
    color: #172033;
}

h2 {
    margin: 36px 0 18px;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    color: #172033;
}

p {
    font-size: 1.1rem;
    line-height: 1.5;
}

/* =========================
   NAVBAR
========================= */

.site-header {
    width: 100%;
    padding: 18px 24px;
    background: #eef4ff;
    border-bottom: 1px solid #d8e3f5;
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-nav {
    max-width: 1240px;
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    padding: 12px;
    border-radius: 28px;

    background: #ffffff;
    border: 1px solid #d8e3f5;
    box-shadow: 0 12px 30px rgba(23, 32, 51, 0.08);
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 54px;
    padding: 0 22px;
    border-radius: 20px;

    background: #1d4ed8;
    color: #ffffff;

    font-size: 1.15rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.nav-brand span {
    color: #dbeafe;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;

    padding: 6px;
    border-radius: 24px;
    background: #f1f5fb;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 54px;
    padding: 0 20px;
    border-radius: 18px;

    color: #26364f;
    background: transparent;

    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;

    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.nav-links a:hover {
    background: #ffffff;
    color: #1d4ed8;
}

.nav-links a.active {
    background: #1d4ed8;
    color: #ffffff;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.user-badge {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;

    display: inline-flex;
    align-items: center;

    min-height: 54px;
    padding: 0 18px;
    border-radius: 18px;

    color: #26364f;
    background: #f1f5fb;
    border: 1px solid #d8e3f5;

    font-size: 1rem;
    font-weight: 600;
}

.logout-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 54px;
    padding: 0 20px;
    border-radius: 18px;

    color: #ffffff;
    background: #ef4444;

    font-size: 1.05rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.logout-link:hover {
    background: #dc2626;
}

/* =========================
   HOME
========================= */

.home-title {
    margin-top: 18px;
    margin-bottom: 32px;
    text-align: center;
}

.home-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 24px;
}

.home-buttons a {
    min-height: 150px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 28px;
    border-radius: 28px;

    background: #1d4ed8;
    color: #ffffff;

    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    text-decoration: none;
    text-align: center;

    box-shadow: 0 14px 30px rgba(29, 78, 216, 0.22);
    transition: transform 0.15s ease, background 0.15s ease;
}

.home-buttons a:hover {
    background: #1e40af;
    transform: translateY(-2px);
}

/* =========================
   LINKS / BACK
========================= */

.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 50px;
    margin-bottom: 28px;
    padding: 0 18px;
    border-radius: 16px;

    background: #ffffff;
    color: #1d4ed8;
    border: 1px solid #d8e3f5;

    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
}

.back-link:hover {
    background: #eef4ff;
}

/* =========================
   FORMS
========================= */

form {
    width: 100%;
}

label {
    display: block;
    margin-bottom: 8px;

    color: #26364f;
    font-size: 1rem;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 56px;

    padding: 0 16px;
    border-radius: 16px;
    border: 1px solid #c9d7ec;

    background: #ffffff;
    color: #172033;

    font-size: 1.1rem;
    font-weight: 600;
}

textarea {
    min-height: 120px;
    padding-top: 14px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(29, 78, 216, 0.18);
    border-color: #1d4ed8;
}

button,
.button,
.reset-button {
    min-height: 58px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 24px;
    border-radius: 18px;
    border: none;

    background: #1d4ed8;
    color: #ffffff;

    font-size: 1.1rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button:hover {
    background: #1e40af;
}

.reset-button {
    background: #ffffff;
    color: #1d4ed8;
    border: 1px solid #c9d7ec;
}

.reset-button:hover {
    background: #eef4ff;
}

/* =========================
   FILTER FORM
========================= */

.filter-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 18px;
    align-items: end;

    margin-bottom: 32px;
    padding: 22px;
    border-radius: 28px;

    background: #ffffff;
    border: 1px solid #d8e3f5;
    box-shadow: 0 10px 26px rgba(23, 32, 51, 0.06);
}

.filter-group {
    min-width: 0;
}

.filter-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* =========================
   FORM PAGES / CARDS
========================= */

.form-card,
section:not(.home-buttons) {
    margin-bottom: 28px;
    padding: 24px;
    border-radius: 28px;

    background: #ffffff;
    border: 1px solid #d8e3f5;
    box-shadow: 0 10px 26px rgba(23, 32, 51, 0.06);
}

/* =========================
   TABLES
========================= */

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;

    margin-bottom: 36px;
    overflow: hidden;

    background: #ffffff;
    border: 1px solid #d8e3f5;
    border-radius: 24px;
    box-shadow: 0 10px 26px rgba(23, 32, 51, 0.06);
}

thead {
    background: #eaf1ff;
}

th,
td {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;

    text-align: left;
    vertical-align: middle;

    font-size: 1rem;
}

th {
    color: #26364f;
    font-weight: 900;
}

td {
    color: #172033;
    font-weight: 600;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: #f8fbff;
}

/* Inputs inside tables */
td input,
td select {
    min-height: 52px;
    font-size: 1rem;
}

/* Action small buttons in tables */
td button,
td .remove-row {
    min-height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    font-size: 1rem;
}

/* =========================
   MESSAGES
========================= */

.success-message {
    padding: 16px 18px;
    margin-bottom: 22px;
    border-radius: 18px;

    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;

    font-size: 1.05rem;
    font-weight: 800;
}

.error-message,
.error {
    padding: 16px 18px;
    margin-bottom: 22px;
    border-radius: 18px;

    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;

    font-size: 1.05rem;
    font-weight: 800;
}

/* =========================
   RESPONSIVE TABLET
========================= */

@media (max-width: 1050px) {
    .site-nav {
        align-items: stretch;
        border-radius: 28px;
        flex-direction: column;
    }

    .nav-brand {
        width: 100%;
    }

    .nav-links {
        width: 100%;
    }

    .nav-links a {
        flex: 1 1 180px;
    }

    .nav-user {
        justify-content: center;
        flex-wrap: wrap;
    }

    .filter-form {
        grid-template-columns: 1fr 1fr;
    }

    .filter-actions {
        grid-column: 1 / -1;
    }
}

/* =========================
   RESPONSIVE MOBILE
========================= */

@media (max-width: 680px) {
    main {
        width: min(100% - 20px, 1180px);
        padding-top: 22px;
    }

    .site-header {
        padding: 10px;
    }

    .site-nav {
        padding: 10px;
    }

    .nav-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .nav-links a {
        min-height: 52px;
        padding: 0 10px;
        font-size: 0.95rem;
    }

    .nav-user {
        flex-direction: column;
        align-items: stretch;
    }

    .user-badge,
    .logout-link {
        justify-content: center;
        width: 100%;
    }

    .home-buttons {
        grid-template-columns: 1fr;
    }

    .home-buttons a {
        min-height: 120px;
        font-size: 1.5rem;
    }

    .filter-form {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    th,
    td {
        padding: 14px;
    }
}/* =========================
   FORCE LIGHT THEME
========================= */

:root {
    color-scheme: light !important;
}

html,
body {
    background: #f4f7fb !important;
    color: #172033 !important;
}

main {
    background: transparent !important;
}

.site-header {
    background: #eef4ff !important;
    border-bottom: 1px solid #d8e3f5 !important;
}

.site-nav,
.form-card,
section:not(.home-buttons),
table,
.filter-form {
    background: #ffffff !important;
    color: #172033 !important;
}

input,
select,
textarea {
    background: #ffffff !important;
    color: #172033 !important;
    border-color: #c9d7ec !important;
    color-scheme: light !important;
}

th {
    background: #eaf1ff !important;
    color: #26364f !important;
}

td {
    background: #ffffff !important;
    color: #172033 !important;
}

h1,
h2,
h3,
label,
p {
    color: #172033 !important;
}
/* =========================
   LOGIN PAGE
========================= */

.login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(29, 78, 216, 0.18), transparent 34%),
        linear-gradient(135deg, #eef4ff 0%, #f8fafc 45%, #eaf1ff 100%);
}

.login-page {
    min-height: 100vh;
    width: min(100% - 32px, 1180px);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 40px 0;
}

.login-card {
    width: min(100%, 480px);

    padding: 34px;
    border-radius: 32px;

    background: #ffffff;
    border: 1px solid #d8e3f5;
    box-shadow: 0 24px 70px rgba(23, 32, 51, 0.14);
}

.login-header {
    margin-bottom: 28px;
    text-align: center;
}

.login-logo {
    width: fit-content;
    min-height: 58px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 22px;
    padding: 0 24px;
    border-radius: 22px;

    background: #1d4ed8;
    color: #ffffff;

    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.login-logo span {
    color: #dbeafe;
}

.login-header h1 {
    margin: 0 0 10px;
    font-size: clamp(2rem, 4vw, 2.8rem);
    text-align: center;
}

.login-header p {
    margin: 0;
    color: #64748b;
    font-size: 1.1rem;
    font-weight: 600;
}

.login-form {
    display: grid;
    gap: 20px;
}

.form-group {
    display: grid;
    gap: 8px;
}

.login-button {
    width: 100%;
    min-height: 64px;
    margin-top: 6px;

    border-radius: 20px;

    font-size: 1.2rem;
}

@media (max-width: 560px) {
    .login-card {
        padding: 24px;
        border-radius: 26px;
    }

    .login-page {
        width: min(100% - 20px, 1180px);
        padding: 24px 0;
    }
}