/* =============================================================================
   DOMUS — Styles principaux
   Cascade noir/blanc, minimaliste
============================================================================= */

* { box-sizing: border-box; }

:root {
    --black: #000;
    --gray-950: #0a0a0a;
    --gray-900: #0f0f0f;
    --gray-800: #1a1a1a;
    --gray-700: #2b2b2b;
    --gray-600: #444;
    --gray-500: #666;
    --gray-400: #888;
    --gray-300: #aaa;
    --gray-200: #ccc;
    --gray-100: #e5e5e2;
    --gray-50: #f0f0ef;
    --off-white: #fafaf9;
    --white: #fff;

    --success-bg: #e6f5ec;
    --success-fg: #1a6b3a;
    --success-border: #b8e0c8;
    --warning-bg: #fef3e2;
    --warning-fg: #8a5a10;
    --warning-border: #f0d5a0;
    --danger-bg: #fbeaea;
    --danger-fg: #a02020;
    --danger-border: #edc0c0;
    --info-bg: #eef4ff;
    --info-fg: #1e4ba3;
    --info-border: #c8d6f0;

    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'SF Mono', Menlo, Monaco, Consolas, 'Courier New', monospace;
    --font-serif: Georgia, 'Times New Roman', serif;

    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;

    --sidebar-width: 220px;
    --sidebar-collapsed: 60px;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--off-white);
    color: var(--gray-800);
    font-size: 14px;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* =============================================================================
   HEADER (bandeau noir en haut)
============================================================================= */
.top-header {
    background: linear-gradient(135deg, #000 0%, #0d0d0d 35%, #1a1a1a 65%, #2b2b2b 100%);
    padding: 20px 28px;
    color: white;
    position: relative;
    overflow: hidden;
}
.top-header::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 45%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03) 50%, rgba(255,255,255,0.06) 100%);
    pointer-events: none;
}
.top-header-inner {
    display: flex; align-items: center; gap: 16px;
    position: relative;
    max-width: 100%;
}
.brand-logo {
    width: 46px; height: 46px;
    border: 1px solid rgba(255,255,255,0.28);
    background: rgba(255,255,255,0.04);
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-serif);
    font-size: 24px;
    color: white;
    letter-spacing: 1px;
}
.brand-name {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 500;
    letter-spacing: 4px;
    margin: 0;
    color: white;
}
.brand-tagline {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin: 3px 0 0;
}
.top-header-date {
    margin-left: auto;
    text-align: right;
}
.top-header-date .day {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.top-header-date .date {
    font-size: 13px;
    color: white;
    font-weight: 500;
}

/* =============================================================================
   LAYOUT (sidebar + content)
============================================================================= */
.app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: calc(100vh - 88px);
}

