* {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #e5e7eb;
    font-size: 16px;
    line-height: 1.45;
}

body.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    margin: 0 auto;
}

.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 16px;
}

h1, h2 {
    text-align: center;
    margin-bottom: 24px;
}

.card {
    background: #020617;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border: 1px solid #1f2937;
}

form.card {
    max-width: 420px;
    margin: 0 auto;
}

label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

input, select {
    width: 100%;
    padding: 10px 12px;
    margin-top: 4px;
    border-radius: 8px;
    border: 1px solid #4b5563;
    background: #020617;
    color: #e5e7eb;
}

button {
    width: 100%;
    padding: 11px 18px;
    border-radius: 999px;
    border: 0;
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    color: #f9fafb;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-top: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 25px rgba(37, 99, 235, 0.4);
    transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, filter 0.12s ease-out;
}

button::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 0 0, rgba(255,255,255,0.4), transparent 55%);
    opacity: 0;
    transition: opacity 0.15s ease-out;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 35px rgba(37, 99, 235, 0.55);
    filter: brightness(1.03);
}

button:hover::before {
    opacity: 0.8;
}

button:active {
    transform: translateY(0);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.45);
}

a {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 500;
}

.top-nav a {
    margin-left: 16px;
    padding: 6px 10px;
    border-radius: 999px;
    transition: background-color 0.15s ease-out, color 0.15s ease-out;
}

.top-nav a:hover {
    background-color: rgba(148, 163, 184, 0.2);
    color: #e5e7eb;
}

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid #f97373;
}

.alert-success {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid #34d399;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
}

.top-nav a {
    margin-left: 12px;
}

.top-nav .contact-btn {
    padding: 8px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #f9fafb;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(22, 163, 74, 0.35);
}

.top-nav .contact-btn:hover {
    background: linear-gradient(135deg, #4ade80, #16a34a);
    color: #f9fafb;
}

.top-nav .logout-btn {
    padding: 8px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fee2e2;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(248, 113, 113, 0.35);
}

.top-nav .logout-btn:hover {
    background: linear-gradient(135deg, #f97373, #b91c1c);
    color: #fee2e2;
}

.top-nav-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-links a {
    margin-left: 0;
}

.nav-toggle {
    display: none;
    width: auto;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #4b5563;
    background: #020617;
    color: #e5e7eb;
    font-size: 0.85rem;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown summary {
    list-style: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #4b5563;
    background: #020617;
    color: #e5e7eb;
    font-size: 0.85rem;
    font-weight: 600;
}

.nav-dropdown summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #020617;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 6px 8px;
    min-width: 220px;
    gap: 6px;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    z-index: 60;
}

.nav-dropdown-content a {
    width: 100%;
}

.nav-dropdown[open] .nav-dropdown-content {
    display: flex;
}

.btn-admin {
    width: auto !important;
    margin-top: 0 !important;
    padding: 6px 12px !important;
    border-radius: 999px !important;
    font-size: 0.8rem !important;
    border: 0;
    box-shadow: none;
    background: #1e293b;
    color: #e5e7eb;
}

.btn-admin-danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c) !important;
    color: #fee2e2;
}

