﻿/* ============================================================
   Klio Go Tienda.Web - estilos
   ============================================================ */

:root {
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-size-base: 10px;
    --radius: 8px;

    --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%);
}

[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);
}

* { 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-card-wide   { max-width: 720px; }
.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; }
.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-divider { text-align: center; margin: 14px 0; position: relative; color: var(--text-muted); font-size: 9px; }
.k-divider::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--border); }
.k-divider span { background: var(--surface); padding: 0 10px; position: relative; }
.btn-google { background: #fff; border: 1px solid var(--border); color: #1f2937; }
.btn-google:hover { background: #f8fafc; }
.k-login-alt { text-align: center; margin-top: 14px; font-size: 10px; }
.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; }

/* ============== Stepper ============== */
.k-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}
.k-step {
    display: flex; flex-direction: column; align-items: center;
    color: var(--text-muted);
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.k-step-num {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    margin-bottom: 4px;
    font-weight: 700;
}
.k-step.active .k-step-num { background: var(--gradient-primary); color: #fff; }
.k-step.active { color: var(--primary); }
.k-step.done .k-step-num { background: var(--emerald); color: #fff; }
.k-step-line {
    height: 2px;
    width: 60px;
    background: var(--border);
    margin: 0 6px 18px;
}
.k-step-line.done { background: var(--emerald); }

/* ============== Radio Cards ============== */
.k-radio-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.k-radio-card {
    display: flex; align-items: center; gap: 10px;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
}
.k-radio-card input { display: none; }
.k-radio-card i { font-size: 22px; color: var(--primary); }
.k-radio-card strong { display: block; font-size: 11px; }
.k-radio-card small { color: var(--text-muted); font-size: 9px; }
.k-radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }

/* ============== 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 --- */
.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; flex-wrap: wrap; }
.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: hidden; }
.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; }
.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; }

/* ============== Grids ============== */
.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; }
.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-group label.k-switch { display: flex !important; margin-bottom: 0; }
.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: que muestre el texto completo de la opciÃ³n 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);
}

.k-prefix { position: relative; }
.k-prefix span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.k-prefix .form-control { padding-left: 24px; }

/* ============== Tables ============== */
.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 tfoot td { padding: 10px 12px; border-top: 1px solid var(--border); font-weight: 700; }

/* ============== 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-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); }
.k-badge-count   { background: rgba(255,255,255,0.25); color: inherit; }

/* ============== Empty ============== */
.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-warning { background: rgba(245,158,11,0.1); color: var(--amber); border-color: var(--amber); }
.k-alert-danger  { background: rgba(244,63,94,0.1); color: var(--rose); border-color: var(--rose); }
.k-alert-info    { background: rgba(6,182,212,0.1); color: var(--cyan); border-color: var(--cyan); }

/* ============== 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); }

/* ============== Amounts ============== */
.k-amount-emerald { color: var(--emerald); font-weight: 700; }
.k-amount-rose { color: var(--rose); font-weight: 700; }

/* ============== Botones ============== */
.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-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); }
.btn-outline-danger { color: var(--rose); border-color: var(--rose); }
.btn-outline-danger:hover { background: rgba(244,63,94,0.1); }
.btn-outline-secondary { color: var(--text-muted); border-color: var(--border); }

