/* ─── EventMarketplace — Client Design System ───────────────────────────────
   Mobile-first. No DaisyUI dependency. Tailwind utilities used in HTML.
   ─────────────────────────────────────────────────────────────────────────── */

/* ── Design Tokens ───────────────────────────────────────────────────────── */
:root {
    --font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;

    /* Brand */
    --primary:       #2563eb;
    --primary-dark:  #1d4ed8;
    --primary-light: #eff6ff;
    --primary-text:  #ffffff;

    /* Surface */
    --bg:       #f8fafc;
    --surface:  #ffffff;
    --border:   #e2e8f0;

    /* Text */
    --text:       #0f172a;
    --text-soft:  #475569;
    --text-muted: #94a3b8;

    /* Status */
    --green: #16a34a; --green-bg: #f0fdf4;
    --red:   #dc2626; --red-bg:   #fef2f2;
    --amber: #b45309; --amber-bg: #fffbeb;

    /* Layout */
    --radius:   10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --topbar-h:  56px;
    --bottomnav-h: 58px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 20px rgba(0,0,0,.09);

    /* DaisyUI variable aliases (oklch-compatible fallbacks) */
    --p:  221 83% 53%;   /* primary HSL */
    --pf: 221 83% 43%;
    --pc: 0 0% 100%;
    --b1: 0 0% 100%;     /* base-100 */
    --b2: 210 40% 98%;   /* base-200 */
    --b3: 214 32% 91%;   /* base-300 */
    --bc: 222 47% 11%;   /* base-content */
    --rounded-btn: 0.625rem;
    --rounded-box: 0.875rem;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; }
html { height: 100%; }
body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    min-height: 100%;
}

/* ── App shell ───────────────────────────────────────────────────────────── */
.em-app {
    display: flex; flex-direction: column;
    min-height: 100vh;
}
.em-main {
    flex: 1;
    padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 8px);
    overflow-y: auto;
}

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.em-topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 16px; gap: 12px;
    position: sticky; top: 0; z-index: 50;
    flex-shrink: 0;
}
.em-topbar__logo {
    display: flex; align-items: center; gap: 8px;
    text-decoration: none; flex: 1;
    /* min-width:0 permite que el logo se encoja por debajo de su contenido;
       sin esto la palabra "EventMarketplace" (sin espacios) fija un ancho
       mínimo que empuja al selector de país + "Ingresar" fuera del viewport
       y genera scroll horizontal en mobiles angostos. */
    min-width: 0;
}
.em-topbar__logo-icon {
    width: 28px; height: 28px; background: var(--primary);
    border-radius: 7px; display: flex; align-items: center;
    justify-content: center; font-size: 13px; color: white; flex-shrink: 0;
}
.em-topbar__logo-text {
    font-weight: 700; font-size: 15px;
    letter-spacing: -.025em; color: var(--text);
    /* Red de seguridad: nunca empujar más allá del ancho disponible. */
    min-width: 0; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
/* En mobiles angostos el nombre del app + selector de país + "Ingresar"
   no caben y generan scroll horizontal. Debajo de 480px mostramos solo el
   icono (branding suficiente); el nombre reaparece con más espacio. */
@media (max-width: 479px) {
    .em-topbar__logo-text { display: none; }
}
.em-topbar__actions { display: flex; align-items: center; gap: 4px; }
.em-topbar__icon-btn {
    width: 36px; height: 36px;
    border-radius: 50%; border: none;
    background: transparent; color: var(--text-soft);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background .12s; font-size: 15px;
}
.em-topbar__icon-btn:hover { background: var(--bg); }

/* Visitor country selector — desktop muestra el nombre del país,
   mobile el ISO2 corto. Evita overflow horizontal en pantallas chicas. */
/* Y no se encoge: es un flex item del topbar, así que sin esto el nav le
   come el ancho y el botón se parte en dos líneas dentro de una barra de
   altura fija. Se notó al sumar "Paquetes" al menú. */
.em-visitor-country { flex-shrink: 0; }
.em-visitor-country__iso  { display: none; }
@media (max-width: 767px) {
    .em-visitor-country__name { display: none; }
    .em-visitor-country__iso  { display: inline; }
}

/* Desktop nav (oculto en mobile) */
.em-topbar__nav { display: none; }
.em-topbar__nav-item {
    padding: 8px 14px;
    font-size: 14px; font-weight: 600;
    color: var(--text-soft); text-decoration: none;
    border-radius: var(--radius);
    transition: background .12s, color .12s;
    /* Un ítem del menú no se parte: en una barra de altura fija, la segunda
       línea se sale por abajo y descuadra todo lo que tiene al lado. */
    white-space: nowrap;
}
.em-topbar__nav-item:hover { background: var(--bg); color: var(--text); }
.em-topbar__nav-item--active { color: var(--primary); }
.em-topbar__nav-item--active:hover { background: var(--primary-light); color: var(--primary); }

/* Avatar circle (mismo estilo que existía inline) */
.em-topbar__avatar {
    width: 34px; height: 34px;
    border-radius: 50%; border: none; cursor: pointer;
    background: var(--primary-light); color: var(--primary);
    font-size: 13px; font-weight: 700; font-family: var(--font-sans);
    display: flex; align-items: center; justify-content: center;
}

/* Dropdown items (extraídos del inline para reutilización) */
.em-dropdown__item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: var(--radius);
    font-size: 13px; color: var(--text); text-decoration: none;
    transition: background .1s;
    background: none; border: none; cursor: pointer; width: 100%;
    font-family: var(--font-sans); text-align: left;
}
.em-dropdown__item:hover { background: var(--bg); }
.em-dropdown__item--danger { color: var(--red); }
.em-dropdown__item--danger:hover { background: var(--red-bg); }

