/* ===========================================================
   Klio Go Admin - Hoja de estilos principal
   Tema claro y oscuro, responsive B2B/operativo denso.
   =========================================================== */

:root {
    /* Tipografia y espaciado base */
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-size-base: 10px;
    --radius: 8px;

    /* Paleta - tema claro */
    --bg:           #f4f6fb;
    --bg-elev:      #ffffff;
    --bg-soft:      #f8fafc;
    --surface:      #ffffff;
    --border:       #e2e8f0;
    --text:         #0f172a;
    --text-muted:   #64748b;
    --text-invert:  #ffffff;

    --primary:      #f97316;
    --primary-soft: #fff7ed;
    --indigo:       #f97316;
    --cyan:         #06b6d4;
    --emerald:      #10b981;
    --amber:        #f59e0b;
    --rose:         #f43f5e;
    --violet:       #8b5cf6;
    --success:      #16a34a;
    --muted:        #94a3b8;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow:    0 6px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 18px 36px rgba(15, 23, 42, 0.10);

    --sidebar-w: 240px;
    --topbar-h:  60px;

    --gradient-primary: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Tema oscuro */
[data-theme="dark"] {
    --bg:           #0b1220;
    --bg-elev:      #111827;
    --bg-soft:      #0f172a;
    --surface:      #1f2937;
    --border:       #1f2937;
    --text:         #f1f5f9;
    --text-muted:   #94a3b8;
    --text-invert:  #0b1220;

    --primary:      #fb923c;
    --primary-soft: #431407;
    --indigo:       #fb923c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow:    0 6px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 18px 36px rgba(0, 0, 0, 0.6);
}

/* ============== Base ============== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--indigo); }
code { background: var(--bg-soft); padding: 1px 6px; border-radius: 4px; font-size: 9px; color: var(--text); }

.required-field::before {
    content: "*";
    color: var(--rose);
    margin-right: 4px;
    font-weight: 700;
}

/* ============== Login ============== */
.k-login-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    padding: 16px;
}
.k-login-card {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 32px;
    width: 100%;
    max-width: 420px;
}
.k-login-card-narrow { max-width: 360px; }
.k-login-brand { text-align: center; margin-bottom: 24px; }
.k-login-brand i {
    font-size: 36px;
    color: var(--primary);
    background: var(--primary-soft);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.k-login-brand h1 { font-size: 22px; margin: 12px 0 4px; color: var(--text); }
.k-login-brand h1 small { font-size: 14px; color: var(--text-muted); font-weight: 400; }
.k-login-brand p { color: var(--text-muted); font-size: 10px; }
.k-btn-lg { padding: 12px 18px; font-size: 11px; font-weight: 600; }
.k-password { position: relative; }
.k-password .form-control { padding-right: 40px; }
.k-password .k-icon-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.k-login-footer { text-align: center; margin-top: 16px; color: var(--text-muted); }
.k-login-legal { margin-top: 18px; font-size: 10px; color: rgba(255,255,255,0.85); }
.k-login-legal a { color: #fff; }

/* ============== Sidebar ============== */
.k-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-elev);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    z-index: 100;
    transition: transform 0.25s ease, width 0.25s ease;
    overflow: hidden;
}

/* --- Marca --- */
.k-sidebar-brand {
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 9px;
    padding: 0 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    background: var(--gradient-primary);
    color: #fff;
    flex-shrink: 0;
}
.k-sidebar-brand > i { font-size: 19px; }
.k-brand-txt { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.k-brand-txt span { font-weight: 800; font-size: 14px; letter-spacing: -0.2px; }
.k-brand-txt small { font-size: 8px; font-weight: 700; opacity: 0.9; text-transform: uppercase; letter-spacing: 1.2px; }
.k-sidebar-close {
    display: none;
    margin-left: auto;
    width: 26px; height: 26px;
    align-items: center; justify-content: center;
    border: none; border-radius: 7px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff; cursor: pointer; font-size: 13px;
    flex-shrink: 0;
}
.k-sidebar-close:hover { background: rgba(255, 255, 255, 0.3); }

/* --- Selector de tienda --- */
.k-sidebar-switcher {
    padding: 8px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.k-switcher-current {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 9px;
    border-radius: 8px;
    background: var(--bg-soft);
    color: var(--text);
    transition: background 0.15s;
}
.k-switcher-current:hover { background: var(--primary-soft); }
.k-switcher-current > i:first-child { color: var(--primary); font-size: 15px; flex-shrink: 0; }
.k-switcher-txt { flex: 1; min-width: 0; line-height: 1.2; }
.k-switcher-txt small { display: block; font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); }
.k-switcher-txt strong { display: block; font-size: 10px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-switcher-caret { font-size: 9px; color: var(--text-muted); flex-shrink: 0; }

/* --- Navegacion por secciones --- */
.k-sidebar-nav { flex: 1; padding: 6px 8px 8px; overflow-y: auto; overflow-x: hidden; }
.k-sidebar-nav::-webkit-scrollbar { width: 5px; }
.k-sidebar-nav::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .4); border-radius: 8px; }

.k-nav-group { margin-bottom: 6px; }
.k-nav-group:last-child { margin-bottom: 0; }

.k-nav-group-label {
    padding: 5px 9px 3px;
    font-size: 8px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: var(--text-muted);
    opacity: 0.8;
    white-space: nowrap;
}

.k-nav-item {
    position: relative;
    display: flex; align-items: center; gap: 9px;
    padding: 6px 9px;
    margin-bottom: 1px;
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s;
}
.k-nav-item > i { width: 16px; text-align: center; font-size: 12px; flex-shrink: 0; }
.k-nav-item > span:not(.k-nav-badge) { overflow: hidden; text-overflow: ellipsis; }
.k-nav-item:hover { background: var(--bg-soft); color: var(--text); }
.k-nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.k-nav-item.active > i { color: var(--primary); }
.k-nav-item.active::before {
    content: "";
    position: absolute; left: 0; top: 5px; bottom: 5px; width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--primary);
}

