/* =========================================================
   COE SPACE – Corporate UI (Navy / White / Light Grey)
   ========================================================= */
:root {
  --navy-900: #0b1f4d;
  --navy-800: #12296a;
  --navy-700: #1e3a8a;
  --navy-600: #2547a8;
  --accent: #0ea5e9;
  --gold: #f5b301;
  --bg: #f3f5f9;
  --card: #ffffff;
  --border: #e5e9f2;
  --text: #0f172a;
  --muted: #64748b;
  --ok: #16a34a;
  --busy: #dc2626;
  --pend: #f59e0b;
  --na: #94a3b8;
  --radius: 14px;
  --sidebar-w: 264px;
  --bs-primary: #1e3a8a;
  --bs-primary-rgb: 30, 58, 138;
  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-link-color: #1e3a8a;
  --bs-link-color-rgb: 30, 58, 138;
}
body { background: var(--bg); color: var(--text); font-size: .92rem; }
.btn-primary { --bs-btn-bg: var(--navy-700); --bs-btn-border-color: var(--navy-700); --bs-btn-hover-bg: var(--navy-800); --bs-btn-hover-border-color: var(--navy-800); --bs-btn-active-bg: var(--navy-900); }
.btn-outline-primary { --bs-btn-color: var(--navy-700); --bs-btn-border-color: var(--navy-700); --bs-btn-hover-bg: var(--navy-700); --bs-btn-hover-border-color: var(--navy-700); }
.text-primary { color: var(--navy-700) !important; }
.bg-primary { background-color: var(--navy-700) !important; }
.form-control, .form-select { border-color: #d7deea; border-radius: 10px; }
.form-control:focus, .form-select:focus { border-color: var(--navy-600); box-shadow: 0 0 0 .2rem rgba(37, 71, 168, .15); }
.form-label { font-weight: 600; font-size: .82rem; color: #334155; margin-bottom: .3rem; }
.req::after { content: ' *'; color: #dc2626; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1040;
  background: linear-gradient(180deg, var(--navy-900) 0%, #0e2660 100%); color: #cbd5f5;
  display: flex; flex-direction: column; transition: transform .25s ease;
}
.brand { display: flex; gap: .75rem; align-items: center; padding: 1.1rem 1.25rem; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--gold), #f97316); color: var(--navy-900); font-size: 1.3rem; }
.brand strong { display: block; font-size: 1.05rem; letter-spacing: .04em; }
.brand small { display: block; font-size: .7rem; opacity: .7; }
.side-nav { flex: 1; overflow-y: auto; padding: .5rem .75rem 1rem; }
.nav-group { font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; opacity: .5; padding: 1rem .75rem .4rem; }
.side-nav a { display: flex; align-items: center; gap: .7rem; padding: .58rem .75rem; border-radius: 10px; color: #cbd5f5; text-decoration: none; font-weight: 500; font-size: .86rem; margin-bottom: 2px; }
.side-nav a i { font-size: 1.05rem; width: 20px; text-align: center; }
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.side-foot { padding: .9rem 1.25rem; opacity: .45; font-size: .68rem; border-top: 1px solid rgba(255,255,255,.08); }
.has-sidebar .main { margin-left: var(--sidebar-w); }
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .sidebar.open + .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1035; }
  .has-sidebar .main { margin-left: 0; }
}

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .75rem; padding: .65rem 1.5rem; background: rgba(255,255,255,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar-title { font-weight: 700; font-size: 1rem; }
.btn-icon { border: 0; background: transparent; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #334155; }
.btn-icon:hover { background: #eef2f8; }
.btn-user { display: flex; align-items: center; gap: .55rem; border: 0; background: transparent; padding: .25rem .5rem; border-radius: 12px; }
.btn-user:hover { background: #eef2f8; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--navy-700); color: #fff; display: grid; place-items: center; font-weight: 700; }
.notif-dot { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #dc2626; color: #fff; font-size: .65rem; font-weight: 700; display: grid; place-items: center; }
.notif-menu { width: 360px; max-width: 92vw; border-radius: 14px; overflow: hidden; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: block; padding: .7rem 1rem; border-bottom: 1px solid #f1f5f9; color: inherit; text-decoration: none; font-size: .82rem; }
.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: #eff6ff; }
.notif-item .t { font-weight: 600; }

/* ---------- Content ---------- */
.content { padding: 1.5rem; max-width: 1600px; }
@media (max-width: 575.98px) { .content { padding: 1rem; } .topbar { padding: .5rem 1rem; } }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.45rem; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.page-head p { margin: .2rem 0 0; color: var(--muted); }
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); padding: .9rem 1.15rem; font-weight: 700; }
.card-body { padding: 1.15rem; }
.table { --bs-table-bg: transparent; font-size: .86rem; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; border-bottom-width: 1px; background: #f8fafc; white-space: nowrap; }
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background: #f8fbff; }
.badge { font-weight: 600; letter-spacing: .01em; }

/* KPI cards */
.kpi { display: flex; gap: .9rem; align-items: center; padding: 1rem 1.1rem; height: 100%; text-decoration: none; color: inherit; }
.kpi:hover { color: inherit; }
.kpi .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.kpi .v { font-size: 1.55rem; font-weight: 800; line-height: 1.1; }
.kpi .l { color: var(--muted); font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ico-blue { background: #e0e7ff; color: #3730a3; } .ico-green { background: #dcfce7; color: #15803d; }
.ico-amber { background: #fef3c7; color: #b45309; } .ico-red { background: #fee2e2; color: #b91c1c; }
.ico-sky { background: #e0f2fe; color: #0369a1; } .ico-violet { background: #ede9fe; color: #6d28d9; }
.ico-slate { background: #e2e8f0; color: #334155; } .ico-teal { background: #ccfbf1; color: #0f766e; }

.quick a { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 1rem .5rem; border-radius: 12px; border: 1px dashed #cbd5e1; text-decoration: none; color: var(--navy-800); font-weight: 600; font-size: .8rem; text-align: center; height: 100%; }
.quick a i { font-size: 1.4rem; }
.quick a:hover { background: #eef2ff; border-style: solid; border-color: #a5b4fc; }

.chart-box { position: relative; height: 260px; }

/* Availability legend & statuses */
.legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .8rem; }
.legend span::before { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.lg-available::before { background: var(--ok); } .lg-booked::before { background: var(--busy); }
.lg-pending::before { background: var(--pend); } .lg-unavailable::before { background: var(--na); }
.st-available { --st: var(--ok); } .st-booked { --st: var(--busy); } .st-pending { --st: var(--pend); } .st-unavailable { --st: var(--na); }
.room-card { border-left: 5px solid var(--st, #cbd5e1); }
.room-card .status-pill { background: var(--st); color: #fff; padding: .2rem .6rem; border-radius: 99px; font-size: .72rem; font-weight: 700; }
.room-thumb { width: 100%; height: 140px; object-fit: cover; border-radius: 10px; background: linear-gradient(135deg, #dbeafe, #e0e7ff); }
.room-thumb.ph { display: grid; place-items: center; color: #6366f1; font-size: 2.5rem; }

/* Day timeline grid */
.timeline-wrap { overflow-x: auto; }
.timeline { border-collapse: separate; border-spacing: 0; min-width: 900px; width: 100%; font-size: .72rem; }
.timeline th, .timeline td { border-right: 1px solid #eef2f7; border-bottom: 1px solid #eef2f7; padding: 0; height: 38px; }
.timeline thead th { position: sticky; top: 0; background: #f8fafc; font-weight: 600; color: var(--muted); text-align: left; padding-left: 4px; }
.timeline .room { position: sticky; left: 0; background: #fff; min-width: 190px; max-width: 220px; padding: .3rem .6rem; font-weight: 600; z-index: 1; font-size: .78rem; }
.timeline .room small { display: block; color: var(--muted); font-weight: 500; }
.slot { min-width: 34px; }
.slot.s-available { background: #f0fdf4; cursor: pointer; }
.slot.s-available:hover { background: #bbf7d0; }
.slot.s-booked { background: var(--busy); }
.slot.s-pending { background: var(--pend); }
.slot.s-unavailable { background: repeating-linear-gradient(45deg, #cbd5e1, #cbd5e1 4px, #e2e8f0 4px, #e2e8f0 8px); }
.slot.s-closed { background: #f1f5f9; }

/* FullCalendar tweaks */
.fc { font-size: .82rem; }
.fc .fc-toolbar-title { font-size: 1.1rem; font-weight: 700; }
.fc .fc-button-primary { background: var(--navy-700); border-color: var(--navy-700); }
.fc .fc-button-primary:not(:disabled).fc-button-active, .fc .fc-button-primary:hover { background: var(--navy-900); border-color: var(--navy-900); }
.fc-event { cursor: pointer; border-radius: 6px; padding: 1px 3px; }

/* Booking detail */
.dl-grid { display: grid; grid-template-columns: 180px 1fr; gap: .45rem 1rem; font-size: .88rem; }
.dl-grid dt { color: var(--muted); font-weight: 600; }
.dl-grid dd { margin: 0; }
@media (max-width: 575.98px) { .dl-grid { grid-template-columns: 1fr; } .dl-grid dt { margin-top: .4rem; } }
.timeline-hist { list-style: none; padding-left: 0; margin: 0; }
.timeline-hist li { position: relative; padding: 0 0 1rem 1.6rem; border-left: 2px solid #e2e8f0; margin-left: .4rem; }
.timeline-hist li::before { content: ''; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--navy-600); border: 2px solid #fff; box-shadow: 0 0 0 2px #c7d2fe; }
.timeline-hist li:last-child { border-left-color: transparent; }

.step-head { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1rem; }
.step-head .n { width: 28px; height: 28px; border-radius: 50%; background: var(--navy-700); color: #fff; display: grid; place-items: center; font-size: .8rem; }
.avail-box { border-radius: 12px; padding: .8rem 1rem; font-size: .86rem; }
.meal-card { border: 1px solid var(--border); border-radius: 12px; padding: 1rem; background: #fbfcfe; position: relative; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem; }
.menu-opt { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--border); border-radius: 10px; padding: .45rem .6rem; background: #fff; font-size: .8rem; }
.menu-opt input[type=number] { width: 72px; }

/* Auth pages */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { background: radial-gradient(1200px 600px at -10% -10%, #2547a8 0%, transparent 60%), linear-gradient(160deg, var(--navy-900), #0e2660); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-hero h1 { font-weight: 800; font-size: 2.4rem; letter-spacing: -.02em; }
.auth-hero .feat { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: 1rem; opacity: .92; }
.auth-hero .feat i { font-size: 1.3rem; color: var(--gold); }
.auth-form { display: grid; place-items: center; padding: 2rem; background: #fff; }
.auth-form .inner { width: 100%; max-width: 400px; }
@media (max-width: 991.98px) { .auth-wrap { grid-template-columns: 1fr; } .auth-hero { display: none; } }

/* Room display (kiosk) */
.kiosk { min-height: 100vh; background: linear-gradient(160deg, var(--navy-900), #0e2660); color: #fff; padding: 3vw; display: flex; flex-direction: column; }
.kiosk .now { font-size: 4vw; font-weight: 800; line-height: 1.1; }
.kiosk .status { display: inline-block; padding: .5vw 1.5vw; border-radius: 99px; font-weight: 800; font-size: 1.6vw; }

/* Print */
@media print {
  .sidebar, .topbar, .no-print, .alert { display: none !important; }
  .has-sidebar .main { margin: 0 !important; }
  .content { padding: 0 !important; max-width: none; }
  body { background: #fff; }
  .card { border: 0; box-shadow: none; }
}
.print-doc { max-width: 820px; margin: 0 auto; background: #fff; padding: 2rem 2.4rem; }
.print-doc .hd { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid var(--navy-900); padding-bottom: 1rem; margin-bottom: 1.2rem; }
.print-doc table td { padding: .35rem .5rem; vertical-align: top; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty i { font-size: 2.4rem; display: block; margin-bottom: .5rem; opacity: .5; }
.cursor-pointer { cursor: pointer; }
.small-muted { font-size: .78rem; color: var(--muted); }
.kpi-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
@media (max-width: 575.98px) { .kpi-grid { grid-template-columns: 1fr 1fr; } }
