/* --- VARIABLES ET CONFIGURATION --- */
:root {
    --bg-body: #f3f4f6;
    --sidebar-bg: #111827;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --white: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
}

body { 
    background: var(--bg-body); 
    color: var(--text-main); 
    line-height: 1.5;
    overflow-x: hidden;
}

.container { display: flex; min-height: 100vh; }

/* --- SIDEBAR --- */
.sidebar { 
    width: 260px; 
    background: var(--sidebar-bg); 
    color: white; 
    padding: 1.5rem; 
    display: flex; 
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
}

.logo { 
    font-size: 1.5rem; 
    font-weight: 800; 
    margin-bottom: 2rem; 
    color: var(--primary); 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

nav a { 
    display: flex;
    align-items: center;
    gap: 12px;
    color: #9ca3af; 
    text-decoration: none; 
    padding: 0.8rem 1rem; 
    border-radius: 8px; 
    margin-bottom: 0.5rem; 
    transition: var(--transition); 
    cursor: pointer;
}

nav a:hover, nav a.active { 
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

nav a.active { 
    background: var(--primary); 
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.user-badge { 
    margin-top: auto; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    background: rgba(255, 255, 255, 0.1); 
    padding: 12px; 
    border-radius: 12px; 
}

.avatar { 
    width: 40px; height: 40px; 
    background: var(--primary); 
    border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; 
    font-weight: bold; color: white;
}

/* --- MAIN CONTENT & SCREENS --- */
.main-content { flex: 1; padding: 2rem; overflow-y: auto; position: relative; }

.content-screen {
    display: none; 
    animation: fadeInSlide 0.4s ease-out;
}

.content-screen.active { display: block; }

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }

/* --- BUTTONS --- */
.btn {
    padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: 600; border: none;
    transition: var(--transition); display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2); }
.btn-secondary { background: #e5e7eb; color: #374151; }
.btn-pay { background: var(--success); color: white; padding: 6px 12px; border-radius: 6px; border: none; cursor: pointer; }
.btn-pay:hover { filter: brightness(0.9); }
.btn-full { width: 100%; justify-content: center; padding: 14px; }

/* --- STATS & CARDS --- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }

.stat-card { 
    background: white; padding: 1.5rem; border-radius: 12px; display: flex; align-items: center; 
    gap: 1rem; box-shadow: var(--shadow); transition: var(--transition);
}
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 12px 20px -5px rgba(0,0,0,0.1); }

.icon-box { 
    width: 48px; height: 48px; border-radius: 12px; display: flex; 
    align-items: center; justify-content: center; font-size: 1.4rem; 
}
.blue { background: #e0e7ff; color: #4338ca; }
.orange { background: #ffedd5; color: #9a3412; }
.green { background: #dcfce7; color: #15803d; }
.red { background: #fee2e2; color: #b91c1c; }

/* --- ROOMS & UNITS --- */
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1.5rem; }
.room-card { 
    background: white; padding: 1.5rem; border-radius: 12px; text-align: center; 
    border-bottom: 5px solid #ddd; box-shadow: var(--shadow); transition: var(--transition);
}
.room-card i { font-size: 2rem; margin-bottom: 1rem; color: var(--text-muted); }
.room-free { border-color: var(--success); }
.room-occupied { border-color: var(--danger); }
.room-dirty { border-color: var(--warning); }

/* --- PLANNING (GANTT) --- */
.planning-row { display: grid; grid-template-columns: 120px 1fr; background: white; margin-bottom: 8px; border-radius: 8px; overflow: hidden; position: relative; }
.planning-label { padding: 15px; background: #f8fafc; font-weight: bold; border-right: 1px solid #eee; display: flex; align-items: center; }
.planning-days { display: flex; padding: 10px; gap: 5px; overflow-x: auto; position: relative; min-height: 60px; }
.day-box { min-width: 40px; height: 40px; background: #f1f5f9; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; flex-shrink: 0; }

.booking-bar {
    position: absolute; height: 26px; background: var(--primary); color: white;
    font-size: 0.7rem; border-radius: 4px; display: flex; align-items: center;
    padding: 0 8px; cursor: grab; z-index: 10; white-space: nowrap; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* --- TABLES & PAIEMENTS --- */
.table-container { background: white; border-radius: 12px; padding: 1.5rem; box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th { text-align: left; padding: 14px 12px; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; border-bottom: 2px solid #f3f4f6; font-weight: 700; }
td { padding: 16px 12px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; font-size: 0.9rem; }
tr:hover td { background-color: #fafafa; }

.amount-tag { font-weight: 800; color: var(--primary); }
.badge { padding: 4px 10px; border-radius: 99px; font-size: 0.75rem; font-weight: bold; display: inline-block; }
.bg-success { background: #dcfce7; color: #15803d; }
.bg-danger { background: #fee2e2; color: #b91c1c; }
.bg-warning { background: #fef9c3; color: #854d0e; }

/* --- TYPE TAGS --- */
.type-tag { font-size: 0.6rem; text-transform: uppercase; padding: 2px 8px; border-radius: 10px; font-weight: bold; margin-bottom: 10px; display: inline-block; }
.tag-hotel { background: #e0e7ff; color: #4338ca; }
.tag-villa { background: #dcfce7; color: #15803d; }
.tag-appart { background: #fef9c3; color: #854d0e; }

/* --- MODAL --- */
.modal { 
    display: none; position: fixed; z-index: 1000; left: 0; top: 0; 
    width: 100%; height: 100%; background: rgba(17, 24, 39, 0.7); 
    backdrop-filter: blur(5px); overflow-y: auto; 
}

.modal-content { 
    background: white; margin: 40px auto; border-radius: 16px; width: 90%; 
    max-width: 500px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); 
    overflow: hidden; animation: modalShow 0.3s ease-out;
}

.modal-header { background: var(--primary); color: white; padding: 20px 30px; display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 30px; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; color: var(--text-main); }
.form-group input, .form-group select { 
    width: 100%; padding: 12px 15px; border: 2px solid #f1f5f9; border-radius: 10px; 
    background: #f8fafc; transition: all 0.2s; font-size: 0.95rem;
}
.form-group input:focus { border-color: var(--primary); background: white; outline: none; box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1); }

@keyframes modalShow { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .sidebar { width: 85px; padding: 1.5rem 1rem; }
    .sidebar span, .user-badge p { display: none; }
    .logo { justify-content: center; }
}

@media (max-width: 768px) {
    .main-content { padding: 1.5rem; }
    .top-bar { flex-direction: column; gap: 1rem; align-items: flex-start; }
    .planning-row { grid-template-columns: 80px 1fr; }
}