/* =========================================================================
   Travelodge Corporate · CRM
   Estética: Apple minimalista · Travelodge red como acento puntual
   ========================================================================= */

:root {
    /* Brand */
    --tl-red:        #C41E3A;
    --tl-red-dark:   #A0182F;
    --tl-red-light:  #FCE9EC;

    /* Apple-system neutrals (apple.com palette) */
    --bg:            #FBFBFD;
    --bg-elev:       #F5F5F7;
    --surface:       #FFFFFF;
    --text:          #1D1D1F;
    --text-muted:    #515154;
    --text-faint:    #86868B;
    --border:        #D2D2D7;
    --border-light:  #F0F0F2;
    --divider:       #F5F5F7;

    /* Status */
    --success:       #00A862;
    --success-bg:    #E5F8EF;
    --warning:       #FF9500;
    --warning-bg:    #FFF4E0;
    --info:          #0071E3;
    --info-bg:       #E5F1FF;
    --danger:        #FF3B30;
    --danger-bg:     #FFEBEA;

    /* Sizing — Apple usa radius más generoso */
    --radius-sm:     8px;
    --radius-md:     12px;
    --radius-lg:     18px;
    --radius-xl:     22px;
    --radius-2xl:    28px;
    --radius-pill:   980px;

    --shadow-card:   0 0 0 0.5px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.02);
    --shadow-md:     0 0 0 0.5px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
    --shadow-lg:     0 0 0 0.5px rgba(0,0,0,0.04), 0 16px 48px -8px rgba(0,0,0,0.10);

    --sidebar-w:     240px;
    --content-max:   1100px;
}

/* ─────────── Reset minimal ─────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Inter var", Inter, "Segoe UI", Roboto, sans-serif;
    font-feature-settings: "cv11", "ss01", "ss03";
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.47;
    font-size: 15px;
    letter-spacing: -0.005em;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

/* ─────────── App layout ─────────── */
.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}
.main {
    padding: 56px 64px 96px;
    max-width: var(--content-max);
    width: 100%;
    margin: 0 auto;
}
@media (max-width: 1100px) {
    .main { padding: 40px 32px 64px; }
}

/* ─────────── Sidebar (Apple-style: minimal, sin border visible) ─────────── */
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar-brand {
    padding: 22px 20px 28px;
    border-bottom: 1px solid var(--divider);
}
.brand-link { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 32px; height: 32px; flex-shrink: 0; }
.brand-text { line-height: 1.15; }
.brand-name {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.01em;
}
.brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13.5px;
    transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover {
    background: var(--bg-elev);
    color: var(--text);
}
.nav-item.active {
    background: var(--tl-red-light);
    color: var(--tl-red);
}
.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-foot {
    padding: 16px 12px 20px;
    border-top: 1px solid var(--divider);
}
.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-md);
}
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--tl-red);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role {
    font-size: 11px;
    color: var(--text-muted);
}
.user-logout {
    color: var(--text-faint);
    padding: 4px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.user-logout:hover { color: var(--tl-red); background: var(--tl-red-light); }

/* ─────────── Page header ─────────── */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 48px;
    gap: 24px;
}
.page-title {
    font-size: 40px;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin: 0;
}
.page-sub {
    color: var(--text-muted);
    font-size: 17px;
    margin-top: 8px;
    line-height: 1.4;
    font-weight: 400;
    letter-spacing: -0.01em;
}
.page-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* ─────────── Buttons (Apple pill style) ─────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 22px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.005em;
    color: var(--text);
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.05s;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.15;
    white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:hover { background: var(--bg-elev); }
.btn-primary {
    background: var(--tl-red);
    color: white;
    border-color: var(--tl-red);
}
.btn-primary:hover { background: var(--tl-red-dark); border-color: var(--tl-red-dark); }
.btn-outline {
    border-color: var(--border);
    background: transparent;
}
.btn-outline:hover { background: var(--bg-elev); border-color: var(--text); }
.btn-ghost { color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { color: var(--text); background: var(--bg-elev); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-link {
    color: var(--info);
    background: transparent;
    border: none;
    padding: 0;
    font-weight: 400;
}
.btn-link:hover {
    background: transparent;
    text-decoration: underline;
    color: var(--info);
}
.btn-link::after {
    content: '›';
    margin-left: 2px;
    transition: transform 0.18s;
    display: inline-block;
}
.btn-link:hover::after { transform: translateX(3px); }

/* ─────────── Cards (Apple-style: sin borde visible, soft shadow) ─────────── */
.card {
    background: var(--surface);
    border: none;
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-card);
}
.card-tight { padding: 18px; }
.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}
.card-title {
    font-size: 19px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.015em;
    line-height: 1.2;
}
.card-sub {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
    letter-spacing: -0.005em;
}

/* ─────────── KPI grid ─────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 48px;
}
.kpi {
    background: var(--surface);
    border: none;
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-card);
}
.kpi-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 10px;
    letter-spacing: -0.005em;
}
.kpi-value {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-bottom: 6px;
}
.kpi-trend {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}
.kpi-trend.up   { color: var(--success); }
.kpi-trend.down { color: var(--danger); }

/* ─────────── Pipeline funnel ─────────── */
.funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel-row {
    display: grid;
    grid-template-columns: 160px 1fr 80px;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}