/* ============== 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; }

/* ============== Kanban ============== */
.k-kanban {
    display: grid;
    grid-template-columns: repeat(4, minmax(280px, 1fr));
    gap: 12px;
    overflow-x: auto;
}
.k-kanban-col {
    background: var(--bg-soft);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: flex; flex-direction: column;
    min-height: 300px;
}
.k-kanban-head {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    color: #fff;
    font-weight: 700;
    border-radius: var(--radius) var(--radius) 0 0;
}
.k-kanban-head h2 { margin: 0; font-size: 12px; color: inherit; display: flex; align-items: center; gap: 8px; }
.k-col-recibidas  { background: linear-gradient(135deg, #fb923c, #f97316); }
.k-col-aceptadas  { background: linear-gradient(135deg, #22d3ee, #06b6d4); }
.k-col-listas     { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.k-col-terminadas { background: linear-gradient(135deg, #4ade80, #16a34a); }
.k-kanban-body { padding: 10px; flex: 1; overflow-y: auto; max-height: 70vh; }
.k-kanban-empty { color: var(--text-muted); text-align: center; font-size: 10px; padding: 16px; }

.k-order-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.k-order-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.k-order-id { font-weight: 700; color: var(--primary); font-size: 11px; }
.k-order-time { font-size: 9px; color: var(--text-muted); }
.k-order-client { font-size: 10px; font-weight: 600; margin-bottom: 4px; }
.k-order-tag { font-size: 9px; color: var(--primary); margin-bottom: 4px; }
.k-order-items { list-style: none; padding: 0; margin: 6px 0; font-size: 9px; color: var(--text-muted); }
.k-order-items li { display: flex; justify-content: space-between; padding: 2px 0; }
.k-order-code { background: var(--primary-soft); padding: 6px; border-radius: 4px; text-align: center; margin: 6px 0; }
.k-order-code small { display: block; font-size: 8px; color: var(--text-muted); }
.k-order-code strong { font-size: 16px; letter-spacing: 4px; color: var(--primary); }
.k-order-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 6px; margin-top: 6px; }
.k-order-foot strong { font-size: 12px; color: var(--emerald); }
.k-order-actions { display: flex; gap: 4px; margin-top: 8px; }
.k-order-actions .btn { flex: 1; padding: 4px 6px; }

/* ============== 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); }
@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); }
.k-help { font-size: 10px; color: var(--text-muted); margin-bottom: 12px; }

/* ============== Password strength ============== */
.k-pwd-strength { height: 4px; border-radius: 2px; margin-top: 6px; background: var(--border); }
.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); }
.k-pwd-strength::after { content: attr(data-text); display: block; font-size: 9px; margin-top: 4px; color: var(--text-muted); }

/* ============== Tiendas grid (selector) ============== */
.k-tiendas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.k-tienda-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    cursor: pointer;
    transition: all 0.15s;
}
.k-tienda-card input { display: none; }
.k-tienda-card-body { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.k-tienda-logo {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.k-tienda-card strong { font-size: 11px; }
.k-tienda-card small { display: block; font-size: 9px; color: var(--text-muted); }
.k-tienda-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }

.k-link-mini { font-size: 9px; margin-left: 4px; }

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 1100px) {
    .k-grid-3 { grid-template-columns: 1fr; }
    .k-span-2 { grid-column: span 1; }
    .k-kanban { grid-template-columns: repeat(2, minmax(280px, 1fr)); }
}
@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; }
    /* Con el menu abierto se oculta el widget flotante para no tapar el pie */
    body.k-nav-open .k-floating-panel { display: none !important; }
    .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; }
    .k-radio-row { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .k-kanban { grid-template-columns: 1fr; }
    .k-dl { grid-template-columns: 1fr; }
    .k-dl dt { margin-top: 6px; }
    .k-user-info { display: none; }
    .k-step-line { width: 30px; }
}
@media (max-width: 500px) {
    .k-page-head h1 { font-size: 16px; }
    .k-login-card { padding: 20px; }
}

/* ============================================================
   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:not(.k-nav-badge),
    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 modo iconos el contador se vuelve un punto sobre el icono */
    body.k-sidebar-collapsed .k-sidebar .k-nav-item { position: relative; }
    body.k-sidebar-collapsed .k-sidebar .k-nav-item > .k-nav-badge.has {
        display: block !important;
        position: absolute;
        top: 4px;
        right: 10px;
        min-width: 7px;
        width: 7px;
        height: 7px;
        padding: 0;
        font-size: 0;
        line-height: 0;
        border-radius: 50%;
        box-shadow: 0 0 0 2px var(--bg-elev);
    }
    body.k-sidebar-collapsed .k-sidebar:hover .k-nav-item > .k-nav-badge.has {
        display: inline-flex !important;
        position: static;
        min-width: 17px;
        width: auto;
        height: 16px;
        padding: 0 5px;
        font-size: 9px;
        line-height: 1;
        border-radius: 999px;
        box-shadow: none;
    }

    /* 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:not(.k-nav-badge),
    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;
    }
}

/* Boton toggle del sidebar (lo agregamos al 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); }

/* ============================================================
   TABLERO DE PEDIDOS (Kanban)
   Diseno compacto y de alto contraste pensado para usar de pie en
   mostrador: cada columna scrollea sola, la tarjeta muestra lo que
   se necesita para preparar el pedido y las acciones son de un clic.
   ============================================================ */

:root {
    --kb-recibida: #6366f1;
    --kb-aceptada: #06b6d4;
    --kb-lista:    #f59e0b;
    --kb-terminada:#10b981;
}

.kb-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* El tablero ocupa toda la altura que queda bajo la barra superior. */
    height: calc(100vh - var(--topbar-h) - 32px);
    min-height: 420px;
}

/* ---------------- Barra superior ---------------- */
.kb-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.kb-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.kb-title i { color: var(--primary); font-size: 14px; }

.kb-live {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--emerald);
    background: rgba(16, 185, 129, .1);
    padding: 3px 8px;
    border-radius: 999px;
}

.kb-live::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--emerald);
    animation: kbPulse 1.8s infinite;
}

.kb-live.kb-off { color: var(--text-muted); background: rgba(148, 163, 184, .15); }
.kb-live.kb-off::before { background: var(--text-muted); animation: none; }

@keyframes kbPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .35; transform: scale(.8); }
}

.kb-search {
    position: relative;
    flex: 1 1 220px;
    max-width: 330px;
}

.kb-search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 11px;
    pointer-events: none;
}

.kb-search input {
    width: 100%;
    height: 32px;
    padding: 0 10px 0 30px;
    font-size: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text);
    transition: border-color .15s, background .15s;
}

.kb-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.kb-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-wrap: wrap;
}

.kb-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    padding: 4px 9px;
    border-radius: 999px;
    white-space: nowrap;
}

.kb-stat strong { color: var(--text); }
.kb-stat.is-money strong { color: var(--emerald); }

.kb-iconbtn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s;
    flex: 0 0 auto;
}

.kb-iconbtn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.kb-iconbtn.is-off { color: var(--rose); }
.kb-iconbtn.is-off:hover { border-color: var(--rose); background: rgba(244, 63, 94, .08); }
.kb-iconbtn.kb-spin i { animation: kbSpin .7s linear infinite; }

@keyframes kbSpin { to { transform: rotate(360deg); } }

