/* ==================================================================
   Hotel Management System — UI theme
   Built on top of Bootstrap 5. Mobile-first, modern, clean.
   ================================================================== */

:root {
    --hms-primary: #4f46e5;
    --hms-primary-dark: #4338ca;
    --hms-primary-soft: #eef2ff;
    --hms-sidebar-bg: #0f172a;
    --hms-sidebar-bg-2: #1e293b;
    --hms-sidebar-muted: #94a3b8;
    --hms-body-bg: #f1f5f9;
    --hms-card-border: #e5e7eb;
    --hms-radius: 14px;
    --hms-sidebar-width: 260px;
    --hms-shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
    --hms-shadow-lg: 0 10px 30px rgba(15, 23, 42, .12);
}

* { -webkit-tap-highlight-color: transparent; }

body {
    background: var(--hms-body-bg);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    font-size: .95rem;
}

/* ---- Buttons & controls ---------------------------------------- */
.btn { border-radius: 10px; font-weight: 500; }
.btn-primary {
    --bs-btn-bg: var(--hms-primary);
    --bs-btn-border-color: var(--hms-primary);
    --bs-btn-hover-bg: var(--hms-primary-dark);
    --bs-btn-hover-border-color: var(--hms-primary-dark);
    --bs-btn-active-bg: var(--hms-primary-dark);
    --bs-btn-disabled-bg: var(--hms-primary);
}
.btn-outline-primary {
    --bs-btn-color: var(--hms-primary);
    --bs-btn-border-color: var(--hms-primary);
    --bs-btn-hover-bg: var(--hms-primary);
    --bs-btn-hover-border-color: var(--hms-primary);
}
.form-control, .form-select {
    border-radius: 10px;
    border-color: #e2e8f0;
    padding: .55rem .85rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--hms-primary);
    box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .15);
}
.form-label { font-weight: 600; font-size: .82rem; color: #475569; margin-bottom: .35rem; }

/* ---- App shell ------------------------------------------------- */
.app-sidebar {
    width: var(--hms-sidebar-width);
    background: linear-gradient(180deg, var(--hms-sidebar-bg) 0%, var(--hms-sidebar-bg-2) 100%);
    color: #e2e8f0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    padding: 1rem .85rem;
}
.app-brand {
    display: flex; align-items: center; gap: .65rem;
    padding: .5rem .6rem 1.1rem;
    color: #fff; text-decoration: none;
}
.app-brand .brand-logo {
    width: 40px; height: 40px; border-radius: 11px;
    background: linear-gradient(135deg, var(--hms-primary) 0%, #7c3aed 100%);
    display: grid; place-items: center; font-size: 1.25rem; color: #fff;
    box-shadow: 0 6px 16px rgba(79, 70, 229, .45);
}
.app-brand .brand-name { font-weight: 700; font-size: 1.05rem; line-height: 1.1; }
.app-brand .brand-sub { font-size: .7rem; color: var(--hms-sidebar-muted); }

.sidebar-heading {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .09em;
    color: #64748b; padding: 1rem .75rem .4rem; font-weight: 700;
}
.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: .75rem;
    color: #cbd5e1; padding: .62rem .75rem; border-radius: 10px;
    font-weight: 500; margin-bottom: 2px; transition: all .15s ease;
}
.sidebar-nav .nav-link i { font-size: 1.1rem; width: 22px; text-align: center; }
.sidebar-nav .nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar-nav .nav-link.active {
    background: var(--hms-primary); color: #fff;
    box-shadow: 0 6px 16px rgba(79, 70, 229, .4);
}
.sidebar-footer { margin-top: auto; padding-top: .75rem; border-top: 1px solid rgba(255,255,255,.08); }

.app-main { margin-left: var(--hms-sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }

.app-topbar {
    background: #fff; border-bottom: 1px solid var(--hms-card-border);
    padding: .8rem 1.4rem; display: flex; align-items: center; gap: 1rem;
    position: sticky; top: 0; z-index: 1020;
}
.app-topbar .page-title { font-weight: 700; font-size: 1.15rem; margin: 0; }
.app-content { padding: 1.6rem 1.4rem; flex: 1; }

/* ---- Avatars & chips ------------------------------------------- */
.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--hms-primary-soft); color: var(--hms-primary);
    display: grid; place-items: center; font-weight: 700; font-size: .82rem;
}
.avatar-sm { width: 32px; height: 32px; font-size: .72rem; }

