:root {
    --bg: #f5f6fa;
    --bg-2: #edeff5;
    --surface: #ffffff;
    --surface-2: #f5f6f9;
    --surface-hover: #eef0f5;
    --text: #0b1220;
    --text-2: #384357;
    --muted: #6b7787;
    --muted-2: #93a0b3;
    --border: #e5e8ef;
    --border-strong: #cbd2dc;
    --border-hover: #b7c0cc;
    --primary: #0b1220;
    --primary-hover: #000;
    --primary-fg: #ffffff;
    --accent: #2b5bd7;
    --accent-2: #6d33c9;
    --accent-fg: #ffffff;

    /* pastel palette (soft tints) */
    --soft-blue-bg: #eaf1ff;   --soft-blue-fg: #1e4bb2;
    --soft-green-bg: #e6f7ec;  --soft-green-fg: #0a6b3b;
    --soft-amber-bg: #fff3d9;  --soft-amber-fg: #92580e;
    --soft-purple-bg: #f0e9ff; --soft-purple-fg: #5a2ea6;
    --soft-rose-bg: #ffe7ee;   --soft-rose-fg: #a4174d;
    --soft-teal-bg: #dff5f2;   --soft-teal-fg: #0a6b60;

    --success-bg: #e8f7ef;
    --success-fg: #0a6b3b;
    --error-bg: #fdecec;
    --error-fg: #a52121;
    --info-bg: #eaf1ff;
    --info-fg: #1e4bb2;
    --warn-bg: #fff5e5;
    --warn-fg: #a86a00;
    --danger: #d43a3a;
    --danger-hover: #b02a2a;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-xs: 0 1px 2px rgba(11,18,32,.04);
    --shadow-sm: 0 1px 3px rgba(11,18,32,.06), 0 1px 2px rgba(11,18,32,.03);
    --shadow-md: 0 6px 20px -6px rgba(11,18,32,.08), 0 3px 6px rgba(11,18,32,.04);
    --shadow-lg: 0 24px 48px -14px rgba(11,18,32,.14);
    --ring: 0 0 0 3px rgba(43,91,215,.14);
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    font-feature-settings: "cv11", "ss03";
    overflow-x: hidden;   /* protege de overflow horizontal accidental */
    max-width: 100vw;
}
img, svg { max-width: 100%; }

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary); }

h1, h2, h3, h4 { margin: 0 0 12px; letter-spacing: -.015em; font-weight: 600; color: var(--text); }
h1 { font-size: 28px; letter-spacing: -.025em; font-weight: 700; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 12px; color: var(--text-2); }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; font-size: 13px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--text-2); }

.ic { display: inline-block; vertical-align: -3px; flex-shrink: 0; }

.container    { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.container-md { max-width: 900px;  margin: 0 auto; padding: 0 28px; }
.container-sm { max-width: 640px;  margin: 0 auto; padding: 0 28px; }

/* ============ TOP NAV (2 filas en desktop) ============ */
.topnav {
    background: rgba(255,255,255,.9);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: saturate(180%) blur(8px);
}
.topnav-inner {
    max-width: 100%;
    margin: 0;
    padding: 14px 32px 0;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    row-gap: 4px;
}
.brand {
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
    letter-spacing: -.015em;
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    padding-bottom: 12px;
}
.brand-dot { width: 12px; height: 12px; background: var(--primary); border-radius: 50%; display: inline-block; }
.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--surface-2);
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(11,18,32,.08);
}
.brand-logo-app {
    height: 42px;
    width: auto;
    max-width: 180px;
    display: inline-block;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 6px;
}
.brand-sep {
    width: 1px;
    height: 32px;
    background: var(--border-strong);
    display: inline-block;
    flex-shrink: 0;
    margin: 0 4px;
}
.brand small { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin-left: 4px; align-self: flex-end; padding-bottom: 4px; }
.brand { order: 0; }

/* Nav right pegado a la derecha en la primera fila */
.nav-right {
    order: 1;
    margin-left: auto;
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Nav links salta SIEMPRE a la segunda fila, centrado */
.nav-links {
    order: 2;
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    display: flex;
    gap: 2px;
    justify-content: center;
    padding: 8px 0 6px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { flex-shrink: 0; white-space: nowrap; }

.nav-links { display: flex; gap: 2px; flex: 1; }
.nav-links a {
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-2);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: background .15s, color .15s;
}
.nav-links a .ic { color: var(--muted); transition: color .15s; }
.nav-links a:hover { background: var(--surface-2); color: var(--text); }
.nav-links a:hover .ic { color: var(--text-2); }
.nav-links a.active { background: var(--text); color: #fff; }
.nav-links a.active .ic { color: #fff; }
.nav-links a.disabled { color: var(--muted-2); pointer-events: none; }

.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-user { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.avatar {
    width: 32px; height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* ============ AUTH ============ */
.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(ellipse 60% 40% at 20% 0%, rgba(43,91,215,.09), transparent 70%),
        radial-gradient(ellipse 50% 40% at 90% 100%, rgba(255,150,90,.06), transparent 70%),
        var(--bg);
}
.card {
    background: var(--surface);
    padding: 36px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid var(--border);
}
.card h1 { margin: 0; font-size: 20px; text-align: center; }
.card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.card label > span { color: var(--text-2); font-weight: 500; }
.card .muted { color: var(--muted); font-size: 13px; text-align: center; }

/* ============ FORMS ============ */
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=number], input[type=date], input[type=time], input[type=datetime-local],
select, textarea {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: #fff;
    font-family: inherit;
    color: var(--text);
    width: 100%;
    transition: border-color .15s, box-shadow .15s, background .15s;
    height: 42px;
    line-height: 1;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-hover); }
textarea { min-height: 96px; resize: vertical; padding: 10px 12px; height: auto; line-height: 1.5; }
input[type=color] { padding: 3px; height: 42px; cursor: pointer; background: #fff; border-radius: var(--radius-sm); border: 1px solid var(--border); width: 100%; max-width: 100px; }
input[type=file] { padding: 8px; height: auto; background: var(--surface-2); border: 1px dashed var(--border-strong); }
select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%236b7787' d='M6 8L0 0h12z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--muted-2); }

/* Validación visual: campos con pattern muestran check verde o borde rojo */
input[type=email]:not(:placeholder-shown):valid,
input[type=tel]:not(:placeholder-shown):valid {
    border-color: rgba(10,107,59,.45);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16' fill='none' stroke='%230a6b3b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 38px;
}
input[type=email]:not(:placeholder-shown):invalid,
input[type=tel]:not(:placeholder-shown):invalid {
    border-color: rgba(212,58,58,.5);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16' fill='none' stroke='%23d43a3a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><line x1='18' y1='6' x2='6' y2='18'/><line x1='6' y1='6' x2='18' y2='18'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 38px;
}
input[type=email]:not(:placeholder-shown):invalid:focus,
input[type=tel]:not(:placeholder-shown):invalid:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(212,58,58,.14);
}

label.check {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .15s;
    min-height: 44px;
}
label.check:hover { border-color: var(--border-hover); background: var(--surface-hover); }
label.check input[type=checkbox], label.check input[type=radio] {
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    accent-color: var(--accent);
    flex-shrink: 0;
    cursor: pointer;
}
label.check > span { color: var(--text); font-weight: 500; font-size: 14px; flex: 1; line-height: 1.35; }
label.check.checked { border-color: var(--accent); background: rgba(43,91,215,.04); }