/* ---------------- Tablero ---------------- */
/* Estilo Trello: el tablero se desplaza en horizontal (siempre se pueden
   ver todas las etapas) y cada columna ocupa toda la altura disponible
   scrolleando por dentro. */
.kb-board-wrap {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
}

.kb-board {
    display: flex;
    gap: 12px;
    align-items: stretch;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}
.kb-board::-webkit-scrollbar { height: 10px; }
.kb-board::-webkit-scrollbar-track { background: transparent; }
.kb-board::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .45);
    border-radius: 8px;
}
.kb-board::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, .7); }

/* Sombras en los bordes: avisan que hay etapas hacia los lados. */
.kb-board-wrap::before,
.kb-board-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 10px;
    width: 26px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
    z-index: 3;
}
.kb-board-wrap::before {
    left: 0;
    background: linear-gradient(90deg, var(--bg-soft), rgba(248, 250, 252, 0));
}
.kb-board-wrap::after {
    right: 0;
    background: linear-gradient(270deg, var(--bg-soft), rgba(248, 250, 252, 0));
}
.kb-board-wrap.kb-can-left::before { opacity: .9; }
.kb-board-wrap.kb-can-right::after { opacity: .9; }

/* Botones para desplazar el tablero (like Trello). */
.kb-scroll-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.kb-scroll {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
}
.kb-scroll:hover:not(:disabled) {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-soft);
}
.kb-scroll:disabled { opacity: .35; cursor: default; }

.kb-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* Ancho fijo: las 5 etapas siempre se recorren deslizando a la derecha. */
    flex: 0 0 288px;
    width: 288px;
    max-width: 288px;
    scroll-snap-align: start;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.kb-col[data-estado="Recibida"]  { --st: var(--kb-recibida); }
.kb-col[data-estado="Aceptada"]  { --st: var(--kb-aceptada); }
.kb-col[data-estado="Lista"]     { --st: var(--kb-lista); }
.kb-col[data-estado="Terminada"] { --st: var(--kb-terminada); }

.kb-col-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    border-top: 3px solid var(--st);
    flex-shrink: 0;
}

.kb-col-head h2 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: var(--text);
}

.kb-col-head h2 i { color: var(--st); font-size: 12px; }

.kb-col-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--st);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
}

.kb-col-total {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.kb-col-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 9px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
}

.kb-col-body::-webkit-scrollbar { width: 7px; }
.kb-col-body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .45);
    border-radius: 8px;
}
.kb-col-body::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, .7); }

.kb-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 26px 12px;
    color: var(--text-muted);
    font-size: 10px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: 10px;
}

.kb-empty i { font-size: 22px; opacity: .35; }

/* ---------------- Tarjeta ---------------- */
.kb-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 9px 10px 8px 13px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
    animation: kbCardIn .18s ease both;
}

.kb-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--st);
}

.kb-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .12);
    border-color: var(--st);
}

.kb-card.kb-new { animation: kbNew .9s ease; }
.kb-card.kb-busy { opacity: .55; pointer-events: none; }

@keyframes kbCardIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}

@keyframes kbNew {
    0%   { box-shadow: 0 0 0 0 var(--st); }
    40%  { box-shadow: 0 0 0 4px var(--st); }
    100% { box-shadow: var(--shadow-sm); }
}

.kb-card-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

.kb-id {
    font-size: 11px;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.kb-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-soft);
    border-radius: 999px;
    padding: 2px 7px;
    white-space: nowrap;
}

.kb-time.is-warn { color: #b45309; background: rgba(245, 158, 11, .13); }
.kb-time.is-late { color: #be123c; background: rgba(244, 63, 94, .13); }
.kb-time.is-late i { animation: kbBlink 1.1s infinite; }

@keyframes kbBlink { 50% { opacity: .25; } }

.kb-client {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 7px;
}

.kb-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: .3px;
    background: linear-gradient(135deg, #818cf8, #6366f1);
}

.kb-client-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kb-chips {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 7px;
}

.kb-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 700;
    background: var(--bg-soft);
    color: var(--text-muted);
    border: 1px solid transparent;
    white-space: nowrap;
}

.kb-chip i { font-size: 9px; }
.kb-chip-delivery { color: var(--st); background: transparent; border-color: var(--border); }
.kb-chip-code { color: #7c3aed; background: rgba(139, 92, 246, .1); font-variant-numeric: tabular-nums; }
.kb-chip-comment { cursor: pointer; }
.kb-chip-comment:hover { color: var(--primary); background: var(--primary-soft); }
.kb-chip-comment.has { color: var(--primary); background: var(--primary-soft); }

.kb-items {
    list-style: none;
    margin: 0 0 7px;
    padding: 6px 8px;
    background: var(--bg-soft);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.kb-items li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 10px;
    color: var(--text);
    line-height: 1.35;
}

.kb-items li span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kb-items li .kb-qty {
    font-weight: 800;
    color: var(--st);
    flex-shrink: 0;
}

.kb-items li .kb-price {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.kb-more {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    padding-left: 2px;
    cursor: pointer;
}

.kb-foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px dashed var(--border);
    margin-bottom: 7px;
}

.kb-total {
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.kb-commission {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.kb-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.kb-btn-main {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 28px;
    border: none;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .2px;
    color: #fff;
    background: var(--st);
    cursor: pointer;
    transition: filter .15s, transform .1s;
}

.kb-btn-main:hover { filter: brightness(1.07); }
.kb-btn-main:active { transform: scale(.98); }

.kb-ico {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: all .15s;
    flex: 0 0 auto;
}

.kb-ico:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.kb-ico.kb-ico-danger:hover { color: var(--rose); border-color: var(--rose); background: rgba(244, 63, 94, .08); }

/* La columna de terminados es solo consulta */
.kb-col[data-estado="Terminada"] .kb-card { cursor: default; opacity: .92; }
.kb-col[data-estado="Terminada"] .kb-card:hover { transform: none; }

/* ---------------- Modal (comentarios / codigo) ---------------- */
.kb-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9500;
    padding: 16px;
    backdrop-filter: blur(2px);
}

.kb-modal.show { display: flex; }

.kb-modal-box {
    width: 100%;
    max-width: 420px;
    max-height: 82vh;
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: kbCardIn .18s ease;
}

.kb-modal-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.kb-modal-head h3 {
    margin: 0;
    font-size: 12px;
    font-weight: 800;
    color: var(--text);
}

.kb-modal-head h3 i { color: var(--primary); margin-right: 5px; }

.kb-modal-head button {
    margin-left: auto;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 7px;
    background: var(--bg-soft);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.kb-modal-head button:hover { color: var(--rose); }

.kb-modal-body {
    flex: 1;
    min-height: 80px;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-soft);
}

.kb-modal-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
}

.kb-modal-foot textarea {
    flex: 1;
    resize: none;
    min-height: 34px;
    max-height: 90px;
    padding: 7px 10px;
    font-size: 11px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text);
    font-family: inherit;
}

.kb-modal-foot textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
}