.sidebar {
    background: var(--gray-900);
    display: flex; flex-direction: column;
    padding: 0 0 16px;
}
.sidebar-hotel {
    padding: 14px;
    border-bottom: 0.5px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
}
.sidebar-hotel-label {
    font-size: 9px;
    color: rgba(255,255,255,0.35);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.sidebar-hotel-card {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.06);
    border: 0.5px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    cursor: pointer;
}
.sidebar-hotel-card:hover { background: rgba(255,255,255,0.1); }
.sidebar-hotel-avatar {
    width: 26px; height: 26px;
    background: white; color: var(--gray-900);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-weight: 500; font-size: 12px;
}
.sidebar-hotel-info { flex: 1; min-width: 0; }
.sidebar-hotel-name {
    font-size: 12px; color: white; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-hotel-meta {
    font-size: 9px; color: rgba(255,255,255,0.4); letter-spacing: 0.5px;
}
.sidebar-hotel-chevron { color: rgba(255,255,255,0.5); font-size: 14px; }

.sidebar-nav { padding: 12px 0 0; display: flex; flex-direction: column; flex: 1; }
.sidebar-section-title {
    padding: 16px 18px 6px;
    font-size: 9px;
    color: rgba(255,255,255,0.3);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.nav-item {
    padding: 11px 18px;
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    display: flex; align-items: center; gap: 12px;
    border-left: 2px solid transparent;
}
.nav-item:hover {
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.8);
    text-decoration: none;
}
.nav-item.active {
    background: rgba(255,255,255,0.06);
    color: white;
    border-left-color: white;
}
.nav-item svg, .nav-item .icon { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-footer {
    margin-top: auto;
    padding: 14px 18px 0;
    border-top: 0.5px solid rgba(255,255,255,0.08);
}
.sidebar-user {
    display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.sidebar-user-avatar {
    width: 30px; height: 30px;
    background: rgba(255,255,255,0.1); color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 500; font-size: 12px;
}
.sidebar-user-name { font-size: 12px; color: white; font-weight: 500; }
.sidebar-user-role { font-size: 10px; color: rgba(255,255,255,0.4); text-transform: capitalize; }
.sidebar-logout {
    padding: 6px 0; font-size: 12px;
    color: rgba(255,255,255,0.5); text-decoration: none;
    display: flex; align-items: center; gap: 8px;
    background: none; border: none; cursor: pointer;
}
.sidebar-logout:hover { color: white; text-decoration: none; }

/* =============================================================================
   MAIN CONTENT
============================================================================= */
.main-content {
    padding: 20px 28px;
    background: var(--off-white);
    overflow-x: auto;
}

.breadcrumb {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 6px;
    font-size: 11px;
    color: var(--gray-400);
}
.breadcrumb .sep { color: var(--gray-200); }

.page-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap; gap: 12px;
}
.page-title {
    margin: 0;
    font-size: 22px; font-weight: 500;
    color: var(--gray-800);
}
.page-subtitle {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--gray-500);
}
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* =============================================================================
   CARDS
============================================================================= */
.card {
    background: white;
    border: 0.5px solid var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 14px;
}
.card-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 500; color: var(--gray-800);
    margin-bottom: 12px; padding-bottom: 8px;
    border-bottom: 0.5px solid var(--gray-100);
}
.card-title-right { margin-left: auto; }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 900px) {
    .grid-3, .grid-4, .grid-6 { grid-template-columns: repeat(2, 1fr); }
}

/* =============================================================================
   STAT CARDS
============================================================================= */
.stat-card {
    background: white;
    border: 0.5px solid var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 14px;
    border-left: 3px solid var(--gray-800);
}
.stat-card .label {
    font-size: 10px; color: var(--gray-500);
    letter-spacing: 1px; text-transform: uppercase; font-weight: 500;
}
.stat-card .value {
    font-size: 26px; font-weight: 500; color: var(--gray-800);
    margin-top: 4px;
}
.stat-card .meta {
    font-size: 11px; color: var(--gray-400); margin-top: 2px;
}