.funnel-label {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}
.funnel-bar {
    height: 22px;
    background: var(--bg-elev);
    border-radius: 6px;
    overflow: hidden;
}
.funnel-fill {
    height: 100%;
    background: var(--tl-red);
    transition: width 0.4s ease;
    border-radius: 6px;
}
.funnel-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ─────────── Tables ─────────── */
.table-wrap {
    background: var(--surface);
    border: none;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table th {
    text-align: left;
    padding: 16px 22px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--divider);
    background: transparent;
}
.table td {
    padding: 18px 22px;
    border-bottom: 1px solid var(--divider);
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover { background: var(--bg-elev); }
.table-link { color: var(--text); font-weight: 500; }
.table-link:hover { color: var(--tl-red); }

/* ─────────── Badges (pill, Apple-style) ─────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-elev);
    color: var(--text-muted);
    line-height: 1.4;
    letter-spacing: -0.005em;
}
.badge-success { background: var(--success-bg); color: #1F7A30; }
.badge-warning { background: var(--warning-bg); color: #B86A00; }
.badge-info    { background: var(--info-bg);    color: #004FBF; }
.badge-danger  { background: var(--danger-bg);  color: #B0271E; }
.badge-red     { background: var(--tl-red-light); color: var(--tl-red); }

/* ─────────── Forms ─────────── */
.form-group { margin-bottom: 22px; }
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}
.form-row-3 { grid-template-columns: repeat(3, 1fr); }
label.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: -0.005em;
}
.input, .select, .textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.18s, box-shadow 0.18s;
    letter-spacing: -0.005em;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--tl-red);
    box-shadow: 0 0 0 3px rgba(196,30,58,0.12);
}
.textarea { resize: vertical; min-height: 80px; }
.select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236E6E73' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

/* ─────────── Filter bar ─────────── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.search-input {
    flex: 1;
    min-width: 240px;
    max-width: 360px;
    padding: 11px 16px 11px 38px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    font-size: 14px;
    background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23808088' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>") 14px center no-repeat;
}
.search-input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px rgba(0,0,0,0.06); }

/* ─────────── Empresa ficha ─────────── */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 1100px) { .detail-grid { grid-template-columns: 1fr; } }

.timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 12px;
    bottom: 12px;
    width: 2px;
    background: var(--divider);
}
.timeline-item {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 12px;
    padding: 14px 0;
    align-items: start;
    position: relative;
}
.timeline-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 1;
}
.timeline-content {
    background: var(--bg-elev);
    border-radius: 10px;
    padding: 12px 14px;
}
.timeline-meta {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ─────────── Login ─────────── */
.standalone {
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.login-card {
    background: var(--surface);
    border-radius: var(--radius-2xl);
    padding: 56px 48px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 0 0 0.5px rgba(0,0,0,0.06), 0 24px 48px -12px rgba(0,0,0,0.10);
}
.login-brand {
    margin-bottom: 40px;
}
.login-mark {
    width: 64px;
    height: 64px;
    margin: 0 0 24px;
}
.login-title {
    font-size: 32px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.025em;
    line-height: 1.1;
}
.login-sub {
    color: var(--text-muted);
    font-size: 17px;
    margin-top: 8px;
    font-weight: 400;
    letter-spacing: -0.01em;
}
.login-card .form-group { margin-bottom: 18px; }
.login-card .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 15px;
    margin-top: 8px;
}
.login-hint {
    margin-top: 24px;
    padding: 12px 14px;
    background: var(--bg-elev);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.55;
}
.login-hint strong { color: var(--text); font-weight: 600; }

/* ─────────── Flashes ─────────── */
.flashes { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.flashes-floating {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: max-content;
    max-width: 420px;
}
.flash {
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    border: 1px solid transparent;
}
.flash-success { background: var(--success-bg); color: #1F7A30; border-color: rgba(48,209,88,0.25); }
.flash-error   { background: var(--danger-bg);  color: #B0271E; border-color: rgba(255,59,48,0.25); }
.flash-info    { background: var(--info-bg);    color: #004FBF; border-color: rgba(0,122,255,0.25); }
.flash-warning { background: var(--warning-bg); color: #B86A00; border-color: rgba(255,159,10,0.25); }

/* ─────────── Layout helpers ─────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.stack-md { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.spacer { flex: 1; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.text-sm { font-size: 12.5px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.text-num { font-variant-numeric: tabular-nums; }
.divider-h { height: 1px; background: var(--divider); margin: 20px 0; }
.empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    font-size: 13.5px;
}
.empty-title { font-size: 15px; color: var(--text); font-weight: 600; margin-bottom: 6px; }

/* ─────────── Avatar with initials ─────────── */
.av {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--text-muted);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}
.av-lg { width: 56px; height: 56px; font-size: 20px; }

/* ═══════════════════════════════════════════════════════════
   COMPONENTES POLISH · v2
   Animaciones, kanban, hero, sparklines, empty states
   ═══════════════════════════════════════════════════════════ */

/* ─────────── Animaciones de entrada ─────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideRight {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}
.fade-in     { animation: fadeIn    0.4s cubic-bezier(0.32, 0.72, 0, 1) both; }
.slide-right { animation: slideRight 0.4s cubic-bezier(0.32, 0.72, 0, 1) both; }
.scale-in    { animation: scaleIn   0.35s cubic-bezier(0.32, 0.72, 0, 1) both; }
.delay-50    { animation-delay: 50ms; }
.delay-100   { animation-delay: 100ms; }
.delay-150   { animation-delay: 150ms; }
.delay-200   { animation-delay: 200ms; }
.delay-300   { animation-delay: 300ms; }
.delay-400   { animation-delay: 400ms; }

/* ─────────── Hero greeting (Apple type scale) ─────────── */
.hero-greeting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    margin-bottom: 56px;
}
.hero-greeting-text { flex: 1; }
.hero-greeting h1 {
    font-size: 56px;
    font-weight: 600;
    letter-spacing: -0.04em;
    margin: 0;
    line-height: 1.05;
}
.hero-greeting-sub {
    color: var(--text-muted);
    font-size: 19px;
    margin-top: 14px;
    font-weight: 400;
    letter-spacing: -0.012em;
    line-height: 1.4;
}
.hero-greeting-emoji {
    font-size: 48px;
    margin-right: 14px;
    display: inline-block;
    vertical-align: middle;
}
.hero-greeting-actions { display: flex; gap: 10px; }
@media (max-width: 1100px) {
    .hero-greeting h1 { font-size: 44px; }
    .hero-greeting-sub { font-size: 17px; }
}

/* ─────────── KPI cards (Apple aesthetic) ─────────── */
.kpi-v2 {
    background: var(--surface);
    border: none;
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-card);
    transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.22s;
    cursor: default;
    position: relative;
    overflow: hidden;
}
.kpi-v2:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.kpi-v2-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.kpi-v2-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: -0.005em;
}
.kpi-v2-icon {
    width: 32px; height: 32px;
    border-radius: 10px;
    background: var(--bg-elev);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.kpi-v2-icon.red    { background: var(--tl-red-light);  color: var(--tl-red); }
.kpi-v2-icon.green  { background: var(--success-bg);    color: var(--success); }
.kpi-v2-icon.blue   { background: var(--info-bg);       color: var(--info); }
.kpi-v2-icon.amber  { background: var(--warning-bg);    color: var(--warning); }
.kpi-v2-value {
    font-size: 44px;
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.kpi-v2-foot {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.kpi-v2-trend {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    letter-spacing: -0.005em;
}
.kpi-v2-trend.up    { color: var(--success); }
.kpi-v2-trend.down  { color: var(--danger); }
.kpi-v2-trend svg   { width: 13px; height: 13px; }
.kpi-v2-spark {
    height: 30px;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    flex: 1;
    max-width: 80px;
}
.kpi-v2-spark-bar {
    flex: 1;
    background: var(--tl-red-light);
    border-radius: 1.5px;
    min-height: 2px;
    transition: height 0.6s cubic-bezier(0.32, 0.72, 0, 1);
}
.kpi-v2-spark-bar.active { background: var(--tl-red); }

/* ─────────── Sidebar v2: section labels ─────────── */
.nav-section-label {
    font-size: 10.5px;
    color: var(--text-faint);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 14px 14px 6px;
    margin-top: 4px;
}
.nav-section-label:first-child { margin-top: 0; padding-top: 6px; }
.nav-item {
    position: relative;
    transition: background 0.15s, color 0.15s, transform 0.05s;
}
.nav-item:active { transform: translateX(1px); }
.nav-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 2px;
    background: var(--tl-red);
}
.role-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 8px;
    font-size: 9.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--tl-red-light);
    color: var(--tl-red);
    vertical-align: middle;
}
.role-badge.marketing { background: var(--info-bg); color: #004FBF; }
.role-badge.comercial { background: var(--success-bg); color: #1F7A30; }

/* ─────────── Login split-screen (Apple-grade) ─────────── */
.login-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    width: 100%;
}
.login-split-brand {
    background:
        radial-gradient(ellipse at 20% 10%, rgba(255,255,255,0.12), transparent 50%),
        radial-gradient(ellipse at 80% 90%, rgba(255,255,255,0.05), transparent 50%),
        linear-gradient(160deg, #8E1426 0%, var(--tl-red) 50%, var(--tl-red-dark) 100%);
    color: white;
    padding: 80px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.login-split-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(255,255,255,0.10) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.5;
    pointer-events: none;
}
@media (max-width: 1100px) {
    .login-split-brand { padding: 56px; }
}
.login-split-brand > * { position: relative; }
.login-split-mark {
    width: 72px; height: 72px;
    border-radius: 20px;
    background: rgba(255,255,255,0.14);
    backdrop-filter: blur(20px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: white;
    border: 1px solid rgba(255,255,255,0.22);
}
.login-split-tagline { margin-top: auto; }
.login-split-tagline h2 {
    font-size: 48px;
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.05;
    margin: 0 0 16px;
    max-width: 480px;
}
.login-split-tagline p {
    font-size: 18px;
    line-height: 1.5;
    color: rgba(255,255,255,0.82);
    max-width: 480px;
    margin: 0;
    font-weight: 400;
    letter-spacing: -0.01em;
}
.login-split-meta {
    display: flex;
    gap: 36px;
    margin-top: 32px;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    line-height: 1.4;
}
.login-split-meta div { line-height: 1.4; }
.login-split-meta strong {
    color: white;
    font-weight: 600;
    font-size: 24px;
    display: block;
    margin-bottom: 2px;
    letter-spacing: -0.02em;
}
.login-split-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px;
    background: var(--surface);
}
.login-split-form .login-card {
    box-shadow: none;
    padding: 0;
    max-width: 380px;
}

@media (max-width: 880px) {
    .login-split { grid-template-columns: 1fr; }
    .login-split-brand { display: none; }
}

/* ─────────── Empresa ficha hero (Apple type scale) ─────────── */
.empresa-hero {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    margin-bottom: 48px;
}
.company-icon {
    width: 80px; height: 80px;
    border-radius: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 8px 24px -6px rgba(0,0,0,0.20);
}
.company-icon.grad-1 { background: linear-gradient(135deg, #C41E3A, #FF6B35); }
.company-icon.grad-2 { background: linear-gradient(135deg, #007AFF, #5AC8FA); }
.company-icon.grad-3 { background: linear-gradient(135deg, #30D158, #00C7BE); }
.company-icon.grad-4 { background: linear-gradient(135deg, #AF52DE, #FF2D70); }
.company-icon.grad-5 { background: linear-gradient(135deg, #FF9F0A, #FFD60A); }
.company-icon.grad-6 { background: linear-gradient(135deg, #5856D6, #AF52DE); }
.company-icon.grad-7 { background: linear-gradient(135deg, #1D1D1F, #6E6E73); }
.empresa-hero-info { flex: 1; min-width: 0; }
.empresa-hero h1 {
    font-size: 44px;
    font-weight: 600;
    letter-spacing: -0.035em;
    margin: 0 0 12px;
    line-height: 1.05;
}
.empresa-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* ─────────── Kanban board ─────────── */
.kanban {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin: 0 -8px;
    padding: 0 8px 12px;
    scroll-snap-type: x mandatory;
}
.kanban-col {
    flex: 0 0 280px;
    background: var(--bg-elev);
    border-radius: var(--radius-lg);
    padding: 12px;
    scroll-snap-align: start;
    max-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}
.kanban-col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px 12px;
    margin-bottom: 4px;
    border-bottom: 2px solid var(--border-light);
    flex-shrink: 0;
}
.kanban-col-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}
.kanban-col-count {
    font-size: 11px;
    background: var(--surface);
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 600;
    color: var(--text-muted);
}
.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding: 4px;
    margin: -4px;
    flex: 1;
}
.kanban-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}
.kanban-card:hover {
    border-color: var(--text-muted);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.kanban-card-name {
    font-weight: 600;
    font-size: 13.5px;
    margin: 0 0 4px;
    color: var(--text);
}
.kanban-card-meta {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.kanban-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--divider);
    font-size: 11.5px;
}
.kanban-card-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

/* ─────────── Drag & drop pipeline ─────────── */
.kanban-card[draggable="true"] {
    cursor: grab;
}
.kanban-card[draggable="true"]:active { cursor: grabbing; }
.kanban-card.dragging {
    opacity: 0.4;
    transform: rotate(1.5deg) scale(0.98);
}
.kanban-col.drag-over {
    background: var(--tl-red-light);
    box-shadow: inset 0 0 0 2px var(--tl-red);
}
.kanban-col.drag-over .kanban-empty {
    color: var(--tl-red);
    font-weight: 600;
}
.kanban-card.just-moved {
    animation: justMoved 0.6s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes justMoved {
    0%   { box-shadow: 0 0 0 3px var(--tl-red-light); }
    100% { box-shadow: 0 0 0 0 transparent; }
}
.kanban-empty {
    text-align: center;
    padding: 24px 8px;
    color: var(--text-faint);
    font-size: 12px;
    border: 1.5px dashed var(--border-light);
    border-radius: 8px;
    margin: 4px;
}

.pipeline-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    z-index: 95;
    animation: scaleIn 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}
.pipeline-toast.success { background: #1F7A30; }
.pipeline-toast.error   { background: var(--danger); }

/* ─────────── View toggle ─────────── */
.view-toggle {
    display: inline-flex;
    background: var(--bg-elev);
    border-radius: 9px;
    padding: 3px;
    gap: 2px;
}
.view-toggle a {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.15s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.view-toggle a.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.view-toggle a:hover:not(.active) { color: var(--text); }

/* ─────────── Empty states con ilustración ─────────── */
.empty-illustrated {
    text-align: center;
    padding: 48px 32px;
}
.empty-illustration {
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
    opacity: 0.7;
}
.empty-illustrated h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--text);
}
.empty-illustrated p {
    color: var(--text-muted);
    font-size: 13.5px;
    margin: 0 0 18px;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

/* ─────────── Progress bar (acuerdo room-night fulfillment) ─────────── */
.progress {
    height: 6px;
    background: var(--bg-elev);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}
.progress-bar {
    height: 100%;
    background: var(--tl-red);
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.32, 0.72, 0, 1);
    position: relative;
}
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger  { background: var(--danger); }

/* ─────────── Hover lift utility ─────────── */
.hover-lift {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border) !important;
}

/* ─────────── Stat block (mini-kpi inside cards) ─────────── */
.stat-block {
    text-align: left;
}
.stat-block-label {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}
.stat-block-value {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.015em;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
.stat-block-sub {
    font-size: 11px;
    color: var(--text-faint);
    margin-top: 1px;
}

/* ─────────── Hotel card v2 ─────────── */
.hotel-card {
    background: var(--surface);
    border: none;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.22s;
}
.hotel-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.hotel-card-header {
    background: linear-gradient(135deg, var(--bg-elev) 0%, var(--surface) 100%);
    padding: 18px 20px;
    border-bottom: 1px solid var(--divider);
    position: relative;
    overflow: hidden;
}
.hotel-card-header::before {
    content: '';
    position: absolute;
    top: -20px; right: -20px;
    width: 80px; height: 80px;
    background: var(--tl-red-light);
    border-radius: 50%;
    opacity: 0.3;
}
.hotel-card-name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin: 0;
    position: relative;
}
.hotel-card-loc {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 2px;
    position: relative;
}
.hotel-card-stars {
    position: absolute;
    top: 18px; right: 20px;
    color: #FFB800;
    font-size: 13px;
    letter-spacing: -1px;
}
.hotel-card-body {
    padding: 18px 20px;
}
.hotel-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.hotel-card-foot {
    border-top: 1px solid var(--divider);
    padding: 12px 20px;
    background: var(--bg-elev);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ─────────── Member card (equipo) ─────────── */
.member-card {
    background: var(--surface);
    border: none;
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-card);
    transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.22s;
}
.member-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.member-card-head {
    display: flex;
    gap: 14px;
    margin-bottom: 18px;
}
.member-avatar-grad {
    width: 56px; height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.10);
}

/* ─────────── Toast notifications (replace flash) ─────────── */
.flashes-floating .flash {
    animation: scaleIn 0.3s cubic-bezier(0.32, 0.72, 0, 1) both;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-radius: 12px;
    padding: 12px 18px;
}

/* ─────────── Mejoras a tablas existentes ─────────── */
.table tbody tr {
    transition: background 0.12s;
}
.table tbody tr:hover {
    background: var(--bg-elev);
}
.table-link {
    transition: color 0.12s;
}

/* ─────────── Scroll-bar refinement (Apple-like) ─────────── */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
*::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ─────────── Selection color ─────────── */
::selection {
    background: var(--tl-red-light);
    color: var(--tl-red-dark);
}

/* ─────────── Section title polish ─────────── */
.page-title {
    animation: fadeIn 0.4s cubic-bezier(0.32, 0.72, 0, 1) both;
}

/* ─────────── Asistente IA · botón flotante + panel lateral ─────────── */
.assistant-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tl-red) 0%, var(--tl-red-dark) 100%);
    border: none;
    color: white;
    box-shadow: 0 6px 24px rgba(196,30,58,0.35), 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
    transition: transform 0.2s, box-shadow 0.2s;
}
.assistant-fab:hover  { transform: scale(1.08); box-shadow: 0 8px 28px rgba(196,30,58,0.45), 0 2px 12px rgba(0,0,0,0.12); }
.assistant-fab:active { transform: scale(0.95); }
.assistant-fab.open   { transform: scale(0.92); }
.assistant-fab svg    { width: 24px; height: 24px; }
.assistant-fab .fab-pulse {
    position: absolute; inset: 0;
    border-radius: 50%;
    background: var(--tl-red);
    opacity: 0.4;
    animation: fabPulse 2.4s ease-out infinite;
    z-index: -1;
}
@keyframes fabPulse {
    0%   { transform: scale(1); opacity: 0.4; }
    70%  { transform: scale(1.6); opacity: 0; }
    100% { transform: scale(1.6); opacity: 0; }
}

.assistant-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.18);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 95;
}
.assistant-backdrop.open { opacity: 1; pointer-events: auto; }

.assistant-panel {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: 440px;
    max-width: 92vw;
    background: var(--surface);
    box-shadow: -12px 0 60px rgba(0,0,0,0.12);
    transform: translateX(105%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 100;
    display: flex;
    flex-direction: column;
}
.assistant-panel.open { transform: translateX(0); }

.assistant-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--divider);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.assistant-icon-mark {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--tl-red) 0%, var(--tl-red-dark) 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}
.assistant-title-block { flex: 1; min-width: 0; }
.assistant-title {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.015em;
    line-height: 1.2;
}
.assistant-subtitle {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 1px;
}
.assistant-status-dot {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--success);
    margin-right: 4px;
    vertical-align: middle;
}

.assistant-header-actions { display: flex; gap: 4px; }
.assistant-iconbtn {
    width: 32px; height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.assistant-iconbtn:hover { background: var(--bg-elev); color: var(--text); }

.assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.assistant-msg {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
}
.assistant-msg-user {
    align-self: flex-end;
    background: var(--tl-red);
    color: white;
    border-bottom-right-radius: 4px;
}
.assistant-msg-assistant {
    align-self: flex-start;
    background: var(--bg-elev);
    color: var(--text);
    border-bottom-left-radius: 4px;
}
.assistant-msg-assistant strong { font-weight: 600; }
.assistant-msg-assistant code {
    background: rgba(0,0,0,0.06);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.92em;
}
.assistant-msg-assistant a { color: var(--tl-red); text-decoration: underline; }
.assistant-msg-assistant ul, .assistant-msg-assistant ol {
    padding-left: 18px;
    margin: 6px 0;
}
.assistant-msg-assistant li { margin: 2px 0; }
.assistant-msg-assistant p { margin: 6px 0; }
.assistant-msg-assistant p:first-child { margin-top: 0; }
.assistant-msg-assistant p:last-child  { margin-bottom: 0; }

.assistant-tool-event {
    align-self: flex-start;
    background: var(--info-bg);
    color: #004FBF;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 88%;
}
.assistant-tool-event::before {
    content: '';
    width: 6px; height: 6px;
    background: currentColor;
    border-radius: 50%;
    animation: pulseDot 1.4s ease-in-out infinite;
}
@keyframes pulseDot {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1; }
}

.assistant-typing {
    align-self: flex-start;
    padding: 10px 14px;
    background: var(--bg-elev);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    display: inline-flex;
    gap: 4px;
    align-items: center;
}
.assistant-typing span {
    width: 6px; height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.2s ease-in-out infinite;
}
.assistant-typing span:nth-child(2) { animation-delay: 0.15s; }
.assistant-typing span:nth-child(3) { animation-delay: 0.30s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30%           { transform: translateY(-4px); opacity: 1; }
}

.assistant-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 20px 12px;
    border-top: 1px solid var(--divider);
    padding-top: 12px;
}
.assistant-chip {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    font-size: 12px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.assistant-chip:hover {
    background: var(--tl-red-light);
    border-color: var(--tl-red);
    color: var(--tl-red);
}

.assistant-input-bar {
    padding: 12px 16px 16px;
    border-top: 1px solid var(--divider);
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
}
.assistant-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 9px 14px;
    font-family: inherit;
    font-size: 13.5px;
    resize: none;
    line-height: 1.45;
    max-height: 120px;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.assistant-input:focus { outline: none; border-color: var(--tl-red); box-shadow: 0 0 0 3px rgba(196,30,58,0.10); }
.assistant-send {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--tl-red);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    flex-shrink: 0;
}
.assistant-send:hover:not(:disabled)  { background: var(--tl-red-dark); transform: scale(1.05); }
.assistant-send:active:not(:disabled) { transform: scale(0.95); }
.assistant-send:disabled { background: var(--border); cursor: not-allowed; opacity: 0.6; }

.assistant-shortcut {
    display: inline-block;
    padding: 1px 5px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 10px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    color: var(--text-muted);
}
@media (max-width: 768px) {
    .assistant-fab { bottom: 16px; right: 16px; }
    .assistant-panel { width: 100vw; }
}

/* ─────────── FullCalendar overrides (Apple-minimalist) ─────────── */
.fc {
    font-family: inherit;
    --fc-border-color: var(--border-light);
    --fc-page-bg-color: var(--surface);
    --fc-neutral-bg-color: var(--bg-elev);
    --fc-list-event-hover-bg-color: var(--bg-elev);
    --fc-today-bg-color: rgba(196, 30, 58, 0.04);
    --fc-now-indicator-color: var(--tl-red);
    --fc-event-bg-color: var(--tl-red);
    --fc-event-border-color: var(--tl-red);
}
.fc .fc-toolbar-title {
    font-size: 18px !important;
    font-weight: 600;
    letter-spacing: -0.015em;
    text-transform: capitalize;
}
.fc .fc-button {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    font-weight: 500 !important;
    font-size: 13px !important;
    padding: 7px 12px !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    text-transform: capitalize;
    transition: all 0.15s ease;
}
.fc .fc-button:hover {
    background: var(--bg-elev) !important;
    border-color: var(--text-muted) !important;
}
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background: var(--tl-red) !important;
    color: white !important;
    border-color: var(--tl-red) !important;
}
.fc .fc-button-group > .fc-button { border-radius: 0 !important; }
.fc .fc-button-group > .fc-button:first-child { border-top-left-radius: 8px !important; border-bottom-left-radius: 8px !important; }
.fc .fc-button-group > .fc-button:last-child  { border-top-right-radius: 8px !important; border-bottom-right-radius: 8px !important; }
.fc .fc-toolbar.fc-header-toolbar { margin-bottom: 16px; }

.fc .fc-col-header-cell-cushion {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 8px 6px;
}
.fc .fc-daygrid-day-number,
.fc .fc-list-day-cushion,
.fc-list-day-text {
    color: var(--text);
    font-weight: 500;
    font-size: 13px;
}
.fc .fc-day-today .fc-daygrid-day-number {
    color: var(--tl-red);
    font-weight: 700;
}
.fc-event {
    border-radius: 5px !important;
    padding: 1px 5px !important;
    font-size: 11.5px !important;
    font-weight: 500 !important;
    border-width: 1px !important;
    margin-bottom: 1px !important;
    cursor: pointer;
}
.fc-event:hover { filter: brightness(0.95); }
.fc-h-event .fc-event-main, .fc-v-event .fc-event-main {
    color: white !important;
}
.fc-event-proxima .fc-event-main { color: #B86A00 !important; }
.fc-daygrid-event-dot { display: none !important; }
.fc-event-time { font-weight: 600 !important; }
.fc-list-event-time, .fc-list-event-title { font-size: 13px !important; }
.fc-list-event:hover td { background: var(--bg-elev) !important; }
.fc .fc-scrollgrid {
    border-radius: 10px;
    overflow: hidden;
}
.fc-day-other .fc-daygrid-day-number { color: var(--text-faint); opacity: 0.5; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE · breakpoints completos
   ═══════════════════════════════════════════════════════════ */

/* ─────────── ≤ 1100px (tablet horizontal / laptop pequeño) ─────────── */
@media (max-width: 1100px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 36px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 16px; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .main { padding: 40px 32px 64px; }
    .hero-greeting h1 { font-size: 44px; }
    .hero-greeting-sub { font-size: 17px; }
    .login-split-brand { padding: 56px; }
    .empresa-hero h1 { font-size: 36px; }
    .company-icon { width: 64px; height: 64px; font-size: 26px; }
}

/* ─────────── ≤ 880px (tablet vertical) ─────────── */
@media (max-width: 880px) {
    .login-split { grid-template-columns: 1fr; }
    .login-split-brand { display: none; }
    .login-split-form { padding: 32px 24px; }
}

/* Backdrop fixed en TODOS los viewports (no toma grid space) */
.sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.32);
    z-index: 85;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s;
    display: none;
}
.sidebar-backdrop.open { opacity: 1; pointer-events: auto; }

/* ─────────── ≤ 768px (móvil grande / phablet) ─────────── */
@media (max-width: 768px) {
    /* Sidebar como drawer */
    .app { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        max-width: 84vw;
        transform: translateX(-100%);
        z-index: 90;
        transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
        box-shadow: 0 0 40px rgba(0,0,0,0.20);
    }
    .sidebar.open { transform: translateX(0); }

    /* Backdrop visible solo en mobile */
    .sidebar-backdrop { display: block; }

    /* Topbar móvil */
    .mobile-topbar {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 14px 18px;
        background: var(--surface);
        border-bottom: 1px solid var(--border-light);
        position: sticky;
        top: 0;
        z-index: 50;
    }
    .mobile-topbar-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        font-weight: 700;
        font-size: 15px;
        letter-spacing: -0.015em;
    }
    .hamburger-btn {
        background: transparent;
        border: none;
        padding: 6px;
        margin-left: -6px;
        cursor: pointer;
        color: var(--text);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
    }
    .hamburger-btn:hover { background: var(--bg-elev); }

    /* Main padding tighter */
    .main {
        padding: 24px 18px 80px;
        max-width: 100%;
    }

    /* KPIs en 1 columna */
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 28px;
    }
    .kpi-v2, .kpi { padding: 22px; }
    .kpi-v2-value, .kpi-value { font-size: 32px; letter-spacing: -0.025em; }

    /* Hero greeting compacto */
    .hero-greeting {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        margin-bottom: 28px;
    }
    .hero-greeting h1 { font-size: 30px; letter-spacing: -0.025em; }
    .hero-greeting-sub { font-size: 15px; margin-top: 6px; }
    .hero-greeting-emoji { font-size: 28px; margin-right: 8px; }
    .hero-greeting-actions { width: 100%; flex-wrap: wrap; }

    /* Page head stack */
    .page-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        margin-bottom: 24px;
    }
    .page-title { font-size: 28px; line-height: 1.1; }
    .page-sub { font-size: 14.5px; margin-top: 6px; }
    .page-actions { width: 100%; flex-wrap: wrap; }

    /* Empresa hero compacto */
    .empresa-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 28px;
    }
    .empresa-hero h1 { font-size: 26px; }
    .company-icon { width: 56px; height: 56px; font-size: 22px; border-radius: 16px; }
    .empresa-hero-meta { gap: 6px; }
    .empresa-hero .page-actions { width: 100%; }

    /* Cards más finas */
    .card { padding: 20px; border-radius: var(--radius-lg); }
    .card-head { flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
    .card-title { font-size: 17px; }

    /* Tables horizontal scroll obligado */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-lg); }
    .table { min-width: 640px; font-size: 13.5px; }
    .table th, .table td { padding: 12px 14px; }

    /* Detail grid de empresa: 1 col */
    .detail-grid { grid-template-columns: 1fr !important; }

    /* Hotel cards stack */
    .hotel-card-header { padding: 16px 18px; }
    .hotel-card-body, .hotel-card-foot { padding: 14px 18px; }

    /* Member card */
    .member-card { padding: 22px; }
    .member-card-head { gap: 12px; }
    .member-avatar-grad { width: 48px; height: 48px; font-size: 17px; }

    /* Sidebar abierto: ajustes user-card */
    .sidebar-foot { padding: 14px 12px 18px; }

    /* Filter bar wrap */
    .filter-bar {
        gap: 8px;
    }
    .filter-bar .select { width: 100% !important; }
    .search-input {
        width: 100%;
        max-width: none;
    }

    /* Kanban: cols más finas */
    .kanban { gap: 10px; padding: 0 4px 12px; }
    .kanban-col { flex: 0 0 240px; }

    /* Login form */
    .login-card { padding: 36px 28px; }
    .login-title { font-size: 26px; }
    .login-sub { font-size: 15px; }

    /* Forms */
    .input, .select, .textarea { font-size: 16px; padding: 12px 14px; } /* 16px previene zoom iOS */

    /* Calendar overrides */
    .fc .fc-toolbar.fc-header-toolbar { flex-direction: column; gap: 10px; align-items: stretch; }
    .fc .fc-toolbar-title { font-size: 16px !important; text-align: center; }
    .fc .fc-button { padding: 6px 10px !important; font-size: 12px !important; }

    /* Asistente fab y panel */
    .assistant-fab { bottom: 16px; right: 16px; width: 52px; height: 52px; }
    .assistant-panel { width: 100vw; }

    /* Pipeline toast */
    .pipeline-toast { left: 16px; right: 16px; bottom: 76px; transform: none; text-align: center; }

    /* Funnel */
    .funnel-row { grid-template-columns: 110px 1fr 50px; gap: 8px; }

    /* Stack-md inside cards */
    .timeline { font-size: 13.5px; }

    /* Buttons sm */
    .btn { padding: 10px 18px; font-size: 13.5px; }
    .btn-sm { padding: 7px 14px; font-size: 12.5px; }

    /* Badges legibles */
    .badge { font-size: 11.5px; }
}