.kb-modal-foot button.kb-send {
    height: 34px;
    padding: 0 14px;
    border: none;
    border-radius: 8px;
    background: var(--gradient-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.kb-modal-foot button.kb-send:disabled { opacity: .6; cursor: default; }

.kb-comment {
    max-width: 88%;
    padding: 7px 10px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 11px;
    color: var(--text);
}

.kb-comment.mine {
    align-self: flex-end;
    background: var(--primary-soft);
    border-color: transparent;
}

.kb-comment small {
    display: block;
    font-size: 9px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.kb-comment-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 10px;
    padding: 24px 10px;
}

.kb-comment-empty i { display: block; font-size: 22px; opacity: .4; margin-bottom: 6px; }

/* Campo del codigo de verificacion */
.kb-code-input {
    width: 100%;
    height: 52px;
    text-align: center;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 10px;
    border-radius: 10px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.kb-code-input:focus {
    outline: none;
    border-color: var(--emerald);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .15);
}

.kb-hint {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1200px) {
    /* El tablero sigue siendo horizontal, solo se angosta un poco mas. */
    .kb-col { flex-basis: 268px; width: 268px; max-width: 268px; }
}

@media (max-width: 700px) {
    .kb-col { flex-basis: min(288px, 84vw); width: min(288px, 84vw); max-width: min(288px, 84vw); }
    .kb-stats { margin-left: 0; }
    .kb-wrap { height: calc(100vh - var(--topbar-h) - 24px); }
}


/* ============================================================
   ESTILOS COMPLEMENTARIOS
   (clases usadas en vistas pero que faltaban en site.css)
   ============================================================ */

/* --- k-act-btn y k-action-trigger: botones de acciï¿½n ---
   estilo consistente con el sistema (similar a Admin pero propio del tema) */
.k-action-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}
.k-action-trigger:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.k-action-trigger:active { transform: translateY(0); }
.k-action-trigger i { font-size: 11px; }

.k-act-btn {
    border: none;
    border-radius: 6px;
    padding: 5px 6px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.15s;
    background: var(--bg-soft);
    color: var(--text);
}
.k-act-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.k-act-success { background: var(--emerald); color: #fff; }
.k-act-success:hover { background: #059669; }
.k-act-primary { background: var(--primary-soft); color: var(--primary); }
.k-act-primary:hover { background: var(--primary); color: #fff; }
.k-act-danger  { background: rgba(244,63,94,0.1); color: var(--rose); }
.k-act-danger:hover { background: var(--rose); color: #fff; }

/* --- k-badge-primary: variante neutral/primary --- */
.k-badge-primary { background: var(--primary-soft); color: var(--primary); }

/* --- k-modal (variante generica no usada actualmente pero solicitada) --- */
.k-modal { display: none; position: fixed; inset: 0; z-index: 9000; background: rgba(0,0,0,0.6); align-items: center; justify-content: center; backdrop-filter: blur(3px); }
.k-modal.show { display: flex; animation: kFadeUp 0.2s; }
.k-modal-content { background: var(--surface); border-radius: 12px; max-width: 90vw; max-height: 90vh; overflow: hidden; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.k-modal-header { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: var(--bg-soft); }
.k-modal-body { padding: 16px; overflow: auto; flex: 1; }
.k-modal-footer { padding: 12px 16px; border-top: 1px solid var(--border); background: var(--bg-soft); display: flex; justify-content: flex-end; gap: 8px; }
.k-modal-close { background: transparent; border: none; font-size: 18px; cursor: pointer; color: var(--text-muted); padding: 4px 8px; border-radius: 6px; }
.k-modal-close:hover { background: var(--bg-soft); color: var(--rose); }

/* Las clases .k-switch / .k-switch-slider / .k-switch-label / .k-switch-input ya estan definidas arriba (linea 378).
   Aqui solo dejamos un placeholder para evitar un bloque vacio. */

/* --- Stepper (k-stepper, k-step, k-step-num, k-step-label, k-step-line) --- */
.k-stepper { display: flex; align-items: center; gap: 6px; padding: 8px 0; }
.k-step { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.k-step-num { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-muted); font-size: 11px; font-weight: 700; }
.k-step.active .k-step-num { background: var(--gradient-primary); color: #fff; border-color: transparent; box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3); }
.k-step.done .k-step-num { background: var(--emerald); color: #fff; border-color: transparent; }
.k-step-label { font-size: 10px; color: var(--text-muted); text-align: center; font-weight: 600; }
.k-step.active .k-step-label, .k-step.done .k-step-label { color: var(--text); }
.k-step-line { flex: 0 0 30px; height: 2px; background: var(--border); margin: 0 -4px 18px; align-self: center; }
.k-step-line.done { background: var(--emerald); }

/* --- Helpers de texto --- */
.k-text-center { text-align: center; }

/* --- Card list / mobile card (utilizadas en vistas responsive) --- */
.k-card-list { display: none; flex-direction: column; gap: 10px; padding: 14px; }
.k-mobile-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px; box-shadow: var(--shadow-sm); }
.k-mobile-card-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); margin-bottom: 10px; }
.k-mobile-card-body { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 11px; }
.k-mobile-card-foot { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); display: flex; gap: 6px; justify-content: flex-end; }

/* --- Toolbar / search / 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: 8px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.k-toolbar-search { flex: 1; min-width: 200px; position: relative; }
.k-toolbar-search input { width: 100%; padding: 8px 12px 8px 32px; border: 1px solid var(--border); border-radius: 8px; font-size: 12px; background: var(--bg-soft); color: var(--text); }
.k-toolbar-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1); }
.k-toolbar-search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 11px; }
.k-filters-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.k-filter-group { display: flex; gap: 6px; align-items: center; }
.k-search-box { position: relative; flex: 1; min-width: 200px; }
.k-search-box input { padding: 8px 12px 8px 32px; border: 1px solid var(--border); border-radius: 8px; font-size: 12px; background: var(--bg-soft); color: var(--text); width: 100%; }
.k-search-box i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.k-results-count { font-size: 11px; color: var(--text-muted); padding: 4px 10px; background: var(--bg-soft); border-radius: 999px; }

/* --- Dropzone para upload de imagenes --- */
.k-dropzone { border: 2px dashed var(--border); border-radius: 12px; padding: 24px; text-align: center; background: var(--bg-soft); cursor: pointer; transition: all 0.15s; }
.k-dropzone:hover { border-color: var(--primary); background: var(--primary-soft); }
.k-dropzone-content { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12px; }
.k-dropzone-content i { font-size: 32px; color: var(--primary); }
.k-dropzone-input { display: none; }
.k-doc-loading { text-align: center; color: var(--text-muted); padding: 16px; font-size: 12px; }
.k-doc-modal { display: none; position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.75); align-items: center; justify-content: center; }
.k-doc-modal.show { display: flex; }
.k-doc-modal-content { background: #0f172a; border-radius: 12px; max-width: 92vw; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; }
.k-doc-modal-header { padding: 12px 18px; background: var(--surface); color: var(--text); display: flex; justify-content: space-between; align-items: center; }
.k-doc-modal-body { padding: 0; overflow: auto; flex: 1; display: flex; align-items: center; justify-content: center; }
.k-doc-modal-body img, .k-doc-modal-body iframe { max-width: 100%; max-height: 80vh; }
.k-doc-modal-close { background: transparent; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); }
.k-doc-modal-close:hover { color: var(--rose); }

/* --- Productos layout --- */
.k-product-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.k-product-image { display: flex; flex-direction: column; gap: 10px; }
.k-product-fields { display: flex; flex-direction: column; gap: 12px; }
.k-product-thumb { width: 80px; height: 80px; border-radius: 8px; background: var(--bg-soft); border: 1px solid var(--border); overflow: hidden; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.k-product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.k-product-thumb-empty { color: var(--text-muted); font-size: 20px; }
.k-img-upload-area { border: 2px dashed var(--border); border-radius: 12px; padding: 18px; text-align: center; cursor: pointer; background: var(--bg-soft); }
.k-img-upload-area:hover { border-color: var(--primary); }
.k-img-placeholder { color: var(--text-muted); font-size: 11px; }
.k-img-preview { max-width: 100%; max-height: 160px; border-radius: 8px; border: 1px solid var(--border); }
.k-img-modal { display: none; position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.85); align-items: center; justify-content: center; }
.k-img-modal.show { display: flex; }
.k-img-modal-img { max-width: 92vw; max-height: 90vh; border-radius: 8px; }
.k-img-modal-close { position: absolute; top: 20px; right: 24px; background: rgba(255,255,255,0.1); border: none; color: #fff; font-size: 28px; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; }
.k-img-file-input { display: none; }
.k-img-remove { background: var(--rose); color: #fff; border: none; padding: 6px 10px; border-radius: 6px; font-size: 11px; cursor: pointer; }

/* --- Upload queue --- */
.k-upload-queue { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.k-upload-item { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--border); padding: 8px 10px; border-radius: 8px; font-size: 11px; }
.k-upload-item-icon { font-size: 16px; color: var(--primary); }
.k-upload-item-info { flex: 1; }
.k-upload-item-info strong { display: block; }
.k-upload-item-info small { color: var(--text-muted); }
.k-upload-item-size { color: var(--text-muted); font-size: 10px; }
.k-upload-item-status { font-size: 10px; padding: 2px 8px; border-radius: 999px; }
.k-upload-item-status[data-status='ok'] { background: rgba(16,185,129,0.1); color: var(--emerald); }
.k-upload-item-status[data-status='err'] { background: rgba(244,63,94,0.1); color: var(--rose); }
.k-upload-item-status[data-status='pending'] { background: rgba(245,158,11,0.1); color: var(--amber); }
.k-upload-item-remove { background: transparent; border: none; color: var(--rose); cursor: pointer; }

/* --- Tickets chat --- */
.k-ticket-thread { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.k-ticket-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--gradient-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.k-ticket-bubble { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; font-size: 12px; max-width: 80%; }
.k-ticket-bubble.k-ticket-msg-self { align-self: flex-end; background: var(--primary); color: #fff; border-color: var(--primary); }
.k-ticket-bubble p { margin: 0; line-height: 1.4; }
.k-ticket-msg { display: flex; gap: 8px; align-items: flex-end; }
.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); }

/* --- Cantidad monedas en dl --- */
.k-amount-emerald { color: var(--emerald); font-weight: 700; }
.k-amount-rose { color: var(--rose); font-weight: 700; }

/* --- Stepper punto adicional --- */
.k-step.active, .k-step.done { /* duplicado para consistencia */ }

/* ============================================================
   Controles compactos y tabs
   Los .form-control/.btn del tema base miden 40px y 10px de fuente:
   en pantallas con varios campos (configuracion, horarios) eso
   empujaba el contenido fuera de pantalla. Aqui van las versiones
   compactas: .form-control-sm, .btn-sm, .k-table-compact y .k-tabs.
   ============================================================ */
.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; }
.btn-sm { font-size: 9px; padding: 3px 9px; border-radius: 6px; line-height: 1.4; }

.k-table-compact thead th { padding: 6px 10px; }
.k-table-compact tbody td { padding: 5px 10px; }
.k-table-compact tbody td .btn { font-size: 9px; padding: 3px 8px; }

/* Tabs */
.k-tabs {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
}
.k-tabs li a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    border-radius: var(--radius) var(--radius) 0 0;
    cursor: pointer;
}
.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-tabs li a .k-badge { font-size: 8px; padding: 2px 6px; }
.k-tab-panel { display: none; }
.k-tab-panel.active { display: block; }

/* Layout compacto de dos columnas: bloque de ajustes | horarios */
.k-compact-grid {
    display: grid;
    grid-template-columns: minmax(260px, 330px) 1fr;
    gap: 14px;
    align-items: start;
}
@media (max-width: 991px) {
    .k-compact-grid { grid-template-columns: 1fr; }
}
.k-compact-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 3px 0;
}
.k-compact-label {
    font-size: 11px;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}
.k-compact-sep {
    border-top: 1px solid var(--border);
    margin: 10px 0 8px;
    padding-top: 8px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

/* Switch compacto */
.k-switch-sm { gap: 8px !important; padding: 2px 0 !important; min-height: 22px !important; }
.k-switch-sm > .k-switch-slider { width: 34px !important; height: 18px !important; min-width: 34px !important; }
.k-switch-sm > .k-switch-slider::before { width: 14px; height: 14px; top: 2px; left: 2px; }
.k-switch-sm > input[type="checkbox"]:checked ~ .k-switch-slider::before { transform: translateX(16px); }
.k-switch-sm > .k-switch-label { font-size: 11px !important; }

/* Dropzone compacto para la pestana de subida */
.k-dropzone-sm { padding: 22px 16px; }
.k-dropzone-sm .k-dropzone-content i { font-size: 28px; margin-bottom: 4px; }
.k-dropzone-sm .k-dropzone-content h3 { font-size: 13px; }
/* ============================================================
   Barra de filtros compacta
   Las clases k-filter-* existen en el CSS del admin pero no en el de
   la tienda: por eso los filtros del historial se apilaban a todo lo
   ancho. Aqui van, en version mas compacta.
   ============================================================ */
.k-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}
.k-filter-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 132px;
}
.k-filter-field.k-w-sm { width: 104px; }
.k-filter-field.k-w-xs { width: 88px; }
.k-filter-field.k-w-mes { width: 128px; }
.k-filter-field.k-w-md { width: 168px; }
.k-filter-field.k-flex-1 { flex: 1 1 180px; width: auto; min-width: 150px; }
.k-filter-field label {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1;
}
.k-filter-spacer { flex: 1 1 auto; }
.k-filter-count {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    padding-bottom: 7px;
}
.k-filter-count strong { color: var(--text); }
@media (max-width: 700px) {
    .k-filter-field, .k-filter-field.k-w-sm, .k-filter-field.k-w-xs, .k-filter-field.k-w-md {
        width: 100%;
    }
}

/* ============================================================
   COMPONENTES: metricas, fichas KPI y layout compacto
   (Metricas usaba clases k-stat-* y k-info-* que nunca existieron,
   por eso la pantalla se veia sin estilo; aqui van las de verdad)
   ============================================================ */

/* --- Rejilla de indicadores --- */
.k-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.k-kpi {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px 10px 14px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow .15s, transform .15s;
}

.k-kpi:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.k-kpi::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--kpi, var(--primary));
}

