/* =============================================
   Hotel Housekeeping System - Light Theme
   Vibrant colors matching hotel operations style
   Mobile-first responsive design
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* Light backgrounds */
    --bg-primary: #f0f2f8;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fd;
    --bg-input: #f5f6fa;
    --bg-sidebar: #1a1a2e;
    --bg-sidebar-hover: rgba(255,255,255,0.07);
    --border: #e2e5f1;
    --border-light: #eceef5;
    --text-primary: #1a1a2e;
    --text-secondary: #555770;
    --text-muted: #8e90a6;
    --text-sidebar: #b8bbd3;
    --text-sidebar-active: #ffffff;

    /* Vibrant accent colors matching the example */
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-light: rgba(79, 70, 229, 0.08);
    --accent-gradient: linear-gradient(135deg, #4f46e5, #7c3aed);

    /* Action buttons */
    --btn-green: #10b981;
    --btn-green-hover: #059669;
    --btn-yellow: #f59e0b;
    --btn-yellow-hover: #d97706;
    --btn-purple: #8b5cf6;
    --btn-purple-hover: #7c3aed;
    --btn-blue: #3b82f6;
    --btn-blue-hover: #2563eb;

    /* FIAS Status Colors - vibrant */
    --dirty: #ef4444;
    --dirty-bg: rgba(239, 68, 68, 0.08);
    --dirty-occ: #dc2626;
    --dirty-occ-bg: rgba(220, 38, 38, 0.08);
    --clean: #10b981;
    --clean-bg: rgba(16, 185, 129, 0.08);
    --clean-occ: #059669;
    --clean-occ-bg: rgba(5, 150, 105, 0.08);
    --inspected: #3b82f6;
    --inspected-bg: rgba(59, 130, 246, 0.08);
    --inspected-occ: #2563eb;
    --inspected-occ-bg: rgba(37, 99, 235, 0.08);
    --dnd: #f59e0b;
    --dnd-bg: rgba(245, 158, 11, 0.08);
    --makeup: #8b5cf6;
    --makeup-bg: rgba(139, 92, 246, 0.08);
    --service-off: #6b7280;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --shadow-card: 0 2px 8px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.03);
    --transition: all 0.2s ease;

    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --sidebar-width: 260px;
}

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

html { font-size: 15px; -webkit-tap-highlight-color: transparent; }

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c5c8d6; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a0a4b8; }

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

/* ========== SIDEBAR (Dark) ========== */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo-img {
    max-width: 180px;
    height: auto;
}

.sidebar-brand { display: none; }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.nav-section { margin-bottom: 6px; }

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 10px 14px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.88rem;
    font-weight: 400;
    position: relative;
    user-select: none;
    border: none;
    background: transparent;
    text-align: left;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.nav-item:hover { background: var(--bg-sidebar-hover); color: #e0e2f0; }
.nav-item.active { background: rgba(79, 70, 229, 0.2); color: #fff; font-weight: 500; }
.nav-item .nav-icon { width: 20px; text-align: center; font-size: 0.95rem; flex-shrink: 0; }

.badge, .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    line-height: 1.4;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.user-details { flex: 1; min-width: 0; }
.user-details .name { font-size: 0.82rem; font-weight: 600; color: #e0e2f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-details .role { font-size: 0.7rem; color: rgba(255,255,255,0.4); text-transform: capitalize; }

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Page Header */
.page-header {
    padding: 18px 28px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 12px;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.page-body {
    flex: 1;
    padding: 24px 28px;
}

/* Connection Status */
.conn-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--bg-input);
}

.conn-status .dot {
    width: 8px; height: 8px; border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

.conn-status.ok .dot { background: var(--success); }
.conn-status.error .dot { background: var(--danger); }
.conn-status.warn .dot { background: var(--warning); }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ========== SUMMARY GRID ========== */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.summary-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 18px 16px;
    text-align: center;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

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

.summary-card .count {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: var(--font-mono);
    line-height: 1.2;
}

.summary-card .label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.summary-card.total .count { color: var(--accent); }
.summary-card .count { color: var(--text-primary); }

.summary-card.total { border-bottom: 3px solid var(--accent); }
/* Default neutral border for category summary cards */
.summary-card:not(.total) { border-bottom: 3px solid var(--border); }

/* ========== TOOLBAR ========== */
.rooms-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 180px;
    max-width: 320px;
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.search-box .form-control { padding-left: 36px; }

.filter-chips-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.filter-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

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

.room-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    overflow: hidden;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

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

/* Status bar on top of card - neutral (app only sends, doesn't receive from Opera) */
.room-card .status-bar {
    height: 4px;
    width: 100%;
    background: var(--border);
}

.room-card .room-number {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 14px 14px 2px;
}

.room-card .room-status {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 0 14px;
}

/* Neutral status sent label */
.room-card .room-status-sent {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    padding: 0 14px;
    color: var(--text-muted);
}

.room-card .room-status-sent i {
    font-size: 0.6rem;
    margin-right: 2px;
    opacity: 0.6;
}

.room-card .guest-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 6px 14px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-card .guest-name i { font-size: 0.7rem; margin-right: 4px; }

.room-card .room-meta {
    display: flex;
    gap: 10px;
    padding: 8px 14px 14px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.room-card .room-meta i { margin-right: 3px; }

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 16px;
}

.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal { transform: translateY(0); }

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 { font-size: 1.1rem; font-weight: 700; }
.modal-header i { color: var(--accent); margin-right: 8px; }

.modal-close {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover { background: rgba(239,68,68,0.08); color: var(--danger); border-color: transparent; }

.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ========== STATUS SELECTOR ========== */
.status-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.status-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid var(--border);
    background: var(--bg-input);
    font-size: 0.78rem;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
}

.status-option:hover { border-color: var(--accent); }
.status-option.selected { border-color: var(--accent); background: var(--accent-light); }

.status-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ========== GUEST INFO BOX ========== */
.guest-info-box {
    background: var(--bg-input);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
}

.guest-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.guest-header .avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.guest-header .name { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.guest-header .company { font-size: 0.78rem; color: var(--text-muted); }

.guest-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.guest-info-grid .info-item { }
.guest-info-grid .lbl { font-size: 0.65rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.guest-info-grid .val { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }

/* ========== FORMS ========== */
.form-group { margin-bottom: 14px; }

.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
}

.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

textarea.form-control { resize: vertical; min-height: 70px; }
select.form-control { cursor: pointer; }

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: inherit;
    white-space: nowrap;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 42px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3); }

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border-light); color: var(--text-primary); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }

.btn-success { background: var(--btn-green); color: #fff; }
.btn-success:hover { background: var(--btn-green-hover); }

.btn-sm { padding: 7px 14px; font-size: 0.8rem; min-height: 36px; }
.btn-block { width: 100%; }

.btn-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    color: var(--text-sidebar);
    font-size: 0.9rem;
    transition: var(--transition);
}
.btn-icon:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ========== LOGIN PAGE ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

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

.login-logo-img {
    max-width: 220px;
    height: auto;
    margin-bottom: 14px;
    background: #0a0a0a;
    border-radius: var(--radius);
    padding: 12px 20px;
}

.login-logo p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========== ALERTS ========== */
.alert-bar {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    font-size: 0.88rem;
    border: 1px solid;
}

.alert-bar.error { background: rgba(239,68,68,0.06); border-color: rgba(239,68,68,0.2); color: #b91c1c; }
.alert-bar.error i { color: var(--danger); }
.alert-bar.warning { background: rgba(245,158,11,0.06); border-color: rgba(245,158,11,0.2); color: #92400e; }
.alert-bar.warning i { color: var(--warning); }
.alert-bar.success { background: rgba(16,185,129,0.06); border-color: rgba(16,185,129,0.2); color: #065f46; }
.alert-bar.success i { color: var(--success); }

/* ========== PAX BADGE ========== */
.pax-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    white-space: nowrap;
    vertical-align: middle;
    margin-left: 4px;
}

.pax-badge i { font-size: 0.6rem; }

.pax-badge.modal-pax {
    font-size: 0.72rem;
    padding: 2px 10px;
}

.guest-name-extra {
    padding: 0 14px;
    font-size: 0.72rem;
    line-height: 1.3;
    margin-top: 2px;
}

/* ========== VIP BADGE ========== */
.vip-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--vip-color, #f59e0b);
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    white-space: nowrap;
    text-transform: uppercase;
}

@supports (background: color-mix(in srgb, red 10%, transparent)) {
    .vip-badge {
        background: color-mix(in srgb, var(--vip-color, #f59e0b) 10%, transparent);
        border-color: color-mix(in srgb, var(--vip-color, #f59e0b) 25%, transparent);
    }
}

.vip-badge i { font-size: 0.65rem; }

.room-card .vip-badge {
    margin: 4px 14px 0;
}

.room-card.has-vip {
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15), 0 0 0 1px rgba(245, 158, 11, 0.2);
}

.guest-header .vip-badge {
    align-self: flex-start;
    margin-top: 2px;
}

/* ========== STATUS BADGES ========== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ========== TIMELINE ========== */
.timeline { }

.timeline-item {
    display: flex;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}

.timeline-item .time {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    min-width: 130px;
    flex-shrink: 0;
    padding-top: 2px;
}

.timeline-item .content { flex: 1; min-width: 0; }

.timeline-item .change {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.timeline-item .arrow { color: var(--text-muted); font-size: 0.8rem; }
.timeline-item .user { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.timeline-item .user i { margin-right: 3px; }
.timeline-item .note { font-size: 0.82rem; color: var(--text-secondary); font-style: italic; margin-top: 4px; }
.timeline-item .mono { font-family: var(--font-mono); font-weight: 600; }

/* ========== DATA TABLE ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.data-table th {
    padding: 12px 16px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-input);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.88rem;
}

.data-table tr:hover td { background: var(--bg-card-hover); }

.data-table .actions {
    display: flex;
    gap: 6px;
}

/* ========== FIAS STATUS BADGES ========== */
.fias-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.fias-status-badge.success { color: #27ae60; background: rgba(39,174,96,0.1); }
.fias-status-badge.warning { color: #f39c12; background: rgba(243,156,18,0.1); }
.fias-status-badge.error   { color: #e74c3c; background: rgba(231,76,60,0.1); }

.table-responsive { overflow-x: auto; }

.mono { font-family: 'Courier New', monospace; }

/* ========== TOAST NOTIFICATIONS ========== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    font-size: 0.88rem;
    animation: toast-in 0.3s ease;
    max-width: 380px;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }

.toast-text { flex: 1; }
.toast-close {
    background: none; border: none; font-size: 1.1rem;
    color: var(--text-muted); cursor: pointer; padding: 0 4px;
}

@keyframes toast-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state .icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.4; }
.empty-state h3 { font-size: 1rem; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 0.85rem; }

/* ========== LOADING ========== */
.loading-spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.page-loading { text-align: center; padding: 40px; color: var(--text-muted); }

@keyframes spin { to { transform: rotate(360deg); } }

/* ========== TEXT UTILITIES ========== */
.text-xs { font-size: 0.72rem; }
.text-sm { font-size: 0.82rem; }
.mono, .fw-600 { font-family: var(--font-mono); }
.fw-600 { font-weight: 600; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted) !important; }
.hidden { display: none !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 14px; }
.mt-3 { margin-top: 22px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 14px; }
.mb-3 { margin-bottom: 22px; }
.gap-2 { gap: 12px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

code {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
}

h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

details summary { cursor: pointer; user-select: none; }

/* ========== MOBILE OVERLAY ========== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 199;
}

.sidebar-overlay.active { display: block; }

/* ========== MOBILE TOGGLE ========== */
.mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1.1rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

/* ========== RESPONSIVE - TABLET ========== */
@media (max-width: 1024px) {
    .summary-grid { grid-template-columns: repeat(3, 1fr); }
    .room-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
    .guest-info-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ========== RESPONSIVE - MOBILE ========== */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
    }

    html { font-size: 14px; }

    .mobile-toggle { display: flex; }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .main-content { margin-left: 0; }

    .page-header {
        padding: 14px 16px;
        gap: 8px;
    }

    .page-header h1 { font-size: 1.1rem; }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .page-body { padding: 16px; }

    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .summary-card {
        padding: 12px 10px;
    }

    .summary-card .count { font-size: 1.4rem; }
    .summary-card .label { font-size: 0.65rem; }

    .rooms-toolbar {
        gap: 6px;
    }

    .search-box {
        min-width: 100%;
        max-width: 100%;
        order: -1;
    }

    .filter-chip {
        padding: 7px 12px;
        font-size: 0.75rem;
    }

    .room-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .room-card .room-number { font-size: 1.15rem; padding: 12px 12px 2px; }
    .room-card .room-status { font-size: 0.68rem; padding: 0 12px; }
    .room-card .guest-name { font-size: 0.75rem; padding: 4px 12px 0; }
    .room-card .room-meta { padding: 6px 12px 12px; font-size: 0.68rem; }

    .modal { max-width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
    .modal-overlay { align-items: flex-end; padding: 0; }

    .status-selector { grid-template-columns: repeat(2, 1fr); }

    .timeline-item { flex-direction: column; gap: 4px; }
    .timeline-item .time { min-width: 0; }

    .data-table { font-size: 0.82rem; }
    .data-table th, .data-table td { padding: 10px 12px; }

    .toast-container { top: auto; bottom: 16px; left: 16px; right: 16px; }
    .toast { max-width: 100%; }

    .login-box { padding: 30px 24px; }

    .btn { min-height: 44px; }
    .btn-sm { min-height: 38px; }
}

/* ========== RESPONSIVE - SMALL PHONES ========== */
@media (max-width: 480px) {
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
    .room-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .status-selector { grid-template-columns: 1fr 1fr; }
    .guest-info-grid { grid-template-columns: 1fr 1fr; }
    .modal-body { padding: 16px; }
    .modal-header { padding: 16px; }
    .modal-footer { padding: 12px 16px; }
}

@media (max-width: 360px) {
    .room-grid { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
}