.k-nav-badge {
    display: none;
    align-items: center; justify-content: center;
    margin-left: auto;
    min-width: 17px; height: 16px; padding: 0 5px;
    border-radius: 999px;
    background: var(--amber);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    flex-shrink: 0;
}
.k-nav-badge.has { display: inline-flex; }

/* --- Pie con el usuario --- */
.k-sidebar-footer {
    display: flex; align-items: center; gap: 4px;
    padding: 6px 8px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.k-sidebar-user {
    display: flex; align-items: center; gap: 8px;
    flex: 1; min-width: 0;
    padding: 5px 6px;
    border-radius: 8px;
    color: var(--text);
    transition: background 0.15s;
}
.k-sidebar-user:hover { background: var(--bg-soft); }
.k-sidebar-user.active { background: var(--primary-soft); }
.k-user-dot {
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--gradient-primary);
    color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .3px;
    flex-shrink: 0;
}
.k-sidebar-user-info { flex: 1; min-width: 0; line-height: 1.15; }
.k-sidebar-user-info strong { display: block; font-size: 10px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-sidebar-user-info small { display: block; font-size: 8px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-logout-btn {
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 7px;
    color: var(--rose);
    flex-shrink: 0;
    transition: background 0.15s;
}
.k-logout-btn:hover { background: rgba(244, 63, 94, 0.1); }

/* --- Fondo del menu en pantallas chicas (admin) --- */
.k-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
body.k-nav-open .k-sidebar-backdrop { opacity: 1; pointer-events: auto; }

/* --- Boton hamburguesa: solo en pantallas chicas --- */
.k-btn-menu { display: none !important; }


/* ============== Topbar ============== */
.k-topbar {
    position: fixed;
    left: var(--sidebar-w);
    right: 0;
    top: 0;
    height: var(--topbar-h);
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    z-index: 90;
}
.k-topbar-title {
    font-size: 13px;
    font-weight: 700;
    flex: 1;
}
.k-topbar-right { display: flex; align-items: center; gap: 12px; }
.k-icon-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 10px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}
.k-icon-btn:hover { color: var(--primary); border-color: var(--primary); }
.k-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px;
    border-radius: var(--radius);
    background: var(--bg-soft);
}
.k-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.k-user-info { line-height: 1.1; }
.k-user-info strong { font-size: 10px; display: block; }
.k-user-info small { font-size: 9px; color: var(--text-muted); }

/* ============== Main ============== */
.k-main {
    margin-left: var(--sidebar-w);
    margin-top: var(--topbar-h);
    min-height: calc(100vh - var(--topbar-h));
    padding: 16px;
}
.k-container { max-width: 1400px; margin: 0 auto; }

.k-page-head {
    margin-bottom: 18px;
    padding-bottom: 8px;
}
.k-page-head h1 { font-size: 20px; margin: 0 0 4px; font-weight: 700; }
.k-page-head h1 i { color: var(--primary); margin-right: 8px; }
.k-subtitle { color: var(--text-muted); font-size: 10px; margin: 0; }
.k-flex-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.k-flex { display: flex; align-items: center; gap: 10px; }
.k-muted { color: var(--text-muted); font-size: 9px; }
.k-text-right { text-align: right; }

/* ============== Cards ============== */
.k-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    overflow: visible;
    position: relative;
}
.k-card-narrow { max-width: 720px; }
.k-card-filter { padding: 10px 14px; }
.k-card-head {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-soft);
    gap: 10px;
}
.k-card-head h2 { margin: 0; font-size: 12px; font-weight: 700; }
.k-card-head h2 i { color: var(--primary); margin-right: 6px; }
.k-card-body { padding: 16px; overflow: visible; }
.k-card-foot {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
}
.k-no-pad .k-card-body, .k-no-pad .k-card-head, .k-no-pad .k-card-foot { padding: 0; }
/* Override de overflow solo cuando el card contiene tablas con dropdowns */
.k-card-with-overflow { overflow: hidden; }

/* KPI cards */
.k-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.k-kpi {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.k-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.k-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}
.k-kpi-body { flex: 1; }
.k-kpi-body small { display: block; color: var(--text-muted); font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; }
.k-kpi-body strong { font-size: 18px; font-weight: 700; display: block; margin-top: 2px; color: var(--text); }
.k-kpi-link { position: absolute; right: 12px; bottom: 8px; font-size: 9px; color: var(--primary); }
.k-kpi-link:hover { color: var(--indigo); }