.k-kpi-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-muted);
    white-space: nowrap;
}

.k-kpi-label i { color: var(--kpi, var(--primary)); font-size: 11px; }

.k-kpi-value {
    margin-top: 4px;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.05;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

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

/* --- Medidor horizontal --- */
.k-meter { margin-bottom: 11px; }
.k-meter:last-child { margin-bottom: 0; }

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

.k-meter-head span { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.k-meter-head i { color: var(--m, var(--primary)); font-size: 10px; }
.k-meter-head strong { font-size: 12px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }

.k-meter-track {
    height: 8px;
    border-radius: 6px;
    background: var(--bg-soft);
    overflow: hidden;
}

.k-meter-fill {
    height: 100%;
    border-radius: 6px;
    background: var(--m, var(--primary));
    transition: width .45s ease;
}

/* --- Calificacion --- */
.k-rating-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.k-rating-main { text-align: center; min-width: 96px; }
.k-rating-big {
    font-size: 38px;
    font-weight: 800;
    line-height: 1;
    color: var(--amber);
    font-variant-numeric: tabular-nums;
}

.k-stars { color: var(--amber); font-size: 14px; letter-spacing: 1px; margin-top: 4px; }
.k-stars .off { color: var(--border); }

.k-dist { flex: 1; min-width: 220px; }

.k-dist-row {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px;
}

.k-dist-row:last-child { margin-bottom: 0; }

.k-dist-label {
    min-width: 34px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 700;
    color: var(--amber);
}

.k-dist-track {
    flex: 1;
    height: 7px;
    border-radius: 5px;
    background: var(--bg-soft);
    overflow: hidden;
}

.k-dist-fill {
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.k-dist-count {
    min-width: 24px;
    text-align: right;
    font-size: 10px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* --- Lista de recomendaciones --- */
.k-tips { margin: 0; padding: 0; list-style: none; }
.k-tips li {
    display: flex;
    gap: 7px;
    padding: 5px 0;
    font-size: 11px;
    line-height: 1.45;
    color: var(--text);
    border-bottom: 1px dashed var(--border);
}
.k-tips li:last-child { border-bottom: none; }
.k-tips li i { color: var(--primary); font-size: 11px; margin-top: 2px; flex-shrink: 0; }

/* --- Layout de dos columnas (aside + contenido) --- */
.k-grid-aside {
    display: grid;
    grid-template-columns: 296px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.k-form-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 10px;
}

.k-field { display: flex; flex-direction: column; gap: 3px; }
.k-field.k-span-all { grid-column: 1 / -1; }

.k-field label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-muted);
    line-height: 1.2;
}

.k-field .form-control {
    height: 32px;
    min-height: 32px;
    padding: 4px 9px;
    font-size: 12px;
    border-radius: 7px;
}

.k-field textarea.form-control { height: auto; min-height: 54px; padding: 6px 9px; }
.k-field .req { color: var(--rose); }

@media (max-width: 1100px) {
    .k-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .k-grid-aside { grid-template-columns: 1fr; }
    .k-form-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .k-kpi-grid { grid-template-columns: 1fr 1fr; }
    .k-form-3 { grid-template-columns: 1fr; }
    .k-kpi-value { font-size: 20px; }
}


/* ============================================================
   MANUAL DE USUARIO
   Pagina de consulta: indice fijo a la izquierda, secciones a la
   derecha y buscador que filtra al escribir.
   ============================================================ */

.mn-wrap {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

/* --- Indice --- */
.mn-toc {
    position: sticky;
    top: calc(var(--topbar-h) + 12px);
    max-height: calc(100vh - var(--topbar-h) - 24px);
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    box-shadow: var(--shadow-sm);
}

.mn-toc-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-muted);
    padding: 2px 4px 6px;
}

.mn-search { position: relative; margin-bottom: 8px; }
.mn-search i {
    position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 10px; pointer-events: none;
}
.mn-search input {
    width: 100%;
    height: 30px;
    padding: 0 8px 0 26px;
    font-size: 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--bg-soft);
    color: var(--text);
}
.mn-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 2px var(--primary-soft);
}