.btn-admin-warning {
    background: linear-gradient(135deg, #facc15, #f59e0b) !important;
    color: #111827;
}

.btn-admin-info {
    background: linear-gradient(135deg, #38bdf8, #6366f1) !important;
    color: #f9fafb;
}

.btn-admin-muted {
    background: #0f172a !important;
    border: 1px solid #1f2937 !important;
    color: #e5e7eb !important;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 0.9rem;
    table-layout: fixed;
}

.responsive-user-table {
    table-layout: auto;
}

@media (max-width: 768px) {
    .responsive-user-table thead {
        display: none;
    }

    .responsive-user-table tbody tr {
        display: block;
        border: 1px solid #1f2937;
        border-radius: 12px;
        padding: 12px;
        margin-bottom: 14px;
        background: #020617;
    }

    .responsive-user-table tbody td {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 10px;
        padding: 8px 0;
        border-bottom: 1px solid #1f2937;
        width: 100%;
    }

    .responsive-user-table tbody td:last-child {
        border-bottom: 0;
    }

    .responsive-user-table tbody td::before {
        content: attr(data-label);
        width: auto;
        flex: 0 0 auto;
        text-align: left;
        font-size: 0.85rem;
        color: #9ca3af;
        margin-bottom: -2px;
    }

    .responsive-user-table td.cell-actions {
        display: block;
        padding: 0;
        border-bottom: 0;
    }

    .responsive-user-table td.cell-actions::before {
        display: none;
    }

    .responsive-user-table .btn-text {
        display: none;
    }

    .responsive-user-table td.cell-actions a.badge {
        display: inline-block;
        margin-bottom: 6px;
    }

    .responsive-user-table td.cell-actions form {
        display: block !important;
        margin-left: 0 !important;
        margin-top: 6px !important;
    }

    .responsive-user-table td.cell-actions form:first-of-type {
        margin-top: 0 !important;
    }

    /* Admin users: buttons spaced vertically on small screens */
    .admin-user-actions {
        align-items: stretch !important;
        flex-wrap: nowrap !important;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .admin-user-actions form {
        width: 100% !important;
        margin: 0 !important;
    }

    .admin-user-actions .btn-admin,
    .admin-user-actions a.btn-admin {
        width: 100% !important;
        justify-content: center;
    }

    /* Admin bookings: stretch action buttons full width */
    td.admin-cell .admin-actions {
        align-items: stretch !important;
    }

    td.admin-cell .admin-actions form {
        width: 100% !important;
        margin: 0 !important;
    }

    td.admin-cell .admin-actions .btn-admin,
    td.admin-cell .admin-actions a.btn-admin {
        width: 100% !important;
        justify-content: center;
    }
}

td.admin-cell {
    vertical-align: top;
    white-space: normal;
}

td.admin-cell .admin-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

td.admin-cell .admin-actions form {
    display: block;
    margin: 0;
}

td.admin-cell .admin-actions button {
    margin-top: 0;
}

.admin-user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

body.modal-open {
    overflow: hidden;
}

.modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: none;
    place-items: center;
    padding: 24px;
    z-index: 2147483647;
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.modal-overlay.is-open {
    display: grid !important;
}

.modal-card {
    width: 92vw;
    max-width: 520px;
    background: rgba(2, 6, 23, 0.92);
    border: 1px solid #1f2937;
    border-radius: 14px;
    box-shadow: 0 30px 70px rgba(0,0,0,0.6);
    padding: 18px;
    position: relative;
    margin: 0 !important;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.modal-body {
    display: grid;
    gap: 12px;
}

th, td {
    padding: 8px 10px;
    border-bottom: 1px solid #1f2937;
    overflow-wrap: anywhere;
    word-break: break-word;
}

th {
    text-align: left;
    background: #020617;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    background: #1e293b;
}

.badge-filled {
    background: #f97316;
    color: #111827;
}

.badge-free {
    background: #22c55e;
    color: #022c22;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.stat-card {
    position: relative;
    overflow: hidden;
    border-radius: 999px;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #f9fafb;
    box-shadow: 0 18px 35px rgba(15,23,42,0.55);
}

.stat-pill-blue {
    background: linear-gradient(135deg, #38bdf8, #6366f1);
}

.stat-pill-red {
    background: linear-gradient(135deg, #fb7185, #f97316);
}

.stat-pill-green {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.stat-pill-purple {
    background: linear-gradient(135deg, #a855f7, #6366f1);
}

.stat-pill-amber {
    background: linear-gradient(135deg, #facc15, #f97316);
}

.stat-pill-slate {
    background: linear-gradient(135deg, #0f172a, #1e293b);
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 0 0, rgba(255,255,255,0.35), transparent 55%);
    opacity: 0.45;
    pointer-events: none;
}

.stat-icon {
    position: relative;
    z-index: 1;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15,23,42,0.15);
    font-size: 20px;
}

.stat-text {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.78rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
}

.day-picker-form {
    margin-bottom: 12px;
}

.day-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.day-btn {
    width: auto;
    min-width: 64px;
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid #1f2937;
    background: #020617;
    box-shadow: 0 8px 18px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.day-btn .day-label {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    color: #9ca3af;
}

.day-btn .day-number {
    font-size: 1rem;
    font-weight: 600;
    color: #e5e7eb;
}

.day-btn-active {
    border-color: #38bdf8;
    background: radial-gradient(circle at top left, rgba(56,189,248,0.3), transparent 55%), #020617;
}

@media (max-width: 768px) {
    .container {
        margin: 24px auto;
    }

    .card {
        padding: 16px;
    }

    .top-nav {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .nav-links {
        display: none !important;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        width: 240px;
        background: rgba(2, 6, 23, 0.85);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-radius: 12px;
        padding: 8px 8px;
        position: absolute;
        top: 56px;
        right: 12px;
        box-shadow: 0 20px 40px rgba(0,0,0,0.6);
        z-index: 50;
        border: 1px solid rgba(56, 189, 248, 0.25);
    }

    .nav-links.is-open {
        display: flex !important;
    }

    .nav-links a {
        margin-left: 0;
        width: 100%;
        padding: 10px 12px;
        font-size: 0.95rem;
        box-sizing: border-box;
    }

    .nav-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 38px;
        padding: 0;
    }

    .nav-dropdown-content {
        position: static;
        box-shadow: none;
        border-radius: 0;
        border: 0;
        padding: 0;
        min-width: 0;
    }

    .nav-dropdown summary {
        width: 100%;
        text-align: left;
    }

    .nav-dropdown[open] .nav-dropdown-content {
        display: flex;
    }

    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Admin table: badges + action buttons with icon + optional text */
.badge-paid {
    background: #22c55e;
    color: #022c22;
    white-space: nowrap;
}

.badge-unpaid {
    background: rgba(239, 68, 68, 0.18);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.4);
    white-space: nowrap;
}

.btn-admin-success {
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    color: #f9fafb;
}

td.admin-cell .admin-actions .btn-admin,
td.admin-cell .admin-actions a.btn-admin {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

td.admin-cell .admin-actions .btn-admin[disabled] {
    opacity: 0.75;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    td.admin-cell .admin-actions .btn-text {
        display: none !important;
    }

    td.admin-cell .admin-actions .btn-admin,
    td.admin-cell .admin-actions a.btn-admin {
        justify-content: center;
    }
}