/* ─────────── ≤ 480px (móviles pequeños) ─────────── */
@media (max-width: 480px) {
    .main { padding: 20px 14px 80px; }
    .hero-greeting h1 { font-size: 26px; }
    .empresa-hero h1 { font-size: 22px; }
    .page-title { font-size: 24px; }
    .kpi-v2-value, .kpi-value { font-size: 28px; }
    .login-split-form { padding: 24px 16px; }
    .login-card { padding: 28px 20px; }
    .login-card .login-hint { font-size: 11.5px; }
}

/* ─────────── Topbar móvil oculta en desktop ─────────── */
.mobile-topbar { display: none; }

/* ═══════════════════════════════════════════════════════════
   TOAST SYSTEM (notificaciones flotantes)
   ═══════════════════════════════════════════════════════════ */
.toast-stack {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 360px;
}
.toast {
    background: var(--text);
    color: white;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: 0 10px 30px -8px rgba(0,0,0,0.25);
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s cubic-bezier(0.32, 0.72, 0, 1) both;
    max-width: 360px;
}
.toast.leaving { animation: toastOut 0.25s ease forwards; }
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); color: #1d1d1f; }
.toast.info    { background: var(--info); }
.toast-close {
    background: transparent; border: none; color: inherit;
    cursor: pointer; opacity: 0.7;
    padding: 2px; margin-left: auto;
    display: inline-flex; align-items: center;
}
.toast-close:hover { opacity: 1; }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px) scale(0.96); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(20px) scale(0.96); }
}
@media (max-width: 768px) {
    .toast-stack { top: 12px; right: 12px; left: 12px; max-width: none; }
}