.k-kpi-indigo   .k-kpi-icon { background: linear-gradient(135deg, #fb923c, #f97316); }
.k-kpi-amber    .k-kpi-icon { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.k-kpi-rose     .k-kpi-icon { background: linear-gradient(135deg, #fb7185, #f43f5e); }
.k-kpi-cyan     .k-kpi-icon { background: linear-gradient(135deg, #22d3ee, #06b6d4); }
.k-kpi-emerald  .k-kpi-icon { background: linear-gradient(135deg, #34d399, #10b981); }
.k-kpi-violet   .k-kpi-icon { background: linear-gradient(135deg, #a78bfa, #8b5cf6); }
.k-kpi-success  .k-kpi-icon { background: linear-gradient(135deg, #4ade80, #16a34a); }
.k-kpi-primary  .k-kpi-icon { background: var(--gradient-primary); }

/* Grid */
.k-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.k-grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.k-span-2 { grid-column: span 2; }

/* Tables */
.k-table-responsive { overflow-x: auto; overflow-y: visible; }
.k-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}
.k-table thead th {
    background: var(--bg-soft);
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 9px;
    border-bottom: 1px solid var(--border);
}
.k-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.k-table tbody tr:hover td { background: var(--bg-soft); }
.k-table-sm thead th, .k-table-sm tbody td { padding: 6px 10px; }

/* Badges */
.k-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 600;
}
.k-badge i { font-size: 9px; }
.k-badge-indigo  { background: var(--primary-soft); color: var(--primary); }
.k-badge-cyan    { background: rgba(6,182,212,0.1); color: var(--cyan); }
.k-badge-emerald { background: rgba(16,185,129,0.1); color: var(--emerald); }
.k-badge-amber   { background: rgba(245,158,11,0.1); color: var(--amber); }
.k-badge-rose    { background: rgba(244,63,94,0.1); color: var(--rose); }
.k-badge-muted   { background: rgba(148,163,184,0.15); color: var(--text-muted); }

/* Empty state */
.k-empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}
.k-empty-state i { font-size: 36px; opacity: 0.4; margin-bottom: 12px; display: block; }
.k-empty-state h3 { font-size: 13px; margin: 8px 0 4px; color: var(--text); }
.k-empty-state p { font-size: 10px; margin: 0; }
.k-empty-state-sm { padding: 16px; }
.k-empty-state-sm i { font-size: 24px; }

/* Alerts */
.k-alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    border-left: 3px solid;
}
.k-alert-success { background: rgba(16,185,129,0.1); color: var(--emerald); border-color: var(--emerald); }
.k-alert-danger  { background: rgba(244,63,94,0.1); color: var(--rose); border-color: var(--rose); }
.k-alert-warning { background: rgba(245,158,11,0.12); color: var(--amber); border-color: var(--amber); }
.k-alert-info    { background: rgba(6,182,212,0.1); color: var(--cyan); border-color: var(--cyan); }

/* Lista de puntos del editor de geocerca */
.k-puntos-lista {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-soft);
    max-height: 168px;
    overflow-y: auto;
    padding: 4px;
}
.k-puntos-vacio {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    padding: 12px 4px;
}
.k-puntos-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 4px;
    border-radius: 4px;
    font-size: 10px;
}
.k-puntos-item:nth-child(odd) { background: rgba(148,163,184,0.07); }
.k-puntos-idx {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.k-puntos-coord {
    flex: 1 1 auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.k-puntos-del {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 4px;
}
.k-puntos-del:hover { background: rgba(244,63,94,0.15); color: var(--rose); }

/* Tabs */
.k-tabs {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
}
.k-tabs li a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    border-radius: var(--radius) var(--radius) 0 0;
}
.k-tabs li a:hover { color: var(--text); background: var(--bg-soft); }
.k-tabs li.active a {
    background: var(--surface);
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    margin-bottom: -2px;
}
.k-tab-content { padding-top: 8px; }

/* Form */
.k-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.k-form-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.form-group { margin-bottom: 12px; }
.form-group label { font-size: 13px; font-weight: 600; margin-bottom: 5px; display: block; color: var(--text); }
.form-check-label { font-size: 14px; font-weight: 500; }
.form-control {
    font-size: 14px;
    padding: 9px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--text);
    transition: border-color 0.15s;
    min-height: 40px;
    width: 100%;
    box-sizing: border-box;
}
.form-control:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
textarea.form-control { resize: vertical; min-height: 80px; }

/* Select nativo: muestra el texto completo de la opcion seleccionada */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3e%3cpath fill='%2364748b' d='M2 4l4 4 4-4z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    text-overflow: ellipsis;
}
select.form-control option {
    padding: 8px 12px;
    font-size: 14px;
    background: #ffffff;
    color: var(--text);
}

/* Inputs compactos: .form-control-sm. Antes Bootstrap lo pisaba con .form-control
   (misma especificidad pero site.css se carga despues) y por eso los selects
   de las barras de filtro median 40px de alto y ocupaban todo el ancho. */
.form-control-sm {
    font-size: 12px;
    padding: 4px 9px;
    min-height: 30px;
    height: 30px;
    line-height: 1.45;
    border-radius: 6px;
}
select.form-control-sm {
    padding-right: 26px;
    background-position: right 7px center;
    background-size: 10px;
}
select.form-control-sm option {
    padding: 4px 9px;
    font-size: 12px;
}
textarea.form-control-sm { height: auto; min-height: 56px; }

/* Barra de filtros compacta con etiquetas */
.k-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.k-filter-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 176px;
}
.k-filter-field.k-w-sm { width: 148px; }
.k-filter-field label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 0;
}
.k-filter-spacer { flex: 1 1 auto; }
.k-filter-count {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}
.k-filter-count strong { color: var(--text); }
@media (max-width: 700px) {
    .k-filter-field, .k-filter-field.k-w-sm { width: 100%; }
}

/* Switch */
.k-switch {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 12px;
    cursor: pointer;
    padding: 6px 0;
    min-height: 28px;
    line-height: 1.3;
}
.k-switch > input[type="hidden"],
.k-switch > input[type="checkbox"] { display: none !important; }
.k-switch > .k-switch-slider {
    display: inline-block !important;
    width: 42px !important;
    height: 22px !important;
    min-width: 42px;
    background: #cbd5e1;
    border-radius: 999px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
    flex-grow: 0;
    vertical-align: middle;
}
.k-switch > .k-switch-slider::before {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.k-switch > input[type="checkbox"]:checked ~ .k-switch-slider { background: var(--primary); }
.k-switch > input[type="checkbox"]:checked ~ .k-switch-slider::before { transform: translateX(20px); }
.k-switch > .k-switch-label {
    display: inline-block !important;
    font-size: 14px !important;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.3;
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}

/* dl */
.k-dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0; font-size: 10px; }
.k-dl dt { color: var(--text-muted); font-weight: 600; }
.k-dl dd { margin: 0; color: var(--text); }

/* Ticket thread */
.k-ticket-thread {
    max-height: 480px;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-soft);
}
.k-ticket-msg { display: flex; gap: 10px; margin-bottom: 12px; }
.k-ticket-msg-self { flex-direction: row-reverse; }
.k-ticket-msg-self .k-ticket-bubble { background: var(--primary-soft); }
.k-ticket-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.k-ticket-bubble {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 10px 12px;
    flex: 1;
    border: 1px solid var(--border);
}
.k-ticket-bubble header { display: flex; justify-content: space-between; font-size: 9px; margin-bottom: 4px; }
.k-ticket-bubble header small { color: var(--text-muted); }
.k-ticket-bubble p { margin: 0; font-size: 10px; line-height: 1.5; }

/* Toasts */
.k-toast-container {
    position: fixed;
    top: 80px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.k-toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    min-width: 280px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 10px;
    animation: kSlideIn 0.3s ease;
    border-left: 3px solid var(--primary);
}
.k-toast-success { border-color: var(--emerald); }
.k-toast-warning { border-color: var(--amber); }
.k-toast-danger { border-color: var(--rose); }
.k-toast i { font-size: 14px; }
@keyframes kSlideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Prose */
.k-prose h2 { font-size: 14px; margin: 16px 0 6px; color: var(--primary); }
.k-prose p { font-size: 10px; line-height: 1.6; margin-bottom: 10px; color: var(--text); }

/* Amount */
.k-amount-rose { color: var(--rose); font-weight: 700; }

/* Strength */
.k-pwd-strength { height: 4px; border-radius: 2px; margin-top: 6px; background: var(--border); }
.k-pwd-strength::after { content: attr(data-text); display: block; font-size: 9px; margin-top: 4px; color: var(--text-muted); }
.k-pwd-strength.k-pwd-1 { background: var(--rose); }
.k-pwd-strength.k-pwd-2 { background: var(--amber); }
.k-pwd-strength.k-pwd-3 { background: var(--cyan); }
.k-pwd-strength.k-pwd-4 { background: var(--emerald); }
.k-pwd-strength.k-pwd-5 { background: var(--primary); }

/* Mini link */
.k-link-mini { font-size: 9px; margin-left: 4px; }

/* Botones override Bootstrap */
.btn { font-size: 10px; padding: 6px 12px; border-radius: var(--radius); font-weight: 600; }
.btn-primary { background: var(--gradient-primary); border: none; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-success { background: var(--emerald); border: none; }
.btn-success:hover { background: #059669; }
.btn-danger  { background: var(--rose); border: none; }
.btn-warning { background: var(--amber); border: none; color: #fff; }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary-soft); }

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 1100px) {
    .k-grid-3 { grid-template-columns: 1fr; }
    .k-span-2 { grid-column: span 1; }
}
@media (max-width: 900px) {
    :root { --sidebar-w: 0px; }

    /* El menu pasa a ser un panel deslizante con fondo oscuro */
    .k-sidebar {
        width: min(278px, 84vw);
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
        z-index: 101;
    }
    body.k-nav-open .k-sidebar { transform: translateX(0); }
    body.k-nav-open { overflow: hidden; }
    .k-sidebar-close { display: inline-flex; }
    .k-btn-menu { display: inline-flex !important; }
    .k-sidebar-toggle { display: none !important; }

    /* Mas espacio para el dedo en pantallas tactiles */
    .k-sidebar .k-nav-item { padding: 9px 10px; font-size: 12px; }
    .k-sidebar .k-nav-item > i { font-size: 13px; width: 18px; }
    .k-sidebar .k-nav-group-label { padding: 8px 10px 4px; font-size: 8.5px; }
    .k-sidebar .k-sidebar-user { padding: 7px; }
    .k-sidebar .k-user-dot { width: 30px; height: 30px; font-size: 10px; }

    .k-topbar { left: 0; }
    .k-main { margin-left: 0; }
    .k-form-grid { grid-template-columns: 1fr; }
    .k-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .k-kpi-grid { grid-template-columns: 1fr 1fr; }
    .k-dl { grid-template-columns: 1fr; gap: 2px 0; }
    .k-dl dt { margin-top: 6px; }
    .k-user-info { display: none; }
}
@media (max-width: 500px) {
    .k-kpi-grid { grid-template-columns: 1fr; }
    .k-page-head h1 { font-size: 16px; }
    .k-login-card { padding: 20px; }
}

/* ===========================================================
   COMPACT TIENDAS - Tiendas pendientes & Detalle
   Tipografia 9pt con alta densidad de informacion
   =========================================================== */

/* Toolbar / filtros */
.k-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}
.k-toolbar-search {
    flex: 1;
    min-width: 240px;
    position: relative;
}
.k-toolbar-search input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
    background: var(--bg-soft);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.k-toolbar-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
    background: var(--surface);
}
.k-toolbar-search i {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 11px;
}
.k-toolbar select, .k-toolbar .k-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
    background: var(--bg-soft);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s;
}
.k-toolbar select:focus {
    outline: none;
    border-color: var(--primary);
}
.k-toolbar-count {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    padding: 4px 10px;
    background: var(--primary-soft);
    border-radius: 999px;
    color: var(--primary);
}

/* Tabla compacta 9pt */
.k-table-compact {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
}
.k-table-compact thead th {
    background: var(--bg-soft);
    padding: 8px 10px;
    text-align: left;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 9px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}
.k-table-compact thead th i {
    margin-right: 4px;
    color: var(--primary);
}
.k-table-compact tbody td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
    transition: background 0.15s;
}
.k-table-compact tbody tr {
    transition: transform 0.15s, box-shadow 0.15s;
}
.k-table-compact tbody tr:hover td {
    background: var(--primary-soft);
}
.k-table-compact tbody tr:last-child td {
    border-bottom: none;
}
.k-table-compact tbody tr {
    animation: k-row-in 0.3s ease-out backwards;
}
.k-table-compact tbody tr:nth-child(1) { animation-delay: 0.02s; }
.k-table-compact tbody tr:nth-child(2) { animation-delay: 0.04s; }
.k-table-compact tbody tr:nth-child(3) { animation-delay: 0.06s; }
.k-table-compact tbody tr:nth-child(4) { animation-delay: 0.08s; }
.k-table-compact tbody tr:nth-child(5) { animation-delay: 0.10s; }
.k-table-compact tbody tr:nth-child(6) { animation-delay: 0.12s; }
.k-table-compact tbody tr:nth-child(7) { animation-delay: 0.14s; }
.k-table-compact tbody tr:nth-child(8) { animation-delay: 0.16s; }
.k-table-compact tbody tr:nth-child(9) { animation-delay: 0.18s; }
.k-table-compact tbody tr:nth-child(10) { animation-delay: 0.20s; }

@keyframes k-row-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Avatar redondo */
.k-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 700;
    font-size: 10px;
    flex-shrink: 0;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.3);
}
.k-avatar-sm { width: 28px; height: 28px; font-size: 9px; }
.k-avatar-md { width: 40px; height: 40px; font-size: 13px; }
.k-avatar-lg { width: 64px; height: 64px; font-size: 22px; }

