/* ============================================================
   LA NOTA — Overrides globales del admin
   Color primario corporativo: #eca411
   ============================================================ */

:root {
    --lanota-primary: #eca411;
    --lanota-primary-hover: #d29410;
    --lanota-primary-soft: #fff4dd;
    --bs-primary: #eca411;
    --bs-primary-rgb: 236, 164, 17;
    --color-primary: #eca411;
}

/* ====== Color primario en todo el theme ====== */
.text-primary, .color-primary, a.color-primary { color: var(--lanota-primary) !important; }
.bg-primary { background-color: var(--lanota-primary) !important; color: #fff !important; }
.btn-primary {
    background-color: var(--lanota-primary) !important;
    border-color: var(--lanota-primary) !important;
    color: #fff !important;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--lanota-primary-hover) !important;
    border-color: var(--lanota-primary-hover) !important;
    color: #fff !important;
}
.btn-outline-primary {
    color: var(--lanota-primary) !important;
    border-color: var(--lanota-primary) !important;
    background-color: transparent !important;
}
.btn-outline-primary:hover {
    background-color: var(--lanota-primary) !important;
    color: #fff !important;
}
a { color: var(--lanota-primary); }
a:hover { color: var(--lanota-primary-hover); }
.dot-primary { background-color: var(--lanota-primary) !important; }
.page-link { color: var(--lanota-primary); }
.page-item.active .page-link,
.page-link:hover {
    background-color: var(--lanota-primary);
    border-color: var(--lanota-primary);
    color: #fff;
}
.form-check-input:checked {
    background-color: var(--lanota-primary) !important;
    border-color: var(--lanota-primary) !important;
}
.form-control:focus, .form-select:focus {
    border-color: var(--lanota-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(236, 164, 17, 0.18) !important;
}

/* ====== Botones squared (icon-only) ====== */
.btn-icon-square {
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
    line-height: 1 !important;
    text-align: center !important;
    vertical-align: middle !important;
}
.btn-icon-square > i {
    font-size: 16px !important;
    line-height: 1 !important;
    display: inline-block !important;
    margin: 0 !important;
}

/* Botones de acciones del datatable: primary + icono blanco */
td .btn-icon-square,
td .btn-icon-square:hover,
td .btn-icon-square:focus,
td .btn-icon-square:active {
    background-color: var(--lanota-primary) !important;
    border-color: var(--lanota-primary) !important;
    color: #fff !important;
}
td .btn-icon-square:hover {
    background-color: var(--lanota-primary-hover) !important;
    border-color: var(--lanota-primary-hover) !important;
}
td .btn-icon-square > i { color: #fff !important; }
/* Asegurar que delete y action-btn dentro de form/td estén alineados */
td form.d-inline,
td form { display: inline-block !important; vertical-align: middle; }
td form .btn-icon-square { margin: 0 2px; }

/* ====== Paginador squared ====== */
.lanota-pager__btn {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--lanota-primary);
    border: 1px solid var(--lanota-primary);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .12s, border-color .12s, transform .12s;
}
.lanota-pager__btn:hover {
    background: var(--lanota-primary-hover);
    border-color: var(--lanota-primary-hover);
    color: #fff;
}
.lanota-pager__btn:active { transform: translateY(1px); }
.lanota-pager__btn[disabled],
.lanota-pager__btn:disabled {
    background: #f4f5f7;
    border-color: #e3e6ed;
    color: #c8cdd4;
    cursor: not-allowed;
    pointer-events: none;
}
.lanota-pager__btn > i {
    font-size: 20px;
    line-height: 1;
    display: inline-block;
}

/* ====== Datatable toolbar ====== */
.lanota-datatable__perpage { width: 75px; }
.lanota-datatable__search {
    width: 280px;
    max-width: 100%;
    border: 1px solid #e3e6ed;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    transition: box-shadow .12s, border-color .12s;
}
.lanota-datatable__search .input-group-text,
.lanota-datatable__search .form-control {
    background-color: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
    height: 30px;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 30px;
    font-size: .85rem;
}
.lanota-datatable__search .input-group-text {
    padding-left: 10px;
    padding-right: 4px;
    color: #a3a8b3;
}
.lanota-datatable__search .form-control { padding-left: 4px; }
.lanota-datatable__search:focus-within {
    border-color: var(--lanota-primary);
    box-shadow: 0 0 0 3px rgba(236, 164, 17, 0.18);
}
.lanota-datatable__search .form-control:focus {
    box-shadow: none !important;
    border: 0 !important;
}

/* ====== Empty state ====== */
.lanota-datatable__empty-icon {
    font-size: 64px;
    color: #c8cdd4;
    line-height: 1;
}

/* ====== Tabla: ajustes ====== */
.lanota-datatable__table thead tr.userDatatable-header th {
    border-bottom: 1px solid #eef0f4;
    background: #f8f9fb;
    padding-top: 12px;
    padding-bottom: 12px;
}
.lanota-datatable__table tbody tr { border-bottom: 1px solid #f3f4f8; }
.lanota-datatable__table tbody tr:last-child { border-bottom: 0; }

/* ====== Badges estandarizados ======
   Default: primary + texto blanco + bordes pequeños (no píldora). */
.badge {
    background-color: var(--lanota-primary);
    color: #fff;
    border-radius: 4px !important;
    padding: 4px 8px !important;
    font-weight: 500;
    font-size: 0.75rem;
    line-height: 1.2;
}
/* Status badges semánticos (mantienen color) */
.badge.bg-success, .badge.bg-success-subtle {
    background-color: #20c997 !important; color: #fff !important;
}
.badge.bg-warning, .badge.bg-warning-subtle {
    background-color: #ffc107 !important; color: #333 !important;
}
.badge.bg-danger, .badge.bg-danger-subtle {
    background-color: #dc3545 !important; color: #fff !important;
}
.badge.bg-info, .badge.bg-info-subtle {
    background-color: #0dcaf0 !important; color: #fff !important;
}
.badge.bg-secondary, .badge.bg-secondary-subtle {
    background-color: #868eae !important; color: #fff !important;
}
/* bg-light queda con primary también */
.badge.bg-light, .badge.bg-light-subtle, .badge.bg-light.text-dark {
    background-color: var(--lanota-primary) !important;
    color: #fff !important;
}

/* code dentro tabla — limpiar */
.lanota-datatable__table code { background: transparent; color: #5a5f7d; }

/* ====== Toolbar "+ Nuevo" fuera del card ====== */
.lanota-datatable__create-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}
.lanota-datatable__create-row .btn {
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 500;
}
.lanota-datatable__create-row .btn i { margin-right: 4px; }

/* ====== Forms full width ====== */
.lanota-form-wrapper { width: 100%; }

/* ====== Botón estándar (<x-admin.btn>) ====== */
.lanota-btn {
    --lanota-btn-bg: var(--lanota-primary);
    --lanota-btn-bg-hover: var(--lanota-primary-hover);
    --lanota-btn-color: #fff;
    --lanota-btn-border: var(--lanota-primary);

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    border-radius: 6px;
    border: 1px solid var(--lanota-btn-border);
    background-color: var(--lanota-btn-bg);
    color: var(--lanota-btn-color);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .12s, border-color .12s, box-shadow .12s, color .12s;
    white-space: nowrap;
    user-select: none;
}
.lanota-btn:hover,
.lanota-btn:focus {
    background-color: var(--lanota-btn-bg-hover);
    border-color: var(--lanota-btn-bg-hover);
    color: var(--lanota-btn-color);
    text-decoration: none;
}
.lanota-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(236, 164, 17, 0.25);
    outline: none;
}
.lanota-btn:active { transform: translateY(1px); }
.lanota-btn.disabled,
.lanota-btn:disabled {
    opacity: 0.55;
    pointer-events: none;
}
.lanota-btn > i { font-size: 16px; line-height: 1; }
.lanota-btn > span { line-height: 1; }
/* Si el slot está vacío (solo ícono), centrar */
.lanota-btn:has(> span:empty) { padding: 0 12px; }
.lanota-btn:has(> span:empty) > span { display: none; }

/* Tamaños */
.lanota-btn--sm { height: 30px; padding: 0 12px; font-size: 0.8rem; }
.lanota-btn--sm > i { font-size: 14px; }
.lanota-btn--lg { height: 44px; padding: 0 20px; font-size: 0.95rem; }

/* Variantes */
.lanota-btn--primary {
    --lanota-btn-bg: var(--lanota-primary);
    --lanota-btn-bg-hover: var(--lanota-primary-hover);
    --lanota-btn-color: #fff;
    --lanota-btn-border: var(--lanota-primary);
}
.lanota-btn--secondary {
    --lanota-btn-bg: #fff;
    --lanota-btn-bg-hover: #f4f5f7;
    --lanota-btn-color: #5a5f7d;
    --lanota-btn-border: #e3e6ed;
}
.lanota-btn--secondary:hover {
    color: #2c2e3a;
    border-color: #d4d8e0;
}
.lanota-btn--danger {
    --lanota-btn-bg: #dc3545;
    --lanota-btn-bg-hover: #c12d3c;
    --lanota-btn-color: #fff;
    --lanota-btn-border: #dc3545;
}
.lanota-btn--success {
    --lanota-btn-bg: #20c997;
    --lanota-btn-bg-hover: #1ba37b;
    --lanota-btn-color: #fff;
    --lanota-btn-border: #20c997;
}
.lanota-btn--outline-primary {
    --lanota-btn-bg: transparent;
    --lanota-btn-bg-hover: var(--lanota-primary);
    --lanota-btn-color: var(--lanota-primary);
    --lanota-btn-border: var(--lanota-primary);
}
.lanota-btn--outline-primary:hover { color: #fff; }
.lanota-btn--outline-danger {
    --lanota-btn-bg: transparent;
    --lanota-btn-bg-hover: #dc3545;
    --lanota-btn-color: #dc3545;
    --lanota-btn-border: #dc3545;
}
.lanota-btn--outline-danger:hover { color: #fff; }
.lanota-btn--ghost {
    --lanota-btn-bg: transparent;
    --lanota-btn-bg-hover: #f4f5f7;
    --lanota-btn-color: #5a5f7d;
    --lanota-btn-border: transparent;
}
.lanota-btn--ghost:hover { color: var(--lanota-primary); }

/* ====== Password toggle (mostrar/ocultar contraseña) ====== */
.lanota-pwd-group {
    border: 1px solid #e3e6ed;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    transition: box-shadow .12s, border-color .12s;
}
.lanota-pwd-group .form-control,
.lanota-pwd-group .lanota-pwd-toggle {
    background-color: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
}
.lanota-pwd-group .form-control:focus { box-shadow: none !important; border: 0 !important; }
.lanota-pwd-group:focus-within {
    border-color: var(--lanota-primary);
    box-shadow: 0 0 0 3px rgba(236, 164, 17, 0.18);
}
.lanota-pwd-group .lanota-pwd-toggle {
    color: #5a5f7d !important;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.lanota-pwd-group .lanota-pwd-toggle:hover {
    background-color: #f4f5f7 !important;
    color: var(--lanota-primary) !important;
}
.lanota-pwd-group .lanota-pwd-toggle i {
    color: inherit !important;
    font-size: 16px;
}

/* ====== Mobile: cada fila se vuelve card ====== */
@media (max-width: 768px) {
    .lanota-datatable__wrap .table-responsive { overflow-x: visible; }
    .lanota-datatable__table thead { display: none; }
    .lanota-datatable__table,
    .lanota-datatable__table tbody,
    .lanota-datatable__table tr,
    .lanota-datatable__table td {
        display: block;
        width: 100%;
    }
    .lanota-datatable__table tbody tr {
        background: #fff;
        border: 1px solid #eef0f4;
        border-radius: 10px;
        padding: 8px 12px;
        margin-bottom: 12px;
        box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
    }
    .lanota-datatable__table tbody tr:last-child { margin-bottom: 0; }
    .lanota-datatable__table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 8px 0;
        border-bottom: 1px dashed #f0f1f5;
        text-align: left !important;
    }
    .lanota-datatable__table td:last-child { border-bottom: 0; }
    .lanota-datatable__table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #5a5f7d;
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        flex-shrink: 0;
    }
    .lanota-datatable__table td:not([data-label])::before,
    .lanota-datatable__table td[data-label=""]::before { content: ""; }
    .lanota-datatable__table tbody tr.lanota-empty-row td {
        text-align: center !important;
        justify-content: center !important;
    }
    .lanota-datatable__table tbody tr.lanota-empty-row td::before { content: ""; }
    .lanota-datatable__toolbar {
        flex-direction: column;
        align-items: stretch !important;
    }
    .lanota-datatable__toolbar > div { width: 100%; }
    .lanota-datatable__search { width: 100%; }
}

/* ====== Tom Select theme ====== */
.ts-wrapper.single .ts-control,
.ts-wrapper.multi .ts-control {
    min-height: 38px;
    border-color: #e3e6ed;
    border-radius: 6px;
    padding: 7px 38px 7px 12px;
    background: #fff;
    box-shadow: none;
    font-size: 0.875rem;
}
.ts-wrapper.focus .ts-control {
    border-color: var(--lanota-primary) !important;
    box-shadow: 0 0 0 3px rgba(236, 164, 17, 0.18) !important;
}
.ts-control > input { font-size: 0.875rem; }
.ts-dropdown {
    border-color: #e3e6ed;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
    margin-top: 4px;
    overflow: hidden;
}
.ts-dropdown .option {
    padding: 9px 12px;
    font-size: 0.875rem;
}
.ts-dropdown .option:hover,
.ts-dropdown .option.active {
    background: #fff4dc;
    color: #2c2e3a;
}
.ts-dropdown .option.selected {
    background: var(--lanota-primary);
    color: #fff;
}
.ts-dropdown-content { max-height: 280px; }
.ts-wrapper.single .ts-control .item {
    padding-top: 0;
    padding-bottom: 0;
    color: #2c2e3a;
}
.ts-wrapper .clear-button {
    color: #868eae;
    opacity: 0.7;
    right: 28px;
    font-size: 18px;
    line-height: 1;
}
.ts-wrapper .clear-button:hover { opacity: 1; color: var(--lanota-primary); }

/* ====== Sidebar: active con primary ====== */
.sidebar_nav li.active > a,
.sidebar_nav li.active > a span.menu-text { color: var(--lanota-primary) !important; }
.sidebar_nav li.active > a span.nav-icon i { color: var(--lanota-primary) !important; }
/* Asegurar visibilidad de TODOS los íconos del sidebar */
.sidebar_nav li > a > .nav-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}
.sidebar_nav li > a > .nav-icon i {
    font-size: 18px !important;
    line-height: 1;
    display: inline-block !important;
}
