/* =====================================================================
   Hotel Management System — Admin Panel Styles
   ===================================================================== */
:root {
  --hms-sidebar-w: 262px;
  --hms-sidebar-collapsed: 72px;
  --hms-sidebar-bg: #1b2436;
  --hms-sidebar-active: #2e8b57;
  --hms-topbar-h: 60px;
  --hms-body-bg: #f2f5f9;
}

body { background: var(--hms-body-bg); font-size: .925rem; }

/* ---------- Sidebar ---------- */
#admin-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--hms-sidebar-w);
  background: var(--hms-sidebar-bg); color: #cfd8e3; z-index: 1040;
  display: flex; flex-direction: column; transition: width .25s ease, transform .25s ease;
  overflow-y: auto; overflow-x: hidden;
}
#admin-sidebar .brand {
  display: flex; align-items: center; gap: .65rem; padding: .9rem 1rem;
  min-height: var(--hms-topbar-h); border-bottom: 1px solid rgba(255,255,255,.08);
  white-space: nowrap;
}
#admin-sidebar .brand img { height: 34px; width: auto; border-radius: 6px; }
#admin-sidebar .brand .brand-name { font-weight: 700; font-size: 1.05rem; color: #fff; line-height: 1.1; }
#admin-sidebar .brand .brand-sub { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: #8fa1b8; }
#admin-sidebar .menu { padding: .75rem .6rem 2rem; flex: 1; }
#admin-sidebar .menu-label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .1em;
  color: #77869c; padding: .85rem .75rem .3rem; white-space: nowrap;
}
#admin-sidebar .nav-link {
  display: flex; align-items: center; gap: .7rem; color: #cfd8e3;
  padding: .55rem .75rem; border-radius: .45rem; white-space: nowrap;
  font-size: .9rem; margin-bottom: .12rem;
}
#admin-sidebar .nav-link i { font-size: 1.06rem; width: 1.35rem; text-align: center; flex: 0 0 auto; }
#admin-sidebar .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
#admin-sidebar .nav-link.active { background: var(--hms-sidebar-active); color: #fff; }
#admin-sidebar .nav-link .badge { margin-left: auto; }

/* Collapsed state (desktop) */
body.sidebar-collapsed #admin-sidebar { width: var(--hms-sidebar-collapsed); }
body.sidebar-collapsed #admin-sidebar .brand .brand-text,
body.sidebar-collapsed #admin-sidebar .nav-link span,
body.sidebar-collapsed #admin-sidebar .menu-label,
body.sidebar-collapsed #admin-sidebar .nav-link .badge { display: none; }
body.sidebar-collapsed #admin-content { margin-left: var(--hms-sidebar-collapsed); }

/* ---------- Content area ---------- */
#admin-content {
  margin-left: var(--hms-sidebar-w); min-height: 100vh;
  display: flex; flex-direction: column; transition: margin-left .25s ease;
}
#admin-topbar {
  position: sticky; top: 0; z-index: 1030; height: var(--hms-topbar-h);
  background: #fff; border-bottom: 1px solid #e6ebf2;
  display: flex; align-items: center; gap: .75rem; padding: 0 1rem;
}
#admin-main { padding: 1.25rem; flex: 1; }

/* ---------- Cards / stats ---------- */
.stat-card { border: 0; border-radius: .8rem; box-shadow: 0 2px 10px rgba(16,34,60,.06); }
.stat-card .icon-wrap {
  width: 46px; height: 46px; border-radius: .65rem; display: flex;
  align-items: center; justify-content: center; font-size: 1.35rem;
}
.card { border: 0; border-radius: .8rem; box-shadow: 0 2px 10px rgba(16,34,60,.06); }
.card-header { background: #fff; border-bottom: 1px solid #eef1f6; font-weight: 600; }

.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.table-sm td, .table-sm th { padding: .55rem .5rem; vertical-align: middle; }

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #16222f 0%, #2e8b57 160%);
}
.login-card { width: 100%; max-width: 420px; }