.k-row-flex { display: flex; align-items: center; gap: 8px; }
.k-cell-title { display: flex; flex-direction: column; line-height: 1.25; }
.k-cell-title strong { font-size: 12px; color: var(--text); font-weight: 600; }
.k-cell-title small { font-size: 10px; color: var(--text-muted); }
.k-code {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 11px;
    background: var(--bg-soft);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
    color: var(--text);
}

/* Dropdown menu de acciones */
.k-action-dropdown {
    position: relative;
    display: inline-block;
}
.k-action-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.k-action-trigger:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}
.k-action-trigger i.trigger-icon {
    font-size: 10px;
    transition: transform 0.2s;
}
.k-action-dropdown.open .k-action-trigger i.trigger-icon {
    transform: rotate(180deg);
}
.k-action-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
    min-width: 200px;
    padding: 4px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px) scale(0.98);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    pointer-events: none;
}
.k-action-dropdown.open .k-action-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
/* Asegura que las celdas con dropdown no recorten el menu */
.k-table-compact tbody td { overflow: visible !important; position: relative; }
.k-table-compact tbody tr { overflow: visible !important; }
.k-action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 11px;
    color: var(--text);
    cursor: pointer;
    transition: background 0.12s;
    text-decoration: none;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-weight: 500;
}
.k-action-item:hover { background: var(--bg-soft); }
.k-action-item i {
    width: 14px;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
}
.k-action-item:hover i { color: var(--primary); }
.k-action-item.k-action-success:hover { background: rgba(16,185,129,0.08); }
.k-action-item.k-action-success:hover i { color: var(--emerald); }
.k-action-item.k-action-danger:hover { background: rgba(244,63,94,0.08); }
.k-action-item.k-action-danger:hover i { color: var(--rose); }
.k-action-item.k-action-warning:hover { background: rgba(245,158,11,0.08); }
.k-action-item.k-action-warning:hover i { color: var(--amber); }
.k-action-item.k-action-info:hover { background: rgba(6,182,212,0.08); }
.k-action-item.k-action-info:hover i { color: var(--cyan); }
.k-action-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 6px;
}