/* ═══════════════════════════════════════════════════════════
   KEYBOARD SHORTCUTS OVERLAY ('?' la abre)
   ═══════════════════════════════════════════════════════════ */
.kbd-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.kbd-overlay.open { display: flex; animation: fadeIn 0.18s; }
.kbd-modal {
    background: var(--surface);
    border-radius: var(--radius-2xl);
    padding: 36px 40px;
    max-width: 540px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 24px 60px -12px rgba(0,0,0,0.30);
}
.kbd-modal h2 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.025em;
}
.kbd-modal-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.kbd-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--divider);
    gap: 16px;
}
.kbd-row:last-child { border-bottom: none; }
.kbd-row span { font-size: 14px; color: var(--text); }
.kbd-keys { display: flex; gap: 4px; flex-shrink: 0; }
.kbd-key {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    padding: 3px 8px;
    border-radius: 6px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text);
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.06);
}
.kbd-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 18px 0 4px;
}
.kbd-section-title:first-child { margin-top: 0; }

/* ═══════════════════════════════════════════════════════════
   SKELETON LOADERS
   ═══════════════════════════════════════════════════════════ */
.skel {
    background: linear-gradient(90deg, var(--bg-elev) 0%, var(--divider) 50%, var(--bg-elev) 100%);
    background-size: 200% 100%;
    border-radius: 6px;
    animation: skelShimmer 1.4s linear infinite;
}
@keyframes skelShimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════════════
   STAGE-STUCK INDICATOR
   ═══════════════════════════════════════════════════════════ */