.field-hint { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.45; }

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    transition: background .15s, color .15s, border-color .15s, transform .05s;
    font-family: inherit;
    height: 40px;
    white-space: nowrap;
    box-shadow: var(--shadow-xs);
    border-color: var(--border);
}
.btn:hover { text-decoration: none; background: var(--surface-hover); border-color: var(--border-hover); }
.btn:active { transform: translateY(1px); }
.btn .ic { color: currentColor; }
.btn-primary {
    background: linear-gradient(180deg, #1f2937 0%, var(--primary) 100%);
    color: var(--primary-fg);
    border-color: var(--primary);
    box-shadow: 0 1px 2px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.08);
}
.btn-primary:hover { background: linear-gradient(180deg, #111827 0%, #000 100%); border-color: #000; color: #fff; }
.btn-accent  { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { background: #1f47b0; color: #fff; border-color: #1f47b0; }
.btn-ghost   { background: transparent; color: var(--text); border-color: var(--border); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger  { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); color: #fff; border-color: var(--danger-hover); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border-strong); box-shadow: none; }
.btn-outline:hover { background: var(--surface-2); }
.btn-sm  { padding: 6px 10px; font-size: 12.5px; height: 32px; gap: 4px; border-radius: 6px; }
.btn-lg  { padding: 12px 22px; font-size: 15px; height: 48px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon  { padding: 0; height: 36px; width: 36px; }

/* ============ ALERTS / FLASH ============ */
.alert { padding: 12px 14px; border-radius: var(--radius); font-size: 13.5px; border: 1px solid transparent; display: flex; align-items: flex-start; gap: 10px; }
.alert .ic { flex-shrink: 0; margin-top: 1px; }
.alert-error   { background: var(--error-bg);   color: var(--error-fg);   border-color: rgba(165,33,33,.15); }
.alert-ok, .alert-success { background: var(--success-bg); color: var(--success-fg); border-color: rgba(10,107,59,.15); }
.alert-info    { background: var(--info-bg);    color: var(--info-fg);    border-color: rgba(30,75,178,.15); }
.alert-warn    { background: var(--warn-bg);    color: var(--warn-fg);    border-color: rgba(168,106,0,.15); }

.flash {
    position: fixed;
    top: 84px;
    right: 24px;
    z-index: 100;
    padding: 12px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    background: #fff;
    border: 1px solid var(--border);
    font-size: 14px;
    max-width: 420px;
    animation: slideIn .25s ease-out;
}
.flash-error { border-left: 3px solid var(--danger); }
.flash-ok    { border-left: 3px solid var(--success-fg); }
.flash-info  { border-left: 3px solid var(--accent); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ============ APP LAYOUT ============ */
.app-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse 70% 30% at 15% 0%, rgba(109,51,201,.07), transparent 70%),
        radial-gradient(ellipse 60% 25% at 85% 10%, rgba(43,91,215,.06), transparent 70%),
        radial-gradient(ellipse 80% 30% at 50% 100%, rgba(255,180,120,.03), transparent 70%),
        var(--bg);
}
.main { flex: 1; padding: 36px 0 80px; }
.main .container { padding: 0 28px; }

/* ============ HERO PAGE HEADER ============ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.page-header h1 { margin: 0 0 4px; }
.page-header .subtitle { color: var(--muted); font-size: 14px; }
.page-header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--text-2);
    margin: 36px 0 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title .ic { color: var(--accent); }
.section-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    border-radius: 2px;
}
.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--border), transparent 60%);
    margin-left: 4px;
}

/* ============ TILES / STAT CARDS ============ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 8px;
}
.stat {
    background: linear-gradient(180deg, var(--surface) 0%, var(--_soft, rgba(43,91,215,.03)) 100%);
    padding: 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(11,18,32,.04), 0 4px 12px -6px var(--_glow, rgba(43,91,215,.08));
    position: relative;
    overflow: hidden;
    transition: box-shadow .2s, transform .15s, border-color .15s;
}
.stat:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(11,18,32,.06), 0 12px 24px -8px var(--_glow, rgba(43,91,215,.16)); }
.stat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--_fg, var(--soft-blue-fg)), var(--_fg2, var(--_fg, var(--soft-blue-fg))));
    opacity: .8;
}
.stat::after {
    content: '';
    position: absolute;
    top: -20px; right: -20px;
    width: 120px; height: 120px;
    background: radial-gradient(circle at top right, var(--_glow, rgba(43,91,215,.12)), transparent 70%);
    pointer-events: none;
}
.stat-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; position: relative; z-index: 1; }
.stat-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--_bg, var(--soft-blue-bg)), rgba(255,255,255,.6));
    color: var(--_fg, var(--soft-blue-fg));
    flex-shrink: 0;
    box-shadow: inset 0 -2px 4px rgba(0,0,0,.04), 0 2px 6px var(--_glow, rgba(43,91,215,.15));
}
.stat-trend {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--success-bg);
    color: var(--success-fg);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.stat-trend.down { background: var(--error-bg); color: var(--error-fg); }
.stat-trend.flat { background: var(--surface-2); color: var(--muted); }
.stat-value {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.05;
    color: var(--text);
    position: relative;
    z-index: 1;
}
.stat-label {
    color: var(--text-2);
    font-size: 13.5px;
    margin-top: 6px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}
.stat-sub {
    color: var(--muted);
    font-size: 12px;
    margin-top: 6px;
    position: relative;
    z-index: 1;
}
.stat.tone-blue   { --_bg: var(--soft-blue-bg);   --_fg: var(--soft-blue-fg);   --_soft: rgba(43,91,215,.035);  --_glow: rgba(43,91,215,.15); }
.stat.tone-green  { --_bg: var(--soft-green-bg);  --_fg: var(--soft-green-fg);  --_soft: rgba(10,107,59,.03);   --_glow: rgba(10,107,59,.13); }
.stat.tone-amber  { --_bg: var(--soft-amber-bg);  --_fg: var(--soft-amber-fg);  --_soft: rgba(146,88,14,.03);   --_glow: rgba(146,88,14,.15); }
.stat.tone-purple { --_bg: var(--soft-purple-bg); --_fg: var(--soft-purple-fg); --_soft: rgba(90,46,166,.035);  --_glow: rgba(90,46,166,.15); }
.stat.tone-rose   { --_bg: var(--soft-rose-bg);   --_fg: var(--soft-rose-fg);   --_soft: rgba(164,23,77,.03);   --_glow: rgba(164,23,77,.13); }
.stat.tone-teal   { --_bg: var(--soft-teal-bg);   --_fg: var(--soft-teal-fg);   --_soft: rgba(10,107,96,.03);   --_glow: rgba(10,107,96,.13); }

/* legacy tile keeps working */
.tile {
    background: var(--surface);
    padding: 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    display: block;
    color: inherit;
    transition: box-shadow .15s, transform .15s, border-color .15s;
    position: relative;
    overflow: hidden;
}
.tile-link:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); text-decoration: none; border-color: var(--border-hover); }
.tile-label { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tile-value { font-size: 28px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.tile-value-sm { font-size: 15px; font-weight: 600; }
.tile-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ============ ACTION CARDS ============ */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}
.action-card {
    background: linear-gradient(180deg, var(--surface) 0%, var(--_soft, rgba(43,91,215,.02)) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    text-align: left;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    color: inherit;
    transition: all .2s;
    box-shadow: 0 1px 2px rgba(11,18,32,.04);
    cursor: pointer;
    font: inherit;
    width: 100%;
    position: relative;
    overflow: hidden;
}
.action-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--_fg, var(--soft-blue-fg));
    opacity: 0;
    transition: opacity .2s;
}
.action-card:hover {
    border-color: var(--_fg, var(--text));
    box-shadow: 0 6px 20px -6px var(--_glow, rgba(43,91,215,.2));
    transform: translateY(-2px);
    text-decoration: none;
}
.action-card:hover::before { opacity: 1; }
.action-card .icon-box {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--_bg, var(--soft-blue-bg)), rgba(255,255,255,.6));
    color: var(--_fg, var(--soft-blue-fg));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 -2px 4px rgba(0,0,0,.04), 0 3px 8px var(--_glow, rgba(43,91,215,.15));
}
.action-card h3 { margin: 0 0 4px; font-size: 15px; }
.action-card p { margin: 0; font-size: 13px; color: var(--muted); }
.action-card.tone-blue   { --_bg: var(--soft-blue-bg);   --_fg: var(--soft-blue-fg);   --_soft: rgba(43,91,215,.03);  --_glow: rgba(43,91,215,.18); }
.action-card.tone-green  { --_bg: var(--soft-green-bg);  --_fg: var(--soft-green-fg);  --_soft: rgba(10,107,59,.03);  --_glow: rgba(10,107,59,.15); }
.action-card.tone-amber  { --_bg: var(--soft-amber-bg);  --_fg: var(--soft-amber-fg);  --_soft: rgba(146,88,14,.03);  --_glow: rgba(146,88,14,.18); }
.action-card.tone-purple { --_bg: var(--soft-purple-bg); --_fg: var(--soft-purple-fg); --_soft: rgba(90,46,166,.03);  --_glow: rgba(90,46,166,.18); }
.action-card.tone-rose   { --_bg: var(--soft-rose-bg);   --_fg: var(--soft-rose-fg);   --_soft: rgba(164,23,77,.03);  --_glow: rgba(164,23,77,.15); }
.action-card.tone-teal   { --_bg: var(--soft-teal-bg);   --_fg: var(--soft-teal-fg);   --_soft: rgba(10,107,96,.03);  --_glow: rgba(10,107,96,.15); }
.action-card .arrow { margin-left: auto; color: var(--muted-2); align-self: center; }
.action-card:hover .arrow { color: var(--text); }

/* ============ PANELS / FORM BLOCKS ============ */
.panel {
    background: var(--surface);
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(11,18,32,.04), 0 6px 16px -8px rgba(11,18,32,.06);
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
}
.panel > h2:first-child { margin-top: 0; }
.panel-header {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    margin: -8px -8px 22px;
    padding: 4px 8px 20px;
    border-bottom: 1px solid var(--border);
}
.panel-header h2 { margin: 0; display: flex; align-items: center; gap: 12px; font-size: 16px; }
.panel-header .icon-chip {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--_bg, var(--soft-blue-bg)), rgba(255,255,255,.5));
    color: var(--_fg, var(--soft-blue-fg));
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 -2px 4px rgba(0,0,0,.04);
}

/* ============ FORM LAYOUT ============ */
.form-grid { display: flex; flex-direction: column; gap: 18px; }
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px 18px;
    align-items: start;
}
.form-row.two    { grid-template-columns: 1fr 1fr; }
.form-row.three  { grid-template-columns: 1fr 1fr 1fr; }
.form-row.mix    { grid-template-columns: 100px 160px 1fr; }
.form-row.compact { grid-template-columns: repeat(auto-fit, minmax(160px, max-content)); }
.form-row > label:not(.check) { display: flex; flex-direction: column; gap: 6px; font-size: 13px; min-width: 0; }
.form-row > label:not(.check) > span:first-child { color: var(--text-2); font-size: 13px; font-weight: 500; }
.form-row > .check { align-self: end; }

/* Color picker "chip" styling */
input[type=color] {
    padding: 3px;
    height: 42px;
    width: 100%;
    max-width: 100px;
    cursor: pointer;
    background: #fff;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
input[type=color]:hover { border-color: var(--border-hover); }

/* Better textarea */
textarea { min-height: 76px; }

/* Field grid for recurso checkbox lists */
.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
}
.form-actions {
    display: flex;
    gap: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
    align-items: center;
}
.form-actions.no-border { border: none; padding-top: 0; margin-top: 0; }

