/* LA TOUR HASSAN PALACE - Design premium or / blanc */

:root {
    --gold: #c9a227;
    --gold-light: #e8d48b;
    --gold-dark: #9a7b1a;
    --black: #0d0d0d;
    --charcoal: #1a1a1a;
    --white: #faf9f7;
    --cream: #f5f0e8;
    --text: #2c2c2c;
    --muted: #6b6b6b;
    --success: #2d8a4e;
    --danger: #a83232;
    --warning: #c9a227;
    --sidebar-w: 260px;
    --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

[data-theme="dark"] {
    --white: #121212;
    --cream: #1e1e1e;
    --text: #e8e8e8;
    --muted: #a0a0a0;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--cream);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
}

/* Titres CS — Times New Roman */
.font-display,
.titre-cs,
h1, h2, h3, h4, h5, h6,
.page-heading,
.section-title,
.modal-title,
.table-luxury thead th,
.brand-title {
    font-family: 'Times New Roman', Times, serif;
}
.text-gold { color: var(--gold) !important; }

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--charcoal) 0%, #2a2418 50%, var(--black) 100%);
    position: relative;
    padding: 1.5rem;
}

.login-bg-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.06;
    background-image: radial-gradient(var(--gold) 1px, transparent 1px);
    background-size: 24px 24px;
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 2.5rem !important;
}

/* Logo un Siècle de Traditions */
.lathp-logo {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.lathp-logo-login {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    border-radius: 8px;
}

.lathp-logo-sidebar {
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
}

.sidebar-brand-logo {
    flex-direction: column;
    text-align: center;
}

.login-brand .brand-sub,
.sidebar-brand-logo .brand-sub {
    color: rgba(201, 162, 39, 0.85);
    letter-spacing: 0.12em;
    font-size: 0.65rem;
}

.brand-palace {
    letter-spacing: 0.4em;
    font-size: 0.85rem;
    color: var(--gold-light);
}

@keyframes pulse-gold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201, 162, 39, 0.3); }
    50% { box-shadow: 0 0 0 12px rgba(201, 162, 39, 0); }
}

/* Cards */
.card-luxury {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(201, 162, 39, 0.12);
    transition: transform var(--transition), box-shadow var(--transition);
}

.card-luxury:hover {
    box-shadow: 0 12px 40px rgba(201, 162, 39, 0.12);
}

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

.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--charcoal), var(--black));
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition);
    border-right: 1px solid rgba(201, 162, 39, 0.2);
}

.sidebar-brand {
    padding: 1.5rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    border-bottom: 1px solid rgba(201, 162, 39, 0.15);
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: rgba(201, 162, 39, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 1.25rem;
}

.brand-title {
    display: block;
    font-weight: 700;
    font-size: 1rem;
    color: var(--gold);
    letter-spacing: 0.05em;
}

.brand-sub {
    font-size: 0.65rem;
    opacity: 0.7;
    letter-spacing: 0.1em;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.75);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: all var(--transition);
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(201, 162, 39, 0.15);
    color: var(--gold-light);
}

.sidebar .nav-link.active {
    border-left: 3px solid var(--gold);
}

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

.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    background: var(--white);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(201, 162, 39, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-heading {
    font-size: 1.75rem;
    margin: 0;
    color: var(--charcoal);
}

[data-theme="dark"] .page-heading { color: var(--gold-light); }

.content-area { padding: 1.5rem; flex: 1; }

/* Buttons */
.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--black);
    border: none;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: all var(--transition);
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    color: var(--black);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(201, 162, 39, 0.4);
}

.btn-outline-gold {
    border: 1px solid var(--gold);
    color: var(--gold-dark);
    background: transparent;
}

.btn-outline-gold:hover {
    background: var(--gold);
    color: var(--black);
}

.btn-icon {
    background: transparent;
    border: 1px solid rgba(201, 162, 39, 0.3);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-dark);
}

/* Stats */
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    box-shadow: var(--shadow);
    border: 1px solid rgba(201, 162, 39, 0.1);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(201, 162, 39, 0.15);
}

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

.stat-icon.gold { background: rgba(201, 162, 39, 0.15); color: var(--gold); }
.stat-icon.success { background: rgba(45, 138, 78, 0.15); color: var(--success); }
.stat-icon.warning { background: rgba(201, 162, 39, 0.15); color: var(--warning); }
.stat-icon.danger { background: rgba(168, 50, 50, 0.15); color: var(--danger); }

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label { font-size: 0.8rem; color: var(--muted); }

.section-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--charcoal);
}

.section-title i { color: var(--gold); margin-right: 0.5rem; }

/* Table */
.table-luxury thead th {
    background: var(--charcoal);
    color: var(--gold);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    padding: 0.85rem 1rem;
}

.table-luxury tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-color: rgba(201, 162, 39, 0.08);
}

.badge-status {
    padding: 0.35em 0.75em;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
}

/* Floor plan — glisser-déposer */
.floor-plan-container {
    height: calc(100vh - 200px);
    min-height: 600px;
}