/* Card view (responsive / mobile + view toggle) */
.k-card-list {
    display: none;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
}
.k-mobile-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
    animation: k-row-in 0.3s ease-out backwards;
    position: relative;
    overflow: visible;
}
.k-mobile-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}
.k-mobile-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border);
    margin-bottom: 14px;
}
.k-mobile-card-head .k-cell-title { flex: 1; }
.k-mobile-card-head .k-cell-title strong { font-size: 15px; }
.k-mobile-card-head .k-cell-title small { font-size: 11px; }
.k-mobile-card-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px 18px;
    font-size: 12px;
    color: var(--text-muted);
}
.k-mobile-card-body .k-mc-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.k-mobile-card-body .k-mc-item .k-mc-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}
.k-mobile-card-body .k-mc-item .k-mc-label i { color: var(--primary); font-size: 10px; }
.k-mobile-card-body .k-mc-item .k-mc-value {
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}
.k-mobile-card-foot {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
    display: flex;
    gap: 8px;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.k-mobile-card-foot .k-flex { gap: 6px; }

/* View toggle (segmented control) */
.k-view-toggle {
    display: inline-flex;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}
.k-view-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
}
.k-view-toggle-btn:hover { color: var(--text); }
.k-view-toggle-btn i { font-size: 11px; }
.k-view-toggle-btn.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.k-view-toggle-btn .k-toggle-badge {
    background: var(--primary-soft);
    color: var(--primary);
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
}
.k-view-toggle-btn.active .k-toggle-badge {
    background: var(--primary);
    color: #fff;
}

/* Detalle tienda - bloques de informacion */
.k-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    padding: 14px;
}
.k-info-block {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.k-info-block::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
}
.k-info-block:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}
.k-info-block:hover::before {
    opacity: 1;
}
.k-info-block-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.k-info-block-label i {
    color: var(--primary);
    font-size: 10px;
}
.k-info-block-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
}

/* Hero header para detalle de tienda */
.k-store-hero {
    background: var(--gradient-primary);
    border-radius: var(--radius);
    padding: 18px 22px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}
.k-store-hero::before {
    content: '';
    position: absolute;
    right: -40px;
    top: -40px;
    width: 160px;
    height: 160px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}
.k-store-hero::after {
    content: '';
    position: absolute;
    right: 20px;
    bottom: -60px;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.k-store-hero .k-avatar {
    background: rgba(255,255,255,0.25);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    backdrop-filter: blur(8px);
    flex-shrink: 0;
}
.k-store-hero-content {
    flex: 1;
    position: relative;
    z-index: 2;
}
.k-store-hero-content h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.k-store-hero-content p {
    margin: 4px 0 0;
    font-size: 11px;
    opacity: 0.95;
}
.k-store-hero-content code {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
}
.k-store-hero-actions {
    display: flex;
    gap: 8px;
    position: relative;
    z-index: 2;
}
.k-store-hero-actions .btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    backdrop-filter: blur(8px);
}
.k-store-hero-actions .btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Tabs modernas */
.k-modern-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-soft);
    border-radius: 10px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    overflow-x: auto;
}
.k-modern-tab {
    flex: 1;
    min-width: 100px;
    padding: 8px 14px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    white-space: nowrap;
}
.k-modern-tab i { font-size: 10px; }
.k-modern-tab:hover { color: var(--text); }
.k-modern-tab.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.k-modern-tab .k-tab-count {
    background: var(--primary-soft);
    color: var(--primary);
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
}