/* ============ TABLES ============ */
.table-wrap {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: auto;
    box-shadow: 0 1px 2px rgba(11,18,32,.04), 0 6px 16px -8px rgba(11,18,32,.06);
}
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th {
    font-weight: 700;
    color: var(--muted);
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    border-bottom: 1px solid var(--border);
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover td { background: rgba(109,51,201,.02); }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.actions > * { display: inline-flex; vertical-align: middle; margin-left: 6px; }
.table td.actions > *:first-child { margin-left: 0; }
.inline { display: inline-block; margin: 0; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    line-height: 1.4;
}
.badge-ok      { background: var(--success-bg); color: var(--success-fg); border-color: rgba(10,107,59,.14); }
.badge-off     { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.badge-info    { background: var(--info-bg); color: var(--info-fg); border-color: rgba(30,75,178,.14); }
.badge-warn    { background: var(--warn-bg); color: var(--warn-fg); border-color: rgba(168,106,0,.14); }
.badge-danger  { background: var(--error-bg); color: var(--error-fg); border-color: rgba(165,33,33,.14); }

/* ============ EMPTY STATES ============ */
.empty {
    background: var(--surface);
    padding: 64px 32px;
    text-align: center;
    border-radius: var(--radius);
    color: var(--muted);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(11,18,32,.04), 0 8px 24px -12px rgba(11,18,32,.08);
    position: relative;
    overflow: hidden;
}
.empty::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 50% 0%, rgba(109,51,201,.08), transparent 70%),
        radial-gradient(ellipse 40% 30% at 50% 100%, rgba(43,91,215,.05), transparent 70%);
    pointer-events: none;
}
.empty > * { position: relative; z-index: 1; }
.empty .icon-box {
    width: 72px; height: 72px;
    background:
        linear-gradient(135deg, var(--soft-purple-bg), var(--soft-blue-bg));
    color: var(--soft-purple-fg);
    border-radius: 18px;
    margin: 0 auto 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 -6px 12px rgba(90,46,166,.08), 0 6px 20px -6px rgba(90,46,166,.25);
    position: relative;
}
.empty .icon-box::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.5);
    pointer-events: none;
}
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.empty p { color: var(--muted); font-size: 14.5px; margin: 0 0 22px; max-width: 400px; margin-left: auto; margin-right: auto; line-height: 1.55; }
.empty .empty-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.empty.compact { padding: 40px 24px; box-shadow: none; border: 1px dashed var(--border-strong); }
.empty.compact .icon-box { width: 52px; height: 52px; border-radius: 14px; margin-bottom: 14px; }

/* ============ PUBLIC ============ */
.public-body { display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }
.public-body .topnav { background: rgba(255,255,255,.94); }
.public-body .main { padding: 40px 0 60px; }

