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

:root {
    --primary: #8B4513;
    --primary-dark: #6B3410;
    --secondary: #D4A574;
    --accent: #DAA520;
    --success: #228B22;
    --warning: #FF8C00;
    --danger: #CD5C5C;
    --bg-light: #F5F0E8;
    --bg-dark: #2D2A26;
    --text-primary: #1A1A1A;
    --text-muted: #6B6B6B;
    --border: #E0D5C7;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 { font-family: 'Playfair Display', serif; color: var(--primary); }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary) 100%);
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.login-header {
    background: var(--primary);
    color: white;
    padding: 40px;
    text-align: center;
}

.login-header h1 {
    font-size: 1.8rem;
    color: white;
    margin-bottom: 5px;
}

.login-header p { opacity: 0.9; font-size: 0.9rem; }

.login-body { padding: 40px; }

.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: var(--text-primary);
}

.btn-primary:hover { background: #B8860B; transform: translateY(-1px); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #1a6b1a; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b54545; }

.btn-secondary { background: var(--secondary); color: var(--text-primary); }
.btn-secondary:hover { background: #c49564; }

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover { border-color: var(--primary); background: var(--bg-light); }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }

/* Layout */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: var(--bg-dark);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s;
    z-index: 1000;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.sidebar-nav {
    padding: 16px 0;
    overflow: visible;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: rgba(255,255,255,0.8);
    transition: all 0.2s;
    border-left: 3px solid transparent;
    white-space: normal;
    overflow: visible;
    word-wrap: break-word;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: var(--accent);
}

.nav-item i { width: 20px; text-align: center; }
.nav-item .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

.nav-section {
    padding: 12px 24px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    background: var(--bg-light);
    overflow-x: hidden;
}

.page-content {
    padding: 24px;
    overflow-x: visible;
}

.full-width .menu-toggle {
    display: block;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .menu-toggle {
        display: block;
    }
}

.topbar {
    background: white;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-primary);
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border-radius: 8px;
    padding: 8px 16px;
    width: 300px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    font-size: 14px;
}

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

.topbar-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    padding: 8px;
}

.topbar-btn .badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: white;
    font-size: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-menu:hover { background: var(--bg-light); }

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-info h4 { font-size: 14px; font-family: 'Inter', sans-serif; }
.user-info p { font-size: 12px; color: var(--text-muted); }

/* Page Content */
.page-content { padding: 24px; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

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

.breadcrumb {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { text-decoration: underline; }

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow-x: visible;
}

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

.card-header h3 {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
}

.card-body { padding: 24px; }
.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-light);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.primary { background: rgba(139, 69, 19, 0.1); color: var(--primary); }
.stat-icon.success { background: rgba(34, 139, 34, 0.1); color: var(--success); }
.stat-icon.warning { background: rgba(255, 140, 0, 0.1); color: var(--warning); }
.stat-icon.danger { background: rgba(205, 92, 92, 0.1); color: var(--danger); }
.stat-icon.accent { background: rgba(218, 165, 32, 0.1); color: var(--accent); }

.stat-content h3 { font-size: 28px; font-family: 'Inter', sans-serif; font-weight: 700; }
.stat-content p { color: var(--text-muted); font-size: 14px; }

/* Grid Layout */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* Tables */
.table-container { 
    overflow-x: auto; 
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    word-wrap: break-word;
}

