/* ==========================================================================
   GuestHouse Manager – mobile-first app shell on top of Bootstrap 5
   ========================================================================== */

:root {
    --brand: #006a4e;
    --brand-dark: #00513b;
    --brand-soft: #d6f0e6;
    --app-bg: #f3f5f8;
    --sidebar-w: 256px;
    --topbar-h: 60px;
    --bottom-nav-h: 64px;
    --radius: 14px;

    --bs-primary: #006a4e;
    --bs-primary-rgb: 0, 106, 78;
    --bs-link-color: #006a4e;
    --bs-link-color-rgb: 0, 106, 78;
    --bs-link-hover-color: #00513b;
    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", "Helvetica Neue", Arial, sans-serif;
    --bs-border-radius: .6rem;
}

body { background: var(--app-bg); font-size: .95rem; }

.btn-primary {
    --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark);
}
.text-primary { color: var(--brand) !important; }
.bg-primary { background-color: var(--brand) !important; }
.form-control:focus, .form-select:focus { border-color: #5cbf9b; box-shadow: 0 0 0 .2rem rgba(0, 106, 78, .15); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.page-link { color: var(--brand); }
.active > .page-link, .page-link.active { background-color: var(--brand); border-color: var(--brand); }
.min-w-0 { min-width: 0; }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.app-sidebar {
    --bs-offcanvas-width: var(--sidebar-w);
    background: linear-gradient(180deg, #006a4e 0%, #003d2d 100%);
    color: #e6fffb;
}
@media (min-width: 992px) {
    .app-sidebar { width: var(--sidebar-w); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; flex-shrink: 0; }
}
.app-sidebar.offcanvas-lg { display: flex; flex-direction: column; }
.sidebar-brand { display: flex; align-items: center; padding: 1rem 1.1rem; height: var(--topbar-h); border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.15); color: #fff; }
.brand-mark-lg { width: 64px; height: 64px; border-radius: 18px; background: var(--brand); font-size: 1.8rem; box-shadow: 0 10px 30px rgba(0,106,78,.35); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .5rem .75rem 1rem; }
.sidebar-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; opacity: .55; margin: 1rem .6rem .35rem; }
.sidebar-link { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border-radius: 10px; color: rgba(255,255,255,.82); text-decoration: none; transition: background .15s; }
.sidebar-link i { font-size: 1.1rem; width: 1.25rem; text-align: center; }
.sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-link.active { background: #fff; color: var(--brand-dark); font-weight: 600; box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.sidebar-footer { padding: .8rem 1.1rem; opacity: .6; border-top: 1px solid rgba(255,255,255,.08); }

.app-topbar {
    position: sticky; top: 0; z-index: 1020; height: var(--topbar-h);
    display: flex; align-items: center; gap: .5rem; padding: 0 1rem;
    background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
    border-bottom: 1px solid #e5e7eb;
}
.app-title { font-size: 1.1rem; font-weight: 600; }
.btn-icon { border: 0; background: transparent; padding: .35rem .5rem; border-radius: 10px; }
.btn-icon:hover { background: #f1f5f9; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }

.app-content { padding: 1rem; padding-bottom: calc(var(--bottom-nav-h) + 1.5rem + env(safe-area-inset-bottom)); }
@media (min-width: 992px) { .app-content { padding: 1.5rem 2rem 2rem; } }

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    display: flex; align-items: center; justify-content: space-around;
    background: #fff; border-top: 1px solid #e5e7eb; box-shadow: 0 -4px 20px rgba(0,0,0,.05);
}
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; color: #64748b; text-decoration: none; }
.bottom-nav a i { font-size: 1.25rem; }
.bottom-nav a.active { color: var(--brand); font-weight: 600; }
.bottom-nav .bottom-nav-fab { flex: 0 0 auto; width: 54px; height: 54px; margin-top: -26px; border-radius: 50%; background: var(--brand); color: #fff; justify-content: center; box-shadow: 0 8px 20px rgba(0,106,78,.4); }
.bottom-nav .bottom-nav-fab i { font-size: 1.5rem; }

/* ---------- Cards & content ---------- */
.card { border: 0; border-radius: var(--radius); box-shadow: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04); }
.card-header { background: transparent; border-bottom: 1px solid #eef0f3; padding: .9rem 1rem; font-weight: 600; }
.page-header { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.page-header .subtitle { color: #64748b; font-size: .875rem; }

.stat-card { position: relative; overflow: hidden; }
.stat-card .stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { color: #64748b; font-size: .8rem; }
.soft-primary { background: #d6f0e6; color: #006a4e; }
.soft-success { background: #dcfce7; color: #15803d; }
.soft-warning { background: #fef3c7; color: #b45309; }
.soft-danger  { background: #fee2e2; color: #b91c1c; }
.soft-info    { background: #dbeafe; color: #1d4ed8; }
.soft-secondary { background: #e2e8f0; color: #475569; }

.badge-status { font-weight: 600; padding: .35em .65em; border-radius: 999px; }
.text-bg-booked { background: #dbeafe !important; color: #1d4ed8 !important; }

.dl-grid { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: .45rem .75rem; margin: 0; }
.dl-grid dt { color: #64748b; font-weight: 500; font-size: .85rem; }
.dl-grid dd { margin: 0; word-break: break-word; }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: #64748b; }
.empty-state .empty-icon { font-size: 2.6rem; color: #cbd5e1; }

/* Filters bar */
.filter-bar .form-control, .filter-bar .form-select { min-width: 0; }

/* ---------- Responsive tables -> cards on phones ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .7rem .75rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; font-weight: 600; background: #f8fafc; border-bottom-width: 1px; white-space: nowrap; }
@media (max-width: 767.98px) {
    .table-cards thead { display: none; }
    .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
    .table-cards tr { background: #fff; border-radius: 12px; margin: 0 0 .75rem; padding: .5rem .25rem; box-shadow: 0 1px 3px rgba(15,23,42,.08); }
    .table-cards td { border: 0; padding: .3rem .75rem !important; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
    .table-cards td::before { content: attr(data-label); color: #64748b; font-size: .8rem; text-align: left; flex-shrink: 0; }
    .table-cards td[data-label=""]::before, .table-cards td:not([data-label])::before { content: none; }
    .table-cards td.td-actions { justify-content: flex-end; border-top: 1px dashed #e2e8f0; margin-top: .25rem; padding-top: .5rem !important; }
    .card .table-cards-wrap { background: transparent; }
    .card:has(.table-cards) { background: transparent; box-shadow: none; }
    .card:has(.table-cards) > .card-footer { background: transparent; border: 0; }
}

/* ---------- Room board ---------- */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.room-tile { position: relative; display: block; border-radius: 14px; padding: .85rem; color: inherit; text-decoration: none; background: #fff; border: 2px solid transparent; box-shadow: 0 1px 3px rgba(15,23,42,.08); transition: transform .12s, box-shadow .12s; min-height: 120px; }
.room-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15,23,42,.1); color: inherit; }
.room-tile .room-code { font-size: 1.25rem; font-weight: 700; }
.room-tile .room-meta { font-size: .75rem; color: #64748b; }
.room-tile .room-guest { font-size: .8rem; margin-top: .35rem; }
.room-tile.st-available  { border-color: #86efac; background: #f0fdf4; }
.room-tile.st-booked     { border-color: #93c5fd; background: #eff6ff; }
.room-tile.st-checked_in { border-color: #fcd34d; background: #fffbeb; }
.room-tile.st-maintenance{ border-color: #fca5a5; background: #fef2f2; }
.room-tile.st-inactive   { border-color: #cbd5e1; background: #f1f5f9; opacity: .75; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .3rem; }

/* Availability timeline */
.timeline-wrap { overflow-x: auto; }
.timeline { border-collapse: separate; border-spacing: 2px; font-size: .75rem; }
.timeline th, .timeline td { min-width: 38px; text-align: center; padding: .3rem .2rem; border-radius: 6px; white-space: nowrap; }
.timeline th.room-col, .timeline td.room-col { position: sticky; left: 0; background: #fff; text-align: left; min-width: 90px; z-index: 1; font-weight: 600; }
.c-available { background: #dcfce7; }
.c-booked { background: #bfdbfe; }
.c-checked_in { background: #fde68a; }
.c-maintenance { background: #fecaca; }
.c-inactive { background: #e2e8f0; }
.timeline a { color: inherit; text-decoration: none; display: block; }

/* ---------- Booking form ---------- */
.step-badge { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .8rem; font-weight: 700; margin-right: .5rem; }
.room-option { cursor: pointer; border: 2px solid #e2e8f0; border-radius: 12px; padding: .75rem; background: #fff; height: 100%; transition: border-color .12s, background .12s; }
.room-option:hover { border-color: #5cbf9b; }
.room-option.selected { border-color: var(--brand); background: #eef8f4; box-shadow: 0 0 0 3px rgba(0,106,78,.12); }
.customer-results .list-group-item { cursor: pointer; }
.selected-customer { border: 2px solid var(--brand); background: #eef8f4; border-radius: 12px; padding: .75rem; }
.summary-sticky { position: sticky; top: calc(var(--topbar-h) + 1rem); }
.summary-row { display: flex; justify-content: space-between; padding: .3rem 0; }
.summary-total { border-top: 1px dashed #cbd5e1; margin-top: .4rem; padding-top: .6rem; font-size: 1.1rem; font-weight: 700; }

/* History timeline */
.history-list { list-style: none; padding: 0; margin: 0; position: relative; }
.history-list::before { content: ""; position: absolute; left: 11px; top: 4px; bottom: 4px; width: 2px; background: #e2e8f0; }
.history-list li { position: relative; padding: 0 0 1rem 2.1rem; }
.history-list li .dot { position: absolute; left: 4px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); }
.history-diff { font-size: .78rem; background: #f8fafc; border-radius: 8px; padding: .4rem .6rem; margin-top: .3rem; }

/* ---------- Feedback ---------- */
.ajax-progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 2000; background: linear-gradient(90deg, transparent, var(--brand), transparent); background-size: 50% 100%; animation: progress 1s linear infinite; }
@keyframes progress { from { background-position: -50% 0; } to { background-position: 150% 0; } }
.confirm-icon { font-size: 2.5rem; color: var(--brand); }
.toast { border: 0; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.loading-overlay { position: absolute; inset: 0; background: rgba(255,255,255,.7); display: grid; place-items: center; border-radius: inherit; z-index: 5; }

/* ---------- Auth ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at top, #d6f0e6 0%, var(--app-bg) 55%); }
.auth-wrap { width: 100%; max-width: 400px; padding: 1.5rem 1rem; }

/* ---------- Landing (sign in + register) ---------- */
.lp { min-height: 100vh; background: var(--app-bg); overflow-x: hidden; }
.lp-nav { position: sticky; top: 0; z-index: 20; background: rgba(0, 61, 44, .92); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(255,255,255,.08); }
.lp-nav-inner { display: flex; align-items: center; gap: .75rem; padding-top: .6rem; padding-bottom: .6rem; }
.lp-brand { display: flex; align-items: center; gap: .6rem; min-width: 0; color: #fff; text-decoration: none; }
.lp-brand:hover { color: #fff; }
.lp-brand img { flex-shrink: 0; width: 44px; height: 44px; background: #fff; border-radius: 50%; padding: 2px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.lp-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.lp-brand-text strong { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-brand-text small { font-size: .72rem; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-nav-actions { display: flex; gap: .5rem; margin-left: auto; flex-shrink: 0; }
.lp-btn-light { background: #fff; color: var(--brand-dark); border: 1px solid #fff; font-weight: 600; }
.lp-btn-light:hover { background: #e9f6f0; color: var(--brand-dark); border-color: #e9f6f0; }
.lp-btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45); font-weight: 600; }
.lp-btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; border-color: #fff; }

.lp-hero {
    position: relative; color: #fff; padding: 2.25rem 0 3.5rem;
    background:
        radial-gradient(circle at 85% 10%, rgba(244, 42, 65, .22) 0, transparent 40%),
        radial-gradient(circle at 0% 100%, rgba(255, 214, 0, .14) 0, transparent 45%),
        linear-gradient(160deg, #004d38 0%, #006a4e 55%, #0a7d5d 100%);
}
.lp-hero::after { /* soft road-line accent */
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
    background: repeating-linear-gradient(90deg, #ffd600 0 36px, transparent 36px 60px); opacity: .55;
}
.lp-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); font-size: .75rem; font-weight: 600; }
.lp-hero h1 { font-weight: 800; font-size: clamp(1.75rem, 6.5vw, 3rem); line-height: 1.12; letter-spacing: -.02em; margin: 1rem 0 .85rem; }
.lp-lead { font-size: clamp(.98rem, 3.6vw, 1.15rem); opacity: .88; margin-bottom: 1.5rem; max-width: 34rem; }
.lp-hero-cta { display: flex; flex-wrap: wrap; gap: .6rem; }
.lp-hero-cta .btn { flex: 1 1 auto; }
.lp-stats { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; list-style: none; padding: 0; margin: 1.5rem 0 0; font-size: .85rem; opacity: .9; }
.lp-stats .bi { color: #ffd600; margin-right: .35rem; }

.lp-card { background: #fff; color: var(--bs-body-color); border-radius: 20px; padding: 1.25rem; box-shadow: 0 24px 60px -20px rgba(0,0,0,.45); scroll-margin-top: 80px; }
.lp-card-head { display: flex; align-items: center; gap: .75rem; padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid #eef1f4; }
.lp-card-head img { width: 56px; height: 56px; flex-shrink: 0; }
#access { scroll-margin-top: 80px; }

.lp-features { padding: 3rem 0 2.5rem; }
.lp-section-title { font-weight: 800; font-size: clamp(1.35rem, 5vw, 2rem); letter-spacing: -.01em; }
.lp-feature { height: 100%; background: #fff; border: 1px solid #e8edf1; border-radius: 16px; padding: 1rem; transition: transform .15s, box-shadow .15s; }
.lp-feature:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -16px rgba(0, 77, 56, .45); }
.lp-feature-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-dark); font-size: 1.25rem; margin-bottom: .75rem; }
.lp-feature-title { font-weight: 700; margin-bottom: .25rem; }
.lp-feature-text { font-size: .85rem; color: var(--bs-secondary-color); }
.lp-app { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding: 1.25rem; border-radius: 18px; color: #fff; background: linear-gradient(120deg, #004d38, #006a4e); }
.lp-footer { padding: 1.25rem 0 calc(1.25rem + env(safe-area-inset-bottom)); border-top: 1px solid #e3e8ec; font-size: .8rem; color: var(--bs-secondary-color); }
.lp-footer .container { display: flex; align-items: center; justify-content: center; gap: .5rem; text-align: center; }

@media (max-width: 575.98px) {
    .lp-brand-text strong { font-size: .92rem; }
    .lp-brand img { width: 38px; height: 38px; }
    .lp-hero { padding-top: 1.5rem; }
    .lp-chip { font-size: .68rem; }
    .lp-feature { padding: .85rem; }
    .lp-feature-text { font-size: .78rem; }
    .lp-app { flex-direction: column; align-items: flex-start; }
    .lp-footer .container { flex-direction: column; }
}
@media (min-width: 992px) {
    .lp-hero { padding: 4.5rem 0 5.5rem; }
    .lp-card { padding: 1.75rem; }
    .lp-hero-cta .btn { flex: 0 0 auto; }
    .lp-feature { padding: 1.4rem; }
}

.landing-tabs .nav-link { color: var(--brand); }
.landing-tabs .nav-link.active { background: var(--brand); color: #fff; }
.play-store-btn { display: inline-flex; align-items: center; gap: .6rem; padding: .5rem 1.1rem; border-radius: 10px; background: #111; color: #fff; text-decoration: none; border: 1px solid #111; transition: background .15s; }
.play-store-btn:hover { background: #2a2a2a; color: #fff; }
.play-store-btn .bi { font-size: 1.6rem; }
.play-store-btn small { display: block; font-size: .62rem; letter-spacing: .04em; opacity: .85; }
.play-store-btn strong { display: block; font-size: 1.05rem; font-weight: 600; }
.play-store-btn.is-soon { opacity: .6; cursor: default; }
.play-store-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #111; color: #fff; font-size: 1rem; text-decoration: none; }
.play-store-icon:hover { background: #2a2a2a; color: #fff; }
.play-store-icon.is-soon { opacity: .6; cursor: default; }

@media print {
    .app-sidebar, .app-topbar, .bottom-nav, .no-print, .toast-container { display: none !important; }
    .app-content { padding: 0 !important; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ---------- IB (RHD Bangladesh) branding & SASS / SES / IB layers ---------- */
.brand-logo { width: 38px; height: 38px; flex-shrink: 0; background: #fff; border-radius: 50%; padding: 2px; }
.auth-logo { width: 96px; height: 96px; }
.sidebar-brand { height: auto; min-height: var(--topbar-h); }
.sidebar-layer { display: flex; align-items: center; gap: .5rem; padding: .55rem 1.1rem; background: rgba(0,0,0,.15); }
.sidebar-footer { font-size: .72rem; }
.layer-sass { background: #f42a41; color: #fff; }
.layer-ses { background: #f59e0b; color: #1f2937; }
.layer-ib { background: #006a4e; color: #fff; }
.sass-hero { background: linear-gradient(120deg, #006a4e 0%, #00513b 70%, #7f1d1d 140%); color: #fff; }
.sass-hero-logo { width: 64px; height: 64px; background: #fff; border-radius: 50%; padding: 3px; }
@media (max-width: 767.98px) { .table-cards tfoot { display: none; } }