/* ---------- Webcam capture ---------- */
.webcam-box { background: #101418; border-radius: .6rem; overflow: hidden; position: relative; }
.webcam-box video, .webcam-box canvas { width: 100%; display: block; }
.webcam-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: .85rem; }

/* ---------- Misc ---------- */
.avatar-sm { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 110px; height: 110px; border-radius: 12px; object-fit: cover; }
.dropdown-menu { box-shadow: 0 8px 24px rgba(16,34,60,.12); border: 0; }
.required::after { content: " *"; color: #dc3545; }
.empty-state { text-align: center; padding: 3rem 1rem; color: #64748b; }
.empty-state i { font-size: 2.6rem; display: block; margin-bottom: .6rem; opacity: .5; }

/* ---------- Mobile ---------- */
@media (max-width: 991.98px) {
  #admin-sidebar { transform: translateX(-100%); width: var(--hms-sidebar-w) !important; }
  body.sidebar-open #admin-sidebar { transform: translateX(0); }
  #admin-content, body.sidebar-collapsed #admin-content { margin-left: 0; }
  .sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1035;
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
  }
  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
}
.sidebar-backdrop { display: none; }
@media (min-width: 992px) { .sidebar-backdrop { display: none !important; } }

/* ---------- Booking calendar ---------- */
.cal-table td, .cal-table th { font-size: .68rem; padding: .18rem .1rem; }
.cal-room-col { min-width: 120px; background: #f8fafc; }
.cal-cell { height: 30px; }
.cal-legend { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; }
.cal-pending { background: #fff3cd !important; }
.cal-confirmed { background: #cff4fc !important; }
.cal-in { background: #d1e7dd !important; color: #0f5132; }
.cal-out { background: #e2e3e5 !important; }
.cal-legend.cal-pending { background: #fff3cd; border: 1px solid #ffec99; }
.cal-legend.cal-confirmed { background: #cff4fc; border: 1px solid #b6effb; }
.cal-legend.cal-in { background: #d1e7dd; border: 1px solid #badbcc; }
.cal-legend.cal-out { background: #e2e3e5; border: 1px solid #d6d8db; }

/* ---------- Print (invoices/reports) ---------- */

@media print {
  #admin-sidebar, #admin-topbar, .no-print, .sidebar-backdrop, .btn, .dataTables_filter, .dataTables_info, .dataTables_paginate { display: none !important; }
  #admin-content { margin: 0 !important; }
  body { background: #fff !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ---------- Dashboard room status cards ---------- */
.room-card {
  display: block; height: 100%; background: #fff; border-radius: .8rem;
  border: 1px solid #eef1f6; box-shadow: 0 2px 10px rgba(16,34,60,.06);
  padding: .75rem .8rem; color: inherit; text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.room-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16,34,60,.12); }
a.room-card { cursor: pointer; }
a.room-card:hover { border-color: #2e8b57; }
.room-card .room-num { font-size: .95rem; line-height: 1.2; }
.room-card .room-meta { font-size: .7rem; }
.room-card .room-status { font-size: .6rem; }
.room-card .room-price { font-size: .72rem; }
.room-card .room-go { font-size: .72rem; font-weight: 600; color: #2e8b57; opacity: .75; transition: opacity .12s ease; white-space: nowrap; }
a.room-card:hover .room-go { opacity: 1; }
.room-card-available    { border-left: 3px solid #2e8b57; }
.room-card-occupied     { border-left: 3px solid #dc3545; }
.room-card-reserved     { border-left: 3px solid #0aa2c0; }
.room-card-cleaning     { border-left: 3px solid #ffc107; }
.room-card-maintenance  { border-left: 3px solid #6c757d; }
.room-card-checkout_pending { border-left: 3px solid #fd7e14; }

/* Dashboard Room Image Size Fix */
.room-card-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
    display: block;
}
