/* ============================================
   HMS Robotel - Main Stylesheet
   Theme: Teal & White
   ============================================ */

:root {
    --teal:        #0d9488;
    --teal-dark:   #0f766e;
    --teal-darker: #115e59;
    --teal-light:  #ccfbf1;
    --teal-pale:   #f0fdfa;
    --white:       #ffffff;
    --gray-50:     #f9fafb;
    --gray-100:    #f3f4f6;
    --gray-200:    #e5e7eb;
    --gray-300:    #d1d5db;
    --gray-500:    #6b7280;
    --gray-700:    #374151;
    --gray-900:    #111827;
    --sidebar-w:   260px;
    --topbar-h:    60px;
    --radius:      10px;
    --shadow:      0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:   0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg:   0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    font-size: 14px;
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; }

/* ============================================
   LAYOUT
   ============================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .25s ease;
}

.main-content.expanded {
    margin-left: 64px;
}

.content-area {
    flex: 1;
    padding: 24px;
    margin-top: var(--topbar-h);
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--teal-darker) 0%, var(--teal-dark) 100%);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width .25s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: 64px;
}

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    min-height: var(--topbar-h);
}

.sidebar-brand-icon {
    width: 36px; height: 36px;
    background: rgba(255,255,255,.15);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: #fff;
    flex-shrink: 0;
}

.sidebar-brand-text { overflow: hidden; }
.brand-name {
    display: block; color: #fff;
    font-weight: 700; font-size: 15px;
    white-space: nowrap;
}
.brand-sub {
    color: rgba(255,255,255,.6);
    font-size: 11px;
}

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .user-info,
.sidebar.collapsed .btn-logout span {
    display: none;
}

/* Nav */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.2) transparent;
}

.nav-section {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    color: rgba(255,255,255,.45);
    padding: 14px 16px 4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: rgba(255,255,255,.8);
    font-size: 13.5px;
    border-radius: 0;
    transition: background .15s, color .15s;
    white-space: nowrap;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255,255,255,.12);
    color: #fff;
}

.nav-item.active {
    background: rgba(255,255,255,.2);
    color: #fff;
    font-weight: 600;
    border-left: 3px solid #fff;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

/* Sidebar footer */
.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,.1);
}

.sidebar-user { display: flex; align-items: center; gap: 10px; flex: 1; overflow: hidden; }

.user-avatar { font-size: 28px; color: rgba(255,255,255,.7); flex-shrink: 0; }

.user-name {
    color: #fff; font-size: 13px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role { color: rgba(255,255,255,.55); font-size: 11px; }

.btn-logout {
    color: rgba(255,255,255,.6);
    font-size: 17px;
    padding: 6px;
    border-radius: 6px;
    transition: color .15s, background .15s;
}
.btn-logout:hover { color: #fff; background: rgba(255,255,255,.15); }

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
    position: fixed;
    top: 0; right: 0;
    left: var(--sidebar-w);
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    z-index: 999;
    transition: left .25s ease;
    box-shadow: var(--shadow);
}

.main-content.expanded .topbar { left: 64px; }

.sidebar-toggle {
    background: none; border: none;
    width: 36px; height: 36px;
    border-radius: 8px;
    color: var(--gray-500);
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--gray-100); color: var(--teal); }

.topbar-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--gray-700);
    flex: 1;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-clock {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--gray-500);
    gap: 4px;
}

.topbar-user .btn-link {
    color: var(--gray-700);
    font-size: 13.5px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background .15s;
}
.topbar-user .btn-link:hover { background: var(--gray-100); }

.badge-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* ============================================
   CARDS / PANELS
   ============================================ */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--gray-200);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.card-header h5, .card-header h6 {
    margin: 0;
    font-weight: 600;
    color: var(--gray-700);
}

.card-body { padding: 18px; }