.mn-toc nav { display: flex; flex-direction: column; gap: 1px; }

.mn-toc nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 500;
    color: var(--text-muted);
    transition: background .12s, color .12s;
}
.mn-toc nav a i { width: 12px; font-size: 9px; opacity: .7; }
.mn-toc nav a:hover { background: var(--bg-soft); color: var(--text); }
.mn-toc nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.mn-toc nav a.active i { opacity: 1; }

/* --- Contenido --- */
.mn-content { min-width: 0; }

.mn-hero {
    background: linear-gradient(135deg, var(--primary-soft), var(--surface));
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.mn-hero h1 {
    display: flex; align-items: center; gap: 8px;
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
}
.mn-hero h1 i { color: var(--primary); }
.mn-hero p { margin: 0; font-size: 11.5px; line-height: 1.55; color: var(--text-muted); }

.mn-sec {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    scroll-margin-top: calc(var(--topbar-h) + 12px);
}

.mn-sec > h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
}
.mn-sec > h2 i { color: var(--primary); font-size: 13px; }

.mn-sec h3 {
    margin: 14px 0 5px;
    font-size: 11.5px;
    font-weight: 800;
    color: var(--text);
    text-transform: none;
}

.mn-lead { margin: 0 0 8px; font-size: 11px; color: var(--text-muted); line-height: 1.5; }

