/**
 * PC Inn Guest House - Management System
 * Main Stylesheet
 * Modern, Clean, Professional UI
 */

/* ===== CSS Variables ===== */
:root {
    /* Primary Colors */
    --primary-color: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #3730a3;
    
    /* Secondary Colors */
    --secondary-color: #06b6d4;
    --secondary-light: #67e8f9;
    --secondary-dark: #0891b2;
    
    /* Status Colors */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    
    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 70px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 250ms ease;
    --transition-slow: 350ms ease;
}

/* ===== Reset & Base Styles ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul, ol {
    list-style: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== Scrollbar Styles ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ===== Sidebar Styles ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%);
    color: var(--white);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width var(--transition);
    box-shadow: var(--shadow-xl);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
}

.logo i {
    color: var(--primary-light);
    font-size: 1.75rem;
}

.sidebar.collapsed .logo span {
    display: none;
}

.sidebar-toggle {
    color: var(--gray-400);
    font-size: 1.25rem;
    padding: 8px;
    border-radius: var(--radius);
    transition: var(--transition-fast);
}

.sidebar-toggle:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.sidebar.collapsed .sidebar-toggle {
    display: none;
}

/* Navigation Menu */
.nav-menu {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--gray-400);
    font-weight: 500;
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.08);
}

.nav-item.active .nav-link {
    color: var(--white);
    background: var(--primary-color);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.nav-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.sidebar.collapsed .nav-link span {
    display: none;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 14px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    background: var(--primary-color);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.8rem;
    color: var(--gray-400);
}

.sidebar.collapsed .user-details {
    display: none;
}

/* ===== Main Content Area ===== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition);
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Top Header */
.top-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: var(--shadow);
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mobile-toggle {
    display: none;
    font-size: 1.25rem;
    color: var(--gray-600);
    padding: 8px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.search-box {
    position: relative;
    width: 280px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    background: var(--gray-50);
    transition: var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notification-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition-fast);
}

.notification-btn:hover {
    background: var(--primary-color);
    color: var(--white);
}

.notification-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: var(--danger-color);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.current-date {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--gray-100);
    border-radius: var(--radius);
    color: var(--gray-600);
    font-weight: 500;
    font-size: 0.9rem;
}

/* ===== Page Content ===== */
.page-content {
    padding: 30px;
    animation: fadeIn var(--transition);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Dashboard Styles ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-info h3 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.stat-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--danger-color);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.stat-icon.purple {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
}

.stat-icon.cyan {
    background: rgba(6, 182, 212, 0.1);
    color: var(--secondary-color);
}

.stat-icon.red {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-actions {
    display: flex;
    gap: 8px;
}

.card-body {
    padding: 24px;
}

/* ===== Tables ===== */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
}

.data-table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-200);
}

.data-table td {
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.95rem;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

/* ===== Status Badges ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.available,
.status-badge.checked-in,
.status-badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.status-badge.booked,
.status-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.status-badge.maintenance,
.status-badge.checked-out,
.status-badge.inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.status-badge.occupied {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.05rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius);
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: var(--transition-fast);
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-control::placeholder {
    color: var(--gray-400);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 6px;
}

.form-error {
    font-size: 0.85rem;
    color: var(--danger-color);
    margin-top: 6px;
}

/* ===== Modal Styles ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn var(--transition);
    box-shadow: var(--shadow-xl);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal.large {
    max-width: 900px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 320px;
    animation: toastSlideIn var(--transition);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast.info {
    border-left: 4px solid var(--info-color);
}

.toast-icon {
    font-size: 1.25rem;
}

.toast.success .toast-icon { color: var(--success-color); }
.toast.error .toast-icon { color: var(--danger-color); }
.toast.warning .toast-icon { color: var(--warning-color); }
.toast.info .toast-icon { color: var(--info-color); }

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.9rem;
    color: var(--gray-600);
}

.toast-close {
    color: var(--gray-400);
    padding: 4px;
    transition: var(--transition-fast);
}

.toast-close:hover {
    color: var(--gray-600);
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 4000;
}

.loading-overlay.active {
    display: flex;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Filters & Actions Bar ===== */
.actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-select {
    padding: 10px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 150px;
}

.search-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
}

