/* ============================================================
   SimpleBooking - Custom App Styles
   Design tokens per the development guide
   ============================================================ */
:root {
    --navy:        #17324D;
    --navy-light:  #22557F;
    --blue:        #3B82F6;
    --soft-blue:   #EDF5FF;
    --bg:          #F7F9FC;
    --white:       #FFFFFF;
    --muted:       #6B7280;
    --border:      #D9E2EA;
    --card-radius: 16px;
    --field-radius: 10px;
    --field-height: 50px;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--navy);
    -webkit-font-smoothing: antialiased;
}

.page-bg { background-color: var(--bg); }

/* ---------- Buttons ---------- */
.btn-navy,
.btn-outline-navy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1.2;
    cursor: pointer;
}
.btn-navy {
    background-color: var(--navy);
    color: #fff;
    border: 1px solid var(--navy);
    border-radius: var(--field-radius);
    height: var(--field-height);
    padding: 0 1.25rem;
    font-weight: 600;
    transition: background-color .15s ease;
}
.btn-navy:hover, .btn-navy:focus {
    background-color: var(--navy-light);
    color: #fff;
    border-color: var(--navy-light);
}
.btn-navy.btn-sm { height: 38px; padding: 0 1rem; }
.btn-navy.btn-lg { height: 52px; }

.btn-outline-navy {
    background-color: transparent;
    color: var(--navy);
    border: 1px solid var(--border);
    border-radius: var(--field-radius);
    height: 38px;
    padding: 0 1rem;
    font-weight: 500;
    transition: all .15s ease;
}
.btn-outline-navy:hover {
    background-color: var(--soft-blue);
    color: var(--navy);
    border-color: var(--blue);
}
.btn-navy .bi,
.btn-outline-navy .bi {
    line-height: 1;
}
.btn-navy.w-100,
.btn-outline-navy.w-100 {
    width: 100%;
}

/* ---------- Cards ---------- */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    box-shadow: 0 1px 3px rgba(23,50,77,0.05);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1.1rem 1.25rem;
}
.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--navy);
}

/* ---------- Forms ---------- */
.form-label {
    font-weight: 600;
    color: var(--navy);
    margin-bottom: .4rem;
}
.form-control, .form-select {
    height: var(--field-height);
    border-radius: var(--field-radius);
    border: 1px solid var(--border);
    background-color: #fff;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
}
textarea.form-control { height: auto; }
.form-control:focus, .form-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 0.2rem rgba(59,130,246,0.15);
}
.form-control[readonly] {
    background-color: var(--bg);
    color: var(--muted);
    cursor: default;
}
.optional-tag {
    font-weight: 400;
    color: var(--muted);
    font-size: 0.85rem;
}
.input-icon {
    position: relative;
}
.input-icon > i {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: var(--muted);
}
.input-icon .form-control {
    padding-left: 2.6rem;
}

/* ---------- Site header ---------- */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1030;
}
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--navy);
    color: #fff;
    font-size: 1.15rem;
}
.brand-mark-lg { width: 52px; height: 52px; border-radius: 14px; font-size: 1.5rem; }
.brand-text { font-weight: 700; color: var(--navy); font-size: 1.1rem; }
.navbar .nav-link {
    font-weight: 500;
    color: var(--navy);
    border-radius: 8px;
    padding: .5rem .9rem;
}
.navbar .nav-link:hover, .navbar .nav-link.active {
    color: var(--blue);
    background: var(--soft-blue);
}
.nav-user-chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: var(--soft-blue);
    color: var(--navy);
    border-radius: 999px;
    padding: .45rem 1rem;
    font-weight: 600;
    font-size: .9rem;
}

/* ---------- Page headings ---------- */
.page-heading { margin-bottom: 1.5rem; }
.page-title { font-weight: 700; color: var(--navy); margin-bottom: .25rem; }
.page-subtitle { color: var(--muted); margin-bottom: 0; }
.eyebrow {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .12em;
    color: var(--blue);
    text-transform: uppercase;
    margin-bottom: .35rem;
}
.section-title { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 1rem; }
.section-divider { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ---------- Metric cards ---------- */
.metric-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    height: 100%;
}
.metric-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}
.metric-label {
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .03em;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: .35rem;
    padding-right: 3rem;
}
.metric-value { font-size: 1.9rem; font-weight: 700; color: var(--navy); }

