/* =====================================================================
   Oxford Admin Panel
   ===================================================================== */
:root { --navy: #13213c; --navy-2: #1d3157; --gold: #c39a3e; --gold-dark: #a8822c; --bg: #f4f5f8; --sidebar-w: 248px; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: #23262d; font-size: .94rem; }
.text-gold { color: var(--gold); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; font-weight: 500; }
.btn-gold:hover, .btn-gold:focus { background: var(--gold-dark); border-color: var(--gold-dark); color: #fff; }
.form-control:focus, .form-select:focus { border-color: var(--gold); box-shadow: 0 0 0 .2rem rgba(195,154,62,.2); }
.form-check-input:checked { background-color: var(--gold); border-color: var(--gold); }
.brand-mark { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: var(--gold); font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; font-weight: 700; border: 2px solid var(--gold); flex-shrink: 0; }

/* Login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem;
  background: linear-gradient(135deg, var(--navy), var(--navy-2) 60%, #3b3220); }
.login-card { background: #fff; width: 100%; max-width: 400px; border-radius: 16px; padding: 2.25rem; box-shadow: 0 25px 60px rgba(0,0,0,.3); }
.login-card h1 { font-family: 'Cormorant Garamond', serif; font-weight: 700; }
.login-card .brand-mark { width: 56px; height: 56px; font-size: 2rem; }

/* Sidebar */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--navy); color: #fff; display: flex; flex-direction: column; z-index: 1040; transition: transform .25s; }
.sidebar-brand { display: flex; align-items: center; gap: .7rem; padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand strong { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; display: block; line-height: 1; }
.sidebar-brand small { font-size: .65rem; text-transform: uppercase; letter-spacing: .18em; color: var(--gold); }
.sidebar-nav { padding: 1rem .75rem; flex: 1; overflow-y: auto; }
.sidebar-nav a { display: flex; align-items: center; gap: .75rem; padding: .65rem .9rem; border-radius: 10px; color: rgba(255,255,255,.72); text-decoration: none; margin-bottom: .2rem; font-weight: 500; }
.sidebar-nav a i { font-size: 1.1rem; }
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav a.active { background: var(--gold); color: #fff; }
.sidebar-foot { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-backdrop { display: none; }

.admin-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.admin-topbar { background: #fff; padding: .9rem 1.5rem; display: flex; align-items: center; border-bottom: 1px solid #e8e9ee; position: sticky; top: 0; z-index: 1020; }
.admin-topbar h1 { font-weight: 600; }
.admin-content { padding: 1.5rem; flex: 1; }

/* Panels */
.panel { background: #fff; border-radius: 12px; border: 1px solid #e8e9ee; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid #f0f1f4; }
.panel-head h2 { font-size: 1rem; font-weight: 600; margin: 0; }
.panel-body { padding: 1.25rem; }
.panel-foot { padding: .8rem 1.25rem; border-top: 1px solid #f0f1f4; }
.panel .table { --bs-table-bg: transparent; }
.panel .table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; font-weight: 600; background: #fafbfc; white-space: nowrap; }
.panel .table td, .panel .table th { padding: .7rem 1rem; }

/* Stats */
.stat-card { background: #fff; border: 1px solid #e8e9ee; border-radius: 12px; padding: 1.1rem; display: flex; gap: 1rem; align-items: center; height: 100%; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; flex-shrink: 0; }
.tone-navy .stat-icon { background: #e6eaf3; color: var(--navy); }
.tone-green .stat-icon { background: #e5f5ec; color: #198754; }
.tone-blue .stat-icon { background: #e4effd; color: #0d6efd; }
.tone-amber .stat-icon { background: #fff4dc; color: #b7791f; }
.stat-label { font-size: .78rem; color: #6b7280; font-weight: 500; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; color: var(--navy); }
.stat-sub { font-size: .75rem; color: #9ca3af; }

/* Bar chart */
.bar-chart { display: flex; gap: .75rem; height: 200px; align-items: stretch; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.bar-val { font-size: .75rem; font-weight: 600; color: var(--navy); }
.bar-track { flex: 1; width: 100%; max-width: 48px; background: #f1f2f6; border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden; margin: .3rem 0; }
.bar { width: 100%; background: linear-gradient(to top, var(--navy), var(--navy-2)); border-radius: 8px 8px 0 0; transition: height .4s; }
.bar-col:first-child .bar { background: linear-gradient(to top, var(--gold-dark), var(--gold)); }
.bar-label { font-size: .72rem; color: #6b7280; white-space: nowrap; }

/* Bookings modal */
.form-group-title { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: #6b7280; font-weight: 600; margin-bottom: .75rem; }
.side-box { background: #fafbfc; border: 1px solid #eef0f3; border-radius: 12px; padding: 1.1rem; }
.total-line { display: flex; justify-content: space-between; align-items: center; background: #fff; border: 1px dashed #d8dbe2; border-radius: 10px; padding: .7rem .9rem; }
.total-line strong { font-size: 1.25rem; color: var(--navy); }
.quick-actions { background: #fff8e8; border: 1px solid #f3e3b8; border-radius: 10px; padding: .7rem .9rem; }
.bookings-table td { font-size: .88rem; }

/* Tabs */
.admin-tabs .nav-link { color: #4b5563; border-radius: 30px; padding: .45rem 1.1rem; font-weight: 500; }
.admin-tabs .nav-link.active { background: var(--navy); }

/* Room tiles */
.group-title { font-weight: 600; margin: .75rem 0 0; font-size: .95rem; }
.room-tile { background: #fff; border: 1px solid #e8e9ee; border-left: 4px solid; border-radius: 10px; padding: .85rem; height: 100%; }
.room-tile.tone-success { border-left-color: #198754; }
.room-tile.tone-primary { border-left-color: #0d6efd; }
.room-tile.tone-warning { border-left-color: #ffc107; }
.room-tile.tone-danger { border-left-color: #dc3545; }
.room-no { font-size: 1.35rem; font-weight: 700; color: var(--navy); line-height: 1; }
.room-legend span { background: #fff; border: 1px solid #e8e9ee; border-radius: 30px; padding: .25rem .75rem; }

/* Type cards */
.type-card { background: #fff; border: 1px solid #e8e9ee; border-radius: 12px; overflow: hidden; height: 100%; }
.type-card.inactive { opacity: .65; }
.type-card h5 { font-weight: 600; font-size: 1.05rem; }
.type-img { aspect-ratio: 16/8; background: #e9ecf2 center/cover; position: relative; display: grid; place-items: center; color: #b0b6c3; font-size: 2.5rem; }
.type-img .badge { position: absolute; top: 10px; left: 10px; font-size: .7rem; }
.img-preview { width: 120px; height: 80px; border-radius: 8px; background: #e9ecf2 center/cover; display: grid; place-items: center; color: #b0b6c3; font-size: 1.5rem; flex-shrink: 0; }

/* Calendar */
.cal-wrap { overflow-x: auto; }
.cal-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .8rem; }
.cal-table th, .cal-table td { border-bottom: 1px solid #f0f1f4; border-right: 1px solid #f4f5f8; text-align: center; min-width: 54px; height: 40px; padding: 0; }
.cal-table thead th { background: #fafbfc; font-weight: 600; padding: .4rem .2rem; line-height: 1.1; position: sticky; top: 0; }
.cal-table thead th span, .cal-table thead th small { display: block; font-size: .65rem; color: #9ca3af; font-weight: 500; }
.cal-table thead th.is-today { background: var(--gold); color: #fff; }
.cal-table thead th.is-today span, .cal-table thead th.is-today small { color: #fff; }
.cal-table .is-weekend { background: #f7f8fb; }
.cal-room { position: sticky; left: 0; background: #fff !important; z-index: 2; text-align: left !important; padding: 0 .8rem !important; min-width: 90px !important; font-weight: 600; white-space: nowrap; border-right: 2px solid #e8e9ee !important; }
.cal-group td { background: #f4f5f8; text-align: left !important; padding: .35rem .8rem !important; font-weight: 600; color: #4b5563; height: auto; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.cal-cell.is-today { background: #fffaf0; }
.cal-cell.booked a { display: block; height: 100%; line-height: 40px; color: #fff; text-decoration: none; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: clip; padding-left: 4px; text-align: left; }
.cal-cell.starts { border-left: 3px solid rgba(0,0,0,.25); }
.st-pending { background: #f6c453; } .cal-cell.st-pending a { color: #3d2e00; }
.st-confirmed { background: #3b82f6; }
.st-checked_in { background: #16a34a; }
.st-checked_out { background: #9ca3af; }
.st-blocked { background: repeating-linear-gradient(45deg, #f3f4f6, #f3f4f6 5px, #e5e7eb 5px, #e5e7eb 10px); }
.cal-legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }

/* Responsive */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .admin-main { margin-left: 0; }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035; }
  .admin-content { padding: 1rem; }
  .admin-topbar { padding: .75rem 1rem; }
}
@media (max-width: 575.98px) {
  .stat-card { flex-direction: column; align-items: flex-start; gap: .5rem; padding: .9rem; }
  .stat-value { font-size: 1.3rem; }
  .admin-topbar h1 { font-size: 1.05rem; }
  .bar-chart { gap: .35rem; }
}