/* Animaciones globales */
@keyframes k-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.k-fade-up { animation: k-fade-up 0.4s ease-out; }
.k-fade-up-1 { animation: k-fade-up 0.4s ease-out 0.06s backwards; }
.k-fade-up-2 { animation: k-fade-up 0.4s ease-out 0.12s backwards; }
.k-fade-up-3 { animation: k-fade-up 0.4s ease-out 0.18s backwards; }

/* Skeleton / loading state */
.k-row-loading td {
    padding: 12px;
}
.k-row-loading td::after {
    content: '';
    display: block;
    height: 8px;
    background: linear-gradient(90deg, var(--bg-soft) 25%, var(--border) 50%, var(--bg-soft) 75%);
    background-size: 200% 100%;
    animation: k-shimmer 1.5s infinite;
    border-radius: 4px;
}
@keyframes k-shimmer {
    from { background-position: -200% 0; }
    to   { background-position: 200% 0; }
}

/* Toast personalizado para acciones */
.k-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    z-index: 9999;
    animation: k-toast-in 0.3s ease-out;
}
@keyframes k-toast-in {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Responsive switches tabla<->card (solo cuando NO hay toggle manual) */
.k-card-list.k-auto-mobile { display: none; }
@media (max-width: 900px) {
    .k-card-list.k-auto-mobile {
        display: flex;
    }
    body:not(.k-view-cards) .k-card-list.k-auto-mobile { display: flex; }
    body.k-view-cards .k-card-list.k-auto-mobile { display: flex; }
    body:not(.k-view-table) .k-table-responsive.k-auto-mobile { display: block; }
    body.k-view-table .k-table-responsive.k-auto-mobile { display: block; }
}
@media (max-width: 700px) {
    .k-toolbar { flex-direction: column; align-items: stretch; }
    .k-toolbar-search { min-width: 0; }
    .k-store-hero { flex-direction: column; align-items: flex-start; text-align: left; }
    .k-store-hero-actions { width: 100%; justify-content: flex-start; }
    .k-info-block-value { font-size: 11px; }
}

/* ============================================================
   SIDEBAR COLAPSABLE (solo iconos, se expande al pasar el mouse)
   Aplica unicamente en escritorio: en pantallas chicas el menu es
   un panel deslizante y nunca se colapsa a iconos.
   ============================================================ */
:root {
    --sidebar-w-collapsed: 64px;
}

@media (min-width: 901px) {
    body.k-sidebar-collapsed .k-sidebar { width: var(--sidebar-w-collapsed); }
    body.k-sidebar-collapsed .k-main { margin-left: var(--sidebar-w-collapsed); }
    body.k-sidebar-collapsed .k-topbar { left: var(--sidebar-w-collapsed); }

    /* Solo iconos */
    body.k-sidebar-collapsed .k-sidebar .k-brand-txt,
    body.k-sidebar-collapsed .k-sidebar .k-switcher-txt,
    body.k-sidebar-collapsed .k-sidebar .k-switcher-caret,
    body.k-sidebar-collapsed .k-sidebar .k-nav-item > span,
    body.k-sidebar-collapsed .k-sidebar .k-nav-group-label,
    body.k-sidebar-collapsed .k-sidebar .k-sidebar-user-info,
    body.k-sidebar-collapsed .k-sidebar .k-logout-btn {
        display: none !important;
    }

    body.k-sidebar-collapsed .k-sidebar-brand { justify-content: center; padding: 0; }
    body.k-sidebar-collapsed .k-sidebar-brand > i { font-size: 22px; }
    body.k-sidebar-collapsed .k-sidebar-switcher { padding: 6px; }
    body.k-sidebar-collapsed .k-switcher-current { justify-content: center; padding: 8px 0; }
    body.k-sidebar-collapsed .k-sidebar-nav { padding: 6px; }
    body.k-sidebar-collapsed .k-nav-item { justify-content: center; padding: 8px 0; }
    body.k-sidebar-collapsed .k-nav-item > i { width: auto; font-size: 14px; }
    body.k-sidebar-collapsed .k-sidebar-footer { padding: 6px; }
    body.k-sidebar-collapsed .k-sidebar-user { justify-content: center; padding: 6px 0; }

    /* En colapsado las secciones se separan con una linea */
    body.k-sidebar-collapsed .k-nav-group {
        margin: 5px 0 0;
        padding-top: 5px;
        border-top: 1px solid var(--border);
    }
    body.k-sidebar-collapsed .k-nav-group:first-child {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }

    /* Al pasar el mouse se expande para leer las etiquetas */
    body.k-sidebar-collapsed .k-sidebar:hover {
        width: var(--sidebar-w);
        box-shadow: var(--shadow-lg);
        z-index: 200;
    }
    body.k-sidebar-collapsed .k-sidebar:hover .k-brand-txt,
    body.k-sidebar-collapsed .k-sidebar:hover .k-switcher-txt,
    body.k-sidebar-collapsed .k-sidebar:hover .k-switcher-caret,
    body.k-sidebar-collapsed .k-sidebar:hover .k-nav-item > span,
    body.k-sidebar-collapsed .k-sidebar:hover .k-nav-group-label,
    body.k-sidebar-collapsed .k-sidebar:hover .k-sidebar-user-info,
    body.k-sidebar-collapsed .k-sidebar:hover .k-logout-btn {
        display: revert !important;
    }
    body.k-sidebar-collapsed .k-sidebar:hover .k-sidebar-brand { justify-content: flex-start; padding: 0 14px; }
    body.k-sidebar-collapsed .k-sidebar:hover .k-sidebar-brand > i { font-size: 19px; }
    body.k-sidebar-collapsed .k-sidebar:hover .k-sidebar-switcher { padding: 8px; }
    body.k-sidebar-collapsed .k-sidebar:hover .k-switcher-current { justify-content: flex-start; padding: 7px 9px; }
    body.k-sidebar-collapsed .k-sidebar:hover .k-sidebar-nav { padding: 6px 8px 8px; }
    body.k-sidebar-collapsed .k-sidebar:hover .k-nav-item { justify-content: flex-start; padding: 6px 9px; }
    body.k-sidebar-collapsed .k-sidebar:hover .k-nav-item > i { width: 16px; font-size: 12px; }
    body.k-sidebar-collapsed .k-sidebar:hover .k-sidebar-footer { padding: 6px 8px; }
    body.k-sidebar-collapsed .k-sidebar:hover .k-sidebar-user { justify-content: flex-start; padding: 5px 6px; }
    body.k-sidebar-collapsed .k-sidebar:hover .k-nav-group {
        margin: 0 0 6px;
        padding-top: 0;
        border-top: none;
    }
}

/* ============================================================
   ESTILOS COMPLEMENTARIOS ADMIN (clases usadas en vistas)
   ============================================================ */

/* Botones bulk (Aprobar/Rechazar todos) - globalizacion desde Detalle.cshtml */
.k-action-bulk-success {
    background: var(--emerald) !important;
    border-color: var(--emerald) !important;
    color: #fff !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}
.k-action-bulk-success:hover {
    background: #059669 !important;
    border-color: #059669 !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.35);
}
.k-action-bulk-danger {
    background: var(--rose) !important;
    border-color: var(--rose) !important;
    color: #fff !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 10px rgba(244, 63, 94, 0.25);
}
.k-action-bulk-danger:hover {
    background: #e11d48 !important;
    border-color: #e11d48 !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(244, 63, 94, 0.35);
}
.k-action-bulk-success i, .k-action-bulk-danger i { font-size: 12px; }

/* Loader de modales (usado en Detalle modal doc) */
.k-loader { color: #fff; font-size: 12px; }

/* Switch label/slider (vista Perfil) */
.k-switch-label { font-size: 11px; color: var(--text-muted); margin-left: 6px; }
.k-switch-slider { position: absolute; inset: 0; background: var(--muted); border-radius: 999px; cursor: pointer; transition: background 0.2s; }
.k-switch-slider::before { content: ''; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.k-switch input:checked ~ .k-switch-slider { background: var(--primary); }
.k-switch input:checked ~ .k-switch-slider::before { transform: translateX(16px); }

/* Sidebar toggle button (topbar) */
.k-sidebar-toggle {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 10px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}
.k-sidebar-toggle:hover { color: var(--primary); border-color: var(--primary); }

/* Tab count (tabs modernas en Detalle) */
.k-tab-count { background: var(--primary-soft); color: var(--primary); padding: 1px 6px; border-radius: 8px; font-size: 9px; font-weight: 700; display: inline-block; margin-left: 4px; }

/* Ticket msg origin (soporte) */
.k-ticket-msg-origin { font-size: 9px; color: var(--text-muted); margin-top: 4px; display: block; }
.k-ticket-bubble.k-ticket-msg-self .k-ticket-msg-origin { color: rgba(255,255,255,0.85); }

/* ============================================================
   INDICE DE TIENDAS - estilos complementarios
   (stat cards k-stat-row, badges k-tl-badge standalone, etc.)
   ============================================================ */

.k-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.k-stat {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    transition: all 0.15s;
    display: block;
}
.k-stat:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.k-stat-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
}
.k-stat-label i { color: var(--primary); font-size: 10px; }
.k-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

/* Variantes de k-tl-badge standalone (sin depender de .k-timeline) */
.k-tl-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2px 8px;
}
.k-tl-badge-muted { background: rgba(148, 163, 184, 0.18); color: var(--text-muted); }
.k-tl-badge-primary { background: var(--primary-soft); color: var(--primary); }
.k-tl-emerald { background: rgba(16, 185, 129, 0.15); color: var(--emerald); }
.k-tl-cyan    { background: rgba(6, 182, 212, 0.15); color: var(--cyan); }
.k-tl-amber   { background: rgba(245, 158, 11, 0.15); color: var(--amber); }
.k-tl-orange  { background: rgba(249, 115, 22, 0.15); color: var(--primary); }
.k-tl-rose    { background: rgba(244, 63, 94, 0.15); color: var(--rose); }
.k-tl-muted   { background: rgba(148, 163, 184, 0.18); color: var(--text-muted); }
.k-tl-badge i { font-size: 9px; }

/* Variantes standalone de k-action-* (cuando se usan fuera de un menu dropdown, ej. en el toolbar) */
.k-action-success { background: rgba(16, 185, 129, 0.15); color: var(--emerald); }
.k-action-success:hover { background: rgba(16, 185, 129, 0.25); border-color: var(--emerald); color: var(--emerald); }
.k-action-warning { background: rgba(245, 158, 11, 0.15); color: var(--amber); }
.k-action-warning:hover { background: rgba(245, 158, 11, 0.25); border-color: var(--amber); color: var(--amber); }
.k-action-danger  { background: rgba(244, 63, 94, 0.15); color: var(--rose); }
.k-action-danger:hover  { background: rgba(244, 63, 94, 0.25); border-color: var(--rose); color: var(--rose); }
.k-action-info    { background: rgba(6, 182, 212, 0.15); color: var(--cyan); }
.k-action-info:hover    { background: rgba(6, 182, 212, 0.25); border-color: var(--cyan); color: var(--cyan); }


/* ============================================================
   DASHBOARD ADMIN
   Cabecera con degradado, indicadores con contador animado,
   linea de tiempo de actividad y barras de salud del ecosistema.
   ============================================================ */

/* ---------- Cabecera ---------- */
.kh-hero {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 12px;
    background: linear-gradient(120deg, #f97316 0%, #ea580c 52%, #b45309 100%);
    color: #fff;
    box-shadow: 0 10px 26px rgba(234, 88, 12, .28);
}

/* Circulos decorativos */
.kh-hero::before,
.kh-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .10);
    pointer-events: none;
}
.kh-hero::before { width: 220px; height: 220px; right: -60px; top: -90px; }
.kh-hero::after  { width: 140px; height: 140px; right: 120px; bottom: -80px; background: rgba(255, 255, 255, .07); }

.kh-hero-row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.kh-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 8.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, .18);
    padding: 3px 9px;
    border-radius: 999px;
    margin-bottom: 6px;
}