.tint-total   .metric-icon { background: var(--soft-blue); color: var(--blue); }
.tint-pending .metric-icon { background: #FFF7E6; color: #B45309; }
.tint-confirmed .metric-icon { background: #E8F5EE; color: #1F7A4D; }
.tint-completed .metric-icon { background: #E8F5EE; color: #1F7A4D; }
.tint-cancelled .metric-icon { background: #FDECEC; color: #C0392B; }
.tint-users   .metric-icon { background: var(--soft-blue); color: var(--blue); }

/* ---------- Status badges (text + color) ---------- */
.badge-status-pending   { background: #FEF3C7; color: #92400E; font-weight: 600; }
.badge-status-confirmed { background: #DBEAFE; color: #1D4ED8; font-weight: 600; }
.badge-status-completed { background: #DCFCE7; color: #15803D; font-weight: 600; }
.badge-status-cancelled { background: #FEE2E2; color: #B91C1C; font-weight: 600; }
.badge { padding: .45em .8em; border-radius: 999px; font-size: .78rem; }

.status-hero {
    display: inline-flex;
    flex-direction: column;
    gap: .35rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 1rem 1.4rem;
}
.status-hero-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
}
.status-hero .badge { font-size: 1rem; padding: .5em 1.1em; }

/* ---------- Detail blocks ---------- */
.detail-block { display: flex; flex-direction: column; gap: .3rem; }
.detail-label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}
.detail-value { font-size: 1.02rem; font-weight: 600; color: var(--navy); }

/* ---------- Auth pages ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 2.2rem;
    box-shadow: 0 4px 20px rgba(23,50,77,0.06);
}
.auth-title { font-weight: 700; color: var(--navy); font-size: 1.6rem; margin-top: 1rem; }
.auth-subtitle { color: var(--muted); }
.auth-switch {
    text-align: center;
    margin-top: 1.4rem;
    color: var(--muted);
    font-size: .92rem;
}
.auth-switch a { color: var(--blue); font-weight: 600; text-decoration: none; }

/* ---------- Calendar panel / summary ---------- */
.calendar-panel { position: sticky; top: 84px; }
.calendar-wrap { position: relative; }
.calendar-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    background: rgba(247,249,252,.85);
    border-radius: 14px;
    z-index: 5;
    color: var(--navy);
    font-weight: 600;
    font-size: .9rem;
}
.calendar-panel.is-loading .calendar-loading { display: flex; }
.calendar-panel.is-loading #bookingCalendar {
    opacity: .35;
    pointer-events: none;
    transition: opacity .2s ease;
}
.calendar-summary {
    background: var(--soft-blue);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .45rem 0;
    border-bottom: 1px solid rgba(217,226,234,.6);
}
.summary-row:last-child { border-bottom: 0; }
.summary-label { color: var(--muted); font-size: .88rem; }
.summary-value { font-weight: 600; color: var(--navy); }

/* ---------- Custom modern calendar ---------- */
.custom-calendar {
    width: 100%;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(23,50,77,0.05);
}
.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--navy);
    color: #fff;
    padding: .75rem .9rem;
}
.cal-title {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: .02em;
}
.cal-nav {
    background: transparent;
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color .15s ease;
}
.cal-nav:hover { background: rgba(255,255,255,.16); }
.cal-nav:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    padding: .85rem .75rem 0;
    text-align: center;
}
.cal-weekdays span {
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}

.cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    padding: .7rem .75rem .9rem;
}
.cal-empty { background: transparent; }
.cal-day {
    min-height: 48px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #fff;
    color: var(--navy);
    font-weight: 500;
    font-size: .98rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color .12s ease, color .12s ease, border-color .12s ease, transform .08s ease;
}
.cal-day:hover:not(.disabled):not(.selected) {
    background: var(--soft-blue);
    color: var(--navy);
}
.cal-day:active:not(.disabled):not(.selected) { transform: scale(.95); }
.cal-day.today:not(.selected) {
    border-color: var(--blue);
    color: var(--blue);
    font-weight: 600;
}
.cal-day.selected {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(23,50,77,.25);
}
.cal-day.disabled {
    color: #C9D4DE;
    background: transparent;
    cursor: not-allowed;
}
.cal-day.disabled:hover { background: transparent; color: #C9D4DE; }

/* Booking date display input */
.booking-date-display {
    background: var(--soft-blue);
    color: var(--navy);
    font-weight: 600;
    cursor: default;
}
.booking-date-display:focus {
    background: var(--soft-blue);
    box-shadow: none;
}



/* ---------- Admin layout ---------- */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--navy);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar-brand { color: #fff; padding: 0 0.5rem 1.25rem; }
.sidebar-brand .brand-text { color: #fff; }
.sidebar-brand .brand-mark { background: rgba(255,255,255,0.12); }
.sidebar-nav { list-style: none; padding: 0; margin: 0; flex-grow: 1; }
.sidebar-nav li { margin-bottom: .25rem; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    padding: .7rem .9rem;
    border-radius: 10px;
    font-weight: 500;
    transition: all .15s ease;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.sidebar-nav a.active { background: var(--blue); color: #fff; }
.sidebar-footer { padding-top: 1rem; }

.admin-main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1.1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.topbar-title { font-size: 1.25rem; font-weight: 700; color: var(--navy); margin: 0; }
.admin-content { padding: 1.5rem; flex-grow: 1; }

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1050;
    height: 42px;
    width: 42px;
    padding: 0;
    border-radius: 10px;
}

/* ---------- Tables ---------- */
.table { --bs-table-hover-bg: var(--soft-blue); }
.table thead th {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.dataTables_wrapper .dataTables_filter input {
    height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--field-radius);
    padding: 0 .75rem;
}
.dataTables_wrapper .dataTables_length select {
    height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--field-radius);
    padding: 0 .5rem;
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 1.25rem 0;
    margin-top: 2rem;
    color: var(--muted);
    font-size: .9rem;
}

/* ---------- Flash alerts ---------- */
.flash-alert { border-radius: var(--field-radius); }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .calendar-panel { position: static; }
    .admin-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        height: 100vh;
        z-index: 1045;
        transition: left .2s ease;
    }
    .admin-sidebar.open { left: 0; }
    .sidebar-toggle { display: inline-flex; }
    .admin-topbar { padding-left: 4.5rem; }
}

@media (max-width: 575.98px) {
    .metric-grid .col-6 { width: 50%; }
    .auth-card { padding: 1.5rem; }
    .admin-content { padding: 1rem; }
}



