* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f0f2f5;
    color: #1a1a1a;
    line-height: 1.5;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card-narrow {
    max-width: 400px;
    margin: 4rem auto 0;
}

h1 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
}

.subtitle {
    margin: 0 0 1.5rem;
    color: #666;
    font-size: 0.9rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

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

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

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

label {
    font-weight: 500;
    font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="search"],
select {
    padding: 0.6rem 0.75rem;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font-size: 1rem;
    width: 100%;
}

input:focus,
select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn {
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-link {
    background: none;
    border: none;
    color: #2563eb;
    padding: 0;
    font-size: 0.85rem;
    cursor: pointer;
}

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

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.hidden {
    display: none;
}

.stations-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.stations-list {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    padding: 0.5rem;
}

.station-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
}

.station-item:hover {
    background: #f9fafb;
}

.station-item input {
    flex-shrink: 0;
}

.station-item label {
    font-weight: 400;
    cursor: pointer;
    flex: 1;
}

.loading {
    color: #666;
    text-align: center;
    padding: 1rem;
}

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

    .page-header {
        flex-direction: column;
    }
}