/* ── Bottom navigation ───────────────────────────────────────────────────── */
.em-bottomnav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex; align-items: stretch;
    z-index: 50;
}
.em-bottomnav__item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px;
    text-decoration: none; color: var(--text-muted);
    transition: color .13s; cursor: pointer;
    font-size: 10px; font-weight: 600; letter-spacing: .02em;
    padding: 6px 0; border: none; background: transparent;
    font-family: var(--font-sans);
}
.em-bottomnav__item svg { width: 22px; height: 22px; stroke-width: 1.8; }
.em-bottomnav__item--active { color: var(--primary); }
.em-bottomnav__item--active svg { stroke-width: 2.3; }

/* ── Drawer (side menu) ──────────────────────────────────────────────────── */
.em-drawer {
    position: fixed; inset: 0 auto 0 0;
    width: 280px; background: var(--surface);
    z-index: 60; transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    display: flex; flex-direction: column;
    box-shadow: 4px 0 40px rgba(0,0,0,.12);
}
.em-drawer.is-open { transform: translateX(0); }
.em-drawer-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 55; display: none;
}
.em-drawer-overlay.is-visible { display: block; }

.em-drawer__header {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 18px; border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.em-drawer__logo-icon {
    width: 38px; height: 38px; background: var(--primary);
    border-radius: 10px; display: flex; align-items: center;
    justify-content: center; font-size: 17px; color: white; flex-shrink: 0;
}
.em-drawer__logo-text { font-weight: 700; font-size: 15px; letter-spacing: -.02em; color: var(--text); }
.em-drawer__logo-sub  { font-size: 12px; color: var(--text-soft); }

.em-drawer__nav { flex: 1; padding: 12px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.em-drawer__item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius);
    font-size: 14px; font-weight: 500; color: var(--text);
    text-decoration: none; cursor: pointer; transition: background .12s;
    background: transparent; border: none; font-family: var(--font-sans); width: 100%; text-align: left;
}
.em-drawer__item svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--text-soft); }
.em-drawer__item:hover { background: var(--bg); }
.em-drawer__item--active { background: var(--primary-light); color: var(--primary); }
.em-drawer__item--active svg { color: var(--primary); }
.em-drawer__item--danger { color: var(--red); }
.em-drawer__item--danger svg { color: var(--red); }
.em-drawer__item--danger:hover { background: var(--red-bg); }
.em-drawer__divider { height: 1px; background: var(--border); margin: 8px 10px; }

.em-drawer__footer { padding: 14px 18px; border-top: 1px solid var(--border); flex-shrink: 0; }
.em-drawer__cta {
    display: flex; gap: 8px; flex-direction: column;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.em-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow .15s, transform .15s;
}
.em-card:active { transform: scale(.988); }
.em-card--interactive:hover { box-shadow: var(--shadow-md); }
.em-card__img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.em-card__header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
}
.em-card__body { padding: 14px 16px; }
.em-card__title { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.em-card__sub   { font-size: 13px; color: var(--text-soft); }
.em-card__footer { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.em-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 20px; border-radius: var(--radius);
    font-size: 14px; font-weight: 600; font-family: var(--font-sans);
    cursor: pointer; border: 1px solid transparent;
    text-decoration: none; transition: all .13s;
    white-space: nowrap; line-height: 1.4;
}
.em-btn--primary { background: var(--primary); color: white; border-color: var(--primary); }
.em-btn--primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: white; }
.em-btn--outline { background: white; color: var(--primary); border-color: var(--primary); }
.em-btn--outline:hover { background: var(--primary-light); }
.em-btn--ghost { background: transparent; color: var(--text-soft); border-color: transparent; }
.em-btn--ghost:hover { background: var(--bg); color: var(--text); }
.em-btn--danger { background: white; color: var(--red); border-color: var(--border); }
.em-btn--danger:hover { background: var(--red-bg); }
.em-btn--block { width: 100%; justify-content: center; }
.em-btn--google { background: #fff; color: var(--text); border-color: var(--border); font-weight: 600; }
.em-btn--google:hover { background: var(--bg); border-color: var(--border-hover); }
.em-btn--sm { padding: 7px 14px; font-size: 13px; }
.em-btn--icon { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: var(--radius); }

/* ── Auth ────────────────────────────────────────────────────────────────── */
.em-auth-wrap {
    min-height: 100vh; display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 24px; background: var(--bg);
}
.em-auth-card {
    width: 100%; max-width: 380px;
    background: white; border: 1px solid var(--border);
    border-radius: var(--radius-xl); box-shadow: var(--shadow-md);
    padding: 32px 28px;
}
.em-auth-logo {
    display: flex; align-items: center; gap: 10px;
    justify-content: center; margin-bottom: 26px;
}
.em-auth-logo__icon {
    width: 36px; height: 36px; background: var(--primary);
    border-radius: 9px; display: flex; align-items: center;
    justify-content: center; font-size: 16px; color: white;
}
.em-auth-logo__text { font-weight: 700; font-size: 17px; letter-spacing: -.02em; color: var(--text); }
.em-auth-title    { font-size: 22px; font-weight: 700; letter-spacing: -.03em; text-align: center; margin-bottom: 6px; }
.em-auth-subtitle { font-size: 13px; color: var(--text-soft); text-align: center; margin-bottom: 24px; }
.em-auth-footer   { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-soft); }
.em-auth-footer a { color: var(--primary); font-weight: 600; text-decoration: none; }
.em-auth-footer a:hover { text-decoration: underline; }