/* ============ LANDING EMPRESA — HERO CON COVER ============ */
.landing-hero-cover {
    margin: -40px calc(-50vw + 50%) 30px;
    padding: 100px 24px 80px;
    background-size: cover;
    background-position: center;
    color: #fff;
    text-align: center;
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.landing-hero-cover .landing-hero-content {
    max-width: 720px;
    position: relative;
    z-index: 2;
}
.landing-hero-cover h1 {
    color: #fff;
    font-size: 44px;
    letter-spacing: -.03em;
    margin: 0 0 16px;
    text-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.landing-hero-cover .landing-lead {
    color: rgba(255,255,255,.92);
    font-size: 17px;
    line-height: 1.55;
    max-width: 560px;
    margin: 0 auto;
    text-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.landing-logo-cover {
    width: 90px; height: 90px;
    border-radius: 50%;
    background: #fff;
    margin: 0 auto 24px;
    padding: 4px;
    box-shadow: 0 12px 40px -8px rgba(0,0,0,.4);
    overflow: hidden;
}
.landing-logo-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ============ LANDING EMPRESA — HERO CLÁSICO ============ */
.landing-hero-classic {
    text-align: center;
    padding: 60px 0 30px;
}
.landing-hero-classic h1 { font-size: 34px; letter-spacing: -.025em; margin: 0 0 12px; }
.landing-hero-classic .landing-lead { color: var(--text-2); font-size: 16px; max-width: 560px; margin: 0 auto 8px; line-height: 1.55; }
.landing-logo-wrap {
    width: 84px; height: 84px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 12px 30px -8px rgba(11,18,32,.15);
    margin: 0 auto 20px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    border: 4px solid #fff;
}
.landing-logo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.landing-logo-wrap .letter { font-size: 32px; font-weight: 700; color: #fff; }

/* ============ CONTACT CHIPS ============ */
.landing-contact-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 820px;
    margin: 0 auto 20px;
    padding: 0 16px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    box-shadow: var(--shadow-xs);
    transition: all .15s;
}
.chip:hover { border-color: var(--text); transform: translateY(-1px); text-decoration: none; }
.chip .ic { color: var(--muted); }
.chip-wa { background: #25d366; color: #fff; border-color: #25d366; }
.chip-wa:hover { background: #1eb057; color: #fff; }
.chip-wa .ic { color: #fff; }

/* ============ INFO GRID (horarios + ubicación) ============ */
.landing-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    max-width: 820px;
    margin: 40px auto 20px;
    padding: 0 16px;
}
.landing-info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-xs);
}
.landing-info-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 15px;
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.landing-info-card h3 .ic { color: var(--accent); }
.landing-info-card p { color: var(--text-2); margin: 0 0 12px; }
.landing-hours { width: 100%; border-collapse: collapse; }
.landing-hours td { padding: 8px 0; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.landing-hours tr:last-child td { border-bottom: none; }
.landing-hours td:first-child { color: var(--muted); }
.landing-hours td:last-child { text-align: right; font-weight: 500; }
.landing-hours tr.today td { color: var(--accent); font-weight: 700; }
.landing-hours tr.today td:first-child { position: relative; padding-left: 12px; }
.landing-hours tr.today td:first-child::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--accent);
    transform: translateY(-50%);
}

/* ============ TEMPLATE PICKER (ajustes) ============ */
.tpl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}
.tpl-option { cursor: pointer; }
.tpl-option input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-card {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    background: var(--surface);
    transition: all .15s;
}
.tpl-card:hover { border-color: var(--border-hover); }
.tpl-option input:checked + .tpl-card {
    border-color: var(--accent);
    background: rgba(43,91,215,.03);
    box-shadow: 0 0 0 3px rgba(43,91,215,.1);
}
.tpl-preview {
    width: 100%;
    height: 90px;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}
.tpl-preview-moderno {
    background: linear-gradient(135deg, #6d33c9, #2b5bd7);
}
.tpl-preview-moderno::before {
    content: '';
    position: absolute;
    top: 20px; left: 50%; transform: translateX(-50%);
    width: 26px; height: 26px;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
}
.tpl-preview-moderno::after {
    content: '';
    position: absolute;
    bottom: 20px; left: 50%; transform: translateX(-50%);
    width: 90px; height: 8px;
    border-radius: 4px;
    background: rgba(255,255,255,.4);
}
.tpl-preview-clasico {
    background: #f5f6f9;
    border: 1px solid var(--border);
}
.tpl-preview-clasico::before {
    content: '';
    position: absolute;
    top: 18px; left: 50%; transform: translateX(-50%);
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--accent);
}
.tpl-preview-clasico::after {
    content: '';
    position: absolute;
    top: 48px; left: 50%; transform: translateX(-50%);
    width: 60px; height: 6px;
    border-radius: 3px;
    background: var(--border-strong);
    box-shadow: 0 12px 0 rgba(11,18,32,.6);
}
.tpl-preview-bares {
    background: #f5f6f9;
    border: 1px solid var(--border);
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 6px;
    padding: 8px;
}
.tpl-preview-bares::before {
    content: '';
    background: var(--accent);
    border-radius: 4px;
    opacity: .18;
}
.tpl-preview-bares::after {
    content: '';
    background:
        linear-gradient(var(--border-strong), var(--border-strong)) 0 6px / 100% 6px no-repeat,
        linear-gradient(var(--border-strong), var(--border-strong)) 0 22px / 100% 6px no-repeat,
        linear-gradient(var(--accent), var(--accent))                0 40px / 100% 12px no-repeat;
    border-radius: 4px;
    opacity: .5;
}
.tpl-title { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.tpl-desc { color: var(--muted); font-size: 12px; line-height: 1.4; }

/* ===== Plantilla BARES (página pública de reservar) ===== */
.bares-shell {
    max-width: 1160px;
    margin: 0 auto;
    padding: 24px 20px 48px;
}
.bares-hero {
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    min-height: 220px;
    display: flex;
    align-items: flex-end;
    padding: 22px;
    color: #fff;
    margin-bottom: 22px;
    background: var(--accent);
}
.bares-hero h1 { color: #fff; }
.bares-hero .sub { color: #fff; }
.bares-hero.has-cover::before {
    content:''; position:absolute; inset:0;
    background: linear-gradient(180deg, rgba(11,18,32,.15) 0%, rgba(11,18,32,.75) 100%);
    z-index:0;
}
.bares-hero-inner { position:relative; z-index:1; display:flex; align-items:center; gap:16px; }
.bares-hero .logo {
    width: 66px; height: 66px; border-radius: 50%;
    background: rgba(255,255,255,.9);
    display:flex; align-items:center; justify-content:center;
    overflow:hidden; flex-shrink:0;
    border:3px solid rgba(255,255,255,.9);
}
.bares-hero .logo img { width:100%; height:100%; object-fit:cover; }
.bares-hero h1 { margin:0; font-size: 28px; letter-spacing:-.01em; }
.bares-hero .sub { opacity:.9; font-size:14px; margin-top:2px; }

.bares-grid {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    gap: 22px;
    align-items: start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
@media (max-width: 820px) {
    .bares-grid { grid-template-columns: 1fr; }
}

.bares-cal { }
.bares-cal-head {
    display:flex; align-items:center; justify-content:space-between;
    background: var(--surface-2);
    padding: 10px 12px;
    border-radius: 10px 10px 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
    color: var(--text);
    font-weight: 600;
    font-size: 15px;
}
.bares-cal-head button {
    background: transparent; border: none; padding: 4px 8px;
    color: var(--text); cursor: pointer; border-radius: 6px;
    display:flex; align-items:center; justify-content:center;
}
.bares-cal-head button:hover:not(:disabled) { background: rgba(0,0,0,.05); }
.bares-cal-head button:disabled { opacity: .35; cursor: not-allowed; }
.bares-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    background: var(--surface);
}
.bares-cal-dow {
    text-align:center; padding:8px 0; font-size:12px;
    color: var(--muted); font-weight:600;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.bares-day {
    aspect-ratio: 1;
    display:flex; align-items:center; justify-content:center;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    background: var(--surface);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    user-select:none;
    transition: background .12s;
}
.bares-day:nth-child(7n) { border-right: none; }
.bares-day.other { color: var(--muted); opacity:.45; cursor: default; }
.bares-day.closed, .bares-day.past { color: var(--muted); opacity:.4; cursor: not-allowed; text-decoration: line-through; }
.bares-day.available:hover { background: rgba(0,0,0,.04); }
.bares-day.selected {
    background: var(--accent) !important;
    color:#fff; font-weight:700;
    border-radius: 4px;
}

.bares-form { display:flex; flex-direction:column; gap:14px; }
.bares-form .row { display:grid; grid-template-columns: 1fr 1fr; gap:14px; }
@media (max-width: 620px) { .bares-form .row { grid-template-columns: 1fr; } }
.bares-form label { display:flex; flex-direction:column; gap:6px; font-size:13px; font-weight:600; color: var(--text-2); }
.bares-form select, .bares-form input[type="text"], .bares-form input[type="email"], .bares-form input[type="tel"], .bares-form textarea {
    width:100%; padding: 12px 14px; font-size: 15px;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.bares-form select:focus, .bares-form input:focus, .bares-form textarea:focus {
    outline:none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(43,91,215,.15);
}
.bares-form select:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.bares-cta {
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    color: #fff;
    cursor: pointer;
    letter-spacing: .01em;
    transition: opacity .12s, transform .06s;
}
.bares-cta:hover:not(:disabled) { opacity:.92; }
.bares-cta:active:not(:disabled) { transform: translateY(1px); }
.bares-cta:disabled { opacity: .5; cursor: not-allowed; }

.bares-selected-date {
    font-size: 13px; color: var(--muted);
    padding: 8px 12px; border-radius: 8px;
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
}
.bares-selected-date b { color: var(--text); }

.bares-error {
    background: #fef3c7; color: #78350f;
    border: 1px solid #fde68a;
    border-radius: 10px; padding: 10px 14px;
    font-size: 14px;
    display:none;
}
.bares-error.on { display:block; }

/* ===== Panel de datos (tras pulsar Reservar) ===== */
.bares-datos-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.bares-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.bares-back {
    background: transparent;
    border: none;
    padding: 6px 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
}
.bares-back:hover { background: rgba(0,0,0,.04); }
.bares-summary {
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    flex: 1;
}
.bares-sum-sep { color: var(--border-strong); margin: 0 6px; font-weight: 400; }

.bares-datos-form { display: flex; flex-direction: column; gap: 16px; }
.bd-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
}
@media (max-width: 620px) { .bd-cols { grid-template-columns: 1fr; } }
.bd-cols label, .bd-full { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.bd-cols input, .bd-full input, .bd-full textarea, .bd-full select {
    width:100%; padding: 12px 14px; font-size: 15px;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface); color: var(--text);
    transition: border-color .15s, box-shadow .15s;
    font-weight: 400;
}
.bd-cols input:focus, .bd-full input:focus, .bd-full textarea:focus, .bd-full select:focus {
    outline:none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(43,91,215,.15);
}

.bd-campos { display: flex; flex-direction: column; gap: 10px; }
.bd-legal {
    display: flex; flex-direction: column; gap: 8px;
    padding: 12px 0;
}
.bd-check {
    display: flex; flex-direction: row; align-items: flex-start; gap: 10px;
    font-size: 14px; font-weight: 500; color: var(--text);
    cursor: pointer;
}
.bd-check input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }
.bd-check a { text-decoration: underline; }

.bares-cta-final { align-self: stretch; }
.bd-tiny {
    font-size: 12px; color: var(--muted);
    text-align: center; margin: -4px 0 0;
}

/* Pie RGPD */
.bares-gdpr {
    margin-top: 22px; padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
    line-height: 1.55;
}
.bares-gdpr h4 { margin: 0 0 6px; color: var(--text); font-size: 13px; font-weight: 700; }
.bares-gdpr p { margin: 0 0 10px; }
.bares-gdpr dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 12px;
    margin: 0;
}
.bares-gdpr dt { font-weight: 700; color: var(--text-2); }
.bares-gdpr dd { margin: 0; }

/* ===== Página de privacidad ===== */
.priv-shell {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px 60px;
    color: var(--text);
}
.priv-head { margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.priv-head h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.01em; }
.priv-sub { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.priv-body h2 { font-size: 20px; margin: 0 0 14px; }
.priv-body h3 {
    font-size: 15px; text-transform: uppercase; letter-spacing: .08em;
    margin: 24px 0 10px; color: var(--text-2);
    padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.priv-body p { margin: 0 0 12px; line-height: 1.65; color: var(--text-2); font-size: 14.5px; }
.priv-body ul { margin: 0 0 12px; padding-left: 22px; line-height: 1.65; color: var(--text-2); font-size: 14.5px; }
.priv-body ul li { margin-bottom: 6px; }
.priv-body dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 16px;
    margin: 0 0 8px;
    font-size: 14.5px;
    color: var(--text-2);
}
.priv-body dt { font-weight: 700; color: var(--text); }
.priv-body dd { margin: 0; }
.priv-body a { color: var(--accent); }
.priv-back { margin-top: 30px; }
@media (max-width: 560px) {
    .priv-body dl { grid-template-columns: 1fr; gap: 2px; }
    .priv-body dt { margin-top: 8px; }
}

.hero-empresa { text-align: center; padding: 60px 0 30px; }
.hero-empresa .logo-wrap {
    width: 76px; height: 76px; border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    margin: 0 auto 20px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; border: 3px solid #fff;
}
.hero-empresa .logo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.hero-empresa .logo-wrap .letter { font-size: 30px; font-weight: 700; color: #fff; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.hero-empresa h1 { font-size: 34px; letter-spacing: -.025em; margin-bottom: 8px; }
.hero-empresa p { color: var(--muted); font-size: 15px; }

.lang-switch { display: flex; gap: 4px; align-items: center; }
.lang-switch a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: .06em;
    transition: background .15s, color .15s;
}
.lang-switch a:hover { background: var(--surface-2); color: var(--text); }
.lang-switch a.active { background: var(--text); color: #fff; }
.lang-switch .flag {
    display: block;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0,0,0,.08);
    flex-shrink: 0;
    overflow: hidden;
}
@media (max-width: 720px) {
    .lang-switch a span { display: none; }
    .lang-switch a { padding: 4px 5px; }
}

.public-footer { padding: 24px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; background: var(--surface); margin-top: 40px; }
.public-footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.footer-admin-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 500;
    transition: all .15s;
    border: 1px solid transparent;
}
.footer-admin-link:hover {
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--border);
    text-decoration: none;
}
.footer-admin-link .ic { color: var(--muted); }
.footer-admin-link:hover .ic { color: var(--text); }
@media (max-width: 720px) {
    .public-footer-inner { flex-direction: column; text-align: center; gap: 10px; }
}

/* ============ SERVICE CARDS ============ */
.service-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.service-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    text-align: left;
    font: inherit;
    color: inherit;
    width: 100%;
    box-shadow: var(--shadow-xs);
}
.service-card:hover { border-color: var(--text); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.service-card.selected { border-color: var(--accent); box-shadow: var(--ring); }
.service-card .swatch { width: 4px; align-self: stretch; border-radius: 4px; min-height: 44px; }
.service-card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.service-card .meta { color: var(--muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.service-card .price { color: var(--text); font-weight: 600; }

/* ============ RESERVAR — CABECERA ============ */
.reservar-header {
    margin: -40px calc(-50vw + 50%) 30px;
    padding: 40px 24px 30px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
    text-align: center;
}
.reservar-header.has-cover {
    padding: 80px 24px 60px;
    background-size: cover;
    background-position: center;
    color: #fff;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.reservar-header-inner {
    max-width: 640px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}
.reservar-header h1 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -.02em;
    font-weight: 700;
}
.reservar-header.has-cover h1 {
    color: #fff;
    font-size: 34px;
    text-shadow: 0 3px 14px rgba(0,0,0,.35);
}
.reservar-logo {
    width: 76px; height: 76px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 10px 26px -8px rgba(11,18,32,.2);
    margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    border: 3px solid #fff;
}
.reservar-logo img { width: 100%; height: 100%; object-fit: cover; }
.reservar-logo .letter { font-size: 30px; font-weight: 700; color: #fff; }
.reservar-logo.cover {
    box-shadow: 0 12px 32px -6px rgba(0,0,0,.4);
    border: 4px solid #fff;
}
@media (max-width: 720px) {
    .reservar-header { padding: 30px 16px 24px; margin-bottom: 20px; }
    .reservar-header.has-cover { padding: 60px 16px 40px; min-height: 200px; }
    .reservar-header h1 { font-size: 22px; }
    .reservar-header.has-cover h1 { font-size: 26px; }
    .reservar-logo { width: 60px; height: 60px; margin-bottom: 12px; }
}

/* ============ STEPPER ============ */
.stepper { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 20px 0 40px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.step .num {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--surface); color: var(--muted);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12.5px; font-weight: 700;
    border: 1.5px solid var(--border);
}
.step.active .num { background: var(--text); color: #fff; border-color: var(--text); }
.step.done .num { background: var(--success-fg); color: #fff; border-color: var(--success-fg); }
.step.active, .step.done { color: var(--text); }
.step-sep { width: 32px; height: 1.5px; background: var(--border); }

/* ============ STATS / CHARTS GRID ============ */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 8px;
}
@media (max-width: 900px) {
    .stats-grid { grid-template-columns: 1fr; }
}
.chart-box {
    position: relative;
    width: 100%;
    height: 260px;
}

/* ============ LICENSE BANNER (bajo el nav) ============ */
.license-banner {
    position: sticky;
    top: 132px;
    z-index: 40;
    padding: 10px 0;
    color: #fff;
    font-size: 13.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.license-banner.expired  { background: linear-gradient(90deg, #b91c1c, #dc2626); }
.license-banner.expiring { background: linear-gradient(90deg, #a86a00, #d97706); }
.license-banner .ic { color: #fff; vertical-align: -2px; }
.license-banner .btn { height: 30px; padding: 4px 12px; }

/* ============ LICENSE HERO (página admin/licencia) ============ */
.license-hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    display: flex;
    gap: 20px;
    align-items: center;
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
}
.license-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
}
.license-hero.active::before   { background: linear-gradient(90deg, var(--success-fg), var(--soft-teal-fg)); }
.license-hero.expiring::before { background: linear-gradient(90deg, var(--warn-fg), #d97706); }
.license-hero.expired::before  { background: linear-gradient(90deg, var(--danger), #b91c1c); }
.license-hero.unlimited::before { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.license-hero-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.license-hero.active .license-hero-icon   { background: var(--soft-green-bg); color: var(--soft-green-fg); }
.license-hero.expiring .license-hero-icon { background: var(--soft-amber-bg); color: var(--soft-amber-fg); }
.license-hero.expired .license-hero-icon  { background: var(--soft-rose-bg); color: var(--soft-rose-fg); }
.license-hero.unlimited .license-hero-icon { background: var(--soft-purple-bg); color: var(--soft-purple-fg); }
.license-hero-body { flex: 1; min-width: 0; }
.license-hero-body h2 { font-size: 22px; letter-spacing: -.02em; }
.license-plan-badge { display: inline-block; }
@media (max-width: 720px) {
    .license-banner { top: auto; position: relative; }
    .license-hero { flex-direction: column; text-align: center; }
}

/* ============ IMPERSONATION BAR (superadmin actuando como admin) ============ */
.impersonation-bar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: linear-gradient(90deg, #6d33c9, #2b5bd7);
    color: #fff;
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(109,51,201,.3);
    flex-wrap: wrap;
}
.impersonation-bar b { font-weight: 700; }
.impersonation-bar .ic { color: #fff; vertical-align: -2px; }
.impersonation-bar .btn {
    background: rgba(255,255,255,.15);
    color: #fff;
    border-color: rgba(255,255,255,.25);
    height: 30px;
    padding: 4px 12px;
}
.impersonation-bar .btn:hover { background: rgba(255,255,255,.25); color: #fff; }
/* La topnav queda debajo, ajusta su sticky */
.impersonation-bar + .topnav { top: 40px; }

/* ============ THUMBNAILS EN TABLAS ADMIN (circulares) ============ */
.row-thumb {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: var(--surface-2);
    border: 1px solid var(--border);
    flex-shrink: 0;
    aspect-ratio: 1;
    max-width: 44px;
    box-shadow: 0 1px 2px rgba(11,18,32,.08);
}
.row-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    background: var(--surface-2);
}

/* Foto en service-card (público) — también circular */
.service-photo {
    width: 56px !important;
    height: 56px !important;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface-2);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(11,18,32,.1);
    aspect-ratio: 1;
    max-width: 56px;
}

/* Avatar en resource pill (público) */
.pill-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 4px;
    vertical-align: middle;
    background: var(--surface-2);
    border: 1px solid rgba(255,255,255,.2);
}
.resource-pill { display: inline-flex; align-items: center; gap: 6px; }
.resource-pill.selected .pill-avatar { border-color: rgba(255,255,255,.4); }

/* ============ RESOURCE CARDS (step 2 · grid con fotos grandes) ============ */
.resource-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    max-width: 760px;
    margin: 0 auto;
}
.resource-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 24px 18px 22px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
    color: inherit;
    box-shadow: var(--shadow-xs);
    position: relative;
}
.resource-card:hover {
    border-color: var(--text);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.resource-card.selected {
    border-color: var(--accent);
    background: rgba(43,91,215,.04);
    box-shadow: var(--ring);
}
.resource-card-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    color: var(--muted);
    border: 3px solid #fff;
    box-shadow: 0 4px 14px rgba(11,18,32,.1);
}
.resource-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.resource-card-letter {
    font-size: 42px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}
.resource-card.any .resource-card-avatar {
    background: linear-gradient(135deg, var(--soft-purple-bg), var(--soft-blue-bg));
    color: var(--soft-purple-fg);
}
.resource-card-text { width: 100%; min-width: 0; }
.resource-card-text h3 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}
.resource-card-text p { margin: 0; font-size: 12.5px; }
.resource-card-arrow { display: none; }

@media (max-width: 480px) {
    .resource-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
    .resource-card { padding: 18px 12px 16px; gap: 10px; }
    .resource-card-avatar { width: 80px; height: 80px; }
    .resource-card-letter { font-size: 32px; }
    .resource-card-text h3 { font-size: 14px; }
}

/* ============ RESOURCE PILLS ============ */
.resource-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 720px;
    margin: 0 auto;
}
.resource-pill {
    padding: 8px 14px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
    color: var(--text);
    line-height: 1;
    box-shadow: var(--shadow-xs);
}
.resource-pill:hover { border-color: var(--text); transform: translateY(-1px); }
.resource-pill.selected {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
    box-shadow: 0 4px 10px -2px rgba(0,0,0,.15);
}

/* ============ CALENDAR / SLOTS ============ */
.cal-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
@media (max-width: 780px) { .cal-wrap { grid-template-columns: 1fr; } }

.cal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-xs); }
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 8px; }
.cal-title { font-weight: 600; font-size: 15px; text-transform: capitalize; }
.cal-nav { display: flex; gap: 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid .dow { text-align: center; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 6px 0; font-weight: 700; }
.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: 8px;
    font-size: 13.5px;
    color: var(--muted-2);
    cursor: not-allowed;
    font-family: inherit;
    transition: all .1s;
    position: relative;
    font-weight: 500;
}
.cal-day.today { font-weight: 700; }
.cal-day.other-month { color: transparent; pointer-events: none; }

/* Días CERRADOS (o pasados/fuera de ventana) */
.cal-day.closed, .cal-day:disabled:not(.available):not(.full) {
    color: var(--muted-2);
    background: transparent;
}

/* Días COMPLETOS (rojo) */
.cal-day.full {
    background: var(--soft-rose-bg);
    color: var(--soft-rose-fg);
    cursor: not-allowed;
    border-color: rgba(164,23,77,.15);
}

/* Días DISPONIBLES (verde) */
.cal-day.available {
    background: var(--soft-green-bg);
    color: var(--soft-green-fg);
    cursor: pointer;
    border-color: rgba(10,107,59,.2);
    font-weight: 600;
}
.cal-day.available:hover {
    background: var(--soft-green-fg);
    color: #fff;
    border-color: var(--soft-green-fg);
    transform: scale(1.05);
}

/* Día SELECCIONADO (siempre gana) */
.cal-day.selected {
    background: var(--text) !important;
    color: #fff !important;
    border-color: var(--text) !important;
    transform: none;
}

/* Leyenda */
.cal-legend {
    display: flex;
    gap: 14px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
    flex-wrap: wrap;
    justify-content: center;
}
.cal-legend .item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
.cal-legend .dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    border: 1px solid transparent;
    flex-shrink: 0;
}
.cal-legend .dot.available { background: var(--soft-green-bg); border-color: rgba(10,107,59,.35); }
.cal-legend .dot.full      { background: var(--soft-rose-bg);  border-color: rgba(164,23,77,.35); }
.cal-legend .dot.closed    { background: transparent; border-color: var(--muted-2); }

.slots { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; max-height: 480px; overflow-y: auto; box-shadow: var(--shadow-xs); }
.slots h3 { font-size: 13.5px; margin-bottom: 12px; text-transform: capitalize; }
.slots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.slot-btn {
    padding: 10px 8px; border: 1px solid var(--border); background: #fff;
    border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
    font-family: inherit; color: var(--text); transition: all .1s;
}
.slot-btn:hover { border-color: var(--text); }
.slot-btn.selected { background: var(--text); color: #fff; border-color: var(--text); }
.slots-empty { color: var(--muted); font-size: 13.5px; padding: 30px 0; text-align: center; }

/* ============ CONFIRM SUMMARY ============ */
.confirm-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 20px;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-xs);
}
.confirm-summary .row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.confirm-summary .row:first-child { border-top: none; }
.confirm-summary .row .label { color: var(--muted); font-size: 13px; }
.confirm-summary .row .value { font-weight: 600; text-align: right; }

/* ============ AGENDA — QUICK STATS ============ */
.agenda-quickstats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.agenda-quickstats .qs {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-xs);
}
.agenda-quickstats .qs-icon {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--_bg, var(--soft-blue-bg)), rgba(255,255,255,.5));
    color: var(--_fg, var(--soft-blue-fg));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 -2px 4px rgba(0,0,0,.04);
}
.agenda-quickstats .qs-value { font-size: 18px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.agenda-quickstats .qs-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; font-weight: 600; }

/* ============ AGENDA — TOOLBAR ============ */
.agenda-toolbar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-xs);
    flex-wrap: wrap;
}
.agenda-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.agenda-filter-label { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-right: 4px; }
.agenda-filters .resource-pill { padding: 5px 10px; font-size: 12px; box-shadow: none; }
.agenda-legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.agenda-legend span { display: inline-flex; align-items: center; gap: 5px; }
.agenda-legend .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex-shrink: 0; }

