/* Reset and basic layout */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f4f7fa;
    color: #2a2a2a;
}

.container {
    width: min(1100px, 96%);
    margin: 2rem auto;
}

/* Header */
.site-header {
    background: linear-gradient(90deg, #2a94ff, #65d2ff);
    color: white;
    padding: 1rem 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand a {
    font-weight: 700;
    font-size: 1.3rem;
    text-decoration: none;
    color: white;
}

.nav a {
    color: white;
    text-decoration: none;
    margin-left: 1rem;
}

/* Buttons */
button,
input[type="submit"],
.button {
    cursor: pointer;
    border: none;
    padding: 0.65rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    background: #2a94ff;
    color: white;
    transition: background 0.2s ease-in-out;
}

button:hover,
input[type="submit"]:hover,
.button:hover {
    background: #1a6ed1;
}

/* Flash messages */
.flash {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.flash-success {
    background: #d5f8d9;
    border: 1px solid #8adf9a;
}

.flash-error {
    background: #ffd4d4;
    border: 1px solid #f18b8b;
}

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.card h2 {
    margin-top: 0;
}

/* Forms */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row label {
    flex: 1 1 200px;
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    gap: 0.4rem;
}

input,
select,
textarea {
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #c2cbd6;
    font-size: 1rem;
    width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #2a94ff;
    box-shadow: 0 0 0 2px rgba(42, 148, 255, 0.25);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th,
td {
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(56, 64, 69, 0.12);
    text-align: left;
}

thead {
    background: rgba(42, 148, 255, 0.12);
}

td.right {
    text-align: right;
}

/* Small text */
small {
    color: #666;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal__content {
    position: relative;
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    width: min(600px, 90%);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.modal__close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(0,0,0,0.1);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 720px) {
    .form-row {
        flex-direction: column;
    }

    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}