/* ============================================================
   HotelSync - Main Stylesheet
   Hotel & Guest House Management System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Playfair+Display:wght@400;600;700&display=swap');

:root {
    --primary:       #1a3c5e;
    --primary-light: #2d6a9f;
    --primary-dark:  #0f2640;
    --accent:        #c8973a;
    --accent-light:  #e8b955;
    --success:       #1a7f4b;
    --danger:        #c0392b;
    --warning:       #d68910;
    --info:          #1a7fa6;
    --sidebar-width: 260px;
    --sidebar-bg:    #0f2640;
    --sidebar-text:  rgba(255,255,255,0.75);
    --topbar-h:      64px;
    --bg:            #f0f4f8;
    --card-bg:       #ffffff;
    --border:        #dee2e6;
    --text:          #1c2b3a;
    --text-muted:    #6c7a8a;
    --shadow:        0 2px 16px rgba(15,38,64,0.08);
    --shadow-lg:     0 8px 40px rgba(15,38,64,0.14);
    --radius:        12px;
    --radius-sm:     8px;
    --transition:    0.2s ease;
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    margin: 0;
    overflow-x: hidden;
}

/* ---- SIDEBAR ---- */
.sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.brand-logo {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.brand-name {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.brand-sub {
    display: block;
    font-size: 11px;
    color: var(--accent-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

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

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    margin: 1px 0;
}

.nav-item i { font-size: 17px; flex-shrink: 0; }

.nav-item:hover {
    color: white;
    background: rgba(255,255,255,0.07);
}

.nav-item.active {
    color: white;
    background: rgba(200,151,58,0.18);
    border-left-color: var(--accent);
}

.nav-item .badge { font-size: 10px; }

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

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

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 15px;
    flex-shrink: 0;
    overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.user-role {
    font-size: 11px;
    color: var(--accent-light);
}

.logout-btn {
    margin-left: auto;
    color: rgba(255,255,255,0.5);
    font-size: 18px;
    transition: color var(--transition);
}
.logout-btn:hover { color: #e74c3c; }

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

.top-navbar {
    height: var(--topbar-h);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 1px 8px rgba(15,38,64,0.05);
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all var(--transition);
}
.sidebar-toggle:hover { background: var(--bg); color: var(--primary); }

.navbar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.navbar-date, .navbar-time {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.navbar-time { font-weight: 600; color: var(--primary); }

.content-area {
    flex: 1;
    padding: 24px;
}

/* ---- CARDS ---- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    background: none;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.card-body { padding: 20px; }

/* ---- STAT CARDS ---- */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

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

.stat-icon.blue    { background: rgba(26,60,94,0.1);  color: var(--primary); }
.stat-icon.green   { background: rgba(26,127,75,0.1); color: var(--success); }
.stat-icon.red     { background: rgba(192,57,43,0.1); color: var(--danger); }
.stat-icon.gold    { background: rgba(200,151,58,0.12);color: var(--accent); }
.stat-icon.teal    { background: rgba(26,127,166,0.1);color: var(--info); }
.stat-icon.orange  { background: rgba(214,137,16,0.1);color: var(--warning); }

.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.stat-label {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

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

.room-tile {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: white;
    position: relative;
}

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

.room-tile.available   { border-color: #1a7f4b; }
.room-tile.occupied    { border-color: #c0392b; background: #fff8f8; }
.room-tile.reserved    { border-color: #d68910; background: #fffdf0; }
.room-tile.maintenance { border-color: #6c757d; background: #f8f9fa; }
.room-tile.housekeeping{ border-color: var(--info); background: #f0f8ff; }

.room-number {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

.room-type {
    font-size: 11px;
    color: var(--text-muted);
    margin: 4px 0;
}

.room-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 4px;
}

.status-available   { background: #d4edda; color: #1a7f4b; }
.status-occupied    { background: #f8d7da; color: #c0392b; }
.status-reserved    { background: #fff3cd; color: #d68910; }
.status-maintenance { background: #e9ecef; color: #495057; }
.status-housekeeping{ background: #cce5ff; color: #004085; }

/* ---- BADGES ---- */
.badge { font-weight: 600; font-size: 11.5px; }
.bg-success { background: var(--success) !important; }
.bg-danger  { background: var(--danger)  !important; }
.bg-warning { background: var(--warning) !important; color: white !important; }
.bg-info    { background: var(--info)    !important; }
.bg-primary { background: var(--primary) !important; }

/* ---- BUTTONS ---- */
.btn {
    font-family: inherit;
    font-weight: 600;
    font-size: 13.5px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

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

.btn-gold {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}
.btn-gold:hover { background: var(--accent-light); color: white; }

.btn-success { background: var(--success); border-color: var(--success); }
.btn-danger  { background: var(--danger);  border-color: var(--danger);  }

/* ---- FORMS ---- */
.form-control, .form-select {
    font-family: inherit;
    font-size: 14px;
    border-color: var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(45,106,159,0.15);
    outline: none;
}

.form-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 6px;
}

/* ---- TABLES ---- */
.table { font-size: 13.5px; }
.table th {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8f9fa;
    border-bottom: 2px solid var(--border);
    padding: 12px 14px;
}

.table td { padding: 12px 14px; vertical-align: middle; }
.table tbody tr:hover { background: rgba(26,60,94,0.02); }

/* ---- ALERTS ---- */
.alert {
    border: none;
    border-left: 4px solid;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
}
.alert-success { border-left-color: var(--success); background: #d4edda; color: #155724; }
.alert-danger  { border-left-color: var(--danger);  background: #f8d7da; color: #721c24; }
.alert-warning { border-left-color: var(--warning); background: #fff3cd; color: #856404; }
.alert-info    { border-left-color: var(--info);    background: #cce5ff; color: #004085; }

/* ---- PAGE HEADER ---- */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    margin: 0;
    line-height: 1.2;
}

.page-header .subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ---- DATATABLES OVERRIDES ---- */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-family: inherit;
    font-size: 13.5px;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-family: inherit;
}

.paginate_button.current, .paginate_button.current:hover {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    border-radius: 6px !important;
}

/* ---- MODAL ---- */
.modal-header {
    background: var(--primary);
    color: white;
    border-radius: var(--radius) var(--radius) 0 0;
}

.modal-title { font-weight: 700; }
.modal-header .btn-close { filter: invert(1); }

/* ---- LOGIN PAGE ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M50 50c0-5.523 4.477-10 10-10s10 4.477 10 10-4.477 10-10 10c0 5.523-4.477 10-10 10s-10-4.477-10-10 4.477-10 10-10zM10 10c0-5.523 4.477-10 10-10s10 4.477 10 10-4.477 10-10 10c0 5.523-4.477 10-10 10S0 25.523 0 20s4.477-10 10-10z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

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

.login-logo .icon {
    width: 72px; height: 72px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    margin-bottom: 16px;
}

.login-logo h1 {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

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

/* ---- RECEIPT ---- */
.receipt-wrapper { max-width: 800px; margin: 0 auto; }

.receipt {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

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

.receipt-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    margin: 0 0 4px;
}

.receipt-body { padding: 32px; }

.receipt-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.receipt-total {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    justify-content: space-between;
    padding: 16px 0 0;
    margin-top: 8px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

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

    .stat-value { font-size: 22px; }
    .room-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

@media (max-width: 576px) {
    .content-area { padding: 16px; }
    .login-card { padding: 32px 24px; margin: 16px; }
    .page-header { flex-direction: column; }
    .navbar-date { display: none; }
}

/* ---- UTILITIES ---- */
.text-gold   { color: var(--accent) !important; }
.text-hotel  { color: var(--primary) !important; }
.bg-hotel    { background: var(--primary) !important; color: white; }
.fw-800      { font-weight: 800 !important; }
.playfair    { font-family: 'Playfair Display', serif; }

.divider {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

/* Sidebar overlay on mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}
.sidebar-overlay.show { display: block; }

/* Smooth scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c0c8d0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #8090a0; }

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Print */
@media print {
    .sidebar, .top-navbar, .no-print { display: none !important; }
    .main-content { margin: 0 !important; }
    .content-area { padding: 0 !important; }
    body { background: white; }
}