.kh-hero h1 {
    margin: 0 0 3px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.3px;
    color: #fff;
}

.kh-hero p {
    margin: 0;
    font-size: 11px;
    color: rgba(255, 255, 255, .88);
}

.kh-hero-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
    flex-wrap: wrap;
}

.kh-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 13px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    transition: all .15s;
    white-space: nowrap;
}

.kh-action:hover {
    background: #fff;
    color: #c2410c;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, .18);
}

/* ---------- Indicadores ---------- */
.kh-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.kh-kpi {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 13px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.kh-kpi::after {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 3px;
    background: var(--kh, var(--primary));
    opacity: .9;
}

.kh-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .12);
    border-color: var(--kh, var(--primary));
}

.kh-kpi-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    background: var(--kh, var(--primary));
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(15, 23, 42, .14);
}

.kh-kpi-body { min-width: 0; flex: 1; }

.kh-kpi-label {
    display: block;
    font-size: 8.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kh-kpi-value {
    display: block;
    margin-top: 3px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.05;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.5px;
}

.kh-kpi-sub {
    display: block;
    margin-top: 2px;
    font-size: 9px;
    color: var(--text-muted);
}

.kh-kpi-link {
    position: absolute;
    right: 10px;
    bottom: 9px;
    font-size: 9px;
    font-weight: 700;
    color: var(--kh, var(--primary));
    opacity: .85;
}
.kh-kpi-link:hover { opacity: 1; text-decoration: underline; }

/* ---------- Fila secundaria (mini indicadores) ---------- */
.kh-minis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.kh-mini {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 11px;
}

.kh-mini i {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    background: var(--bg-soft);
    color: var(--kh, var(--primary));
    flex-shrink: 0;
}

.kh-mini small {
    display: block;
    font-size: 8.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-muted);
}

