/* ============================================================
   EasyMan Hotel ERP - Main Stylesheet
   Bootstrap 5 + Custom Sidebar Layout
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 64px;
    --topbar-height: 56px;
    --sidebar-bg: #1a1f2e;
    --sidebar-text: #c9d1e0;
    --sidebar-active-bg: rgba(13,110,253,.18);
    --sidebar-active-text: #4d9fff;
    --sidebar-hover-bg: rgba(255,255,255,.06);
    --topbar-bg: #ffffff;
    --body-bg: #f4f6fb;
    --card-border-radius: .75rem;
}

[data-bs-theme="dark"] {
    --topbar-bg: #1e2330;
    --body-bg: #13172a;
    --sidebar-bg: #111420;
}

/* ── Layout ────────────────────────────────────────────────── */
html, body { height: 100%; }

.easyman-body {
    display: flex;
    background: var(--body-bg);
    min-height: 100vh;
    overflow-x: hidden;
}

.easyman-auth-body {
    background: linear-gradient(135deg, #1a1f2e 0%, #0d6efd 100%);
    min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.easyman-sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    transition: width .25s ease, transform .25s ease;
    overflow: hidden;
}

.easyman-sidebar .sidebar-brand {
    min-height: var(--topbar-height);
    color: #fff;
}

.easyman-sidebar .nav-link {
    color: var(--sidebar-text);
    border-radius: .5rem;
    font-size: .875rem;
    padding: .45rem .75rem;
    transition: background .15s, color .15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.easyman-sidebar .nav-link:hover {
    background: var(--sidebar-hover-bg);
    color: #fff;
}

.easyman-sidebar .nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
}

.easyman-sidebar .sidebar-footer {
    color: var(--sidebar-text);
    font-size: .8rem;
}

/* ── Main Content ──────────────────────────────────────────── */
.easyman-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    transition: margin-left .25s ease;
    display: flex;
    flex-direction: column;
}

/* ── Top Bar ───────────────────────────────────────────────── */
.easyman-topbar {
    background: var(--topbar-bg);
    border-bottom: 1px solid rgba(0,0,0,.08);
    min-height: var(--topbar-height);
    z-index: 1030;
}

[data-bs-theme="dark"] .easyman-topbar {
    border-bottom-color: rgba(255,255,255,.08);
}

/* ── Sidebar Collapsed ─────────────────────────────────────── */
body.sidebar-collapsed .easyman-sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .easyman-main {
    margin-left: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .easyman-sidebar .nav-link span,
body.sidebar-collapsed .easyman-sidebar .sidebar-brand div,
body.sidebar-collapsed .easyman-sidebar .sidebar-footer .flex-grow-1,
body.sidebar-collapsed .easyman-sidebar .sidebar-footer a,
body.sidebar-collapsed .easyman-sidebar small.text-muted {
    display: none !important;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
    border-radius: var(--card-border-radius) !important;
}

/* ── Tables ────────────────────────────────────────────────── */
.table th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
}

.table td {
    font-size: .875rem;
    vertical-align: middle;
}

/* ── Badges ────────────────────────────────────────────────── */
.badge {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .03em;
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-label {
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: .3rem;
}

/* ── Page Header ───────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: .5rem;
}

.page-header h4 {
    margin: 0;
    font-weight: 700;
}

/* ── Stat Cards ────────────────────────────────────────────── */
.stat-card {
    border-radius: var(--card-border-radius);
    border: none;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: transform .15s, box-shadow .15s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

/* ── Room Status Grid ──────────────────────────────────────── */
.room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: .5rem;
}

.room-tile {
    border-radius: .5rem;
    padding: .6rem;
    text-align: center;
    cursor: pointer;
    font-size: .8rem;
    font-weight: 600;
    transition: transform .1s;
    border: 2px solid transparent;
}

.room-tile:hover { transform: scale(1.05); }
.room-tile.available    { background: #d1e7dd; color: #0a3622; border-color: #a3cfbb; }
.room-tile.occupied     { background: #f8d7da; color: #58151c; border-color: #f1aeb5; }
.room-tile.reserved     { background: #fff3cd; color: #664d03; border-color: #ffe69c; }
.room-tile.cleaning     { background: #cff4fc; color: #055160; border-color: #9eeaf9; }
.room-tile.maintenance  { background: #e2e3e5; color: #41464b; border-color: #c4c8cb; }
.room-tile.blocked      { background: #f8d7da; color: #58151c; border-color: #f1aeb5; }

/* ── POS Interface ─────────────────────────────────────────── */
.pos-menu-item {
    cursor: pointer;
    transition: transform .1s, box-shadow .1s;
    border-radius: .5rem;
}

.pos-menu-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

/* ── Print Styles ──────────────────────────────────────────── */
@media print {
    .easyman-sidebar,
    .easyman-topbar,
    .no-print {
        display: none !important;
    }
    .easyman-main {
        margin-left: 0 !important;
    }
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .easyman-sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }
    .easyman-main {
        margin-left: 0 !important;
    }
    body.sidebar-open .easyman-sidebar {
        transform: translateX(0);
    }
    body.sidebar-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.5);
        z-index: 1039;
    }
}

/* ── Scrollbar ─────────────────────────────────────────────── */
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }
