/* ═══════════════════════════════════════════════════════════════
   BOOKINGS.REST — DESIGN SYSTEM v2.0
   Minimal zen · Neutro elegante · Indigo accent
   ═══════════════════════════════════════════════════════════════ */

/* Ocultar WordPress chrome */
#wpadminbar { display: none !important; }
html { margin-top: 0 !important; background: #f8f8f6 !important; }
body { margin-top: 0 !important; padding-top: 0 !important; background: #f8f8f6 !important; }
html.wp-toolbar { padding-top: 0 !important; }
body.page .site-header,body.page .site-footer,body.page .entry-header,
body.page .entry-title,body.page .page-title,body.page .wp-block-post-title,
body.page header.entry-header,body.page footer.site-footer,body.page .ast-footer,
body.page .site-info,body.page #colophon,body.page .footer-widget-area,
.entry-title,.page-title,.wp-block-post-title,.site-footer,#colophon,
footer.wp-block-template-part,footer[class*="footer"],
header.wp-block-template-part,header[class*="header"]:not(.bookings-topbar),
.site-header,.main-header-bar,.ast-header{display:none!important}
body.page .entry-content,.entry-content{padding:0!important;margin:0!important;max-width:none!important}
body.page #primary,body.page .site-main,body.page main#main,
#primary,.site-main,main#main,.site-content,.content-area,
.page .entry-content,.hentry,.post,.page-content,
article.page,article.post,#content,.ast-container{padding:0!important;margin:0!important;max-width:none!important}
body.page .site,body .site,#page,.hfeed{padding-top:0!important;margin-top:0!important}

/* ─── DESIGN TOKENS ─── */
:root {
    /* Accent */
    --primary: #6366f1;
    --primary-light: rgba(99,102,241,0.1);
    --primary-hover: #5558e6;
    /* Semantic */
    --green: #10b981;
    --green-bg: rgba(16,185,129,0.1);
    --green-text: #059669;
    --yellow-bg: rgba(245,158,11,0.1);
    --yellow-text: #d97706;
    --red: #ef4444;
    --red-bg: rgba(239,68,68,0.08);
    --red-text: #dc2626;
    --blue-bg: rgba(99,102,241,0.1);
    --blue-text: #4338ca;
    /* Surfaces */
    --bg-base: #f8f8f6;
    --bg-surface: #ffffff;
    --bg-elevated: #ffffff;
    /* Text */
    --text-main: #1a1a1a;
    --text-secondary: #6b6b6b;
    --text-muted: #9a9a9a;
    /* Borders */
    --border: rgba(0,0,0,0.08);
    --border-hover: rgba(0,0,0,0.15);
    /* Effects */
    --shadow-sm: none;
    --shadow-card: none;
    --shadow-hover: none;
    /* Radii */
    --radius: 10px;
    --radius-lg: 10px;
    /* Deprecated but kept for compat */
    --secondary: #10b981;
    --accent: #6366f1;
}

/* ─── BASE ─── */
.bookings-backoffice {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-base);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
}
.bookings-backoffice * { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── LAYOUT ─── */
.bookings-layout { display: flex; min-height: 100vh; background: var(--bg-base); }

/* ─── SIDEBAR ─── */
.bookings-sidebar {
    width: 220px;
    background: var(--bg-surface);
    color: var(--text-main);
    display: none;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    border-right: 1px solid var(--border);
    z-index: 20;
}
.bookings-layout .bookings-sidebar { display: flex; }
.bookings-sidebar-header {
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    height: 48px;
    display: flex;
    align-items: center;
}
.bookings-sidebar-header h1 {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
    color: var(--text-main);
}
.bookings-nav { flex: 1; padding: 8px 8px; overflow-y: auto; }
.bookings-nav::-webkit-scrollbar { width: 4px; }
.bookings-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.bookings-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.12s;
    border-radius: 6px;
    margin-bottom: 1px;
    min-height: 38px;
}
.bookings-nav a .nav-icon {
    width: 16px;
    height: 16px;
    opacity: 0.45;
    flex-shrink: 0;
    transition: opacity 0.12s;
}
.bookings-nav a:hover {
    background: var(--bg-base) !important;
    color: var(--text-main) !important;
}
.bookings-nav a:hover .nav-icon { color: var(--text-main) !important; opacity: 0.7; }
.bookings-nav a.active {
    background: var(--bg-base) !important;
    color: var(--text-main) !important;
    font-weight: 500;
    border-left: none;
}
.bookings-nav a.active .nav-icon {
    opacity: 0.75;
}
.bookings-nav-divider { height: 1px; background: var(--border); margin: 8px 12px; }
.bookings-nav-section { font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-muted); padding: 14px 12px 5px; }
.bookings-sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
}
.bookings-user-name { display: block; font-size: 13px; font-weight: 500; margin-bottom: 1px; color: var(--text-main); }
.bookings-user-role { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 8px; font-weight: 400; }
.bookings-btn-logout {
    width: 100%;
    padding: 7px;
    background: var(--bg-surface);
    color: var(--red-text);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.12s;
}
.bookings-btn-logout:hover { background: var(--red-bg); border-color: rgba(239,68,68,0.2); }
.bookings-btn-sidebar {
    width: 100%;
    padding: 7px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.12s;
    margin-bottom: 4px;
}
.bookings-btn-sidebar:hover { background: var(--bg-base); color: var(--text-main); }
.bookings-btn-sidebar-muted {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
    margin-bottom: 0;
}
.bookings-btn-sidebar-muted:hover { background: transparent; color: var(--red-text); border-color: transparent; }

/* ─── MAIN ─── */
.bookings-main { flex: 1; margin-left: 219px; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.bookings-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px 4px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    position: sticky;
    top: 0;
    z-index: 10;
    height: 48px;
    gap: 10px;
}
.bookings-topbar-left {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 12px;
}
.bookings-topbar-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--text-main);
    margin: 0;
    white-space: nowrap;
    line-height: 1;
    display: inline !important;
    flex-shrink: 0;
}
.bookings-topbar-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    white-space: nowrap;
    line-height: 1;
    position: relative;
    top: 1px;
    display: inline !important;
}
.bookings-topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ─── TOOLBAR INLINE FILTERS ─── */
.tb-filter { display: flex; align-items: center; gap: 5px; }
.tb-filter-label { font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); white-space: nowrap; }
.tb-filter-select { padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-surface); font-size: 12px; font-weight: 500; color: var(--text-main); font-family: inherit; outline: none; height: 30px; }
.tb-filter-select:focus { border-color: var(--primary); }
.tb-sep { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }

.bookings-body { flex: 1; padding: 16px 32px; overflow: auto; box-sizing: border-box; display: flex; flex-direction: column; min-height: 0; }
.bookings-view { display: none; max-width: 100%; }
.bookings-view.active { display: flex; flex-direction: column; }
#view-dashboard.active { flex: 1; min-height: 0; overflow: hidden; }

/* ─── STAT CARDS ─── */
.bookings-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.bookings-stat-card {
    background: var(--bg-surface);
    padding: 16px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: none;
    position: relative;
    overflow: hidden;
}
.bookings-stat-card::after { display: none; }
.bookings-stat-card:hover { box-shadow: none; transform: none; }
.bookings-stat-card h3 { margin: 0 0 4px; font-size: 10px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.8px; }
.bookings-stat-card .value { font-size: 28px; font-weight: 700; color: var(--text-main); letter-spacing: -1px; line-height: 1.1; }
.bookings-stat-card .stat-change { font-size: 11px; font-weight: 700; margin-top: 4px; color: var(--text-muted); }
.bookings-stat-card .stat-change.up { color: #059669; }
.bookings-stat-card .stat-change.down { color: #dc2626; }

/* ─── CARDS ─── */
.bookings-card {
    background: var(--bg-surface);
    padding: 18px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 16px;
    transition: none;
}
.bookings-card:hover { box-shadow: none; }
.bookings-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.bookings-card-header h3 { margin: 0; font-size: 13px; font-weight: 500; letter-spacing: 0; }

/* ─── FILTERS ─── */
.bookings-filters { background: var(--bg-surface); padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid var(--border); overflow: hidden; }
.bookings-filters-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.bookings-filter { display: flex; flex-direction: column; gap: 3px; }
.bookings-filter label { font-size: 10px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; }
.bookings-filter input, .bookings-filter select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    min-width: 80px;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-main);
    background: var(--bg-surface);
    transition: border-color 0.15s;
    height: 32px;
}
.bookings-filter input:focus, .bookings-filter select:focus {
    outline: none;
    border-color: var(--primary);
}
.bookings-filter input[type="date"] { width: 130px; }
.bookings-filter input[type="number"] { width: 65px; }
.bookings-filter-search { min-width: 150px; max-width: 200px; }
.bookings-filter-search input { width: 100%; }
.bookings-filter-buttons { display: flex; gap: 6px; align-items: center; }
.bookings-filter-buttons .bookings-btn { padding: 6px 14px; font-size: 12px; white-space: nowrap; height: 32px; }

/* ─── TABLE ─── */
.bookings-table-wrapper { overflow-x: auto; background: #fff; border-radius: 10px; border: 1px solid var(--border); }
.bookings-table { width: 100%; border-collapse: collapse; table-layout: auto; border: none; border-spacing: 0; min-width: 800px; }
.bookings-table th, .bookings-table td { border: none !important; outline: none; }
.bookings-table th {
    padding: 12px 14px;
    text-align: left;
    background: var(--bg-surface);
    font-weight: 700 !important;
    font-size: 13px !important;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border) !important;
    white-space: nowrap;
}
.bookings-table td { padding: 10px 14px; text-align: left; font-size: 13px; color: var(--text-main); background: inherit !important; }
.bookings-table tbody tr { transition: background 0.1s; border-bottom: 1px solid rgba(0,0,0,0.04); }
.bookings-table tbody tr:nth-child(odd) { background: #ffffff !important; }
.bookings-table tbody tr:nth-child(even) { background: #f5f5f3 !important; }
.bookings-table tbody tr:last-child { border-bottom: none; }
.bookings-table tbody tr:hover { background: #eeeeec !important; }

/* ─── BADGES ─── */
.bookings-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.bre-experience-active #reservation-menu-block { display: none !important; }
.bookings-badge-confirmed { background: rgba(99,102,241,0.1); color: #4338ca; }
.bookings-badge-pending { background: rgba(245,158,11,0.1); color: #92400e; }
.bookings-badge-cancelled { background: rgba(0,0,0,0.04); color: #9a9a9a; }
.bookings-badge-seated { background: rgba(16,185,129,0.1); color: #059669; }
.bookings-badge-completed { background: rgba(16,185,129,0.1); color: #059669; }
.bookings-badge-no_show { background: rgba(0,0,0,0.04); color: #9a9a9a; }

/* ─── TAGS (allergy, VIP, role, etc) ─── */
.btag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 5px; white-space: nowrap; }
.btag-allergy { background: rgba(239,68,68,0.1); color: #dc2626; }
.btag-vip { background: rgba(245,158,11,0.12); color: #d97706; }
.btag-role-owner { background: rgba(99,102,241,0.12); color: #4338ca; }
.btag-role-director { background: rgba(16,185,129,0.12); color: #059669; }
.btag-role-user { background: rgba(0,0,0,0.06); color: #6b6b6b; }
.btag-active { background: rgba(16,185,129,0.1); color: #059669; }
.btag-inactive { background: rgba(0,0,0,0.04); color: #9a9a9a; }
.btag-neutral { background: rgba(0,0,0,0.04); color: #6b6b6b; }

/* ─── BUTTONS ─── */
.bookings-btn {
    padding: 7px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.12s;
    height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.bookings-btn-primary { background: var(--primary) !important; color: #fff !important; }
.bookings-btn-primary:hover { background: var(--primary-hover) !important; }
.bookings-btn-success { background: var(--primary); color: #fff; }
.bookings-btn-success:hover { background: var(--primary-hover); }
.bookings-btn-danger { background: var(--bg-surface); color: var(--red-text); border: 1px solid var(--border); }
.bookings-btn-danger:hover { background: var(--red-bg); border-color: rgba(239,68,68,0.2); }
.bookings-btn-secondary { background: var(--bg-surface) !important; color: var(--text-secondary) !important; border: 1px solid var(--border) !important; }
.bookings-btn-secondary:hover { background: var(--bg-base) !important; color: var(--text-main) !important; border-color: var(--border-hover) !important; }
.bookings-btn-sm { padding: 5px 10px; font-size: 11px; height: 30px; }

/* ─── CLIENT CELL ─── */
.client-cell { display: flex; align-items: center; gap: 10px; }
.client-av { width: 32px; height: 32px; border-radius: 50%; background: #eeeeec; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 500; color: var(--text-secondary); flex-shrink: 0; }
.client-av.vip { border: 2px solid rgba(245,158,11,0.5); background: rgba(245,158,11,0.06); color: #d97706; }
.client-info { display: flex; flex-direction: column; }
.client-name { font-weight: 500; display: flex; align-items: center; gap: 6px; }
.client-email { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ─── ACTION BUTTONS (38px touch target with 1px border) ─── */
.bookings-actions { display: flex; gap: 4px; }
.bookings-action-btn {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; padding: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.12s;
}
.bookings-action-btn:hover { background: var(--bg-base); border-color: var(--border-hover); color: var(--text-main); }
.bookings-action-btn-danger { border-color: var(--border); color: var(--text-secondary); }
.bookings-action-btn-danger:hover { background: var(--red-bg); color: var(--red-text); border-color: rgba(239,68,68,0.25); }
.bookings-action-btn svg { display: block; }
.bookings-action-btn svg.spin { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ─── FORM FIELDS ─── */
.bookings-field { margin-bottom: 14px; }
.bookings-field label { display: block; margin-bottom: 4px; font-weight: 500; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; }
.bookings-field input, .bookings-field textarea, .bookings-field select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-main);
    background: var(--bg-surface);
    transition: border-color 0.15s;
    height: 40px;
}
.bookings-field input:focus, .bookings-field textarea:focus, .bookings-field select:focus {
    outline: none;
    border-color: var(--primary);
}
.bookings-field textarea { height: auto; min-height: 70px; resize: vertical; }
.bookings-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.15s;
    background: var(--bg-surface);
    cursor: pointer;
    color: var(--text-main);
    height: 38px;
}
.bookings-select:focus { outline: none; border-color: var(--primary); }
.bookings-field small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 10px; }
.bookings-fields-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ─── CALENDAR ─── */
.bookings-calendar { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; user-select: none; }
.bookings-calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.bookings-calendar-title { font-weight: 500; font-size: 13px; color: var(--text-main); }
.bookings-calendar-nav { display: flex; gap: 4px; }
.bookings-calendar-nav button { width: 30px; height: 30px; border: 1px solid var(--border); background: var(--bg-surface); border-radius: 6px; cursor: pointer; font-size: 12px; color: var(--text-muted); transition: all 0.12s; font-family: inherit; }
.bookings-calendar-nav button:hover { background: var(--bg-base); color: var(--text-main); border-color: var(--border-hover); }
.bookings-calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.bookings-calendar-weekday { text-align: center; font-size: 10px; font-weight: 500; color: var(--text-muted); padding: 4px 0; text-transform: uppercase; letter-spacing: 0.5px; }
.bookings-calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.bookings-calendar-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 12px; border-radius: 6px; cursor: pointer; transition: all 0.1s; border: none; background: var(--bg-surface); color: var(--text-secondary); font-family: inherit; }
.bookings-calendar-day:hover:not(.disabled):not(.selected) { background: var(--bg-base); }
.bookings-calendar-day.today { font-weight: 600; color: var(--primary); }
.bookings-calendar-day.selected { background: var(--primary); color: #fff; font-weight: 500; }
.bookings-calendar-day.disabled { color: #ccc; cursor: not-allowed; }
.bookings-calendar-day.other-month { color: #ddd; }
.bookings-calendar-day.closed { color: var(--red-text); background: var(--red-bg); cursor: not-allowed; }

/* ─── MODAL ─── */
.bookings-modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.3); z-index: 9999; align-items: center; justify-content: center; }
.bookings-modal.active { display: flex; }
.bookings-modal-box { background: var(--bg-surface); border-radius: 12px; padding: 26px; max-width: 520px; width: 95%; max-height: 90vh; overflow-y: auto; border: 1px solid var(--border); }
.bookings-modal-box h2 { margin: 0 0 4px; font-size: 18px; font-weight: 500; letter-spacing: -0.2px; }
.bookings-modal-box > p { color: var(--text-muted); margin: 0 0 20px; font-size: 13px; }
.bookings-modal-error { display: none; margin: 12px 0; padding: 10px; background: var(--red-bg); color: var(--red-text); border-radius: 6px; font-size: 13px; }
.bookings-modal-buttons { display: flex; gap: 8px; margin-top: 20px; }
.bookings-modal-buttons .bookings-btn { flex: 1; justify-content: center; font-size: 13px; }

/* ─── TABS ─── */
.bookings-tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 1px solid var(--border); background: transparent; padding: 0; border: none; border-radius: 0; }
.bookings-tab { padding: 10px 16px; background: transparent; border: none; border-bottom: 2px solid transparent; border-radius: 0; cursor: pointer; font-weight: 500; font-size: 12px; color: var(--text-muted); transition: all 0.12s; font-family: inherit; }
.bookings-tab:hover { background: transparent; color: var(--text-secondary); }
.bookings-tab.active { background: transparent; color: var(--primary); font-weight: 500; box-shadow: none; border-bottom-color: var(--primary); }
.bookings-tab-content { display: none; }
.bookings-tab-content.active { display: block; }

/* ─── DAYS SELECTOR ─── */
.bookings-days-selector { display: flex; gap: 4px; flex-wrap: wrap; }
.bookings-days-selector label { display: flex; align-items: center; padding: 8px 12px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 500; transition: all 0.12s; }
.bookings-days-selector label:has(input:checked) { background: var(--primary); color: #fff; border-color: var(--primary); }
.bookings-days-selector input { display: none; }
.bookings-days-selector .day-toggle { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 7px; cursor: pointer; font-size: 11px; font-weight: 500; transition: all 0.12s; user-select: none; }
.bookings-days-selector .day-toggle.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.bookings-days-selector .day-toggle.disabled { opacity: 0.35; cursor: not-allowed; }

/* ─── PERIODS ─── */
.bookings-period-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; }
.bookings-period-info { flex: 1; }
.bookings-period-name { font-weight: 500; font-size: 13px; margin-bottom: 2px; }
.bookings-period-time { font-size: 12px; color: var(--text-muted); }
.bookings-period-inactive { opacity: 0.4; }

/* ─── LOGIN ─── */
.bookings-login-container { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 120px); }
.bookings-login-box {
    max-width: 380px;
    width: 100%;
    padding: 36px 32px;
    background: var(--bg-surface);
    border-radius: 12px;
    border: 1px solid var(--border);
}
.bookings-login-box h1 { font-size: 18px; text-align: center; color: var(--text-main); margin-bottom: 4px; font-weight: 600; }
.bookings-login-box > p { color: var(--text-muted); text-align: center; margin-bottom: 24px; font-size: 12px; }
.bookings-login-error { display: none; margin-top: 12px; padding: 10px; background: var(--red-bg); color: var(--red-text); border-radius: 6px; text-align: center; font-size: 12px; }

/* ─── EXCEPTIONS CALENDAR ─── */
.exc-day:hover { background: var(--primary-light) !important; color: var(--primary) !important; }
.exc-day-past:hover { background: var(--bg-base) !important; color: var(--text-muted) !important; }
.exc-month { background: var(--bg-surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }

/* ─── TIMELINE ─── */
#view-timeline { overflow: hidden; }
#view-timeline .tl-container { overflow: auto; width: calc(100vw - 252px); }

/* Legend in topbar */
.tl-legend { display: flex; gap: 14px; align-items: center; }
.tl-legend-item { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--text-secondary); }
.tl-legend-sw { width: 20px; height: 10px; border-radius: 3px; }
.tl-legend-confirmed { background: rgba(99,102,241,0.25); border: 1px solid rgba(99,102,241,0.35); }
.tl-legend-pending { background: rgba(245,158,11,0.2); border: 1px solid rgba(245,158,11,0.35); }
.tl-legend-seated { background: rgba(16,185,129,0.2); border: 1px solid rgba(16,185,129,0.35); }
.tl-legend-chip { font-size: 8px; font-weight: 600; padding: 1px 4px; border-radius: 3px; background: rgba(239,68,68,0.15); color: #dc2626; }
.tl-legend-vip { width: 10px; height: 10px; border-radius: 3px; border: 1.5px solid rgba(245,158,11,0.5); }

/* Nav bar */
.tl-nav-bar { padding: 10px 32px; display: flex; align-items: center; gap: 8px; background: var(--bg-surface); border-bottom: 1px solid var(--border); }
.tl-nav-btn { padding: 6px 10px; border-radius: 5px; border: 1px solid var(--border); background: var(--bg-surface); font-size: 11px; font-weight: 500; color: var(--text-secondary); cursor: pointer; font-family: inherit; height: 30px; display: flex; align-items: center; gap: 4px; }
.tl-nav-btn:hover { background: var(--bg-base); color: var(--text-main); }
.tl-nav-today { background: var(--primary); color: #fff !important; border-color: var(--primary); }
.tl-nav-today:hover { background: var(--primary-hover); }
.tl-nav-mode.active { background: var(--bg-base); color: var(--text-main); border-color: rgba(0,0,0,0.15); }
.tl-nav-date { font-size: 13px; font-weight: 500; color: var(--text-main); padding: 0 4px; white-space: nowrap; }
.tl-nav-sep { width: 1px; height: 16px; background: var(--border); flex-shrink: 0; }

/* Container */
.tl-container { overflow: auto; height: calc(100vh - 160px); background: var(--bg-surface); }

/* Gantt */
.tl-gantt { min-width: fit-content; }

/* Gantt header */
.tl-hdr { display: flex; position: sticky; top: 0; z-index: 8; background: var(--bg-surface); border-bottom: 1px solid var(--border); min-width: fit-content; }
.tl-lc { width: 80px; flex-shrink: 0; padding: 10px 12px; font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); border-right: 1px solid var(--border); position: sticky; left: 0; z-index: 9; background: var(--bg-surface); }
.tl-hrs { display: flex; }
.tl-hr { width: 110px; flex-shrink: 0; padding: 10px 0; font-size: 10px; font-weight: 500; color: var(--text-muted); text-align: center; border-left: 1px solid rgba(0,0,0,0.04); font-family: var(--mono); }
.tl-hr.now { color: var(--primary); font-weight: 600; }

/* Rows */
.tl-body { display: flex; flex-direction: column; min-width: fit-content; }
.tl-row { display: flex; min-height: 58px; border-bottom: 1px solid rgba(0,0,0,0.05); min-width: fit-content; }
.tl-row:hover { background: rgba(0,0,0,0.01); }
.tl-row.closed { background: repeating-linear-gradient(135deg, transparent, transparent 4px, rgba(0,0,0,0.015) 4px, rgba(0,0,0,0.015) 8px); }
.tl-row.today { background: rgba(99,102,241,0.02); }
.tl-day { width: 80px; flex-shrink: 0; padding: 10px 12px; border-right: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; position: sticky; left: 0; z-index: 4; background: #ffffff; }
.tl-row.closed .tl-day { background: #f5f5f3; }
.tl-row.today .tl-day { background: #fbfbfa; }
.tl-dn { font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.tl-dd { font-size: 14px; font-weight: 500; color: var(--text-main); margin-top: 1px; }
.tl-row.today .tl-dd { color: var(--primary); }
.tl-dc { font-size: 9px; color: var(--text-muted); margin-top: 2px; }

/* Slots area */
.tl-slots { flex: 1; position: relative; padding: 8px 0; min-height: 58px; overflow: hidden; z-index: 1; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--primary); z-index: 3; opacity: 0.4; }

/* Blocks */
.blk {
    position: absolute;
    height: 50px;
    border-radius: 7px;
    padding: 5px 10px;
    font-size: 13px;
    cursor: pointer;
    overflow: hidden;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1.5px solid transparent;
    transition: transform 0.1s;
}
.blk:hover { transform: translateY(-1px); z-index: 4; }
.blk-top { display: flex; align-items: center; gap: 4px; }
.blk-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.blk-meta { font-size: 12px; opacity: 0.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; font-family: var(--mono); }
.blk.confirmed { background: rgba(99,102,241,0.1); border-color: rgba(99,102,241,0.2); color: #4338ca; }
.blk.pending { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.2); color: #92400e; }
.blk.seated { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.2); color: #065f46; }
.blk.cancelled { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); color: #9a9a9a; }
.blk.allergy { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.2); color: #b91c1c; }
.blk.vip { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.5); border-width: 2px; color: #92400e; }
.a-chip { font-size: 9px; font-weight: 600; padding: 1px 4px; border-radius: 3px; background: rgba(239,68,68,0.15); color: #dc2626; white-space: nowrap; flex-shrink: 0; }
.vip-d { width: 5px; height: 5px; border-radius: 50%; background: #f59e0b; flex-shrink: 0; }

.timeline-empty { padding: 40px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ─── TIMELINE DETAIL MODAL ─── */
.tl-modal { background: var(--bg-surface); border-radius: 12px; width: 620px; max-width: 95%; margin: 80px auto; position: relative; z-index: 11; overflow: hidden; }
.tl-modal-hd { padding: 20px 26px 16px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid rgba(0,0,0,0.06); }
.tl-modal-hd-l { display: flex; flex-direction: column; gap: 3px; }
.tl-modal-hd-nr { display: flex; align-items: center; gap: 8px; }
.tl-modal-name { font-size: 18px; font-weight: 500; color: var(--text-main); }
.tl-modal-vip { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 5px; background: rgba(245,158,11,0.12); color: #d97706; text-transform: uppercase; letter-spacing: 0.5px; }
.tl-modal-code { font-family: var(--mono); font-size: 13px; color: var(--text-muted); }
.tl-modal-x { width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-surface); display: flex; align-items: center; justify-content: center; cursor: pointer; margin: -6px -6px 0 0; }
.tl-modal-x svg { width: 18px; height: 18px; color: var(--text-secondary); }
.tl-modal-bd { padding: 20px 26px; }
.tl-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 26px; }
.tl-modal-di { display: flex; flex-direction: column; gap: 3px; }
.tl-modal-dl { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); }
.tl-modal-dv { font-size: 15px; font-weight: 500; color: var(--text-main); }
.tl-modal-mono { font-family: var(--mono); font-size: 14px; color: var(--text-secondary); }
.tl-modal-mono a { color: var(--primary); text-decoration: none; }
.tl-modal-dv.muted { color: var(--text-muted); font-weight: 400; }
.tl-modal-bs { font-size: 13px; font-weight: 500; padding: 3px 9px; border-radius: 6px; display: inline-block; }
.tl-modal-bs.confirmed { background: rgba(99,102,241,0.1); color: #4338ca; }
.tl-modal-bs.pending { background: rgba(245,158,11,0.1); color: #d97706; }
.tl-modal-bs.seated { background: rgba(16,185,129,0.1); color: #059669; }
.tl-modal-bs.cancelled { background: rgba(0,0,0,0.06); color: var(--text-muted); }
.tl-modal-nts { margin-top: 16px; }
.tl-modal-nts-t { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 8px; }
.tl-modal-nl { display: flex; align-items: baseline; gap: 6px; font-size: 14px; line-height: 1.5; }
.tl-modal-nl + .tl-modal-nl { margin-top: 4px; }
.tl-modal-nd { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; position: relative; top: -1px; }
.tl-modal-nd.g { background: var(--green); }
.tl-modal-nd.a { background: #f59e0b; }
.tl-modal-ntx { color: var(--text-secondary); }
.tl-modal-ntx.w { color: #d97706; }
.tl-modal-ft { padding: 16px 26px 20px; display: flex; gap: 6px; border-top: 1px solid rgba(0,0,0,0.06); align-items: center; }
.tl-mb { padding: 8px 14px; border-radius: 7px; font-size: 13px; font-weight: 500; font-family: inherit; cursor: pointer; display: flex; align-items: center; gap: 5px; min-height: 40px; white-space: nowrap; }
.tl-mb svg { width: 15px; height: 15px; }
.tl-mb-pri { background: var(--primary); color: #fff; border: none; }
.tl-mb-gho { background: var(--bg-surface); color: var(--text-secondary); border: 1px solid var(--border); }
.tl-mb-dng { background: var(--bg-surface); color: #dc2626; border: 1px solid var(--border); }
.tl-mb-rev { background: var(--bg-surface); color: var(--text-secondary); border: 1px solid var(--border); margin-left: auto; }
.tl-modal-input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; font-family: inherit; color: var(--text-main); background: var(--bg-surface); outline: none; }
.tl-modal-input:focus { border-color: var(--primary); }
textarea.tl-modal-input { resize: vertical; min-height: 44px; }

/* ─── EXCEPTIONS CALENDAR ─── */
.exc-cals { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.exc-cal { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.exc-cal-title { font-size: 13px; font-weight: 500; color: var(--text-main); text-align: center; margin-bottom: 12px; }
.exc-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.exc-cal-hdr { font-size: 10px; font-weight: 500; color: var(--text-muted); text-align: center; padding: 4px 0; }
.exc-cal-day { font-size: 12px; text-align: center; padding: 7px 0; border-radius: 6px; cursor: pointer; color: var(--text-main); transition: background 0.1s; min-height: 32px; display: flex; align-items: center; justify-content: center; }
.exc-cal-day:hover { background: var(--bg-base); }
.exc-cal-day.empty { cursor: default; }
.exc-cal-day.empty:hover { background: transparent; }
.exc-cal-day.today { font-weight: 600; color: var(--primary); }
.exc-cal-day.blocked { background: rgba(239,68,68,0.1); color: #dc2626; font-weight: 500; }
.exc-cal-day.blocked:hover { background: rgba(239,68,68,0.18); }
.exc-cal-day.past { color: #ccc; cursor: default; }
.exc-cal-day.past:hover { background: transparent; }
.exc-cal-day.closed { color: #d4d4d4; font-style: italic; }
.exc-cal-day.selected { background: rgba(99,102,241,0.12); color: var(--primary); }
.exc-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 14px 18px; display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.exc-card:hover { border-color: var(--border-hover); }
.exc-dates { display: flex; flex-direction: column; gap: 1px; min-width: 140px; }
.exc-date { font-size: 13px; font-weight: 500; color: var(--text-main); }
.exc-range { font-size: 11px; color: var(--text-muted); font-family: var(--mono); }
.exc-reason { font-size: 13px; color: var(--text-secondary); flex: 1; }
.exc-badge { font-size: 10px; font-weight: 500; padding: 3px 9px; border-radius: 5px; white-space: nowrap; }
.exc-badge.future { background: rgba(245,158,11,0.08); color: #d97706; }
.exc-badge.past { background: rgba(0,0,0,0.04); color: var(--text-muted); }
.exc-badge.active { background: rgba(239,68,68,0.08); color: #dc2626; }

/* ─── MODO COCINA ─── */
body.kitchen-mode .bookings-sidebar { display: none !important; }
body.kitchen-mode .bookings-main { margin-left: 0 !important; }
body.kitchen-mode .bookings-body { padding: 10px !important; overflow: auto !important; }
body.kitchen-mode .bookings-card { padding: 10px; }
body.kitchen-mode .bookings-filters { display: none !important; }
body.kitchen-mode .bookings-table { font-size: 15px; width: 100%; table-layout: auto; }
body.kitchen-mode .bookings-table th { font-size: 10px; padding: 10px 8px; }
body.kitchen-mode .bookings-table td { padding: 10px 8px; font-size: 15px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
body.kitchen-mode .bookings-action-btn { width: 42px; height: 42px; min-width: 42px; }
body.kitchen-mode .bookings-action-btn svg { width: 20px; height: 20px; }
body.kitchen-mode .bookings-badge { font-size: 12px; padding: 3px 8px; }
body.kitchen-mode .bookings-card-header { margin-bottom: 10px; }
body.kitchen-mode .bookings-card-header h3 { font-size: 16px; }
body.kitchen-mode #btn-kitchen-mode { font-size: 14px; padding: 10px 20px; }
body.kitchen-mode #btn-kitchen-columns { font-size: 12px; padding: 8px 16px; }
body.kitchen-mode .bookings-table-wrapper { overflow-x: auto; width: 100%; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
    .bookings-sidebar { width: 60px; }
    .bookings-sidebar-header h1 span:not(.material-symbols-outlined) { display: none; }
    .bookings-nav a span:not(.nav-icon) { display: none; }
    .bookings-nav a { justify-content: center; padding: 10px 0; }
    .bookings-sidebar-footer .bookings-user-name,
    .bookings-sidebar-footer .bookings-user-role { display: none; }
    .bookings-main { margin-left: 60px; }
    .bookings-body { padding: 16px 20px; }
    .bookings-topbar { padding: 14px 20px; }
    .bookings-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .bookings-fields-row { grid-template-columns: 1fr; }
    .bookings-tabs { flex-wrap: wrap; }
}
@media (max-width: 600px) {
    .bookings-layout { flex-direction: column; }
    .bookings-sidebar { width: 100%; position: relative; flex-direction: row; flex-wrap: wrap; }
    .bookings-sidebar-header { padding: 12px; border-bottom: none; }
    .bookings-nav { display: flex; flex-wrap: wrap; padding: 8px; gap: 4px; }
    .bookings-nav a { padding: 8px 12px; border-left: none !important; border-radius: 6px; }
    .bookings-sidebar-footer { width: 100%; padding: 8px 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .bookings-sidebar-footer .bookings-user-name, .bookings-sidebar-footer .bookings-user-role { display: inline; margin: 0; }
    .bookings-btn-logout { width: auto; margin-left: auto; }
    .bookings-main { margin-left: 0; }
    .bookings-stats { grid-template-columns: 1fr; }
}