/* ---- Cards ----------------------------------------------------- */
.card { border: 1px solid var(--hms-card-border); border-radius: var(--hms-radius); box-shadow: var(--hms-shadow); }
.card-header { background: #fff; border-bottom: 1px solid var(--hms-card-border); font-weight: 600; padding: 1rem 1.25rem; border-radius: var(--hms-radius) var(--hms-radius) 0 0 !important; }

/* ---- Stat cards ------------------------------------------------ */
.stat-card { position: relative; overflow: hidden; }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.stat-card .stat-label { color: #64748b; font-size: .82rem; font-weight: 600; }
.stat-card .stat-icon {
    width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; font-size: 1.5rem;
}
.tint-indigo { background: #eef2ff; color: #4f46e5; }
.tint-green  { background: #ecfdf5; color: #10b981; }
.tint-amber  { background: #fffbeb; color: #f59e0b; }
.tint-rose   { background: #fff1f2; color: #f43f5e; }
.tint-sky    { background: #eff6ff; color: #3b82f6; }
.tint-violet { background: #f5f3ff; color: #8b5cf6; }

/* ---- Tables ---------------------------------------------------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table thead th {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
    color: #64748b; font-weight: 700; border-bottom: 1px solid var(--hms-card-border);
    padding: .8rem 1rem; white-space: nowrap;
}
.table tbody td { padding: .85rem 1rem; vertical-align: middle; border-bottom: 1px solid #f1f5f9; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* ---- Badges ---------------------------------------------------- */
.badge-soft { padding: .35em .7em; border-radius: 8px; font-weight: 600; font-size: .72rem; }
.badge-available, .badge-active, .badge-checked_in { background: #ecfdf5; color: #059669; }
.badge-occupied, .badge-checked_out { background: #eff6ff; color: #2563eb; }
.badge-inactive { background: #f1f5f9; color: #64748b; }
.badge-admin { background: #f5f3ff; color: #7c3aed; }
.badge-receptionist { background: #ecfeff; color: #0891b2; }

/* ---- Empty state ----------------------------------------------- */
.empty-state { text-align: center; padding: 3.5rem 1rem; color: #94a3b8; }
.empty-state i { font-size: 3rem; opacity: .5; }

/* ---- Auth page ------------------------------------------------- */
.auth-wrap {
    min-height: 100vh; display: grid; place-items: center;
    background: linear-gradient(135deg, #0f172a 0%, #312e81 55%, #4f46e5 100%);
    padding: 1.5rem;
}
.auth-card {
    width: 100%; max-width: 410px; background: #fff;
    border-radius: 20px; box-shadow: var(--hms-shadow-lg); padding: 2.4rem 2.2rem;
}
.auth-logo {
    width: 58px; height: 58px; border-radius: 16px; margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--hms-primary) 0%, #7c3aed 100%);
    display: grid; place-items: center; font-size: 1.7rem; color: #fff;
    box-shadow: 0 10px 24px rgba(79, 70, 229, .5);
}

/* ---- Responsive ------------------------------------------------ */
@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); transition: transform .25s ease; }
    .app-sidebar.open { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .sidebar-backdrop {
        position: fixed; inset: 0; background: rgba(15, 23, 42, .5);
        z-index: 1035; display: none;
    }
    .sidebar-backdrop.show { display: block; }
}
@media (min-width: 992px) {
    .sidebar-toggle { display: none !important; }
}

/* ---- Utilities ------------------------------------------------- */
.text-muted-2 { color: #94a3b8 !important; }
.cursor-pointer { cursor: pointer; }
.page-header { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
a { text-decoration: none; }