.stuck-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(255, 149, 0, 0.3);
}
.stuck-badge::before { content: '⚠'; }

/* ═══════════════════════════════════════════════════════════
   AI SUGGEST CARD
   ═══════════════════════════════════════════════════════════ */
.ai-suggest-card {
    background: linear-gradient(135deg, rgba(196,30,58,0.04) 0%, rgba(255,149,0,0.04) 100%);
    border: 1px solid rgba(196,30,58,0.15);
    border-radius: var(--radius-xl);
    padding: 20px 24px;
    margin-bottom: 20px;
}
.ai-suggest-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.ai-suggest-mark {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--tl-red), #FF6B35);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ai-suggest-title {
    font-weight: 600;
    font-size: 14.5px;
    letter-spacing: -0.01em;
}
.ai-suggest-body {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text);
}
.ai-suggest-body p:first-child { margin-top: 0; }
.ai-suggest-body p:last-child  { margin-bottom: 0; }
.ai-suggest-body ul { padding-left: 20px; margin: 8px 0; }
.ai-suggest-body li { margin: 3px 0; }

/* ═══════════════════════════════════════════════════════════
   ACTIVITY FEED (audit log condensado)
   ═══════════════════════════════════════════════════════════ */
.activity-row {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--divider);
    align-items: flex-start;
    font-size: 13.5px;
}
.activity-row:last-child { border-bottom: none; }
.activity-icon {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--bg-elev);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
    margin-top: 1px;
}
.activity-text { flex: 1; min-width: 0; }
.activity-meta { color: var(--text-faint); font-size: 11.5px; margin-top: 2px; }