/* ============ AGENDA — GRID ============ */
.agenda-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    overflow: auto;
    box-shadow: var(--shadow-xs);
}
.agenda {
    display: grid;
    gap: 1px;
    background: var(--border);
    min-width: 720px;
    position: relative;
}
.agenda-cell {
    background: #fff;
    padding: 6px 8px;
    font-size: 13px;
    min-height: 42px;
    position: relative;
}
.agenda-cell.time {
    background: var(--surface-2);
    color: var(--muted);
    text-align: right;
    font-size: 11px;
    font-weight: 700;
    padding-top: 6px;
    padding-right: 10px;
    letter-spacing: .04em;
}
.agenda-cell.head {
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    font-weight: 600;
    text-align: center;
    font-size: 13px;
    padding: 12px 8px;
    color: var(--text);
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 1px solid var(--border);
}
.agenda-cell.hour-mark { border-top: 1px solid var(--border-strong); }
.agenda-cell.closed-cell {
    background: repeating-linear-gradient(
        45deg,
        rgba(212, 58, 58, 0.08),
        rgba(212, 58, 58, 0.08) 6px,
        rgba(212, 58, 58, 0.04) 6px,
        rgba(212, 58, 58, 0.04) 12px
    );
    cursor: not-allowed;
}

/* ============ AGENDA — ITEMS (coloreadas por tiempo) ============ */
.agenda-item {
    background: var(--muted-2);
    color: #fff;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 11.5px;
    line-height: 1.25;
    box-shadow: 0 2px 6px -1px rgba(0,0,0,.15), inset 0 -1px 0 rgba(0,0,0,.1);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: transform .1s, box-shadow .1s;
    border-left: 4px solid var(--_svc, rgba(0,0,0,.25));
    position: relative;
}
.agenda-item:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 14px -2px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1);
    z-index: 3;
}
.agenda-item-time { font-weight: 700; opacity: .95; font-size: 11.5px; }
.agenda-item-name { font-weight: 600; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-item-svc { opacity: .85; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }

/* Estado temporal: pasadas / en curso / futuras */
.agenda-item.is-past {
    background: #cfd4dc;
    color: #4a5568;
    opacity: .85;
}
.agenda-item.is-past .agenda-item-svc { opacity: .75; }
.agenda-item.is-future {
    background: var(--soft-green-fg);
    color: #fff;
}
.agenda-item.is-ongoing {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow:
        0 0 0 3px rgba(43, 91, 215, .25),
        0 6px 16px -3px rgba(43, 91, 215, .4);
    animation: pulse-now 2.5s ease-in-out infinite;
    z-index: 2;
}
@keyframes pulse-now {
    0%, 100% { box-shadow: 0 0 0 3px rgba(43,91,215,.25), 0 6px 16px -3px rgba(43,91,215,.4); }
    50%      { box-shadow: 0 0 0 5px rgba(43,91,215,.35), 0 8px 20px -3px rgba(43,91,215,.55); }
}
.agenda-item.cancelada {
    background: var(--muted-2) !important;
    opacity: .5;
    text-decoration: line-through;
    animation: none;
}

/* Línea "ahora" — MÁS VISIBLE */
.now-line {
    position: absolute;
    left: 68px;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--danger) 0%, var(--danger) 60%, transparent 100%);
    z-index: 6;
    pointer-events: none;
}
.now-line::before {
    content: '';
    position: absolute;
    left: -7px;
    top: -6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(212, 58, 58, .25), 0 0 12px rgba(212, 58, 58, .5);
    animation: now-pulse 2s ease-in-out infinite;
}
@keyframes now-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(212,58,58,.25), 0 0 12px rgba(212,58,58,.5); }
    50%      { box-shadow: 0 0 0 8px rgba(212,58,58,.15), 0 0 18px rgba(212,58,58,.6); }
}
.now-line .now-label {
    position: absolute;
    left: -62px;
    top: -10px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: .05em;
    box-shadow: 0 2px 6px rgba(212,58,58,.35);
}

