* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    color: #222;
    background: #f4f4f2;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #2f3b52;
    color: #fff;
}

.topbar-title { font-weight: 600; font-size: 15px; }
.topbar-user { font-size: 15px; }
.topbar-user a { color: #cfe0ff; }

.topnav { display: flex; gap: 4px; }
.topnav a {
    color: #cfe0ff;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 3px;
    font-size: 15px;
}
.topnav a:hover { background: rgba(255,255,255,0.1); }
.topnav a.active { background: rgba(255,255,255,0.18); color: #fff; font-weight: 600; }

.content-full { padding: 16px; }

.layout { display: flex; min-height: calc(100vh - 44px); }

.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #ddd;
    padding: 16px;
    position: sticky;
    top: 0;
    align-self: flex-start;
    max-height: 100vh;
    overflow-y: auto;
}

.passenger-counter {
    background: #eef2fb;
    border: 1px solid #d3ddf5;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 14px;
}
.passenger-counter label { display: block; font-size: 12px; color: #555; margin-bottom: 4px; }
.passenger-counter form input[type="date"] {
    width: 100%;
    padding: 5px 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
    margin-bottom: 6px;
}
.passenger-counter-value { font-size: 24px; font-weight: 700; color: #2f3b52; }

.filters { display: flex; flex-direction: column; gap: 4px; }
.filters label { font-size: 14px; color: #666; margin-top: 8px; }
.filters input, .filters select {
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 15px;
}
.filters button {
    margin-top: 14px;
    padding: 7px 10px;
    border: 1px solid #2f3b52;
    background: #2f3b52;
    color: #fff;
    border-radius: 3px;
    cursor: pointer;
}
.filters button:hover { background: #3d4c6b; }

.content { flex: 1; padding: 16px; overflow-x: auto; }

.table-wrap { background: #fff; border: 1px solid #ddd; border-radius: 4px; overflow: hidden; }

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

.flights-table th {
    text-align: left;
    background: #eef0f4;
    padding: 8px 10px;
    font-weight: 600;
    font-size: 14px;
    color: #444;
    border-bottom: 1px solid #ddd;
}

.flights-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #eee;
}

.flights-table td.num { text-align: center; }

.flights-table tr.row-full { background: #dcf3df; }
.flights-table tr:hover { background: #f1f6ff; }
.flights-table tr.row-full:hover { background: #cdeed3; }
.flights-table tr.row-overfull { background: #ffe4b3; }
.flights-table tr.row-overfull:hover { background: #ffd68a; }
.flights-table tr.row-cancelled { background: #fbe3e1; color: #7a2a24; }
.flights-table tr.row-cancelled:hover { background: #f6d2ce; }
.flights-table tr.row-review { background: #fff3cd; color: #6b5000; }
.flights-table tr.row-review:hover { background: #ffe9a8; }
.status-badge.status-review { background: #ffe08a; color: #6b5000; margin-left: 4px; cursor: help; }

.status-badge { font-size: 14px; padding: 2px 8px; border-radius: 10px; background: #eee; }
.status-badge.status-open { background: #dde8ff; color: #1d3f8f; }
.status-badge.status-completed { background: #e2e2e2; color: #444; }
.status-badge.status-notified { background: #dbf3dd; color: #1d6b2f; }
.status-badge.status-paid { background: #dbf3dd; color: #1d6b2f; }
.status-badge.status-unpaid { background: #ffe4b3; color: #7a4d00; }

.row-passenger-cancelled { opacity: 0.55; text-decoration: line-through; }
.row-passenger-cancelled .link-btn { text-decoration: none; opacity: 1; }

.meta-line { font-size: 14px; color: #888; margin: -8px 0 14px; }
.status-badge.status-cancelled { background: #f5c6c1; color: #7a2a24; }

.actions-cell { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.inline-form { display: inline; margin: 0; }
.link-btn-danger { color: #b3261e; }

.status-checks { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.quick-days { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.quick-day-btn {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 12px;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    background: #fff;
}
.quick-day-btn:hover { background: #eef2fb; border-color: #2f5db3; }

.blacklist-form { display: inline-flex; gap: 6px; align-items: center; }
.blacklist-reason-input {
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
    width: 140px;
}

.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 15px; color: #333; }
.checkbox-label input { width: auto; }

.empty { text-align: center; color: #999; padding: 24px; }

.toolbar { margin-bottom: 10px; }

.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 15px;
    cursor: pointer;
}
.btn-primary {
    background: #2f3b52;
    color: #fff;
    border: 1px solid #2f3b52;
}
.btn-primary:hover { background: #3d4c6b; }
.btn-secondary {
    background: #fff;
    color: #333;
    border: 1px solid #ccc;
    margin-left: 8px;
}

.form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }

.modal-box-wide .flight-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}
.modal-box-wide .flight-form .modal-title,
.modal-box-wide .flight-form .meta-line,
.modal-box-wide .flight-form .checkbox-label,
.modal-box-wide .flight-form .form-actions {
    grid-column: 1 / -1;
}
.form-row label { font-size: 14px; color: #666; }
.form-row .form-control {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 15px;
}
.form-actions { margin-top: 16px; }
.form-actions button {
    padding: 9px 16px;
    background: #2f3b52;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}
.form-row .error { color: #b3261e; font-size: 14px; margin: 0; }

.link-btn {
    background: none;
    border: none;
    padding: 0;
    color: #2f5db3;
    text-decoration: underline;
    cursor: pointer;
    font-size: 15px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 24, 33, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal-overlay[hidden] { display: none; }

.modal-box {
    background: #fff;
    border-radius: 6px;
    padding: 20px 24px;
    width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.modal-box.modal-box-wide { width: 960px; max-width: 92vw; }

.modal-title { font-size: 16px; margin: 0 0 14px; font-weight: 600; }

.modal-subtitle { font-size: 14px; margin: 0 0 10px; font-weight: 600; }

.passengers-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid #eee; }

.passengers-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 12px; }
.passengers-table th { text-align: left; color: #666; padding: 4px 6px; border-bottom: 1px solid #eee; }
.passengers-table td { padding: 5px 6px; border-bottom: 1px solid #f2f2f2; }

.empty-inline { font-size: 15px; color: #999; margin: 0 0 12px; }

.passenger-add-form { background: #f7f8fa; border-radius: 4px; padding: 10px 12px; }
.passenger-add-form .btn-secondary { margin-top: 4px; }

.row-editing td { background: #f7f8fa; padding: 10px; }
.booking-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-bottom: 10px; }
.booking-edit-form .form-actions,
.booking-edit-form button { margin-top: 4px; }
.booking-edit-form .link-btn { margin-left: 8px; }

.phone-autocomplete { position: relative; }
.phone-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    max-height: 160px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.suggestion-item { padding: 6px 8px; font-size: 14px; cursor: pointer; }
.suggestion-item:hover { background: #eef2fb; }

.search-form { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 16px; }
.search-form label { font-size: 14px; color: #666; display: block; margin-bottom: 4px; }
.search-form input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    width: 260px;
}
.search-form button {
    padding: 8px 16px;
    background: #2f3b52;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.metric-cards { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.metric-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px 16px;
    min-width: 160px;
}
.metric-label { display: block; font-size: 14px; color: #666; margin-bottom: 4px; }
.metric-value { display: block; font-size: 20px; font-weight: 600; }

.section-title { font-size: 14px; font-weight: 600; margin: 20px 0 8px; }

.log-note { font-size: 14px; color: #999; margin-top: 8px; }

.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 280px;
    background: #fff;
    padding: 24px;
    border: 1px solid #ddd;
    border-radius: 6px;
}
.login-form h1 { font-size: 18px; margin: 0 0 12px; }
.login-form label { font-size: 14px; color: #666; margin-top: 6px; }
.login-form input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
}
.login-form button {
    margin-top: 14px;
    padding: 9px;
    background: #2f3b52;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}
.login-form .error { color: #b3261e; font-size: 15px; }