.search-input input {
    border: none;
    outline: none;
    font-size: 0.9rem;
    min-width: 200px;
}

.search-input i {
    color: var(--gray-400);
}

/* ===== Room Cards Grid ===== */
.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.room-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.room-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.room-image {
    height: 160px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.room-image i {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.3);
}

.room-status-badge {
    position: absolute;
    top: 12px;
    right: 12px;
}

.room-details {
    padding: 20px;
}

.room-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.room-type {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.room-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.room-price span {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--gray-500);
}

.room-actions {
    display: flex;
    gap: 8px;
}

/* ===== Activity Timeline ===== */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    transition: background var(--transition-fast);
}

.activity-item:hover {
    background: var(--gray-100);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.check-in {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.activity-icon.check-out {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.activity-icon.booking {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.activity-time {
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* ===== Invoice Styles ===== */
.invoice-preview {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.invoice-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 30px;
}

.invoice-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.invoice-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.invoice-details {
    padding: 30px;
}

.invoice-section {
    margin-bottom: 30px;
}

.invoice-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.invoice-guest-info p {
    margin-bottom: 4px;
    color: var(--gray-700);
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.invoice-table th,
.invoice-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.invoice-table th {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.85rem;
}

.invoice-table tfoot td {
    font-weight: 600;
    border-bottom: none;
}

.invoice-total {
    display: flex;
    justify-content: flex-end;
    padding: 20px 30px;
    background: var(--gray-50);
}

.invoice-total-content {
    text-align: right;
}

.invoice-total-row {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    padding: 8px 0;
}

.invoice-total-row.grand-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    border-top: 2px solid var(--gray-200);
    padding-top: 16px;
    margin-top: 8px;
}

/* ===== Reports Styles ===== */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
}

.report-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
}

.report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.report-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.chart-placeholder {
    height: 200px;
    background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--gray-400);
}

.chart-placeholder i {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

/* Simple Chart Bars */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    height: 200px;
    padding-top: 20px;
}

.bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bar {
    width: 100%;
    max-width: 50px;
    background: var(--primary-color);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: height var(--transition);
}

.bar-label {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.bar-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

/* ===== Settings Styles ===== */
.settings-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.settings-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
}

.settings-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.settings-description {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-top: 4px;
}

.settings-body {
    padding: 24px;
}

/* ===== Print Styles ===== */
@media print {
    body {
        background: white;
    }
    
    .sidebar,
    .top-header,
    .actions-bar,
    .btn,
    .modal-overlay {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .invoice-preview {
        box-shadow: none;
    }
}

/* ===== Responsive Styles ===== */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .search-box {
        display: none;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-content {
        padding: 20px;
    }
    
    .top-header {
        padding: 0 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .rooms-grid {
        grid-template-columns: 1fr;
    }
    
    .modal {
        max-width: 100%;
        border-radius: var(--radius);
    }
    
    .invoice-info {
        grid-template-columns: 1fr;
    }
    
    .current-date {
        display: none;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .toast {
        min-width: auto;
        width: calc(100% - 40px);
    }
    
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 20px;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state-description {
    color: var(--gray-500);
    margin-bottom: 24px;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-700);
    font-weight: 500;
    transition: var(--transition-fast);
}

.pagination-btn:hover {
    background: var(--gray-100);
}

.pagination-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 24px;
}

.tab-btn {
    padding: 12px 24px;
    font-weight: 500;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition-fast);
}

.tab-btn:hover {
    color: var(--gray-700);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn var(--transition);
}

/* ===== Checkbox & Radio ===== */
.checkbox-group,
.radio-group {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-input,
.radio-input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* ===== Date Range Picker ===== */
.date-range {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-input {
    padding: 10px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

/* ===== Quick Actions ===== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 16px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: all var(--transition-fast);
}

.quick-action-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.quick-action-btn i {
    font-size: 2rem;
    color: var(--primary-color);
}

.quick-action-btn span {
    font-weight: 500;
    color: var(--gray-700);
}

/* ===== Profile Card ===== */
.profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: var(--primary-color);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--white);
}

.profile-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

.profile-info p {
    color: var(--gray-500);
    font-size: 0.95rem;
}

/* ===== Settings Navigation ===== */
.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    color: var(--gray-600);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: left;
}

.settings-nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.settings-nav-item.active {
    background: var(--primary-light);
    color: var(--primary-color);
}

.settings-nav-item i {
    width: 20px;
}

/* ===== Role Badges ===== */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.role-badge.role-manager {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
}

.role-badge.role-receptionist {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

.role-badge.role-housekeeping {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.role-badge.role-maintenance {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.role-badge.role-security {
    background: rgba(107, 114, 128, 0.1);
    color: var(--gray-600);
}

/* ===== Switch Toggle ===== */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-300);
    transition: var(--transition);
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* ===== Detail Grid ===== */
.detail-grid {
    display: grid;
    gap: 16px;
}

.detail-item {
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.detail-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.detail-value {
    font-size: 0.95rem;
    color: var(--gray-800);
}

.detail-value i {
    margin-right: 6px;
    color: var(--gray-400);
}

/* ===== Modal Large Size ===== */
.modal.large {
    max-width: 900px;
    width: 90%;
}

/* ===== Stat Icon Colors ===== */
.stat-icon.purple {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
}

.stat-icon.red {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger-color);
}

/* ===== Menu Toggle for Mobile ===== */
#menuToggle {
    display: none;
}

/* ===== COMPREHENSIVE RESPONSIVE STYLES ===== */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
    .page-content {
        max-width: 1600px;
        margin: 0 auto;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktop (1200px - 1399px) */
@media (max-width: 1399px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

/* Tablet Landscape / Small Desktop (992px - 1199px) */
@media (max-width: 1199px) {
    .sidebar {
        width: 220px;
    }
    
    .main-content {
        margin-left: 220px;
    }
    
    .modal.large {
        max-width: 95%;
    }
}

/* Tablet (768px - 991px) */
@media (max-width: 991px) {
    /* Sidebar becomes overlay */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 280px;
        transform: translateX(-100%);
        z-index: 1001;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    #menuToggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: none;
        background: var(--gray-100);
        border-radius: var(--radius);
        color: var(--gray-700);
        cursor: pointer;
    }
    
    .header-left {
        gap: 12px;
    }
    
    .search-box {
        display: none;
    }
    
    /* Settings page layout */
    .settings-nav {
        display: none;
    }
    
    #settingsContent {
        grid-column: span 2;
    }
    
    /* Tables become scrollable */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        min-width: 700px;
    }
    
    /* Stats grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Form layouts */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Modal full width */
    .modal {
        max-width: 95%;
        margin: 20px;
        max-height: 90vh;
    }
    
    .modal.large {
        max-width: 95%;
        width: 95%;
    }
    
    /* Tabs scrollable */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }
    
    .tab-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* Mobile Landscape / Large Phone (576px - 767px) */
@media (max-width: 767px) {
    .page-content {
        padding: 16px;
    }
    
    .top-header {
        padding: 0 16px;
        height: 56px;
    }
    
    .page-title {
        font-size: 1.1rem;
    }
    
    /* Stats single column */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-info h3 {
        font-size: 0.75rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    /* Cards */
    .card {
        border-radius: var(--radius);
    }
    
    .card-header,
    .card-body {
        padding: 16px;
    }
    
    /* Actions bar stack vertically */
    .actions-bar {
        flex-direction: column;
        gap: 12px;
    }
    
    .search-filters {
        width: 100%;
        flex-direction: column;
    }
    
    .search-filters .search-box {
        display: flex;
        width: 100%;
    }
    
    .search-filters select {
        width: 100%;
    }
    
    .actions-bar .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Room grid */
    .rooms-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* Invoice responsive */
    .invoice-info {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .invoice-header {
        padding: 20px;
    }
    
    .invoice-details {
        padding: 20px;
    }
    
    /* Modal full screen on mobile */
    .modal-overlay {
        padding: 0;
    }
    
    .modal {
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
    }
    
    .modal-body {
        max-height: calc(100vh - 120px);
    }
    
    /* Date range buttons wrap */
    .date-range-selector {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .date-range-selector .btn-group {
        flex-wrap: wrap;
    }
    
    .date-range-selector .btn {
        flex: 1;
        min-width: calc(50% - 4px);
    }
    
    /* Pagination compact */
    .pagination {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .pagination span {
        width: 100%;
        text-align: center;
        margin-bottom: 8px;
    }
    
    /* Hide some table columns */
    .data-table .hide-mobile {
        display: none;
    }
    
    /* Quick actions */
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Current date hide */
    .current-date {
        display: none;
    }
    
    /* Notification badge */
    .notification-btn {
        padding: 8px;
    }
}

/* Mobile Portrait (up to 575px) */
@media (max-width: 575px) {
    .page-content {
        padding: 12px;
    }
    
    .top-header {
        padding: 0 12px;
    }
    
    .page-title {
        font-size: 1rem;
    }
    
    /* Single column stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-card {
        padding: 14px;
    }
    
    /* Very small tables */
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
    
    /* Buttons smaller */
    .btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .btn-sm {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
    
    /* Form controls */
    .form-control {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .form-label {
        font-size: 0.85rem;
    }
    
    /* Tabs smaller */
    .tab-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
    
    .tab-btn i {
        display: none;
    }
    
    /* Empty state compact */
    .empty-state {
        padding: 40px 16px;
    }
    
    .empty-state-icon {
        font-size: 3rem;
    }
    
    .empty-state-title {
        font-size: 1.1rem;
    }
    
    /* Toast notifications */
    .toast-container {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }
    
    .toast {
        width: 100%;
        min-width: auto;
    }
    
    /* Detail grid single column */
    .detail-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Report charts */
    .report-card {
        padding: 16px;
    }
    
    /* Settings navigation as tabs on mobile */
    .settings-nav {
        display: block;
        margin-bottom: 16px;
    }
    
    .settings-nav .card-body {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding: 8px;
        -webkit-overflow-scrolling: touch;
    }
    
    .settings-nav-item {
        flex-shrink: 0;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .settings-nav-item span {
        display: none;
    }
    
    .settings-nav-item i {
        margin: 0;
    }
}

/* Extra Small Devices (up to 375px) */
@media (max-width: 375px) {
    .page-content {
        padding: 10px;
    }
    
    .card-header,
    .card-body {
        padding: 12px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    /* Hide action button text, show only icons */
    .actions-bar .btn span {
        display: none;
    }
    
    .actions-bar .btn i {
        margin: 0;
    }
}

/* Sidebar Overlay Background */
@media (max-width: 991px) {
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
    }
    
    .nav-link {
        min-height: 48px;
    }
    
    .form-control {
        min-height: 44px;
    }
    
    .tab-btn {
        min-height: 44px;
    }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        padding-bottom: 10px;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .modal {
        max-height: 95vh;
    }
    
    .modal-body {
        max-height: 60vh;
    }
}

/* High DPI / Retina displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card,
    .modal,
    .stat-card {
        border: 0.5px solid var(--gray-200);
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (for future) */
@media (prefers-color-scheme: dark) {
    /* Can be enabled when dark mode is implemented */
}