/* ============ VIEW TOGGLE ============ */
.view-toggle {
    display: inline-flex;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}
.view-toggle a {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all .15s;
}
.view-toggle a:hover { color: var(--text); }
.view-toggle a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

/* ============ WEEK VIEW ============ */
.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    background: transparent;
}
@media (max-width: 900px) {
    .week-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}
.week-day {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 220px;
}
.week-day.is-today {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(43, 91, 215, .15), var(--shadow-sm);
}
.week-day-head {
    padding: 12px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    display: block;
    color: inherit;
    transition: background .15s;
    position: relative;
}
.week-day-head:hover { background: var(--surface-hover); text-decoration: none; }
.week-day.is-today .week-day-head { background: linear-gradient(180deg, rgba(43,91,215,.08), var(--surface)); }
.wd-dow { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.wd-num { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin-top: 2px; }
.week-day.is-today .wd-num { color: var(--accent); }
.wd-count {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--text);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    min-width: 22px;
    text-align: center;
}
.week-day.is-today .wd-count { background: var(--accent); }
.week-day-body {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
    max-height: 500px;
}
.week-empty { color: var(--muted-2); text-align: center; padding: 20px 0; font-size: 13px; }
.week-item {
    background: var(--muted-2);
    color: #fff;
    border-radius: 6px;
    padding: 7px 9px;
    cursor: pointer;
    border-left: 4px solid var(--_svc, rgba(0,0,0,.25));
    transition: transform .1s, box-shadow .1s;
    font-size: 12px;
    line-height: 1.3;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.week-item:hover { transform: translateY(-1px); box-shadow: 0 4px 10px -2px rgba(0,0,0,.15); }
.week-item.is-past { background: #cfd4dc; color: #4a5568; }
.week-item.is-future { background: var(--soft-green-fg); }
.week-item.is-ongoing {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 0 2px rgba(43,91,215,.25);
}
.week-item.cancelada { background: var(--muted-2) !important; opacity: .5; text-decoration: line-through; }
.week-item-time { font-weight: 700; font-size: 12px; }
.week-item-name { font-weight: 600; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-item-meta { opacity: .85; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }

/* ============ MODAL ============ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalIn .15s ease-out;
}
@keyframes modalIn { from { opacity: 0 } to { opacity: 1 } }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 18, 32, .45);
    backdrop-filter: blur(3px);
    cursor: pointer;
}
.modal-body {
    position: relative;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    border: 1px solid var(--border);
}
.modal-header {
    padding: 20px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.modal-header h2 { font-size: 18px; }
.modal-color {
    width: 12px;
    height: 40px;
    border-radius: 4px;
    background: var(--accent);
    flex-shrink: 0;
}
.modal-content {
    padding: 8px 22px;
}
.modal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    font-size: 14px;
}
.modal-row:last-child { border-bottom: none; }
.modal-row .label {
    color: var(--muted);
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
.modal-row .value { font-weight: 600; text-align: right; word-break: break-word; }
.modal-footer {
    padding: 18px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    background: var(--surface-2);
}

/* ============ FILTERS ============ */
.filters {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    box-shadow: 0 1px 2px rgba(11,18,32,.04);
}
.filters label { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.filters select, .filters input { width: auto; height: 36px; font-size: 13px; }

/* ============ ONBOARDING / SHARE LINK BOX ============ */
.share-box {
    background: linear-gradient(135deg, #0b1220 0%, #1f2937 100%);
    color: #fff;
    padding: 24px 26px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}
.share-box::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 180px; height: 180px;
    background: radial-gradient(circle, rgba(43,91,215,.4), transparent 70%);
    pointer-events: none;
}
.share-box .share-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: rgba(255,255,255,.1);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.share-box h3 { color: #fff; margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.share-box p { color: rgba(255,255,255,.7); margin: 0; font-size: 13px; }
.share-box .share-body { flex: 1; min-width: 240px; z-index: 1; }
.share-box .share-url {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.1);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    margin-top: 10px;
    display: block;
    word-break: break-all;
}
.share-box .btn { background: #fff; color: var(--text); border-color: #fff; z-index: 1; }
.share-box .btn:hover { background: rgba(255,255,255,.9); }

/* ============ MARKETING LANDING ============ */
.marketing-body {
    min-height: 100vh;
    background:
        radial-gradient(ellipse 60% 40% at 15% 0%, rgba(109,51,201,.10), transparent 70%),
        radial-gradient(ellipse 50% 30% at 90% 20%, rgba(43,91,215,.09), transparent 70%),
        var(--bg);
}
.marketing-body .topnav { background: rgba(255,255,255,.85); }
.marketing-body .nav-links a { padding: 8px 14px; }
.marketing-body .nav-links a.active { background: transparent; color: var(--accent); }

/* HERO */
.mkt-hero {
    position: relative;
    padding: 100px 0 80px;
    overflow: hidden;
    text-align: center;
}
.mkt-hero-inner {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 2;
}
.mkt-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(43,91,215,.08);
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .02em;
    margin-bottom: 22px;
    border: 1px solid rgba(43,91,215,.14);
}
.mkt-hero h1 {
    font-size: 62px;
    line-height: 1.05;
    letter-spacing: -.035em;
    font-weight: 800;
    margin: 0 0 22px;
}
.mkt-gradient {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 60%, #d94a94 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}
.mkt-lead {
    font-size: 18px;
    color: var(--text-2);
    max-width: 640px;
    margin: 0 auto 32px;
    line-height: 1.55;
}
.mkt-cta-row {
    display: inline-flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 28px;
}
.mkt-trust {
    display: inline-flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 13px;
    color: var(--muted);
}
.mkt-trust span { display: inline-flex; align-items: center; gap: 6px; }
.mkt-trust .ic { color: var(--success-fg); }
.mkt-hero-blur {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 1;
}
.mkt-blur-1 {
    top: 40px; left: -80px;
    width: 340px; height: 340px;
    background: radial-gradient(circle, rgba(109,51,201,.35), transparent 70%);
}
.mkt-blur-2 {
    bottom: 40px; right: -60px;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(43,91,215,.3), transparent 70%);
}

/* SECTIONS */
.mkt-section {
    padding: 90px 0;
    position: relative;
}
.mkt-section-alt {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.mkt-section-head {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 56px;
    padding: 0 24px;
}
.mkt-section-head h2 {
    font-size: 40px;
    letter-spacing: -.025em;
    font-weight: 700;
    margin: 12px 0 14px;
}
.mkt-section-head p {
    font-size: 17px;
    color: var(--muted);
}

/* FEATURES */
.mkt-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}
.mkt-feature {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    transition: all .2s;
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
}
.mkt-feature:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px -8px var(--_glow, rgba(43,91,215,.2));
    border-color: var(--_fg, var(--text));
}
.mkt-feature::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--_fg, var(--soft-blue-fg));
    opacity: 0;
    transition: opacity .2s;
}
.mkt-feature:hover::before { opacity: 1; }
.mkt-feature .icon-box {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--_bg, var(--soft-blue-bg)), rgba(255,255,255,.5));
    color: var(--_fg, var(--soft-blue-fg));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    box-shadow: 0 4px 12px var(--_glow, rgba(43,91,215,.15));
}
.mkt-feature h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.mkt-feature p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.mkt-feature.tone-blue   { --_bg: var(--soft-blue-bg);   --_fg: var(--soft-blue-fg);   --_glow: rgba(43,91,215,.18); }
.mkt-feature.tone-green  { --_bg: var(--soft-green-bg);  --_fg: var(--soft-green-fg);  --_glow: rgba(10,107,59,.15); }
.mkt-feature.tone-amber  { --_bg: var(--soft-amber-bg);  --_fg: var(--soft-amber-fg);  --_glow: rgba(146,88,14,.18); }
.mkt-feature.tone-purple { --_bg: var(--soft-purple-bg); --_fg: var(--soft-purple-fg); --_glow: rgba(90,46,166,.18); }
.mkt-feature.tone-rose   { --_bg: var(--soft-rose-bg);   --_fg: var(--soft-rose-fg);   --_glow: rgba(164,23,77,.15); }
.mkt-feature.tone-teal   { --_bg: var(--soft-teal-bg);   --_fg: var(--soft-teal-fg);   --_glow: rgba(10,107,96,.15); }