/* Stat cards */
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-icon.teal    { background: var(--teal-light); color: var(--teal); }
.stat-icon.green   { background: #d1fae5; color: #059669; }
.stat-icon.orange  { background: #ffedd5; color: #ea580c; }
.stat-icon.red     { background: #fee2e2; color: #dc2626; }
.stat-icon.blue    { background: #dbeafe; color: #2563eb; }
.stat-icon.purple  { background: #ede9fe; color: #7c3aed; }
.stat-icon.yellow  { background: #fef9c3; color: #ca8a04; }

.stat-info { flex: 1; }
.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.1;
}
.stat-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* ============================================
   ROOM GRID (Dashboard)
   ============================================ */
.room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.room-card {
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    position: relative;
    border: 2px solid transparent;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.room-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.room-card .room-number {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.room-card .room-type {
    font-size: 10px;
    opacity: .75;
    margin-top: 2px;
}

.room-card .room-guest {
    font-size: 11px;
    font-weight: 600;
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-card .room-status-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 4px;
}

/* Status colors */
.status-vc  { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.status-oc  { background: #dbeafe; color: #1e3a8a; border-color: #93c5fd; }
.status-ot  { background: #fef9c3; color: #713f12; border-color: #fde047; }
.status-vd  { background: #ffedd5; color: #7c2d12; border-color: #fdba74; }
.status-oo  { background: #fee2e2; color: #7f1d1d; border-color: #fca5a5; }
.status-oh  { background: #ede9fe; color: #3b0764; border-color: #c4b5fd; }

.room-card.status-vc { background: #ecfdf5; border-color: #6ee7b7; }
.room-card.status-oc { background: #eff6ff; border-color: #93c5fd; }
.room-card.status-ot { background: #fefce8; border-color: #fde047; }
.room-card.status-vd { background: #fff7ed; border-color: #fdba74; }
.room-card.status-oo { background: #fef2f2; border-color: #fca5a5; }
.room-card.status-oh { background: #f5f3ff; border-color: #c4b5fd; }

/* ============================================
   LEGEND
   ============================================ */
.status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray-600);
}

.legend-dot {
    width: 12px; height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ============================================
   TABLES
   ============================================ */
.table { font-size: 13.5px; }
.table thead th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    padding: 10px 12px;
    white-space: nowrap;
}
.table tbody td { padding: 10px 12px; vertical-align: middle; }
.table tbody tr:hover { background: var(--teal-pale); }

/* ============================================
   FORMS
   ============================================ */
.form-label {
    font-weight: 500;
    font-size: 13px;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.form-control, .form-select {
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 13.5px;
    padding: 8px 12px;
    transition: border-color .15s, box-shadow .15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(13,148,136,.12);
    outline: none;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 8px;
    padding: 7px 16px;
    transition: all .15s;
}

.btn-teal {
    background: var(--teal);
    color: #fff;
    border: 1px solid var(--teal);
}
.btn-teal:hover { background: var(--teal-dark); color: #fff; border-color: var(--teal-dark); }

.btn-outline-teal {
    background: transparent;
    color: var(--teal);
    border: 1px solid var(--teal);
}
.btn-outline-teal:hover { background: var(--teal); color: #fff; }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 2px 8px; font-size: 11px; border-radius: 6px; }

/* ============================================
   BADGES
   ============================================ */
.badge { font-size: 11px; font-weight: 600; border-radius: 6px; padding: 3px 8px; }

/* ============================================
   MODALS
   ============================================ */
.modal-header {
    background: var(--teal);
    color: #fff;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 14px 20px;
}
.modal-header .btn-close { filter: invert(1); }
.modal-title { font-size: 15px; font-weight: 600; }
.modal-body { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--gray-200); }
.modal-content { border-radius: var(--radius); border: none; box-shadow: var(--shadow-lg); }

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.page-header .breadcrumb {
    margin: 0;
    font-size: 12px;
}

.breadcrumb-item + .breadcrumb-item::before { color: var(--gray-400); }
.breadcrumb-item.active { color: var(--teal); }

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--teal-darker) 0%, var(--teal) 50%, #06b6d4 100%);
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: 16px;
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo .logo-icon {
    width: 64px; height: 64px;
    background: var(--teal-light);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--teal);
    margin-bottom: 12px;
}

.login-logo h4 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.login-logo p {
    font-size: 13px;
    color: var(--gray-500);
    margin: 4px 0 0;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    border-radius: 8px;
    font-size: 13.5px;
    padding: 10px 14px;
}

/* ============================================
   CHECKIN FORM
   ============================================ */
.checkin-stepper {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
}

.step-item {
    flex: 1;
    text-align: center;
    position: relative;
}

.step-item::after {
    content: '';
    position: absolute;
    top: 16px; left: 50%;
    width: 100%; height: 2px;
    background: var(--gray-200);
    z-index: 0;
}

.step-item:last-child::after { display: none; }

.step-circle {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-500);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    position: relative;
    z-index: 1;
    transition: background .2s, color .2s;
}

.step-item.active .step-circle { background: var(--teal); color: #fff; }
.step-item.done .step-circle { background: #059669; color: #fff; }
.step-label { font-size: 11px; color: var(--gray-500); margin-top: 4px; }
.step-item.active .step-label { color: var(--teal); font-weight: 600; }

/* ============================================
   ROOM SELECTOR
   ============================================ */
.room-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.room-selector-item {
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    padding: 8px 6px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
    background: var(--white);
}

.room-selector-item:hover { border-color: var(--teal); background: var(--teal-pale); }
.room-selector-item.selected { border-color: var(--teal); background: var(--teal-light); color: var(--teal-darker); }
.room-selector-item.occupied { opacity: .5; cursor: not-allowed; background: var(--gray-100); }

.room-selector-item .rsi-no { font-weight: 700; font-size: 16px; }
.room-selector-item .rsi-type { font-size: 10px; color: var(--gray-500); }
.room-selector-item .rsi-price { font-size: 10px; font-weight: 600; color: var(--teal); margin-top: 2px; }

/* ============================================
   UTILITIES
   ============================================ */
.text-teal { color: var(--teal) !important; }
.bg-teal { background: var(--teal) !important; color: #fff; }
.bg-teal-light { background: var(--teal-light) !important; }
.border-teal { border-color: var(--teal) !important; }

.section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--teal);
    margin-bottom: 14px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--teal-light);
}

.divider { border-top: 1px solid var(--gray-200); margin: 16px 0; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-content { margin-left: 0 !important; }
    .topbar { left: 0 !important; }
    .content-area { padding: 14px; }
    .room-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 22px; }
}

@media (max-width: 480px) {
    .room-grid { grid-template-columns: repeat(3, 1fr); }
    .login-card { padding: 28px 20px; }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ============================================
   PRINT
   ============================================ */
@media print {
    .sidebar, .topbar, .btn, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .content-area { margin-top: 0 !important; padding: 0 !important; }
}