.mn-sec p, .mn-sec li { font-size: 11.5px; line-height: 1.6; color: var(--text); }
.mn-sec p { margin: 6px 0; }
.mn-sec ul, .mn-sec ol { margin: 6px 0; padding-left: 18px; }
.mn-sec li { margin-bottom: 3px; }
.mn-sec li strong { font-weight: 700; }
.mn-sec a { color: var(--primary); font-weight: 600; }

/* --- Tablas --- */
.mn-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    margin: 8px 0;
}
.mn-table th {
    text-align: left;
    background: var(--bg-soft);
    padding: 6px 8px;
    font-size: 8.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.mn-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    line-height: 1.5;
}
.mn-table tr:last-child td { border-bottom: none; }
.mn-table td code, .mn-table td b { font-weight: 700; }

/* --- Avisos --- */
.mn-note {
    display: flex;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.5;
    margin: 8px 0;
    border-left: 3px solid var(--border);
    background: var(--bg-soft);
}
.mn-note i { margin-top: 2px; flex-shrink: 0; }
.mn-note.info { background: rgba(6, 182, 212, .09); border-color: var(--cyan); }
.mn-note.info i { color: var(--cyan); }
.mn-note.warn { background: rgba(245, 158, 11, .11); border-color: var(--amber); }
.mn-note.warn i { color: var(--amber); }
.mn-note.ok { background: rgba(16, 185, 129, .10); border-color: var(--emerald); }
.mn-note.ok i { color: var(--emerald); }
.mn-note.danger { background: rgba(244, 63, 94, .09); border-color: var(--rose); }
.mn-note.danger i { color: var(--rose); }