/* HOW IT WORKS */
.mkt-steps {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    flex-wrap: wrap;
}
.mkt-step {
    flex: 1;
    min-width: 240px;
    max-width: 320px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px 26px;
    text-align: center;
    position: relative;
}
.mkt-step-num {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    box-shadow: 0 6px 16px -4px rgba(43,91,215,.35);
}
.mkt-step h3 { font-size: 18px; margin: 0 0 8px; }
.mkt-step p { color: var(--muted); font-size: 14px; margin: 0; line-height: 1.55; }
.mkt-step p code { background: rgba(43,91,215,.06); color: var(--accent); }
.mkt-step-arrow {
    display: flex;
    align-items: center;
    color: var(--muted-2);
}
@media (max-width: 900px) {
    .mkt-step-arrow { transform: rotate(90deg); }
}

/* CASES */
.mkt-cases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}
.mkt-case {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--text);
    text-align: center;
    transition: all .15s;
    box-shadow: var(--shadow-xs);
}
.mkt-case:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

/* ACCESS (dark section) */
.mkt-section-dark {
    background: linear-gradient(135deg, #0b1220 0%, #1a1f36 60%, #2b1a4d 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.mkt-section-dark::before {
    content: '';
    position: absolute;
    top: -80px; left: -100px;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(109,51,201,.4), transparent 70%);
    filter: blur(80px);
}
.mkt-section-dark::after {
    content: '';
    position: absolute;
    bottom: -80px; right: -100px;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(43,91,215,.35), transparent 70%);
    filter: blur(80px);
}
.mkt-section-dark .mkt-eyebrow {
    background: rgba(255,255,255,.08);
    color: #fff;
    border-color: rgba(255,255,255,.15);
}
.mkt-access {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}
@media (max-width: 720px) { .mkt-access { grid-template-columns: 1fr; } }
.mkt-access-card {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.12);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px 28px;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mkt-access-card .icon-box {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(43,91,215,.4), rgba(109,51,201,.4));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    box-shadow: 0 8px 24px -4px rgba(43,91,215,.35);
}
.mkt-access-card h3 { color: #fff; margin: 0; font-size: 20px; }
.mkt-access-card p { color: rgba(255,255,255,.65); font-size: 14px; margin: 0 0 16px; }
.mkt-slug-form { display: flex; flex-direction: column; gap: 10px; }
.mkt-slug-input {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 10px;
    padding: 0 0 0 12px;
    transition: border-color .15s;
    overflow: hidden;
}
.mkt-slug-input:focus-within { border-color: var(--accent); background: rgba(255,255,255,.12); }
.mkt-slug-input span {
    color: rgba(255,255,255,.55);
    font-size: 13.5px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    white-space: nowrap;
}
.mkt-slug-input input {
    background: transparent;
    border: none;
    color: #fff;
    height: 46px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    padding: 0 12px;
    box-shadow: none !important;
}
.mkt-slug-input input:focus { outline: none; box-shadow: none; }
.mkt-slug-input input::placeholder { color: rgba(255,255,255,.35); }

/* CTA FINAL */
.mkt-cta-final { padding: 80px 0; }
.mkt-cta-box {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(240,233,255,.4) 100%);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 20px 60px -20px rgba(43,91,215,.15);
}
.mkt-cta-box h2 {
    font-size: 34px;
    letter-spacing: -.02em;
    margin: 0 0 12px;
}
.mkt-cta-box p {
    color: var(--muted);
    font-size: 16px;
    margin: 0 0 24px;
}

/* FOOTER */
.marketing-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 30px 0;
}
.marketing-footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

@media (max-width: 720px) {
    .mkt-hero { padding: 60px 0 40px; }
    .mkt-hero h1 { font-size: 40px; }
    .mkt-lead { font-size: 16px; }
    .mkt-section { padding: 60px 0; }
    .mkt-section-head h2 { font-size: 28px; }
    .mkt-section-head p { font-size: 15px; }
    .mkt-cta-box { padding: 40px 24px; }
    .mkt-cta-box h2 { font-size: 24px; }
}

/* ============ MOBILE NAV / HAMBURGER ============ */
.nav-hamburger {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    color: var(--text);
    align-items: center;
    justify-content: center;
}
.nav-hamburger:hover { background: var(--surface-2); }
.nav-mobile-extra { display: none; }
body.menu-open { overflow: hidden; }

/* ============ RESPONSIVE — MEDIUM (tablet) ============ */
@media (max-width: 960px) {
    .container    { padding: 0 20px; }
    .container-md { padding: 0 20px; }
    .container-sm { padding: 0 20px; }
    .main { padding: 24px 0 60px; }
    .topnav-inner { padding: 0 20px; }
    .brand small { display: none; }
    h1 { font-size: 24px; }
    .page-header { align-items: flex-start; gap: 12px; }
    .page-header h1 { font-size: 22px; }
    .agenda-quickstats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
    .agenda-quickstats .qs-value { font-size: 16px; }
    .panel { padding: 22px; }
    .form-actions { flex-wrap: wrap; }
}

