:root {
    --navy: #0b2f4a;
    --navy-dark: #071f32;
    --teal: #0d7d7d;
    --teal-light: #12a3a3;
    --sand: #f5f1e8;
    --white: #ffffff;
    --red: #c0392b;
    --green: #1e8449;
    --amber: #b9770e;
    --gray: #6b7785;
    --border: #d9dee3;
    --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--sand);
    color: var(--navy-dark);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 20px;
}

.topbar {
    background: var(--navy);
    color: var(--white);
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    color: var(--white);
    text-decoration: none;
    font-size: 22px;
    font-weight: 700;
}

.topbar-link {
    color: var(--white);
    text-decoration: none;
    margin-left: 20px;
    font-size: 16px;
    opacity: 0.85;
}
.topbar-link:hover { opacity: 1; }

.topbar-user {
    margin-left: auto;
    margin-right: 4px;
    color: var(--white);
    opacity: 0.7;
    font-size: 14px;
}

.page {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px 80px;
}

.home-center {
    min-height: calc(100vh - 220px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
}
.home-center .page-title,
.home-center .page-subtitle {
    text-align: center;
}
.home-center .tile-grid {
    width: 100%;
}

.page-title {
    font-size: 34px;
    margin: 8px 0 4px;
    color: var(--navy);
}

.page-subtitle {
    font-size: 18px;
    color: var(--gray);
    margin: 0 0 28px;
}

.back-link {
    display: inline-block;
    color: var(--teal);
    text-decoration: none;
    font-size: 18px;
    margin-bottom: 12px;
}

/* Kiosk home tiles */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.tile {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px 24px;
    text-align: center;
    text-decoration: none;
    color: var(--navy-dark);
    box-shadow: 0 3px 10px rgba(11,47,74,0.10);
    border: 2px solid transparent;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.tile:active { transform: scale(0.97); }

.tile-icon { font-size: 52px; }
.tile-label { font-size: 22px; font-weight: 700; }
.tile-sub { font-size: 15px; color: var(--gray); }

.tile-departure:hover { border-color: var(--teal); }
.tile-return:hover { border-color: var(--green); }
.tile-school:hover { border-color: var(--amber); }

.admin-link-wrap {
    text-align: center;
    margin-top: 48px;
}
.admin-link {
    color: var(--gray);
    font-size: 15px;
    text-decoration: underline;
}

/* Forms */
.kiosk-form {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: 0 3px 10px rgba(11,47,74,0.08);
}
.kiosk-form-narrow { max-width: 420px; }

.form-group {
    margin-bottom: 22px;
    flex: 1;
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 17px;
}

.req { color: var(--red); }

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="datetime-local"],
select {
    width: 100%;
    padding: 16px 14px;
    font-size: 19px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    color: var(--navy-dark);
}
input:focus {
    outline: none;
    border-color: var(--teal);
}

.btn {
    display: inline-block;
    border: none;
    border-radius: 10px;
    padding: 16px 28px;
    font-size: 19px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}
.btn-primary { background: var(--teal); color: var(--white); }
.btn-primary:active { background: var(--teal-light); }
.btn-secondary { background: var(--navy); color: var(--white); font-size: 15px; padding: 10px 18px; }
.btn-large { width: 100%; padding: 20px; font-size: 21px; margin-top: 8px; }

/* Toggle switch */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 14px;
}
.switch {
    position: relative;
    display: inline-block;
    width: 58px;
    height: 32px;
    flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: 0.2s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 24px; width: 24px;
    left: 4px; bottom: 4px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
}
input:checked + .slider { background-color: var(--teal); }
input:checked + .slider:before { transform: translateX(26px); }
#toggle-label { font-weight: 600; font-size: 17px; }

/* Success panel */
.success-panel {
    text-align: center;
    background: var(--white);
    border-radius: var(--radius);
    padding: 60px 30px;
    box-shadow: 0 3px 10px rgba(11,47,74,0.08);
}
.success-icon { font-size: 64px; display: block; margin-bottom: 12px; }

/* Boat list (return check-in) */
.boat-list { display: flex; flex-direction: column; gap: 16px; }
.boat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: 0 3px 10px rgba(11,47,74,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.boat-card-name { font-size: 21px; font-weight: 700; }
.boat-card-detail { font-size: 15px; color: var(--gray); margin-top: 2px; }
.muted { color: var(--gray); font-weight: 400; }

.empty-state {
    text-align: center;
    color: var(--gray);
    font-size: 18px;
    padding: 40px 0;
}

/* Flash messages */
.flash-wrap { margin-bottom: 20px; }
.flash {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-size: 16px;
}
.flash-error { background: #fdecea; color: var(--red); border: 1px solid #f5c6cb; }
.flash-success { background: #eafaf1; color: var(--green); border: 1px solid #b7e4c7; }

/* Admin dashboard */
.dash-section { margin-bottom: 40px; }
.dash-section h2 { color: var(--navy); font-size: 22px; }
.dash-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.table-wrap { overflow-x: auto; background: var(--white); border-radius: var(--radius); box-shadow: 0 3px 10px rgba(11,47,74,0.08); }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.data-table th, .data-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table th { background: var(--navy); color: var(--white); font-weight: 600; }
.row-overdue { background: #fdecea; }

/* Below this width, tables stack into cards instead of scrolling
   sideways - one card per row, label + value per line. */
@media (max-width: 900px) {
    .table-wrap { overflow-x: visible; box-shadow: none; background: transparent; }
    .data-table thead { display: none; }
    .data-table, .data-table tbody, .data-table tr, .data-table td {
        display: block;
        width: 100%;
    }
    .data-table tr {
        margin-bottom: 14px;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 4px 0;
        background: var(--white);
        box-shadow: 0 3px 10px rgba(11,47,74,0.08);
    }
    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 10px 14px;
        border-bottom: 1px solid var(--border);
        white-space: normal;
        text-align: right;
    }
    .data-table tr td:last-child { border-bottom: none; }
    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--navy);
        text-align: left;
        margin-right: 10px;
        flex-shrink: 0;
    }
    .row-overdue { background: transparent; }
    .row-overdue td { background: #fdecea; }
    .data-table td[data-label="Actions"] {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px;
    }
    .data-table td[data-label="Actions"]::before {
        width: 100%;
        margin-bottom: 4px;
    }
}

.badge { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-overdue { background: var(--red); color: white; }
.badge-ok { background: var(--green); color: white; }

.filter-form {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--white);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: 0 3px 10px rgba(11,47,74,0.08);
    margin-bottom: 8px;
}
.filter-field { flex: 0 0 auto; }
.filter-field label { font-size: 14px; margin-bottom: 4px; }
.filter-field input[type="date"] {
    padding: 10px 12px;
    font-size: 15px;
    width: auto;
}
.filter-note {
    color: var(--gray);
    font-size: 14px;
    margin: 10px 0 0;
}

.footer {
    text-align: center;
    color: var(--gray);
    font-size: 13px;
    padding: 20px;
}

/* Kiosk touch-friendliness: bigger tap targets on small screens */
@media (max-width: 600px) {
    body { font-size: 18px; }
    .page-title { font-size: 28px; }
    .tile { padding: 32px 18px; }
}
