/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f1f5f9;
    color: #1e293b;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; color: #334155; }

.muted { color: #94a3b8; font-size: 0.9rem; }

/* ── Card ────────────────────────────────────────────────────── */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.center-card {
    max-width: 420px;
    margin: 80px auto;
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* ── Forms ───────────────────────────────────────────────────── */
label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 12px;
    color: #475569;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
textarea {
    display: block;
    width: 100%;
    padding: 10px 12px;
    margin-top: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s;
}

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

button {
    padding: 10px 20px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

button:hover { background: #1d4ed8; }
button:disabled { background: #94a3b8; cursor: not-allowed; }

.btn-text {
    background: none;
    color: #64748b;
    padding: 6px 12px;
    font-size: 0.85rem;
}
.btn-text:hover { color: #1e293b; background: #f1f5f9; text-decoration: none; }

.btn-small {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-danger-small {
    padding: 4px 10px;
    font-size: 0.8rem;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 6px;
}
.btn-danger-small:hover { background: #fecaca; }

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
}
.checkbox-label input { width: auto; margin: 0; }

.form-row {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.form-row label { flex: 1; min-width: 120px; margin-bottom: 0; }

.error-msg { color: #dc2626; font-size: 0.9rem; margin-top: 12px; }

/* ── Flash Messages ──────────────────────────────────────────── */
.flash-container {
    max-width: 700px;
    margin: 16px auto;
    padding: 0 16px;
}

.flash {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 8px;
}
.flash-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Admin ───────────────────────────────────────────────────── */
.admin-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 24px 16px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.link-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.link-box code {
    flex: 1;
    font-size: 0.9rem;
    color: #2563eb;
    word-break: break-all;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.data-table th {
    text-align: left;
    padding: 8px 12px;
    color: #64748b;
    font-weight: 500;
    border-bottom: 1px solid #e2e8f0;
}
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
}

/* ── Booking Page ────────────────────────────────────────────── */
.booking-page {
    max-width: 540px;
    margin: 0 auto;
    padding: 40px 16px;
}

.booking-header {
    text-align: center;
    margin-bottom: 24px;
}
.booking-header h1 { font-size: 1.6rem; }
.subtitle { color: #64748b; margin-top: 4px; }

/* ── Timezone Bar ────────────────────────────────────────────── */
.tz-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
    padding: 10px 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}
.tz-bar label { margin: 0; font-size: 1rem; }
.tz-bar select {
    padding: 7px 10px;
    border: 1px solid #93c5fd;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #1e40af;
    background: #fff;
    flex: 1;
    cursor: pointer;
}

/* ── Calendar ────────────────────────────────────────────────── */
.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.cal-header span {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1e293b;
}
.cal-nav {
    width: 36px;
    height: 36px;
    padding: 0;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cal-nav:hover { background: #e2e8f0; }

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.cal-dow {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    padding: 4px 0 8px;
    text-transform: uppercase;
}
.cal-day {
    text-align: center;
    padding: 10px 4px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #cbd5e1;
    user-select: none;
}
.cal-day.empty { visibility: hidden; }
.cal-day.past { color: #e2e8f0; }
.cal-day.available {
    color: #1e293b;
    font-weight: 600;
    background: #f0fdf4;
    cursor: pointer;
    transition: all 0.15s;
}
.cal-day.available:hover { background: #dcfce7; }
.cal-day.selected {
    background: #2563eb !important;
    color: #fff !important;
    font-weight: 700;
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.slot-btn {
    padding: 12px;
    background: #f0fdf4;
    border: 2px solid #bbf7d0;
    border-radius: 8px;
    color: #166534;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.slot-btn:hover { background: #dcfce7; border-color: #86efac; }
.slot-btn.active { background: #16a34a; border-color: #16a34a; color: #fff; }

.slot-summary {
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    margin-bottom: 16px;
    color: #334155;
}

/* ── Confirmed Page ──────────────────────────────────────────── */
.success-icon {
    width: 56px;
    height: 56px;
    background: #16a34a;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 16px;
}

.detail-table {
    text-align: left;
    margin: 20px auto;
    font-size: 0.95rem;
}
.detail-table td { padding: 6px 16px 6px 0; }
.detail-table .label { color: #64748b; font-weight: 500; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
    .form-row { flex-direction: column; }
    .date-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
    .admin-page, .booking-page { padding: 16px 12px; }
    .center-card { margin: 40px 12px; padding: 28px 20px; }
}