/* ============ RESPONSIVE — MOBILE (≤720px) ============ */
@media (max-width: 720px) {
    /* Fuerza que todos los bloques principales no desborden */
    .main, .container, .container-md, .container-sm, .panel, .table-wrap,
    .agenda-quickstats, .agenda-toolbar, .stat-grid, .grid, .service-list,
    .form-grid, .form-row, .action-grid, .cal-wrap, .empty, .share-box,
    .page-header, .page-header-actions {
        max-width: 100%;
        min-width: 0;
    }
    .page-header > div, .page-header > * { min-width: 0; max-width: 100%; }
    /* Top nav — vuelve a 1 fila en móvil (nav-links en drawer) */
    .topnav-inner {
        min-height: 60px;
        height: auto;
        padding: 8px 16px;
        gap: 8px;
        flex-wrap: nowrap;
    }
    .brand {
        font-size: 15px;
        gap: 8px;
        padding-bottom: 0;
        min-width: 0;
        flex: 1 1 auto;
    }
    .brand small { display: none; }
    .brand-text { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
    .brand-logo { width: 34px; height: 34px; }
    .brand-logo-app { height: 34px; max-width: 100px; }
    .brand-sep { height: 24px; }
    .nav-hamburger { display: inline-flex; flex: 0 0 auto; }
    .nav-desktop { display: none !important; }
    .nav-right {
        gap: 6px;
        padding-bottom: 0;
        margin-left: 0;
        flex: 0 0 auto;
        order: 1;
    }

    /* Mobile nav drawer */
    .nav-links {
        display: none;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--surface);
        z-index: 45;
        padding: 20px 16px;
        flex-direction: column;
        gap: 4px;
        overflow-y: auto;
        border-top: 1px solid var(--border);
        animation: slideDown .2s ease-out;
    }
    body.menu-open .nav-links { display: flex; }
    @keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
    .nav-links a {
        padding: 14px 16px;
        border-radius: 10px;
        font-size: 15px;
        color: var(--text);
        justify-content: flex-start;
    }
    .nav-links a .ic { color: var(--muted); }
    .nav-links a.active { background: var(--text); color: #fff; }
    .nav-links a.active .ic { color: #fff; }
    .nav-mobile-extra { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
    .nav-mobile-extra .btn { justify-content: center; }

    /* Lang switch */
    .lang-switch a span { display: none; }
    .lang-switch a { padding: 4px 6px; }

    /* Main content */
    .main { padding: 20px 0 60px; }
    .container    { padding: 0 16px; }
    .container-md { padding: 0 16px; }
    .container-sm { padding: 0 16px; }

    /* Page headers */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 20px;
        padding-bottom: 16px;
    }
    .page-header h1 { font-size: 20px; }
    .page-header .subtitle { font-size: 13px; }
    .page-header-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }
    .page-header-actions > * { flex: 0 0 auto; max-width: 100%; }
    .page-header-actions .btn:not(.btn-icon) { flex: 1 1 auto; min-width: 0; }
    .page-header-actions .btn-icon { flex: 0 0 40px; width: 40px; min-width: 40px; }
    .page-header-actions input[type=date] { flex: 1 1 130px; min-width: 130px; width: auto; }
    .page-header-actions .view-toggle {
        display: flex !important;
        flex: 1 1 100%;
        width: 100%;
        justify-content: center;
    }
    .view-toggle a { flex: 1; justify-content: center; }

    /* Typography */
    h1 { font-size: 22px; }
    h2 { font-size: 17px; }

    /* Panels */
    .panel { padding: 18px; border-radius: 10px; }
    .panel-header { margin: -4px -4px 16px; padding: 4px 4px 14px; }
    .panel-header h2 { font-size: 15px; gap: 10px; }
    .panel-header .icon-chip { width: 34px; height: 34px; }
    .form-grid { gap: 14px; }
    .form-row { grid-template-columns: 1fr !important; gap: 12px; }
    .form-actions { flex-direction: column-reverse; align-items: stretch; padding-top: 14px; }
    .form-actions .btn { width: 100%; }

    /* Tables → scroll horizontal con indicador de sombra */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table { min-width: 560px; }
    .table th, .table td { padding: 10px 12px; font-size: 13px; }
    .table .actions { justify-content: flex-end; flex-wrap: nowrap; }
    .table .actions .btn { padding: 6px 8px; font-size: 12px; }

    /* Stats grid */
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat { padding: 16px; }
    .stat-value { font-size: 26px; }
    .stat-icon { width: 36px; height: 36px; }
    .stat-label { font-size: 12px; }

    /* Action cards (dashboard onboarding) */
    .action-card { padding: 18px; }
    .action-card h3 { font-size: 14px; }
    .action-card p { font-size: 12.5px; }

    /* Share box (dashboard) */
    .share-box { flex-direction: column; align-items: stretch; padding: 20px; }
    .share-box .share-icon { align-self: flex-start; }
    .share-box .btn { width: 100%; }

    /* Tiles */
    .tile { padding: 16px; }
    .tile-value { font-size: 22px; }

    /* Empty state */
    .empty { padding: 40px 20px; }
    .empty .icon-box { width: 56px; height: 56px; }
    .empty h3 { font-size: 16px; }
    .empty p { font-size: 13.5px; }
    .empty .empty-actions { flex-direction: column; align-items: stretch; }
    .empty .empty-actions .btn { width: 100%; }

    /* Filters */
    .filters { padding: 12px; gap: 8px; }
    .filters select, .filters input { flex: 1; min-width: 0; }

    /* Alert */
    .alert { padding: 10px 12px; font-size: 13px; }

    /* Buttons */
    .btn-lg { padding: 12px 18px; font-size: 14px; height: 44px; }

    /* Hero empresa */
    .hero-empresa { padding: 30px 0 20px; }
    .hero-empresa h1 { font-size: 24px; }
    .hero-empresa .logo-wrap { width: 60px; height: 60px; margin-bottom: 14px; }
    .hero-empresa .logo-wrap .letter { font-size: 24px; }

    /* Booking flow */
    .stepper { gap: 4px; margin: 12px 0 24px; }
    .step { font-size: 11px; }
    .step .num { width: 22px; height: 22px; font-size: 11px; }
    .step-sep { width: 16px; }
    .service-list { grid-template-columns: 1fr; }
    .service-card { padding: 16px; }
    .service-card h3 { font-size: 14px; }
    .cal-wrap { grid-template-columns: 1fr; gap: 14px; }
    .cal, .slots { padding: 16px; }
    .slots { max-height: 320px; }
    .cal-day { font-size: 12.5px; border-radius: 6px; }
    .slots-grid { grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 5px; }
    .slot-btn { padding: 9px 4px; font-size: 12.5px; }
    .cal-legend { gap: 10px; font-size: 11px; margin-top: 10px; padding-top: 10px; }
    .confirm-summary { padding: 4px 16px; }
    .confirm-summary .row { padding: 10px 0; font-size: 13px; }

    /* Resource pills */
    .resource-pill { padding: 6px 10px; font-size: 12px; }
    .resource-pills { justify-content: flex-start; }

    /* Agenda */
    .agenda-quickstats { grid-template-columns: 1fr 1fr; gap: 8px; }
    .agenda-quickstats .qs { padding: 10px 12px; gap: 8px; min-width: 0; overflow: hidden; }
    .agenda-quickstats .qs > div { min-width: 0; flex: 1; overflow: hidden; }
    .agenda-quickstats .qs-icon { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; }
    .agenda-quickstats .qs-value { font-size: 14px; word-break: break-word; line-height: 1.2; }
    .agenda-quickstats .qs-label { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .agenda-toolbar { flex-direction: column; align-items: stretch; gap: 12px; padding: 12px; }
    .agenda-filters { flex-wrap: wrap; }
    .agenda-legend { flex-wrap: wrap; font-size: 11px; }
    .agenda-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .agenda { min-width: 560px; }
    .agenda-cell { min-height: 38px; padding: 4px 6px; font-size: 12px; }
    .agenda-cell.head { font-size: 12px; padding: 10px 6px; }
    .agenda-item { font-size: 10.5px; padding: 4px 6px; }
    .agenda-item-time { font-size: 10.5px; }
    .agenda-item-svc { font-size: 9.5px; }
    .now-line .now-label { display: none; }

    /* Week view */
    .week-grid { grid-template-columns: 1fr; gap: 8px; }
    .week-day { min-height: auto; }
    .week-day-body { max-height: none; }
    .wd-num { font-size: 18px; }

    /* Modal */
    .modal { padding: 12px; align-items: flex-end; }
    .modal-body { max-height: 92vh; border-radius: 16px 16px 0 0; }
    @keyframes modalIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
    .modal-body { animation: modalIn .2s ease-out; }
    .modal-header { padding: 16px 18px; }
    .modal-header h2 { font-size: 16px; }
    .modal-content { padding: 4px 18px; }
    .modal-row { padding: 10px 0; font-size: 13.5px; flex-direction: column; align-items: flex-start; gap: 4px; }
    .modal-row .value { text-align: left; }
    .modal-footer { padding: 14px 18px; flex-direction: column-reverse; }
    .modal-footer .btn { width: 100%; }

    /* Marketing landing */
    .mkt-hero { padding: 40px 0 30px; }
    .mkt-hero h1 { font-size: 34px; }
    .mkt-lead { font-size: 15px; }
    .mkt-cta-row { flex-direction: column; align-items: stretch; width: 100%; }
    .mkt-cta-row .btn { width: 100%; }
    .mkt-trust { gap: 12px; font-size: 12px; }
    .mkt-section { padding: 50px 0; }
    .mkt-section-head { margin-bottom: 32px; }
    .mkt-section-head h2 { font-size: 24px; }
    .mkt-section-head p { font-size: 14px; }
    .mkt-features { grid-template-columns: 1fr; gap: 12px; }
    .mkt-feature { padding: 20px; }
    .mkt-steps { flex-direction: column; }
    .mkt-step-arrow { transform: rotate(90deg); margin: 0 auto; }
    .mkt-step { max-width: none; }
    .mkt-cases { grid-template-columns: 1fr 1fr; }
    .mkt-case { padding: 14px 12px; font-size: 13.5px; }
    .mkt-access { grid-template-columns: 1fr; }
    .mkt-cta-final { padding: 40px 0; }
    .mkt-cta-box { padding: 32px 20px; }
    .mkt-cta-box h2 { font-size: 22px; }

    /* Auth cards */
    .card { padding: 28px 22px; }
    .card h1 { font-size: 18px; }

    /* Public footer / hero */
    .public-body .main { padding: 24px 0 40px; }

    /* Flash toasts */
    .flash { top: 68px; right: 12px; left: 12px; max-width: none; }

    /* Filters bar generic */
    .filters { flex-direction: column; align-items: stretch; }
    .filters label { display: block; }
    .filters .btn { width: 100%; }
}

/* ============ RESPONSIVE — SMALL MOBILE (≤500px) ============ */
@media (max-width: 500px) {
    .stat-grid { grid-template-columns: 1fr; }
    .agenda-quickstats { grid-template-columns: 1fr; }
    .mkt-cases { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
    .brand-text { max-width: 120px; }
    .brand { font-size: 13px; }
    .mkt-hero h1 { font-size: 28px; }
    h1 { font-size: 20px; }
    .container    { padding: 0 12px; }
    .container-md { padding: 0 12px; }
    .container-sm { padding: 0 12px; }
    .topnav-inner { padding: 0 12px; }
    .panel { padding: 14px; }
    .action-card { padding: 14px; }
}