/* ── Form ────────────────────────────────────────────────────────────────── */
.em-form-group { margin-bottom: 18px; }
.em-label { font-size: 13px; font-weight: 600; color: var(--text); display: block; margin-bottom: 6px; }
.em-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.em-forgot { font-size: 12px; font-weight: 600; color: var(--primary); text-decoration: none; }
.em-forgot:hover { text-decoration: underline; }
.em-input {
    width: 100%; padding: 10px 13px;
    border: 1.5px solid var(--border); border-radius: var(--radius);
    font-size: 14px; font-family: var(--font-sans);
    color: var(--text); background: white;
    transition: border-color .13s, box-shadow .13s; outline: none;
}
.em-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.em-input::placeholder { color: var(--text-muted); }
.em-input.is-invalid { border-color: var(--red); }
.em-invalid-msg { color: var(--red); font-size: 12px; margin-top: 4px; }
.em-input-group { position: relative; display: flex; }
.em-input-suffix {
    position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); cursor: pointer;
}
.em-check { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.em-check input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.em-check span  { font-size: 13px; color: var(--text); }

/* ── Alert ───────────────────────────────────────────────────────────────── */
.em-alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 16px; border-radius: var(--radius);
    font-size: 13px; margin-bottom: 14px;
}
.em-alert--success { background: var(--green-bg); color: var(--green); }
.em-alert--error   { background: var(--red-bg);   color: var(--red); }
.em-alert--warning { background: var(--amber-bg); color: var(--amber); }