/* --- Pasos del flujo --- */
.mn-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0;
}
.mn-step {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 8px 10px;
}
.mn-step b {
    display: block;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--primary);
    margin-bottom: 2px;
}
.mn-step span { font-size: 10.5px; line-height: 1.4; color: var(--text); }

/* --- Tecla --- */
.mn-kbd {
    display: inline-block;
    padding: 1px 5px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-soft);
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-sans);
}

/* --- Boton imprimir --- */
.mn-print {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}
.mn-print:hover { color: var(--primary); border-color: var(--primary); }

/* --- Ocultar secciones al buscar --- */
.mn-sec.mn-oculta { display: none; }

@media (max-width: 1000px) {
    .mn-wrap { grid-template-columns: 1fr; }
    .mn-toc { position: static; max-height: none; }
    .mn-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
    .k-sidebar, .k-topbar, .k-floating-panel, .mn-toc, .mn-print, #kToastContainer { display: none !important; }
    .k-main { margin: 0 !important; padding: 0 !important; }
    .mn-wrap { grid-template-columns: 1fr; }
    .mn-sec { break-inside: avoid; box-shadow: none; }
}


/* ============================================================
   CONSEJO DEL PORTAL
   Modal pequeno que aparece de vez en cuando con un tip util.
   Se retrasa unos segundos y se puede cerrar o desactivar.
   ============================================================ */

.ktip-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .42);
    z-index: 9400;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity .2s ease;
}

.ktip-overlay.ktip-show { display: flex; opacity: 1; }

.ktip-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border-radius: 16px;
    padding: 18px 18px 14px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .32);
    border: 1px solid var(--border);
    transform: translateY(10px);
    transition: transform .22s ease;
}

.ktip-overlay.ktip-show .ktip-card { transform: translateY(0); }

.ktip-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 7px;
    background: var(--bg-soft);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ktip-close:hover { color: var(--rose); background: rgba(244, 63, 94, .1); }

.ktip-icono {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: #fff;
    font-size: 18px;
    margin-bottom: 10px;
    box-shadow: 0 6px 14px rgba(249, 115, 22, .28);
}

.ktip-etiqueta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 8.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 3px 8px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.ktip-titulo {
    margin: 0 0 5px;
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.3;
}

.ktip-texto {
    margin: 0;
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--text-muted);
}

.ktip-texto b { color: var(--text); font-weight: 700; }

.ktip-accion {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 9px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
}

.ktip-accion:hover { text-decoration: underline; }

.ktip-pie {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.ktip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.ktip-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

.ktip-btn-ok {
    flex: 1;
    border: none;
    background: var(--gradient-primary);
    color: #fff;
}

.ktip-btn-ok:hover { filter: brightness(1.07); background: var(--gradient-primary); color: #fff; }

.ktip-nunca {
    display: block;
    margin: 10px auto 0;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 9.5px;
    cursor: pointer;
    text-decoration: underline;
    opacity: .8;
}

.ktip-nunca:hover { color: var(--rose); opacity: 1; }

.ktip-contador {
    margin-left: auto;
    font-size: 9px;
    color: var(--text-muted);
    opacity: .75;
}

/* Punto de aviso en el menu (pagos pendientes) */
.k-nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rose); margin-left: auto; display: inline-block; flex-shrink: 0; }