/* =============================================================================
   BUTTONS
============================================================================= */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    background: white;
    color: var(--gray-800);
    border: 0.5px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 12px; font-family: inherit;
    cursor: pointer; text-decoration: none;
    transition: background 0.15s;
}
.btn:hover { background: var(--gray-50); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--gray-800); color: white; border-color: var(--gray-800); }
.btn-primary:hover { background: var(--black); }
.btn-danger { background: var(--danger-bg); color: var(--danger-fg); border-color: var(--danger-border); font-weight: 500; }
.btn-danger:hover { background: #f5d5d5; }
.btn-success { background: var(--success-bg); color: var(--success-fg); border-color: var(--success-border); font-weight: 500; }
.btn-warning { background: var(--warning-bg); color: var(--warning-fg); border-color: var(--warning-border); font-weight: 500; }
.btn-sm { padding: 5px 9px; font-size: 10px; }
.btn-lg { padding: 11px 18px; font-size: 13px; font-weight: 500; }
.btn-block { width: 100%; justify-content: center; }

/* =============================================================================
   FORMS
============================================================================= */
.form-group { margin-bottom: 14px; }
.form-label {
    display: block; margin-bottom: 4px;
    font-size: 11px; color: var(--gray-500);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.form-label .required { color: var(--danger-fg); }
.form-control {
    width: 100%;
    padding: 8px 10px;
    border: 0.5px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 13px; font-family: inherit;
    background: white;
    box-sizing: border-box;
}
.form-control:focus { outline: 2px solid var(--gray-800); outline-offset: -1px; }
.form-control-mono { font-family: var(--font-mono); }
.form-help {
    font-size: 10px; color: var(--gray-400); margin-top: 4px;
}
.form-checkbox {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: var(--gray-800); cursor: pointer;
}
.form-error {
    background: var(--danger-bg); color: var(--danger-fg);
    padding: 10px 12px; border-radius: var(--radius);
    font-size: 12px; margin-bottom: 12px;
    border-left: 3px solid var(--danger-fg);
}

/* =============================================================================
   TABLES
============================================================================= */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    table-layout: auto;
}
.table thead {
    color: var(--gray-500);
    text-align: left;
    border-bottom: 0.5px solid var(--gray-100);
}
.table th {
    padding: 8px 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 10px;
    white-space: nowrap;
}
.table td {
    padding: 12px 8px;
    border-bottom: 0.5px solid var(--gray-100);
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--off-white); }
.table .mono { font-family: var(--font-mono); font-size: 11px; }
.table .muted { color: var(--gray-400); }
.table .right { text-align: right; }
.table .center { text-align: center; }

.table-empty {
    text-align: center;
    padding: 32px 12px;
    color: var(--gray-400);
    font-style: italic;
    font-size: 12px;
}

/* =============================================================================
   BADGES
============================================================================= */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px; font-weight: 500;
    letter-spacing: 0.3px;
}
.badge-info { background: var(--info-bg); color: var(--info-fg); }
.badge-success { background: var(--success-bg); color: var(--success-fg); }
.badge-warning { background: var(--warning-bg); color: var(--warning-fg); }
.badge-danger { background: var(--danger-bg); color: var(--danger-fg); }
.badge-neutral { background: var(--gray-50); color: var(--gray-600); }

/* =============================================================================
   FLASH MESSAGES
============================================================================= */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 13px;
    display: flex; align-items: center; gap: 8px;
}
.flash-success { background: var(--success-bg); color: var(--success-fg); border-left: 3px solid var(--success-fg); }
.flash-error { background: var(--danger-bg); color: var(--danger-fg); border-left: 3px solid var(--danger-fg); }
.flash-info { background: var(--info-bg); color: var(--info-fg); border-left: 3px solid var(--info-fg); }

/* =============================================================================
   AUTH PAGES (login, setup, change-password)
============================================================================= */
.auth-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--off-white);
    padding: 40px 20px;
}
.auth-card {
    width: 100%; max-width: 400px;
    background: white;
    border: 0.5px solid var(--gray-100);
    border-radius: var(--radius-xl);
    padding: 32px;
}
.auth-logo {
    width: 56px; height: 56px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #000 0%, #2b2b2b 100%);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-serif);
    font-size: 30px; color: white; letter-spacing: 1px;
}
.auth-brand {
    text-align: center;
    font-family: var(--font-serif);
    font-size: 22px; font-weight: 500;
    color: var(--gray-800);
    letter-spacing: 3px;
    margin: 0 0 4px;
}
.auth-tagline {
    text-align: center;
    font-size: 11px;
    color: var(--gray-400);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0 0 24px;
}
.auth-error {
    background: var(--danger-bg); color: var(--danger-fg);
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    margin-bottom: 12px;
    text-align: center;
}
.auth-note {
    text-align: center;
    margin-top: 16px;
    font-size: 10px;
    color: var(--gray-400);
}

/* =============================================================================
   INVOICE VIEW
============================================================================= */
.invoice {
    background: white;
    border: 0.5px solid var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 32px;
}
.invoice-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 24px; padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-800);
}
.invoice-hotel-name {
    margin: 0;
    font-size: 24px; font-weight: 500;
    color: var(--gray-800);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.invoice-hotel-address {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--gray-500);
    letter-spacing: 0.5px;
}
.invoice-info-cards { display: flex; gap: 8px; }
.invoice-info-card {
    border: 0.5px solid var(--gray-100);
    border-radius: var(--radius);
    padding: 8px 12px;
    min-width: 90px;
}
.invoice-info-card .label {
    font-size: 9px; color: var(--gray-400);
    text-transform: uppercase; letter-spacing: 1px;
}
.invoice-info-card .value {
    font-size: 12px; color: var(--gray-800);
}
.invoice-info-card .value.mono { font-family: var(--font-mono); }

.invoice-detail-cards {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 12px; margin-bottom: 20px;
}

.invoice-table {
    width: 100%; border-collapse: collapse;
    font-size: 10px; margin-bottom: 20px;
}
.invoice-table thead tr {
    color: var(--gray-500);
    text-align: left;
    border-top: 0.5px solid var(--gray-800);
    border-bottom: 0.5px solid var(--gray-800);
}
.invoice-table th {
    padding: 8px 4px; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.5px;
    font-size: 9px;
}
.invoice-table td {
    padding: 8px 4px;
    border-bottom: 0.5px solid var(--gray-100);
    font-family: var(--font-mono);
    font-size: 10px;
}
.invoice-table .name { font-family: var(--font-sans); }

.invoice-totals-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.invoice-tva-box, .invoice-totals-box {
    border: 0.5px solid var(--gray-100);
    border-radius: var(--radius);
    padding: 12px;
}
.invoice-totals-box .row {
    display: flex; justify-content: space-between;
    padding: 4px 0; font-size: 11px;
    border-bottom: 0.5px solid var(--gray-100);
}
.invoice-totals-box .row:last-child { border-bottom: none; }
.invoice-totals-box .row.total {
    padding: 8px 0 4px;
    font-size: 13px; font-weight: 500;
    color: var(--gray-800);
}

.invoice-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 0.5px solid var(--gray-100);
    font-size: 9px;
    color: var(--gray-500);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* =============================================================================
   ERROR PAGES
============================================================================= */
.error-page {
    min-height: 60vh;
    display: flex; align-items: center; justify-content: center;
    padding: 40px 20px;
}
.error-box {
    text-align: center;
    max-width: 500px;
}
.error-code {
    font-family: var(--font-serif);
    font-size: 96px;
    font-weight: 500;
    color: var(--gray-800);
    margin: 0;
    line-height: 1;
}
.error-title {
    font-size: 20px; font-weight: 500;
    color: var(--gray-800);
    margin: 12px 0;
}
.error-message {
    color: var(--gray-500);
    margin-bottom: 24px;
}

/* =============================================================================
   UTILS
============================================================================= */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.text-muted { color: var(--gray-400); }
.text-mono { font-family: var(--font-mono); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }

/* =============================================================================
   DROPDOWN MENU
============================================================================= */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    position: absolute;
    top: 100%; left: 0;
    background: white;
    border: 0.5px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    min-width: 200px;
    z-index: 100;
    display: none;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
    display: block;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--gray-800);
    text-decoration: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.dropdown-item:hover { background: var(--gray-50); text-decoration: none; }

/* =============================================================================
   PANEL (collapsible sur-occupation)
============================================================================= */
.panel-toggle {
    padding: 10px 12px;
    background: var(--off-white);
    border: 0.5px solid var(--gray-100);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12px; color: var(--gray-800);
    margin-bottom: 8px;
}
.panel-content { display: none; padding: 14px; background: var(--off-white); border-radius: var(--radius); margin-bottom: 14px; }
.panel-content.open { display: block; }