/* ── Badge ───────────────────────────────────────────────────────────────── */
.em-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 99px;
    font-size: 12px; font-weight: 600;
}
.em-badge--primary { background: var(--primary-light); color: var(--primary); }
.em-badge--green   { background: var(--green-bg);  color: var(--green); }
.em-badge--neutral { background: #f1f5f9; color: var(--text-soft); }

/* ── Section header ──────────────────────────────────────────────────────── */
.em-section { margin-bottom: 24px; }
.em-section__header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.em-section__title  { font-size: 17px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.em-section__link   { font-size: 13px; font-weight: 600; color: var(--primary); text-decoration: none; }
.em-section__link:hover { text-decoration: underline; }

/* ── Scrollbar hide ──────────────────────────────────────────────────────── */
.scrollbar-hide          { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ── Skeleton ────────────────────────────────────────────────────────────── */
.em-skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── HTMX ────────────────────────────────────────────────────────────────── */
.htmx-request .htmx-indicator { display: inline-block; }
.htmx-indicator { display: none; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.em-toast {
    position: fixed;
    bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 10px);
    left: 50%; transform: translateX(-50%);
    z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
    pointer-events: none;
}

/* ── Line clamp ──────────────────────────────────────────────────────────── */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ═══════════════════════════════════════════════════════════════════════════
   DAISYUI / TAILWIND SEMANTIC COMPATIBILITY SHIMS
   Page-level views still use DaisyUI class names. These shims make them
   render correctly until a full migration is complete.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Base color semantics */
.bg-base-100 { background: #ffffff; }
.bg-base-200 { background: #f8fafc; }
.bg-base-300 { background: #f1f5f9; }
.bg-primary  { background: var(--primary) !important; }
.bg-secondary{ background: #64748b !important; }
.text-base-content { color: var(--text); }
.text-primary-content { color: white; }
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--text-soft); }
.text-error { color: var(--red); }
.text-success { color: var(--green); }
.text-muted { color: var(--text-muted); }
.border-base-200 { border-color: var(--border); }
.border-base-300 { border-color: #cbd5e1; }

/* Navbar (DaisyUI) */
.navbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 16px; gap: 8px;
    position: sticky; top: 0; z-index: 50;
}
.navbar-start { display: flex; align-items: center; flex: 1; gap: 8px; }
.navbar-end   { display: flex; align-items: center; gap: 6px; }

/* Btn (DaisyUI) */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border-radius: var(--radius);
    font-size: 14px; font-weight: 600; font-family: var(--font-sans);
    cursor: pointer; border: 1.5px solid transparent;
    text-decoration: none; transition: all .13s;
    white-space: nowrap; line-height: 1.4;
}
.btn-primary  { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: white; }
.btn-outline  { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost    { background: transparent; color: var(--text-soft); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-error    { background: var(--red); color: white; border-color: var(--red); }
.btn-sm       { padding: 6px 12px; font-size: 13px; }
.btn-lg       { padding: 12px 24px; font-size: 15px; }
.btn-block    { width: 100%; justify-content: center; }
.btn-square   { width: 40px; height: 40px; padding: 0; justify-content: center; }
.btn-circle   { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 50%; }
.w-full { width: 100%; }

/* Card (DaisyUI) */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-body    { padding: 16px; }
.card-title   { font-size: 16px; font-weight: 700; margin-bottom: 6px; letter-spacing: -.01em; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card:active  { transform: scale(.988); }
.image-full { position: relative; }
.image-full figure { position: absolute; inset: 0; margin: 0; }
.image-full figure img { width: 100%; height: 100%; object-fit: cover; }
.image-full .card-body { position: relative; z-index: 1; margin-top: auto; }

/* Input (DaisyUI) */
.input, .textarea, .select {
    width: 100%; padding: 10px 13px;
    border: 1.5px solid var(--border); border-radius: var(--radius);
    font-size: 14px; font-family: var(--font-sans);
    color: var(--text); background: white;
    transition: border-color .13s, box-shadow .13s; outline: none;
    display: block;
}
.input:focus, .textarea:focus, .select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input-bordered, .textarea-bordered, .select-bordered { border-color: var(--border); }
.input-error { border-color: var(--red) !important; }

/* Badge (DaisyUI) */
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 9px; border-radius: 99px;
    font-size: 12px; font-weight: 600;
}
.badge-primary  { background: var(--primary-light); color: var(--primary); }
.badge-success  { background: var(--green-bg);  color: var(--green); }
.badge-error    { background: var(--red-bg);    color: var(--red); }
.badge-warning  { background: var(--amber-bg);  color: var(--amber); }
.badge-ghost    { background: #f1f5f9; color: var(--text-soft); }
.badge-outline  { background: transparent; border: 1px solid currentColor; }
.badge-sm       { padding: 2px 7px; font-size: 11px; }

/* Alert (DaisyUI) */
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 16px; border-radius: var(--radius);
    font-size: 13px; margin-bottom: 14px;
}
.alert-success { background: var(--green-bg); color: var(--green); }
.alert-error   { background: var(--red-bg);   color: var(--red); }
.alert-warning { background: var(--amber-bg); color: var(--amber); }

/* Menu (DaisyUI) */
.menu { list-style: none; padding: 0; margin: 0; }
.menu li a, .menu li button {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius);
    font-size: 14px; font-weight: 500; color: var(--text);
    text-decoration: none; cursor: pointer; transition: background .12s;
    background: transparent; border: none; width: 100%; text-align: left;
    font-family: var(--font-sans);
}
.menu li a:hover, .menu li button:hover { background: var(--bg); }
.menu li.active > a, .menu li > a.active { background: var(--primary-light); color: var(--primary); }
.menu-sm li a, .menu-sm li button { padding: 6px 10px; font-size: 13px; }
.menu-lg li a, .menu-lg li button { padding: 12px 14px; font-size: 15px; }

/* Dropdown (DaisyUI) */
.dropdown { position: relative; display: inline-block; }
.dropdown-content {
    position: absolute; right: 0; top: calc(100% + 8px);
    background: white; border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
    min-width: 200px; z-index: 100; padding: 6px;
    display: none;
}
.dropdown:focus-within .dropdown-content,
.dropdown:hover .dropdown-content { display: block; }
.dropdown-end .dropdown-content { right: 0; left: auto; }

/* Avatar (DaisyUI) */
.avatar { display: inline-flex; align-items: center; }
.avatar > div {
    width: 36px; height: 36px; border-radius: 50%;
    overflow: hidden; display: flex; align-items: center; justify-content: center;
    background: var(--primary-light); color: var(--primary);
    font-weight: 700; font-size: 13px;
}
.avatar.placeholder > div { }
.avatar-sm > div { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg > div { width: 48px; height: 48px; font-size: 17px; }

/* Loading (DaisyUI) */
.loading {
    width: 20px; height: 20px;
    border: 2px solid rgba(37,99,235,.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .6s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-sm { width: 14px; height: 14px; }

/* Skeleton (DaisyUI) */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
    display: block;
}

/* Divider (DaisyUI) */
.divider {
    display: flex; align-items: center; gap: 8px;
    margin: 16px 0; color: var(--text-muted); font-size: 12px;
}
.divider::before,.divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Stats (DaisyUI) */
.stats { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: white; }
.stat { padding: 20px; border-right: 1px solid var(--border); flex: 1; min-width: 120px; }
.stat:last-child { border-right: none; }
.stat-title { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -.03em; color: var(--text); }
.stat-desc  { font-size: 12px; color: var(--text-soft); margin-top: 4px; }

/* Fieldset */
.fieldset-label {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 5px; font-size: 13px; font-weight: 600; color: var(--text);
}

/* Bottom nav (DaisyUI) */
.btm-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: calc(58px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--border);
    display: flex; align-items: stretch; z-index: 50;
}
.btm-nav > * {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px;
    text-decoration: none; color: var(--text-muted);
    transition: color .13s; font-size: 10px; font-weight: 600; letter-spacing: .02em;
    padding: 6px 0;
}
.btm-nav > *.active,
.btm-nav > *:where(.active)  { color: var(--primary) !important; border-top: 2px solid var(--primary); background: rgba(37,99,235,.04); }
.btm-nav-label { font-size: 10px; line-height: 1.2; }
.btm-nav-sm > * { font-size: 10px; }

main { padding-bottom: calc(58px + env(safe-area-inset-bottom) + 8px); }

/* Form-control */
.form-control {
    width: 100%; padding: 10px 13px;
    border: 1.5px solid var(--border); border-radius: var(--radius);
    font-size: 14px; font-family: var(--font-sans);
    color: var(--text); background: white;
    transition: border-color .13s, box-shadow .13s; outline: none;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-control::placeholder { color: var(--text-muted); }

/* Rounded-box, rounded-btn */
.rounded-box { border-radius: var(--radius-lg); }

/* z-50 for drawer-side */
.z-50 { z-index: 50; }
.z-10 { z-index: 10; }

/* ── Responsive: desktop chrome ──────────────────────────────────────────── */
/* En desktop el menú hamburguesa, el drawer y el bottom-nav desaparecen.
   Aparece nav horizontal en el topbar. El topbar pasa a tener max-width
   centrado en lugar de ocupar 100% del viewport. */
@media (min-width: 1024px) {
    .em-topbar {
        padding: 0 32px;
    }
    .em-topbar__hamburger { display: none; }
    .em-topbar__nav {
        display: flex; align-items: center; gap: 4px;
        margin-left: 24px; flex: 1;
        /* min-width:0 para que el nav ceda ancho antes que el selector de país
           y las acciones, que son lo que no puede desaparecer. */
        min-width: 0;
    }
    .em-topbar__actions { flex-shrink: 0; }
    .em-topbar__logo { flex: 0 0 auto; }
    .em-bottomnav { display: none; }
    .em-main {
        padding-bottom: 0;
    }
    /* Drawer queda inutilizado en desktop pero por seguridad ocultamos también
       el overlay si alguien forzó open desde dev tools */
    .em-drawer, .em-drawer-overlay { display: none; }
}

/* En tablet (768-1023) mantenemos comportamiento mobile-like pero podemos
   ensanchar el topbar y subir el padding del main si hace falta. */
@media (min-width: 768px) and (max-width: 1023px) {
    .em-topbar { padding: 0 24px; }
}

/* ── Form scaffolding compartido (em-create__* + em-input--*) ────────────── */
/* Originalmente en Create.cshtml inline, extraído acá para que CreateServiceRequest,
   ServiceRequestDetail, AssignLeadProvider, BulkImportGuests, EditGuest y
   EditServiceSelection del cliente reusen el mismo layout. */

.em-create-event,
.em-edit-task-page { padding: 24px 20px 80px; max-width: 720px; margin: 0 auto; }

.em-edit-task__header { margin-bottom: 24px; }
.em-edit-task__title {
    font-size: 22px; font-weight: 800; color: var(--text);
    margin: 6px 0 0 0; letter-spacing: -.02em;
}

.em-create__header { margin-bottom: 32px; }
.em-create__back {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 13px; font-weight: 600; color: var(--text-soft);
    text-decoration: none; margin-bottom: 16px;
}
.em-create__back:hover { color: var(--text); }
.em-create__title {
    font-size: clamp(24px, 5vw, 32px); font-weight: 800;
    letter-spacing: -.03em; color: var(--text); line-height: 1.15;
}
.em-create__subtitle {
    font-size: 15px; color: var(--text-soft); line-height: 1.55; margin-top: 8px;
    max-width: 520px;
}

.em-create__error-summary:not(:empty) {
    background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
    padding: 12px 16px; border-radius: var(--radius-lg); font-size: 13px;
    margin-bottom: 24px;
}
.em-create__error-summary ul { margin: 0; padding-left: 18px; }

.em-create__section {
    background: white; border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 24px 20px; margin-bottom: 16px;
}
.em-create__section-head {
    display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}
.em-create__step-num {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--primary-light); color: var(--primary);
    font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.em-create__section-title {
    font-size: 17px; font-weight: 700; color: var(--text);
    letter-spacing: -.02em; flex: 1;
}
.em-create__section-optional {
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    background: var(--bg); padding: 3px 8px; border-radius: 999px;
    text-transform: lowercase;
}

.em-create__field { margin-bottom: 18px; }
.em-create__field:last-child { margin-bottom: 0; }
.em-create__field-row {
    display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 18px;
}
.em-create__field-row .em-create__field { margin-bottom: 0; }

.em-create__label {
    display: block; font-size: 13px; font-weight: 600; color: var(--text);
    margin-bottom: 7px;
}
.em-create__optional {
    font-weight: 500; color: var(--text-muted); font-size: 12px;
}
.em-create__hint {
    font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.4;
}
.em-create__field-error {
    display: block; font-size: 12px; color: #b91c1c; margin-top: 6px;
}
.em-create__field-error:empty { display: none; }

.em-input {
    width: 100%; padding: 11px 14px; font-size: 15px;
    border: 1.5px solid var(--border); border-radius: 10px;
    background: white; color: var(--text);
    transition: border-color .13s, box-shadow .13s;
    font-family: inherit;
}
.em-input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.em-input::placeholder { color: var(--text-muted); }
.em-input--date, .em-input--select { padding-right: 10px; }
.em-input--textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

.em-create__actions {
    display: flex; gap: 10px; justify-content: flex-end; align-items: center;
    margin-top: 24px; flex-wrap: wrap;
}
.em-create__submit {
    display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px;
    font-size: 14px;
}

@media (min-width: 640px) {
    .em-create-event,
    .em-edit-task-page { padding: 36px 24px 80px; }
    .em-create__field-row { grid-template-columns: 1fr 1fr; gap: 14px; }
    .em-create__section { padding: 28px 28px; }
}

/* ── Auth dentro del drawer ──────────────────────────────────────────────────
   Panel compartido por "Solicitar servicio" y "Solicitar propuesta": el
   visitante sin cuenta entra o se registra sin salir del trámite. Vive acá y
   no en el <style> de cada Detail porque lo usan las dos pantallas. */
.em-auth-drawer { padding: 4px 0 8px; }

.em-auth-drawer__intro { margin-bottom: 14px; }

.em-auth-drawer__title {
    font-size: 16px; font-weight: 800; color: var(--text);
    margin: 0 0 4px; line-height: 1.3;
}

.em-auth-drawer__lead {
    font-size: 13px; color: var(--text-soft); margin: 0; line-height: 1.5;
}

.em-auth-drawer__tabs {
    display: flex; gap: 4px; padding: 4px; margin-bottom: 16px;
    background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
}

.em-auth-drawer__tab {
    flex: 1; padding: 9px 12px; border: 0; border-radius: 9px; cursor: pointer;
    background: transparent; color: var(--text-soft);
    font-family: var(--font-sans); font-size: 13px; font-weight: 700;
    transition: background .15s, color .15s;
}

.em-auth-drawer__tab:hover { color: var(--text); }

.em-auth-drawer__tab.is-active {
    background: var(--surface); color: var(--primary);
    box-shadow: 0 1px 3px rgb(15 23 42 / .10);
}

.em-auth-drawer__alert { margin-bottom: 14px; }

/* Nombre y apellido, contraseña y confirmación: en una fila cuando entra. */
.em-auth-drawer__row { display: grid; grid-template-columns: 1fr; gap: 0 12px; }

.em-auth-drawer__check { margin: 2px 0 16px; }

.em-auth-drawer__done { text-align: center; padding: 12px 0 4px; }

.em-auth-drawer__done-icon {
    width: 48px; height: 48px; margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--primary-light); color: var(--primary);
}

.em-auth-drawer__done-title {
    font-size: 16px; font-weight: 800; color: var(--text); margin: 0 0 6px;
}

.em-auth-drawer__done-msg {
    font-size: 13px; color: var(--text-soft); line-height: 1.55; margin: 0 0 18px;
}

.em-auth-drawer__done-actions { display: flex; flex-direction: column; gap: 10px; }

.em-auth-drawer__link {
    font-size: 12px; font-weight: 600; color: var(--text-muted); text-decoration: none;
}

.em-auth-drawer__link:hover { color: var(--primary); text-decoration: underline; }

@media (min-width: 480px) {
    .em-auth-drawer__row { grid-template-columns: 1fr 1fr; }
}

.em-auth-drawer__divider {
    display: flex; align-items: center; gap: 10px; margin: 16px 0;
    color: var(--text-muted); font-size: 12px;
}

.em-auth-drawer__divider::before,
.em-auth-drawer__divider::after {
    content: ""; flex: 1; height: 1px; background: var(--border);
}

.em-auth-drawer__google {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    text-decoration: none;
}
/* ── Modal de confirmación ───────────────────────────────────────────────────
   Estilos del partial _EmConfirmModalClient. El rediseño del back-office pasó
   el partial compartido a las clases de Cleopatra, que sólo existen en el
   bundle del admin: en el área Client el modal quedaba sin reglas y se dibujaba
   como un bloque al final de la página. */
.em-confirm-modal {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .55);
    z-index: 9999;
    display: none;
    align-items: center; justify-content: center;
    padding: 20px;
}

.em-confirm-modal[data-open="true"] { display: flex; }

.em-confirm-modal__body {
    background: var(--surface);
    border-radius: 14px;
    width: 100%; max-width: 480px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 24px 48px rgba(15, 23, 42, .25);
    padding: 22px;
}

.em-confirm-modal__icon {
    width: 56px; height: 56px; margin: 0 auto 14px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}

.em-confirm-modal__icon .ti { font-size: 28px; }

/* Con icono, el modal pasa a ser un aviso centrado. */
.em-confirm-modal--error   .em-confirm-modal__icon { background: var(--red-bg);   color: var(--red); }
.em-confirm-modal--warning .em-confirm-modal__icon { background: var(--amber-bg); color: var(--amber); }
.em-confirm-modal--success .em-confirm-modal__icon { background: var(--green-bg); color: var(--green); }
.em-confirm-modal--info    .em-confirm-modal__icon { background: var(--primary-light); color: var(--primary); }

.em-confirm-modal--error   .em-confirm-modal__title,
.em-confirm-modal--warning .em-confirm-modal__title,
.em-confirm-modal--success .em-confirm-modal__title,
.em-confirm-modal--info    .em-confirm-modal__title,
.em-confirm-modal--error   .em-confirm-modal__message,
.em-confirm-modal--warning .em-confirm-modal__message,
.em-confirm-modal--success .em-confirm-modal__message,
.em-confirm-modal--info    .em-confirm-modal__message { text-align: center; }

.em-confirm-modal--error   .em-confirm-modal__actions,
.em-confirm-modal--warning .em-confirm-modal__actions,
.em-confirm-modal--success .em-confirm-modal__actions,
.em-confirm-modal--info    .em-confirm-modal__actions { justify-content: center; border-top: 0; }

.em-confirm-modal__title {
    font-size: 17px; font-weight: 700; letter-spacing: -.01em;
    color: var(--text); margin: 0 0 8px;
}

.em-confirm-modal__message {
    font-size: 13px; color: var(--text-soft); line-height: 1.5; margin-bottom: 14px;
}

.em-confirm-modal__message p:first-child { margin-top: 0; }
.em-confirm-modal__message p:last-child  { margin-bottom: 0; }

.em-confirm-modal__reason,
.em-confirm-modal__field { margin-bottom: 14px; }

.em-confirm-modal__field-label {
    display: block; font-size: 12px; font-weight: 600;
    color: var(--text); margin-bottom: 6px;
}

.em-confirm-modal__number-subtitle {
    font-size: 12px; color: var(--text-soft); margin: -2px 0 8px;
}

.em-confirm-modal__field-error {
    font-size: 12px; color: var(--red); margin-top: 6px;
}

.em-confirm-modal__number-input {
    width: 100%; font-size: 18px; font-weight: 600;
    text-align: center; font-variant-numeric: tabular-nums;
}

.em-confirm-modal__code-input {
    width: 100%; font-size: 18px; font-weight: 600;
    text-align: center; letter-spacing: 6px;
}

.em-confirm-modal__actions {
    display: flex; gap: 8px; justify-content: flex-end;
    padding-top: 14px; border-top: 1px solid var(--border);
}

/* Confirmar destructivo: dentro del modal va relleno rojo para que se lea como
   acción peligrosa. El .em-btn--danger global sigue siendo outline. */
.em-confirm-modal .em-btn.em-btn--danger,
.em-confirm-modal .em-btn.em-btn--danger:focus {
    background: var(--red); color: #fff; border: 1px solid var(--red);
}

.em-confirm-modal .em-btn.em-btn--danger:hover {
    background: #b91c1c; color: #fff; border: 1px solid #b91c1c;
}

/* ── Campana de notificaciones ───────────────────────────────────────────────
   El componente NotificationsBell lo comparten el back-office y el cliente. El
   rediseño lo dejó sólo con clases de Cleopatra, que viven en el bundle del
   admin: acá la campana quedaba sin tamaño ni posición y el dropdown se abría
   fuera de lugar. Estas son las reglas del vocabulario em-*. */
.em-notif-bell { position: relative; display: inline-block; }

.em-notif-bell__trigger { position: relative; }

.em-notif-bell__badge {
    position: absolute; top: 2px; right: 2px;
    min-width: 16px; padding: 0 4px;
    border-radius: 999px;
    background: var(--red); color: #fff;
    font-size: 10px; font-weight: 700; line-height: 14px; text-align: center;
    box-shadow: 0 0 0 2px var(--surface);
}

.em-notif-bell__menu {
    position: absolute; top: calc(100% + 6px); right: 0;
    width: 340px; max-width: 90vw;
    background: var(--surface);
    border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, .18);
    z-index: 1000; overflow: hidden;
}

.em-notif-bell__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg); border-bottom: 1px solid var(--border);
}

.em-notif-bell__head-title { font-size: 13px; font-weight: 700; color: var(--text); }

.em-notif-bell__read-all {
    padding: 0; border: 0; background: transparent; cursor: pointer;
    font-family: var(--font-sans); font-size: 11px; font-weight: 600; color: var(--primary);
}

.em-notif-bell__read-all:hover { text-decoration: underline; }

.em-notif-bell__empty {
    padding: 28px 14px; text-align: center;
    font-size: 13px; color: var(--text-soft);
}

.em-notif-bell__empty-icon {
    display: block; margin-bottom: 6px; font-size: 24px; opacity: .5;
}

.em-notif-bell__list { max-height: 360px; overflow-y: auto; }

.em-notif-bell__item {
    display: flex; gap: 10px; padding: 10px 14px;
    color: inherit; text-decoration: none;
    border-bottom: 1px solid var(--border);
}

.em-notif-bell__item:last-child { border-bottom: 0; }
.em-notif-bell__item:hover      { background: var(--bg); }
.em-notif-bell__item.is-unread  { background: var(--primary-light); }

.em-notif-bell__item-icon { flex-shrink: 0; margin-top: 2px; font-size: 18px; }
.em-notif-bell__item-icon.is-ok   { color: var(--green); }
.em-notif-bell__item-icon.is-bad  { color: var(--red); }
.em-notif-bell__item-icon.is-info { color: var(--primary); }

.em-notif-bell__item-main { flex: 1; min-width: 0; }

.em-notif-bell__item-title {
    font-size: 13px; color: var(--text); margin-bottom: 2px;
}

.em-notif-bell__item-title.is-read { font-weight: 500; }
.em-notif-bell__item-title.is-new  { font-weight: 700; }

.em-notif-bell__item-body {
    font-size: 12px; color: var(--text-soft); line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.em-notif-bell__item-time { margin-top: 3px; font-size: 11px; color: var(--text-muted); }

.em-notif-bell__all {
    display: block; padding: 11px; text-align: center; text-decoration: none;
    background: var(--bg); border-top: 1px solid var(--border);
    font-size: 12px; font-weight: 600; color: var(--primary);
}

.em-notif-bell__all:hover { background: var(--border); }

/* El JS del componente alterna la lista y el estado vacío con esta clase, que
   en el back-office viene de las utilidades del template. */
.hidden { display: none !important; }

/* ── Drawer de solicitud ───────────────────────────────────────────────────
   El panel lateral desde donde el cliente pide algo: un servicio, una
   propuesta o un paquete. Vivía repetido dentro de cada página que lo abría;
   acá está una sola vez para que una pantalla nueva no tenga que copiarlo.
   Las páginas de servicio y proveedor todavía traen su copia local idéntica,
   que se puede borrar cuando se las toque. */
.em-req-drawer-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    animation: em-req-fade-in .15s ease-out;
}

.em-req-drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 100%; max-width: 480px;
    background: white;
    z-index: 100;
    box-shadow: -8px 0 32px rgba(0,0,0,0.18);
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: em-req-slide-in .22s ease-out;
}

@keyframes em-req-fade-in  { from { opacity: 0; }                to { opacity: 1; } }
@keyframes em-req-slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* Target del swap de htmx: sin esto la cadena flex se corta y el cuerpo no scrollea. */
.em-req-drawer > div { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.em-req-drawer__panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.em-req-drawer__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.em-req-drawer__title {
    font-size: 16px; font-weight: 800; color: var(--text);
    letter-spacing: -.01em; margin: 0;
}

.em-req-drawer__close {
    width: 36px; height: 36px;
    border-radius: 50%; border: 0; background: transparent;
    color: var(--text-soft); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .12s;
}

.em-req-drawer__close:hover { background: var(--bg); }

.em-req-drawer__svc {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px; background: var(--bg);
    border-bottom: 1px solid var(--border); flex-shrink: 0;
}

.em-req-drawer__svc-img {
    width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex-shrink: 0;
    border: 1px solid var(--border);
}

.em-req-drawer__svc-img--placeholder { background: #e2e8f0; }
.em-req-drawer__svc-meta { flex: 1; min-width: 0; }

.em-req-drawer__svc-cat {
    font-size: 11px; font-weight: 700; color: var(--primary);
    text-transform: uppercase; letter-spacing: 0.04em;
}

.em-req-drawer__svc-name {
    font-size: 14px; font-weight: 700; color: var(--text);
    margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.em-req-drawer__body { flex: 1; overflow-y: auto; padding: 20px; }

.em-req-drawer__auth { text-align: center; padding: 16px 0; }
.em-req-drawer__auth-msg { font-size: 14px; color: var(--text); line-height: 1.5; margin: 0 0 16px 0; }
.em-req-drawer__auth-actions { display: flex; flex-direction: column; gap: 10px; }
.em-req-drawer__auth-btn { width: 100%; }
.em-req-drawer__auth-hint { font-size: 12px; color: var(--text-muted); margin: 12px 0 0 0; }

.em-req-drawer__toggle {
    display: flex; gap: 4px; padding: 4px; background: var(--bg);
    border-radius: 10px; margin-bottom: 16px;
}

.em-req-drawer__toggle-btn {
    flex: 1; padding: 8px 12px; border: 0; background: transparent;
    font-size: 13px; font-weight: 600; color: var(--text-soft);
    border-radius: 8px; cursor: pointer; transition: all .15s;
}

.em-req-drawer__toggle-btn--active {
    background: white; color: var(--text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.em-req-drawer__section { margin-bottom: 14px; }

.em-req-drawer__label {
    display: block; font-size: 12px; font-weight: 700; color: var(--text);
    margin-bottom: 6px;
}

.em-req-drawer__input,
.em-req-drawer__select {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; color: var(--text); font-family: inherit;
    background: white;
    box-sizing: border-box;
}

.em-req-drawer__input:focus,
.em-req-drawer__select:focus {
    outline: 2px solid var(--primary-light); outline-offset: 1px;
    border-color: var(--primary);
}

.em-req-drawer__hint { font-size: 11px; color: var(--text-muted); margin: 6px 0 0 0; }

.em-req-drawer__error {
    margin-top: 12px; padding: 10px 12px; border-radius: 8px;
    background: #fee2e2; color: #b91c1c; font-size: 12px; font-weight: 600;
}

.em-req-drawer__footer {
    display: flex; gap: 8px; padding-top: 14px;
    border-top: 1px solid var(--border); margin-top: 8px;
}

.em-req-drawer__footer .em-btn { flex: 1; }

/* ── Selector de ciudad ────────────────────────────────────────────────────
   El componente CityAutocomplete lo comparten las dos áreas, pero venía
   vestido sólo con las utilidades del build del Admin: acá esas clases no
   existen y el panel salía sin fondo, sin borde y fuera de lugar. Estas reglas
   lo visten con el sistema em-*; el Admin no carga este archivo, así que allá
   sigue mandando su propio CSS. */
.em-city-autocomplete { display: flex; flex-direction: column; gap: 16px; }

.em-city__label {
    display: block; font-size: 13px; font-weight: 600; color: var(--text);
    margin-bottom: 7px;
}

.em-city__select {
    width: 100%; padding: 11px 36px 11px 14px;
    border: 1.5px solid var(--border); border-radius: 10px;
    background: white; color: var(--text);
    font-size: 15px; font-family: inherit;
    outline: none; box-sizing: border-box;
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
.em-city__select:focus { border-color: var(--primary); }

/* El panel se ancla al control cerrado, no al formulario. */
.em-city__root { position: relative; }

.em-city__trigger {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid var(--border); border-radius: 10px;
    background: white; color: var(--text);
    font-size: 15px; font-family: inherit; text-align: left;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    cursor: pointer; box-sizing: border-box;
    transition: border-color .13s, box-shadow .13s;
}
.em-city__trigger:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.em-city__display {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--text);
}
/* Sin ciudad elegida el texto es un marcador de posición, no un valor. */
.em-city__display.is-empty { color: var(--text-muted); }

.em-city__panel {
    position: absolute; top: 100%; left: 0; right: 0;
    margin-top: 4px; z-index: 50;
    background: white; border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15,23,42,.12);
    overflow: hidden;
}

.em-city__search-box { padding: 8px; border-bottom: 1px solid var(--border); }
.em-city__search {
    width: 100%; padding: 8px 10px;
    border: 1.5px solid var(--border); border-radius: 8px;
    font-size: 14px; font-family: inherit; color: var(--text);
    background: white; outline: none; box-sizing: border-box;
}
.em-city__search:focus { border-color: var(--primary); }

.em-city__list {
    list-style: none; margin: 0; padding: 4px 0;
    max-height: 240px; overflow-y: auto;
}

.em-city__option {
    padding: 8px 12px; cursor: pointer;
    border-bottom: 1px solid var(--border);
}
.em-city__option:last-child { border-bottom: 0; }
.em-city__option:hover { background: var(--bg); }
.em-city__option-name { font-size: 14px; font-weight: 600; color: var(--text); }
.em-city__option-sub  { font-size: 12px; color: var(--text-muted); }

.em-city__empty { padding: 10px 12px; font-size: 13px; color: var(--text-muted); }

.em-city__help {
    display: block; font-size: 12px; color: var(--text-muted);
    margin-top: 6px; line-height: 1.4;
}

.em-city__caret { flex-shrink: 0; color: var(--text-muted); }