.kh-mini strong {
    display: block;
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

/* ---------- Rejillas ---------- */
.kh-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 12px;
    align-items: start;
}

.kh-chart-box { height: 208px; position: relative; }

/* ---------- Linea de tiempo ---------- */
.kh-timeline {
    position: relative;
    margin: 0;
    padding: 2px 0 2px 16px;
    list-style: none;
}

.kh-timeline::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(var(--border), var(--border));
}

.kh-tl-item {
    position: relative;
    padding: 0 0 10px 4px;
    animation: khFadeUp .35s ease both;
}
.kh-tl-item:last-child { padding-bottom: 0; }

.kh-tl-dot {
    position: absolute;
    left: -16px;
    top: 3px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--tl, var(--primary));
    box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--border);
}

.kh-tl-title {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
}

.kh-tl-title time {
    margin-left: auto;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.kh-tl-desc {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.45;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.kh-tl-tag {
    display: inline-block;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--text-muted);
}

/* colores de los puntos */
.kh-tl-item.c-emerald .kh-tl-dot { --tl: #10b981; }
.kh-tl-item.c-cyan    .kh-tl-dot { --tl: #06b6d4; }
.kh-tl-item.c-amber   .kh-tl-dot { --tl: #f59e0b; }
.kh-tl-item.c-rose    .kh-tl-dot { --tl: #f43f5e; }
.kh-tl-item.c-violet  .kh-tl-dot { --tl: #8b5cf6; }
.kh-tl-item.c-indigo  .kh-tl-dot { --tl: #f97316; }

/* ---------- Barras de salud ---------- */
.kh-health { display: flex; flex-direction: column; gap: 11px; }

.kh-health-row .kh-health-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
    font-size: 10px;
    color: var(--text-muted);
}

.kh-health-head span { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.kh-health-head strong { font-size: 11px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }

.kh-health-track {
    height: 7px;
    border-radius: 6px;
    background: var(--bg-soft);
    overflow: hidden;
}

.kh-health-fill {
    height: 100%;
    width: 0;
    border-radius: 6px;
    background: var(--kh, var(--primary));
    transition: width .9s cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Animaciones ---------- */
@keyframes khFadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.kh-anim { animation: khFadeUp .4s ease both; }

@media (prefers-reduced-motion: reduce) {
    .kh-anim, .kh-tl-item { animation: none !important; }
    .kh-health-fill { transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .kh-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kh-minis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kh-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .kh-kpis { grid-template-columns: 1fr; }
    .kh-minis { grid-template-columns: 1fr; }
    .kh-hero-actions { margin-left: 0; width: 100%; }
    .kh-hero h1 { font-size: 17px; }
    .kh-chart-box { height: 180px; }
}

/* Filas de conteo dentro de la tarjeta de salud (sin barra, para no
   inventar porcentajes que no existen). */
.kh-stat-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 10.5px;
    color: var(--text-muted);
}
.kh-stat-line:last-child { border-bottom: none; }
.kh-stat-line i { color: var(--kh, var(--primary)); font-size: 11px; }
.kh-stat-line span { font-weight: 600; }
.kh-stat-line strong {
    margin-left: auto;
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}