:root {
    color-scheme: light;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: #1b1b1b;
    background-color: #f7f5f0;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, #f9f7f2 0%, #e7e4dd 100%);
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: #004e7c;
    text-decoration: none;
    font-weight: 700;
}

a:hover,
a:focus {
    text-decoration: underline;
}

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

.app-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.app-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem 1.5rem 1.25rem;
    background: #005a9c;
    color: #ffffff;
    border-radius: 1.25rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

.app-header-title {
    font-size: 2.4rem;
    font-weight: 800;
}

.app-header-subtitle {
    font-size: 1.2rem;
    opacity: 0.92;
}

.app-header-actions {
    margin-top: 1rem;
}

.header-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.25rem;
    border-radius: 1rem;
    background: #fde047;
    color: #1f2937;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.header-action-button:hover,
.header-action-button:focus {
    background: #facc15;
}

.app-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card,
section,
article,
form {
    background: #ffffff;
    border: 1px solid #dcd7ce;
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: 0 10px 20px rgba(36, 40, 46, 0.06);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: #1b1b1b;
    margin-top: 0;
    margin-bottom: 0.85rem;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2.4rem;
}

h2 {
    font-size: 1.9rem;
}

p,
label,
span,
button,
input,
select,
textarea,
th,
td {
    font-size: 1.05rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 3.2rem;
    padding: 0.95rem 1rem;
    margin-top: 0.3rem;
    margin-bottom: 1rem;
    border: 1.8px solid #9ca3af;
    border-radius: 0.9rem;
    background: #fff;
    color: #1b1b1b;
}

input:focus,
select:focus,
textarea:focus,
button:focus,
a:focus {
    outline: 3px solid #4f87c2;
    outline-offset: 3px;
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 3.3rem;
    padding: 1rem 1.4rem;
    border: none;
    border-radius: 1rem;
    background: #005a9c;
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
    font-weight: 700;
}

button:hover,
button:focus {
    background: #00477a;
    transform: translateY(-1px);
}

button.secondary,
.btn-secondary,
button[type="button"] {
    background: #4b5563;
}

button.secondary:hover,
.btn-secondary:hover {
    background: #3d4552;
}

button.danger,
.btn-danger {
    background: #b91c1c;
}

button.danger:hover,
.btn-danger:hover {
    background: #991414;
}

.flash-message {
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 8px 16px rgba(16, 24, 40, 0.05);
}

.flash-success {
    background: #d1fae5;
    color: #0f5132;
    border-left: 0.6rem solid #10b981;
}

.flash-error {
    background: #fee2e2;
    color: #7f1d1d;
    border-left: 0.6rem solid #ef4444;
}

.flash-info {
    background: #e0f2fe;
    color: #0c4a6e;
    border-left: 0.6rem solid #0284c7;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

thead th,
tbody td {
    border: 1px solid #d1d5db;
    padding: 1rem;
    text-align: left;
}

th {
    background: #f3f4f6;
}

tr:nth-child(even) {
    background: #fafafa;
}

small {
    font-size: 0.95rem;
}

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

@media (max-width: 900px) {
    .app-shell {
        padding: 1rem;
    }

    .app-header {
        padding: 1.25rem 1rem;
    }

    h1 {
        font-size: 2rem;
    }
}

.autocomplete-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    z-index: 999;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.85rem;
    box-shadow: 0 10px 30px rgba(16, 24, 40, 0.1);
    max-height: 18rem;
    overflow-y: auto;
}

.autocomplete-dropdown button,
.autocomplete-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.9rem 1rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    color: #111827;
    cursor: pointer;
    font-size: 1rem;
}

.autocomplete-dropdown button:last-child,
.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-dropdown button:hover,
.autocomplete-dropdown button:focus,
.autocomplete-item:hover,
.autocomplete-item:focus {
    background: #eef2ff;
    outline: none;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-notice {
    padding: 1rem;
    color: #4b5563;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

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

.page-panel {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.wide-panel {
    max-width: 100%;
}

@media (max-width: 1100px) {
    .page-panel {
        padding: 1.5rem;
    }
}

@media (max-width: 900px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}
