/* Dhonthakuru Admin — island front-office theme on top of Bootstrap 5.3 */

:root {
    --reef: #0F2E36;
    --reef-2: #16404A;
    --lagoon: #0B7A83;
    --lagoon-dark: #08636A;
    --shallow: #E3F1F0;
    --page: #F2F5F5;
    --line: #DCE4E4;
    --ink: #17282D;
    --muted: #5E7378;
    --sun: #F0B43C;
    --coral: #D94B45;
    --palm: #2E8B57;

    --bs-body-font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--page);
    --bs-border-color: var(--line);
    --bs-primary: var(--lagoon);
    --bs-primary-rgb: 11, 122, 131;
    --bs-link-color: var(--lagoon);
    --bs-link-color-rgb: 11, 122, 131;
    --bs-link-hover-color: var(--lagoon-dark);
    --bs-link-hover-color-rgb: 8, 99, 106;
    --bs-border-radius: .5rem;
    --sidebar-w: 248px;
}

body { font-size: .9rem; font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; }
h1, .h1, h2, .h2, h3, .h3, h4, .h4 { font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.h4 { font-size: 1.35rem; }
.text-muted { color: var(--muted) !important; }
a { text-decoration: none; }
:focus-visible { outline: 2px solid var(--lagoon); outline-offset: 2px; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
    background: var(--reef); color: #C9DCDD;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column;
}
.sidebar .brand {
    display: flex; align-items: center; gap: .65rem;
    padding: 1.25rem 1.25rem 1rem; color: #fff;
}
.brand-mark {
    width: 34px; height: 34px; border-radius: 10px; flex: none;
    background: linear-gradient(160deg, #3FB8B0 0%, var(--lagoon) 55%, var(--reef-2) 100%);
    display: grid; place-items: center; font-weight: 800; font-size: .95rem; color: #fff;
}
.brand-name { font-weight: 800; font-size: 1rem; line-height: 1.1; }
.brand-sub { font-size: .75rem; color: #8FB0B3; }

.nav-group { padding: .5rem .75rem; }
.nav-group + .nav-group { border-top: 1px solid rgba(255,255,255,.06); }
.nav-group-title {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    background: none; border: 0; color: #8FB0B3; font-size: .78rem; font-weight: 600;
    padding: .5rem .5rem; border-radius: .4rem;
}
.nav-group-title:hover { color: #fff; }
.nav-group-title .bi-chevron-down { transition: transform .15s ease; font-size: .7rem; }
.nav-group-title.collapsed .bi-chevron-down { transform: rotate(-90deg); }

.side-link {
    display: flex; align-items: center; gap: .6rem;
    padding: .45rem .6rem; margin: 1px 0; border-radius: .45rem;
    color: #D3E3E4; font-weight: 500;
}
.side-link .bi { font-size: 1rem; opacity: .75; width: 1.1rem; }
.side-link:hover { background: var(--reef-2); color: #fff; }
.side-link.active { background: var(--lagoon); color: #fff; }
.side-link.active .bi { opacity: 1; }
.side-link.soon { color: #6E8F93; cursor: default; }
.side-link.soon:hover { background: none; color: #6E8F93; }
.side-link .soon-tag { margin-left: auto; font-size: .68rem; color: #6E8F93; }

.sidebar .user {
    margin-top: auto; padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.08);
    display: flex; align-items: center; gap: .65rem;
}
.avatar {
    width: 32px; height: 32px; border-radius: 50%; background: var(--reef-2); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none;
}
.sidebar .user-name { color: #fff; font-weight: 600; line-height: 1.1; }
.sidebar .user-role { font-size: .75rem; color: #8FB0B3; }
.sidebar .logout { margin-left: auto; color: #8FB0B3; background: none; border: 0; padding: .25rem; }
.sidebar .logout:hover { color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: 56px; background: #fff; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 1rem; padding: 0 1.5rem;
    position: sticky; top: 0; z-index: 10;
}
.topbar .page-title { font-weight: 700; font-size: 1rem; margin: 0; }
.topbar .today { margin-left: auto; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.content { padding: 1.5rem; max-width: 1480px; width: 100%; }

.menu-toggle { display: none; border: 0; background: none; font-size: 1.4rem; color: var(--ink); padding: 0; }
.backdrop { display: none; }

@media (max-width: 991.98px) {
    .sidebar { position: fixed; left: 0; z-index: 1040; transform: translateX(-100%); transition: transform .2s ease; }
    .app.menu-open .sidebar { transform: none; }
    .app.menu-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(15,46,54,.4); z-index: 1030; }
    .menu-toggle { display: block; }
    .content { padding: 1rem; }
}

/* ---------- Section tabs (Front office) ---------- */
.section-tabs { display: flex; gap: 1.25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; overflow-x: auto; }
.section-tabs a {
    padding: .6rem 0; color: var(--muted); font-weight: 600; white-space: nowrap;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.section-tabs a:hover { color: var(--ink); }
.section-tabs a.active { color: var(--lagoon); border-bottom-color: var(--lagoon); }

/* ---------- Surfaces ---------- */
.card { border: 1px solid var(--line); border-radius: .75rem; box-shadow: none; }
.card-header { background: #fff; border-bottom: 1px solid var(--line); font-weight: 700; padding: .8rem 1rem; }
.card-footer { background: #FAFCFC; border-top: 1px solid var(--line); }

/* ---------- Tables ---------- */
.table { --bs-table-hover-bg: #F5FAFA; margin-bottom: 0; }
.table > thead th {
    background: #F7FAFA; color: var(--muted); font-size: .76rem; font-weight: 700;
    border-bottom: 1px solid var(--line); padding-top: .6rem; padding-bottom: .6rem; white-space: nowrap;
}
.table > :not(caption) > * > * { padding-left: .75rem; padding-right: .75rem; border-color: #E9EFEF; }
.table td.money, .table th.money, .text-end { font-variant-numeric: tabular-nums; }
.table-success { --bs-table-bg: #EAF6EE; }
.table-warning { --bs-table-bg: #FFF6E3; }

/* ---------- Status pills ---------- */
.status {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .15rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap;
    background: #EEF2F2; color: var(--muted);
}
.status::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.status-pending   { background: #FFF3D6; color: #8A5A00; }
.status-confirmed { background: var(--shallow); color: var(--lagoon-dark); }
.status-checkin   { background: #E2F3E8; color: #1E6B40; }
.status-checkout  { background: #ECEFF0; color: #55666A; }
.status-cancelled, .status-rejected { background: #FBE6E5; color: #A3302B; }
.status-noshow    { background: #E6E9EA; color: #33464B; }
.due { color: var(--coral); font-weight: 700; }

/* ---------- Buttons & forms ---------- */
.btn { font-weight: 600; border-radius: .5rem; }
.btn-dark, .btn-primary {
    --bs-btn-bg: var(--lagoon); --bs-btn-border-color: var(--lagoon);
    --bs-btn-hover-bg: var(--lagoon-dark); --bs-btn-hover-border-color: var(--lagoon-dark);
    --bs-btn-active-bg: var(--lagoon-dark); --bs-btn-active-border-color: var(--lagoon-dark);
    --bs-btn-color: #fff; --bs-btn-hover-color: #fff;
}
.btn-outline-dark, .btn-outline-secondary {
    --bs-btn-color: var(--ink); --bs-btn-border-color: var(--line);
    --bs-btn-hover-bg: #EEF4F4; --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: #C9D6D6;
}
.btn-success { --bs-btn-bg: var(--palm); --bs-btn-border-color: var(--palm); --bs-btn-hover-bg: #23724A; --bs-btn-hover-border-color: #23724A; }
.btn-warning { --bs-btn-bg: var(--sun); --bs-btn-border-color: var(--sun); --bs-btn-hover-bg: #DDA02A; --bs-btn-hover-border-color: #DDA02A; }
.form-label { font-weight: 600; font-size: .82rem; margin-bottom: .3rem; color: #33464B; }
.form-control, .form-select { border-color: #CFDADA; background-color: #fff; }
.form-control:focus, .form-select:focus { border-color: var(--lagoon); box-shadow: 0 0 0 .2rem rgba(11,122,131,.15); }
.form-check-input:checked { background-color: var(--lagoon); border-color: var(--lagoon); }

.pagination { --bs-pagination-active-bg: var(--lagoon); --bs-pagination-active-border-color: var(--lagoon); --bs-pagination-color: var(--lagoon); }

.alert { border-radius: .6rem; border: 0; }
.alert-success { background: #E2F3E8; color: #1E6B40; }
.alert-danger { background: #FBE6E5; color: #8E2A25; }
.alert-warning { background: #FFF3D6; color: #6E4A00; }

/* ---------- Dashboard: today board ---------- */
.today-board { display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border: 1px solid var(--line); border-radius: .75rem; overflow: hidden; margin-bottom: 1.5rem; }
.today-board .cell { padding: 1rem 1.25rem; border-left: 1px solid var(--line); display: block; color: var(--ink); }
.today-board .cell:first-child { border-left: 0; }
.today-board .cell:hover { background: #F7FAFA; }
.today-board .num { font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.today-board .label { color: var(--muted); font-weight: 600; margin-top: .35rem; display: flex; align-items: center; gap: .4rem; }
.today-board .cell.arrivals { box-shadow: inset 0 3px 0 var(--lagoon); }
.today-board .cell.inhouse { box-shadow: inset 0 3px 0 var(--palm); }
.today-board .cell.departures { box-shadow: inset 0 3px 0 var(--sun); }
.today-board .cell.transfers { box-shadow: inset 0 3px 0 #3FB8B0; }
@media (max-width: 767.98px) { .today-board { grid-template-columns: repeat(2, 1fr); } .today-board .cell:nth-child(3) { border-left: 0; } .today-board .cell:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-side {
    background: var(--reef); color: #D3E3E4; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between;
    background-image:
        radial-gradient(ellipse 80% 50% at 20% 110%, rgba(63,184,176,.35), transparent 70%),
        radial-gradient(ellipse 60% 40% at 90% 100%, rgba(11,122,131,.45), transparent 70%);
}
.login-side h1 { color: #fff; font-size: 2.4rem; font-weight: 800; letter-spacing: -.02em; max-width: 14ch; }
.login-side p { color: #9FC0C2; max-width: 36ch; }
.login-form { display: grid; place-items: center; padding: 2rem; background: #fff; }
.login-form form { width: 100%; max-width: 340px; }
@media (max-width: 767.98px) { .login-wrap { grid-template-columns: 1fr; } .login-side { padding: 2rem; } .login-side h1 { font-size: 1.8rem; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.section-tabs .tab-count { display: inline-block; min-width: 1.4rem; padding: 0 .35rem; margin-left: .25rem; border-radius: 999px; background: #E6EEEE; color: var(--ink); font-size: .72rem; text-align: center; }
.section-tabs a.active .tab-count { background: var(--shallow); color: var(--lagoon-dark); }

/* ---------- Booking page ---------- */
.doc-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem; }
.doc {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem;
    background: #fff; border: 1px solid var(--line); border-radius: .75rem; padding: .75rem 1rem;
}
.doc-icon { font-size: 1.4rem; color: var(--lagoon); }
.doc-name { font-weight: 700; }
.doc-actions { display: flex; gap: .25rem; }
.doc-off { background: #F7FAFA; }
.doc-off .doc-icon, .doc-off .doc-name { color: var(--muted); }
@media (max-width: 767.98px) { .doc-bar { grid-template-columns: 1fr; } }

.detail-list { display: grid; grid-template-columns: 7.5rem 1fr; gap: .4rem .75rem; margin: 0; }
.detail-list dt { color: var(--muted); font-weight: 600; }
.detail-list dd { margin: 0; }

.charges td { padding: .3rem 0; }
.charges tr.total td { border-top: 1px solid var(--ink); font-weight: 800; font-size: 1rem; padding-top: .5rem; }

.balance-strip { display: flex; flex-wrap: wrap; gap: 1.25rem; font-weight: 500; font-size: .85rem; }
.balance-strip strong { font-weight: 800; margin-left: .25rem; }
tr.row-link { cursor: pointer; }

/* ---------- Collapsible sidebar (desktop) ---------- */
.side-link .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .user .logout-form { margin-left: auto; }
.sidebar-toggle {
    border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: .45rem;
    width: 34px; height: 34px; display: grid; place-items: center; font-size: 1.05rem; flex: none;
}
.sidebar-toggle:hover { background: #EEF4F4; }
.sidebar { transition: width .2s ease, flex-basis .2s ease; }

@media (min-width: 992px) {
    html.sb-collapsed .sidebar { width: 68px; flex-basis: 68px; overflow-x: hidden; }
    html.sb-collapsed .sidebar .brand { justify-content: center; padding: 1.25rem .5rem 1rem; }
    html.sb-collapsed .sidebar .brand-text,
    html.sb-collapsed .sidebar .label,
    html.sb-collapsed .sidebar .soon-tag,
    html.sb-collapsed .sidebar .user-text,
    html.sb-collapsed .sidebar .nav-group-title { display: none; }
    /* every group's icons stay visible in the rail */
    html.sb-collapsed .sidebar .collapse { display: block !important; height: auto !important; }
    html.sb-collapsed .sidebar .nav-group { padding: .4rem .6rem; }
    html.sb-collapsed .side-link { justify-content: center; padding: .55rem 0; gap: 0; }
    html.sb-collapsed .side-link .bi { width: auto; font-size: 1.1rem; }
    html.sb-collapsed .sidebar .user { flex-direction: column; padding: .75rem .5rem; gap: .4rem; }
    html.sb-collapsed .sidebar .user .logout-form { margin-left: 0; }
    html.sb-collapsed .sidebar-toggle .when-open { display: none; }
}
@media (max-width: 991.98px) { .sidebar-toggle { display: none; } }
.sidebar-toggle .when-closed { display: none; }
@media (min-width: 992px) { html.sb-collapsed .sidebar-toggle .when-closed { display: inline; } }

/* ---------- Settings ---------- */
.settings-card { max-width: 980px; }
.rate-now { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin: .35rem 0 .25rem; color: var(--lagoon-dark); }
.logo-preview { width: 96px; height: 96px; border: 1px dashed var(--line); border-radius: .75rem; display: grid; place-items: center; background: #fff; overflow: hidden; }
.logo-preview img { max-width: 84px; max-height: 84px; }

/* ---------- Booking forecast (room × day grid) ---------- */
.fc-month { min-width: 9.5rem; text-align: center; }
.fc-legend { display: flex; flex-wrap: wrap; gap: .9rem; color: var(--muted); font-weight: 600; }
.fc-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.fc-swatch { display: inline-block; width: 1.1rem; height: .75rem; border-radius: 3px; }

.fc-card { overflow: hidden; }
.fc-scroll { overflow-x: auto; }
.fc-grid { --room-w: 8.5rem; --cell: minmax(26px, 1fr); min-width: calc(var(--room-w) + var(--days) * 26px); }
.fc-row {
    display: grid; grid-template-columns: var(--room-w) repeat(var(--days), var(--cell));
    grid-template-rows: 34px; align-items: stretch; border-bottom: 1px solid #E9EFEF;
}
.fc-row > * { grid-row: 1; }
.fc-room {
    grid-column: 1; position: sticky; left: 0; z-index: 3; background: #fff;
    display: flex; flex-direction: column; justify-content: center; padding: 0 .75rem;
    border-right: 1px solid var(--line); line-height: 1.1; white-space: nowrap; overflow: hidden;
}
.fc-room strong { font-size: .9rem; }
.fc-room span { font-size: .7rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.fc-cell { border-left: 1px solid #F0F4F4; }
.fc-weekend { background: #F7FAFA; }
.fc-today { background: #E3F1F0 !important; }

.fc-head, .fc-foot { grid-template-rows: 40px; background: #F7FAFA; }
.fc-head .fc-room, .fc-foot .fc-room { background: #F7FAFA; color: var(--muted); font-size: .76rem; font-weight: 700; }
.fc-head { border-bottom: 1px solid var(--line); }
.fc-day { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; border-left: 1px solid #EDF2F2; }
.fc-dow { font-size: .62rem; color: var(--muted); font-weight: 600; }
.fc-num { font-size: .8rem; font-weight: 700; }
.fc-head .fc-today .fc-num { color: var(--lagoon-dark); }

.fc-foot { border-top: 1px solid var(--line); border-bottom: 0; }
.fc-occ {
    min-width: 22px; height: 20px; border-radius: 5px; display: grid; place-items: center; padding: 0 3px;
    font-size: .72rem; font-weight: 800; color: var(--ink);
    background: color-mix(in srgb, var(--lagoon) calc(var(--occ) * .55), #fff);
}
.fc-occ:empty { background: transparent; }

/* Stay bars */
.fc-bar {
    z-index: 2; margin: 5px 1px; border-radius: 5px; padding: 0 6px;
    display: flex; align-items: center; overflow: hidden; white-space: nowrap;
    font-size: .72rem; font-weight: 700; line-height: 1; border-left: 3px solid; text-decoration: none;
}
.fc-bar span { overflow: hidden; text-overflow: ellipsis; }
.fc-bar:hover { filter: brightness(.96); box-shadow: 0 0 0 2px rgba(15,46,54,.15); }
.fc-cut-start { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-style: dotted; }
.fc-cut-end { border-top-right-radius: 0; border-bottom-right-radius: 0; }

.fc-pending   { background: #FFF3D6; color: #8A5A00; border-color: var(--sun); }
.fc-confirmed { background: var(--shallow); color: var(--lagoon-dark); border-color: var(--lagoon); }
.fc-checkin   { background: #E2F3E8; color: #1E6B40; border-color: var(--palm); }
.fc-checkout  { background: #ECEFF0; color: #55666A; border-color: #9AA8AB; }
.fc-other     { background: #EEF2F2; color: var(--muted); border-color: #C9D6D6; }
.fc-provisional { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.55) 0 4px, transparent 4px 8px); outline: 1px dashed currentColor; outline-offset: -1px; }
.fc-swatch.fc-pending, .fc-swatch.fc-confirmed, .fc-swatch.fc-checkin, .fc-swatch.fc-checkout { border-left: 3px solid; }
.fc-swatch.fc-pending { border-color: var(--sun); }
.fc-swatch.fc-confirmed { border-color: var(--lagoon); }
.fc-swatch.fc-checkin { border-color: var(--palm); }
.fc-swatch.fc-checkout { border-color: #9AA8AB; }

.fc-unplaced .fc-room strong { color: var(--coral); font-size: .78rem; }
.fc-empty { display: flex; align-items: center; padding: 0 1rem; color: var(--muted); }
.price-input { max-width: 7rem; margin-left: auto; }

/* ---------- Users ---------- */
.role { display: inline-block; padding: .15rem .55rem; border-radius: .4rem; font-size: .76rem; font-weight: 700; }
.role-super-admin { background: var(--reef); color: #fff; }
.role-admin { background: var(--shallow); color: var(--lagoon-dark); }
.role-staff { background: #EEF2F2; color: var(--muted); }

/* ---------- GST statement ---------- */
.mira-table th { font-size: .72rem; }
.mira-table td { font-size: .82rem; }

/* ---------- HR ---------- */
.staff-photo { width: 84px; height: 84px; border-radius: 50%; background: var(--shallow); display: grid; place-items: center; overflow: hidden; color: var(--lagoon-dark); font-size: 2.2rem; flex: none; }
.staff-photo img { width: 100%; height: 100%; object-fit: cover; }