th {
    background: var(--bg-light);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

tr:hover { background: var(--bg-light); }

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success { background: rgba(34, 139, 34, 0.1); color: var(--success); }
.badge-warning { background: rgba(255, 140, 0, 0.1); color: var(--warning); }
.badge-danger { background: rgba(205, 92, 92, 0.1); color: var(--danger); }
.badge-primary { background: rgba(139, 69, 19, 0.1); color: var(--primary); }
.badge-info { background: rgba(0, 123, 255, 0.1); color: #007bff; }
.badge-secondary { background: var(--bg-light); color: var(--text-muted); }

/* Room Grid */
.room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.room-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

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

.room-card .room-number {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.room-card .room-type {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.room-card .room-price {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
}

.room-card.available { border-top: 4px solid var(--success); }
.room-card.occupied { border-top: 4px solid #007bff; }
.room-card.cleaning { border-top: 4px solid var(--warning); }
.room-card.maintenance { border-top: 4px solid var(--danger); }
.room-card.reserved { border-top: 4px solid #6f42c1; }

/* POS Styles */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    height: calc(100vh - 140px);
}

.pos-products {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pos-products-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 12px;
}

.pos-products-header input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
}

.pos-products-header input:focus { border-color: var(--accent); outline: none; }

.pos-products-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.category-tab {
    padding: 8px 16px;
    border: none;
    background: var(--bg-light);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.category-tab:hover, .category-tab.active {
    background: var(--accent);
    color: var(--text-primary);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.product-item {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.product-item:hover {
    background: var(--secondary);
    transform: scale(1.02);
}

.product-item .product-name {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 8px;
    word-wrap: break-word;
    min-height: 36px;
    display: flex;
    align-items: center;
}

.product-item .product-price {
    font-weight: 700;
    color: var(--primary);
}

.pos-cart {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

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

.cart-customer {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.cart-customer label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.cart-customer input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
}

.cart-customer input:focus {
    outline: none;
    border-color: var(--accent);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 8px;
}

.cart-item-info h4 { font-size: 14px; font-family: 'Inter', sans-serif; }
.cart-item-info p { font-size: 12px; color: var(--text-muted); }

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 16px;
}

.qty-btn:hover { background: var(--accent); }

.cart-qty { font-weight: 600; min-width: 24px; text-align: center; }
.cart-item-total { font-weight: 600; min-width: 70px; text-align: right; }

.cart-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.cart-summary { margin-bottom: 16px; }
.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.cart-summary-row.total {
    font-size: 18px;
    font-weight: 700;
    border-top: 2px solid var(--border);
    padding-top: 12px;
    margin-top: 8px;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.payment-method {
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
}

.payment-method:hover { border-color: var(--accent); }
.payment-method.active { border-color: var(--accent); background: rgba(218, 165, 32, 0.1); }
.payment-method i { display: block; font-size: 20px; margin-bottom: 4px; }

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-backdrop.show { display: flex; }

.modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-x: visible;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

.modal-header h3 { font-size: 18px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; }
.modal-body { padding: 24px; max-height: 60vh; overflow-y: auto; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* Tabs */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab {
    padding: 12px 24px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    color: var(--text-muted);
}

.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); }
.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
}

/* Activity List */
.activity-list { list-style: none; }
.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.activity-content h4 { font-size: 14px; font-family: 'Inter', sans-serif; }
.activity-content p { font-size: 12px; color: var(--text-muted); }
.activity-time { font-size: 11px; color: var(--text-muted); margin-left: auto; }

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.quick-action {
    background: var(--bg-light);
    border: none;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-action:hover { background: var(--secondary); transform: translateY(-2px); }
.quick-action i { font-size: 24px; margin-bottom: 8px; color: var(--primary); }
.quick-action span { font-size: 13px; font-weight: 500; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { color: var(--text-primary); margin-bottom: 8px; }

/* Pagination */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 24px;
}

.pagination button {
    padding: 8px 14px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
}

.pagination button:hover { background: var(--bg-light); }
.pagination button.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Receipt Preview */
.receipt-preview {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    max-width: 300px;
    margin: 0 auto;
}

.receipt-header { text-align: center; margin-bottom: 16px; }
.receipt-header h2 { font-size: 16px; margin-bottom: 4px; }
.receipt-header p { font-size: 10px; }
.receipt-divider { border-top: 1px dashed #000; margin: 12px 0; }
.receipt-items { margin: 12px 0; }
.receipt-item { display: flex; justify-content: space-between; margin-bottom: 8px; }
.receipt-total { font-weight: bold; border-top: 1px solid #000; padding-top: 8px; margin-top: 8px; }
.receipt-footer { text-align: center; margin-top: 16px; font-size: 10px; }

/* Print Styles */
@media print {
    body * { visibility: hidden; }
    .receipt-preview, .receipt-preview * { visibility: visible; }
    .receipt-preview {
        position: absolute;
        left: 0;
        top: 0;
        width: 80mm;
        border: none;
        box-shadow: none;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .pos-layout { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .search-box { display: none; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .user-info { display: none; }
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-overlay.show { display: flex; }

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

.hidden { display: none !important; }

.status-select {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.status-select.status-pending { background: #FFF3CD; color: #856404; border-color: #FFEEBA; }
.status-select.status-paid { background: #D4EDDA; color: #155724; border-color: #C3E6CB; }
.status-select.status-overdue { background: #F8D7DA; color: #721C24; border-color: #F5C6CB; }
.status-select.status-cancelled { background: #E2E3E5; color: #383D41; border-color: #D6D8DB; }