.floor-plan-wrap {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(201, 162, 39, 0.2);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.floor-plan-canvas {
    position: relative;
    flex: 1;
    min-height: 500px;
    background: #1a1a1a center center / contain no-repeat;
    background-color: rgba(201, 162, 39, 0.06);
    overflow: hidden;
    transform-origin: center center;
    transition: transform 0.3s ease;
}

.floor-plan-canvas.has-image {
    background-color: #0d0d0d;
}

.floor-plan-canvas .plan-placeholder {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    pointer-events: none;
}

.table-node {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: box-shadow var(--transition), transform 0.15s ease;
    border: 3px solid transparent;
    font-size: 1rem;
    font-weight: 700;
    z-index: 2;
    user-select: none;
    touch-action: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.table-node.draggable:active,
.table-node.dragging {
    cursor: grabbing;
    z-index: 10;
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.table-node.libre { 
    background: linear-gradient(135deg, #4caf50, #45a049); 
    color: white; 
    border-color: #388e3c;
}

.table-node.reservee { 
    background: linear-gradient(135deg, #ff9800, #f57c00); 
    color: white; 
    border-color: #ef6c00;
}

.table-node.occupee { 
    background: linear-gradient(135deg, #f44336, #d32f2f); 
    color: white; 
    border-color: #c62828;
}

.table-node:hover { 
    transform: scale(1.08); 
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.table-node span {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
}

.table-node small {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.9;
    margin-top: 2px;
}

.floor-legend { 
    display: flex; 
    gap: 2rem; 
    flex-wrap: wrap; 
    font-size: 0.9rem;
    padding: 0.75rem;
    background: rgba(201, 162, 39, 0.05);
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-item i { 
    font-size: 1rem;
}

.legend-item.libre i { color: #4caf50; }
.legend-item.reservee i { color: #ff9800; }
.legend-item.occupee i { color: #f44336; }

/* Responsive pour écrans tactiles et tablettes */
@media (max-width: 768px) {
    .floor-plan-container {
        height: calc(100vh - 180px);
        min-height: 400px;
    }
    
    .table-node {
        width: 60px;
        height: 60px;
        font-size: 0.85rem;
    }
    
    .table-node span {
        font-size: 1rem;
    }
    
    .table-node small {
        font-size: 0.65rem;
    }
    
    .floor-legend {
        font-size: 0.8rem;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .floor-plan-container {
        height: calc(100vh - 160px);
        min-height: 350px;
    }
    
    .table-node {
        width: 50px;
        height: 50px;
        font-size: 0.75rem;
    }
    
    .table-node span {
        font-size: 0.9rem;
    }
    
    .table-node small {
        font-size: 0.6rem;
    }
}

/* VIP & upcoming */
.list-vip { list-style: none; padding: 0; margin: 0; }
.list-vip li {
    padding: 0.75rem;
    border-left: 3px solid var(--gold);
    margin-bottom: 0.5rem;
    background: rgba(201, 162, 39, 0.06);
    border-radius: 0 8px 8px 0;
    animation: fadeIn 0.5s ease;
}

.upcoming-item {
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-size: 0.9rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-menu { min-width: 320px; max-height: 400px; overflow-y: auto; }

/* Forms */
.form-control, .form-select {
    border: 1px solid rgba(201, 162, 39, 0.25);
    border-radius: 8px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 0.2rem rgba(201, 162, 39, 0.2);
}

.input-luxury .input-group-text {
    background: rgba(201, 162, 39, 0.1);
    border-color: rgba(201, 162, 39, 0.25);
    color: var(--gold-dark);
}

.nav-luxury .nav-link {
    color: var(--muted);
    border: none;
    border-bottom: 2px solid transparent;
}

.nav-luxury .nav-link.active {
    color: var(--gold-dark);
    border-bottom-color: var(--gold);
    background: transparent;
}

/* Calendar */
.res-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.res-cal-day {
    padding: 0.5rem;
    text-align: center;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    min-height: 48px;
}

.res-cal-day.has-res {
    background: rgba(201, 162, 39, 0.2);
    font-weight: 600;
    color: var(--gold-dark);
}

.res-cal-day.selected {
    background: var(--gold);
    color: var(--black);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in { animation: fadeIn 0.6s ease; }
.animate-slide-up { animation: fadeIn 0.5s ease backwards; }

/* QR */
.qr-box {
    width: 120px;
    height: 120px;
    background: #fff;
    padding: 8px;
    border: 1px solid var(--gold);
    border-radius: 8px;
}

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

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    .main-content { margin-left: 0; }
}

@media print {
    .sidebar, .top-bar, .toolbar-luxury, .btn { display: none !important; }
    .main-content { margin: 0 !important; }
}

/* Table checkboxes for multi-table selection */
.tables-grid {
    max-height: 320px;
    overflow-y: auto;
}

.table-checkbox {
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(201, 162, 39, 0.2);
    background: var(--white);
    transition: all var(--transition);
}

.table-checkbox:hover {
    background: rgba(201, 162, 39, 0.05);
    border-color: var(--gold);
}

.table-checkbox.table-reserved {
    background: rgba(168, 50, 50, 0.05);
    border-color: rgba(168, 50, 50, 0.3);
}

.table-checkbox input[type="checkbox"]:checked + label {
    color: var(--gold-dark);
}

.table-checkbox input[type="checkbox"]:disabled + label {
    opacity: 0.6;
    cursor: not-allowed;
}
