@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --febros-orange: #ff7a00;
    --febros-orange-hover: #e66d00;
    --febros-bg: #f4f7f6;
    --febros-sidebar: #eef1f4;
    --febros-white: #ffffff;
    --febros-text: #1a1a1a;
    --febros-text-muted: #6b7280;
    --febros-border: #e5e7eb;
    --febros-blue: #3b82f6;
    --febros-green: #22c55e;
    --febros-purple: #a855f7;
    --febros-red: #ef4444;
    --febros-radius: 12px;
    --febros-shadow: 0 2px 16px rgba(15, 23, 42, 0.06);
    --febros-sidebar-width: 260px;
}

* { box-sizing: border-box; }

body.febros-app {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--febros-bg);
    color: var(--febros-text);
    min-height: 100vh;
}

.febros-layout {
    display: flex;
    min-height: 100vh;
}

.febros-sidebar {
    width: var(--febros-sidebar-width);
    background: var(--febros-sidebar);
    border-right: 1px solid var(--febros-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.25s ease;
}

.febros-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    border: none;
    padding: 0;
    margin: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 99;
    cursor: pointer;
}

body.febros-sidebar-open .febros-sidebar-backdrop {
    display: block;
}

.febros-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 10px 4px 6px;
    border-bottom: 1px solid var(--febros-border);
    position: relative;
}

.febros-sidebar-collapse-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 1px solid var(--febros-border);
    border-radius: 8px;
    background: var(--febros-white);
    color: var(--febros-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.febros-sidebar-collapse-btn:hover {
    border-color: var(--febros-orange);
    color: var(--febros-orange);
}

.febros-brand-link {
    display: block;
    width: 50%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: transparent;
    flex-shrink: 0;
    text-decoration: none;
}

.febros-sidebar-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.febros-nav { padding: 12px 10px; flex: 1; }

.febros-nav-item,
.febros-nav-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    margin-bottom: 4px;
    border-radius: 10px;
    color: #374151;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    transition: all 0.15s ease;
}

.febros-nav-item:hover,
.febros-nav-toggle:hover {
    background: rgba(255, 122, 0, 0.08);
    color: var(--febros-orange);
}

.febros-nav-item.active,
.febros-nav-toggle.active {
    background: var(--febros-orange);
    color: #fff;
}

.febros-nav-item i,
.febros-nav-toggle i:first-child {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
}

.febros-nav-toggle .febros-chevron {
    margin-left: auto;
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.febros-nav-toggle[aria-expanded="true"] .febros-chevron {
    transform: rotate(180deg);
}

.febros-subnav { padding-left: 12px; margin-bottom: 6px; }

.febros-subnav a {
    display: block;
    padding: 8px 14px 8px 38px;
    color: var(--febros-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 8px;
    margin-bottom: 2px;
}

.febros-subnav a:hover {
    color: var(--febros-orange);
    background: rgba(255, 122, 0, 0.06);
}

.febros-subnav a.active { color: var(--febros-orange); font-weight: 600; }

.febros-sidebar-footer {
    padding: 16px 18px;
    border-top: 1px solid var(--febros-border);
    font-size: 0.8rem;
    color: var(--febros-text-muted);
}

.febros-sidebar-footer strong {
    display: block;
    color: var(--febros-text);
    margin-top: 2px;
}

.febros-sidebar-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--febros-red);
    text-decoration: none;
}

.febros-sidebar-logout:hover {
    color: #dc2626;
}

.febros-main {
    flex: 1;
    margin-left: var(--febros-sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.25s ease;
}

body.febros-sidebar-collapsed .febros-sidebar {
    transform: translateX(-100%);
}

body.febros-sidebar-collapsed .febros-main {
    margin-left: 0;
}

.febros-topbar {
    background: var(--febros-white);
    border-bottom: 1px solid var(--febros-border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--febros-shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}

.febros-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.febros-topbar-user { font-size: 0.9rem; color: var(--febros-text-muted); margin-right: auto; }
.febros-topbar-user strong { color: var(--febros-text); }

.febros-btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--febros-border);
    background: var(--febros-white);
    color: var(--febros-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.febros-btn-icon:hover { border-color: var(--febros-orange); color: var(--febros-orange); }

.febros-btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 10px;
    border: none;
    background: #fee2e2;
    color: var(--febros-red);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.febros-btn-logout:hover { background: #fecaca; color: #dc2626; }

.febros-content { padding: 28px; flex: 1; }

.febros-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.febros-page-header h1 {
    font-size: 1.65rem;
    font-weight: 700;
    margin: 0;
}

.febros-page-actions { display: flex; gap: 10px; }

.febros-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.febros-btn-primary { background: var(--febros-orange); color: #fff; }
.febros-btn-primary:hover { background: var(--febros-orange-hover); color: #fff; }
.febros-btn-outline { background: var(--febros-white); color: var(--febros-text); border: 1px solid var(--febros-border); }
.febros-btn-outline:hover { border-color: var(--febros-orange); color: var(--febros-orange); }
.febros-btn-success { background: var(--febros-green); color: #fff; }
.febros-btn-danger { background: var(--febros-red); color: #fff; }

.febros-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.febros-kpi {
    border-radius: var(--febros-radius);
    padding: 22px 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: var(--febros-shadow);
}

.febros-kpi-label { font-size: 0.85rem; opacity: 0.95; margin-bottom: 6px; }
.febros-kpi-value { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.febros-kpi-icon { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 2.8rem; opacity: 0.25; }
.febros-kpi.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.febros-kpi.green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.febros-kpi.purple { background: linear-gradient(135deg, #a855f7, #9333ea); }
.febros-kpi.orange { background: linear-gradient(135deg, #ff7a00, #ea580c); }

.febros-card {
    background: var(--febros-white);
    border-radius: var(--febros-radius);
    box-shadow: var(--febros-shadow);
    border: 1px solid var(--febros-border);
    margin-bottom: 24px;
    overflow: hidden;
}

.febros-card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--febros-border);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.febros-card-body { padding: 22px; }

.febros-filter-bar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.febros-search { flex: 1; min-width: 240px; position: relative; }
.febros-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--febros-text-muted); }

.febros-search input,
.febros-select,
.febros-input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    border: 1px solid var(--febros-border);
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--febros-white);
}

.febros-select, .febros-input { padding-left: 14px; }
.febros-search input:focus, .febros-select:focus, .febros-input:focus {
    outline: none;
    border-color: var(--febros-orange);
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.12);
}

.febros-filter-bar .febros-select { min-width: 180px; flex: 0 0 auto; }
.febros-table-wrap { overflow-x: auto; }
.febros-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

.febros-table thead th {
    background: #f9fafb;
    color: var(--febros-text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--febros-border);
}

.febros-table tbody td { padding: 14px 16px; border-bottom: 1px solid #f3f4f6; }
.febros-table tbody tr:hover { background: #fafafa; }

.febros-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.febros-badge-success { background: #dcfce7; color: #15803d; }
.febros-badge-danger { background: #fee2e2; color: #b91c1c; }

.febros-avatar {
    width: 36px; height: 36px; border-radius: 50%; background: #dbeafe; color: #2563eb;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.8rem; margin-right: 10px;
}

.febros-customer-cell { display: flex; align-items: center; }

.febros-top-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.febros-top-card {
    background: var(--febros-white);
    border: 1px solid var(--febros-border);
    border-radius: var(--febros-radius);
    padding: 20px;
    box-shadow: var(--febros-shadow);
}

.febros-top-card .rank {
    width: 28px; height: 28px; background: var(--febros-orange); color: #fff;
    border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700; margin-bottom: 10px;
}

.febros-top-card h3 { margin: 0 0 4px; font-size: 1rem; }
.febros-top-card .type { color: var(--febros-text-muted); font-size: 0.8rem; margin-bottom: 12px; }
.febros-top-card .amount { color: var(--febros-green); font-weight: 700; font-size: 1.1rem; }
.febros-top-card .meta { font-size: 0.8rem; color: var(--febros-text-muted); margin-top: 8px; }

.febros-banner {
    background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
    padding: 12px 16px; border-radius: 10px; font-size: 0.875rem; margin-bottom: 20px;
}

.febros-section-title {
    background: var(--febros-orange); color: #fff; padding: 10px 16px;
    border-radius: var(--febros-radius) var(--febros-radius) 0 0;
    font-weight: 600; font-size: 0.9rem; text-align: center;
}

.febros-section-title.green { background: var(--febros-green); }

.febros-section-body {
    background: var(--febros-white);
    border: 1px solid var(--febros-border);
    border-top: none;
    border-radius: 0 0 var(--febros-radius) var(--febros-radius);
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: var(--febros-shadow);
}

.febros-form-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 6px; }
.febros-form-group { margin-bottom: 16px; }

.febros-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff7ed 0%, var(--febros-bg) 50%, #eff6ff 100%);
    padding: 24px;
}

.febros-login-card {
    width: 100%; max-width: 420px; background: var(--febros-white);
    border-radius: 16px; box-shadow: 0 8px 32px rgba(15, 23, 42, 0.1);
    overflow: hidden; border: 1px solid var(--febros-border);
}

.febros-login-header { text-align: center; padding: 32px 28px 20px; }
.febros-login-logo {
    display: block;
    width: 200px;
    max-width: 100%;
    height: auto;
    margin: 0 auto 12px;
    object-fit: contain;
}
.febros-login-header .febros-brand-icon { margin: 0 auto 16px; width: 56px; height: 56px; font-size: 1.4rem; }
.febros-login-header h1 { margin: 0 0 4px; font-size: 1.5rem; }
.febros-login-header p { margin: 0; color: var(--febros-text-muted); font-size: 0.9rem; }
.febros-login-body { padding: 0 28px 32px; }
.febros-login-body .febros-input { padding-left: 14px; margin-bottom: 14px; }

.febros-menu-toggle {
    display: inline-flex;
    flex-shrink: 0;
}

.d-none { display: none !important; }

@media (max-width: 768px) {
    .febros-sidebar { transform: translateX(-100%); }
    .febros-sidebar.open,
    body.febros-sidebar-open .febros-sidebar { transform: translateX(0); }
    .febros-main { margin-left: 0; }
    body.febros-sidebar-collapsed .febros-main { margin-left: 0; }
}

@media (min-width: 769px) {
    body.febros-sidebar-open .febros-sidebar-backdrop { display: none !important; }
}

/* ── Compatibilidad Laravel / Bootstrap ── */
.febros-nav-heading {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--febros-text-muted);
    padding: 14px 14px 6px;
    font-weight: 700;
}

.febros-app .sb-topnav,
.febros-app #layoutSidenav_nav .sb-sidenav-dark { display: none !important; }

.febros-app .container-fluid.px-4 {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.febros-app .container-fluid > h1.mt-4,
.febros-app .container-fluid > h1.text-center {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--febros-text);
    margin-top: 0 !important;
    margin-bottom: 8px;
    text-align: left !important;
}

.febros-app .breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.febros-app .breadcrumb-item a { color: var(--febros-orange); text-decoration: none; }
.febros-app .breadcrumb-item.active { color: var(--febros-text-muted); }

.febros-app .card {
    border: 1px solid var(--febros-border);
    border-radius: var(--febros-radius);
    box-shadow: var(--febros-shadow); 
    overflow: hidden;
}

.febros-app .card-header {
    background: var(--febros-white);
    border-bottom: 1px solid var(--febros-border);
    font-weight: 600;
    padding: 18px 22px;
}

.febros-app .card-body { padding: 22px; }
.febros-app .card-footer { background: #fafafa; border-top: 1px solid var(--febros-border); }

.febros-app .card.text-bg-light {
    background: var(--febros-white) !important;
    color: var(--febros-text) !important;
}

.febros-app .btn-primary {
    background: var(--febros-orange) !important;
    border-color: var(--febros-orange) !important;
    border-radius: 10px;
    font-weight: 600;
    padding: 10px 18px;
}

.febros-app .btn-primary:hover {
    background: var(--febros-orange-hover) !important;
    border-color: var(--febros-orange-hover) !important;
}

.febros-app .btn-success {
    background: var(--febros-green) !important;
    border-color: var(--febros-green) !important;
    border-radius: 10px;
}

.febros-app .btn-danger {
    border-radius: 10px;
}

.febros-app .btn-secondary {
    border-radius: 10px;
}

.febros-app .febros-table-actions,
.febros-app .febros-page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.febros-app .febros-table-actions .btn,
.febros-app .febros-page-actions .btn {
    flex: 0 0 auto;
}

.febros-app .form-control,
.febros-app .form-select {
    border-radius: 10px;
    border-color: var(--febros-border);
    padding: 10px 14px;
}

.febros-app .form-control:focus,
.febros-app .form-select:focus {
    border-color: var(--febros-orange);
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.12);
}

.febros-app .form-control[type="file"] {
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.febros-app .form-control[type="file"]::file-selector-button,
.febros-app .form-control[type="file"]::-webkit-file-upload-button {
    border-radius: 8px;
    margin: 0 0.75rem 0 0;
    padding: 0.375rem 0.875rem;
    border: 1px solid var(--febros-border);
    background: #f8f9fa;
    font-weight: 500;
    color: var(--febros-text);
    cursor: pointer;
}

.febros-app .form-control[type="file"]:hover:not(:disabled):not([readonly])::file-selector-button,
.febros-app .form-control[type="file"]:hover:not(:disabled):not([readonly])::-webkit-file-upload-button {
    background: #e9ecef;
}

.febros-app .table thead th,
.febros-app #datatablesSimple thead th {
    background: #f9fafb !important;
    color: var(--febros-text-muted) !important;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--febros-border) !important;
}

.febros-app .table tbody td,
.febros-app #datatablesSimple tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-color: #f3f4f6 !important;
}

.febros-app .table tbody tr:hover,
.febros-app #datatablesSimple tbody tr:hover {
    background: #fafafa;
}

.febros-app .datatable-wrapper {
    font-family: 'Inter', system-ui, sans-serif;
    width: 100%;
}

.febros-app .datatable-top,
.febros-app .datatable-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 0 1rem;
    width: 100%;
    clear: both;
}

.febros-app .datatable-top > nav,
.febros-app .datatable-top > div,
.febros-app .datatable-bottom > nav,
.febros-app .datatable-bottom > div {
    float: none !important;
    flex: 0 1 auto;
}

.febros-app .datatable-dropdown {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.febros-app .datatable-dropdown label,
.febros-app .datatable-info {
    font-size: 0.875rem;
    color: var(--febros-text-muted);
    font-weight: 500;
    margin: 0;
    text-transform: none;
    white-space: nowrap;
}

.febros-app .datatable-info {
    flex: 1 1 auto;
    min-width: 200px;
}

.febros-app .datatable-selector,
.febros-app .datatable-input {
    font-family: inherit;
    font-size: 0.875rem;
    border-radius: 10px;
    border-color: var(--febros-border);
    color: var(--febros-text);
}

.febros-app .datatable-selector:focus,
.febros-app .datatable-input:focus {
    border-color: var(--febros-orange);
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.12);
}

.febros-app .datatable-pagination a {
    font-size: 0.875rem;
    border-radius: 8px;
    color: var(--febros-text);
}

.febros-app .datatable-pagination .active a,
.febros-app .datatable-pagination .active a:focus,
.febros-app .datatable-pagination .active a:hover {
    background-color: var(--febros-orange);
    border-color: var(--febros-orange);
}

.febros-app .badge.text-bg-success {
    background: #dcfce7 !important;
    color: #15803d !important;
    font-weight: 600;
    padding: 4px 12px;
}

.febros-app .badge.text-bg-danger {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    font-weight: 600;
    padding: 4px 12px;
}

.febros-app .modal-content {
    border-radius: var(--febros-radius);
    border: 1px solid var(--febros-border);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
}

.febros-app .dropdown-menu {
    border-radius: 10px;
    border: 1px solid var(--febros-border);
    box-shadow: var(--febros-shadow);
}

.febros-app .text-white.bg-success.p-1,
.febros-app .text-white.bg-success.p-1.text-center {
    background: var(--febros-green) !important;
    border-radius: var(--febros-radius) var(--febros-radius) 0 0;
    padding: 10px 16px !important;
    font-weight: 600;
}

.febros-app .text-white.bg-primary.p-1,
.febros-app .text-white.bg-primary.p-1.text-center {
    background: var(--febros-orange) !important;
    border-radius: var(--febros-radius) var(--febros-radius) 0 0;
    padding: 10px 16px !important;
    font-weight: 600;
}

.febros-app .border.border-3.border-success,
.febros-app .border.border-3.border-primary {
    border: 1px solid var(--febros-border) !important;
    border-top: none !important;
    border-radius: 0 0 var(--febros-radius) var(--febros-radius);
    background: var(--febros-white);
    box-shadow: var(--febros-shadow);
    padding: 22px !important;
    margin-bottom: 20px;
}

.febros-app .card.bg-primary.text-white,
.febros-app .card.bg-success.text-white,
.febros-app .card.bg-info.text-white,
.febros-app .card.bg-secondary.text-white {
    border: none;
    border-radius: var(--febros-radius);
    box-shadow: var(--febros-shadow);
}

.febros-app .card.bg-primary.text-white { background: linear-gradient(135deg, #3b82f6, #2563eb) !important; }
.febros-app .card.bg-success.text-white { background: linear-gradient(135deg, #22c55e, #16a34a) !important; }
.febros-app .card.bg-info.text-white { background: linear-gradient(135deg, #a855f7, #9333ea) !important; }
.febros-app .card.bg-secondary.text-white { background: linear-gradient(135deg, #ff7a00, #ea580c) !important; }

.febros-app footer.bg-light {
    background: transparent !important;
    border-top: 1px solid var(--febros-border);
    margin-top: 24px;
}

.febros-topbar .dropdown-toggle::after { display: none; }

.febros-topbar-notifications {
    position: relative;
    color: var(--febros-text-muted);
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 10px;
}

.febros-topbar-notifications:hover { color: var(--febros-orange); background: rgba(255,122,0,0.06); }

.febros-topbar-notifications .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.65rem;
}

.febros-welcome { background: var(--febros-bg); color: var(--febros-text); }
.febros-welcome .navbar { background: var(--febros-white) !important; box-shadow: var(--febros-shadow); }
.febros-welcome .btn-primary { background: var(--febros-orange) !important; border-color: var(--febros-orange) !important; border-radius: 10px; }
.febros-welcome .card { border-radius: var(--febros-radius); box-shadow: var(--febros-shadow); }
.febros-welcome .card-header { border-color: var(--febros-orange) !important; color: var(--febros-orange) !important; }
.febros-welcome .text-light { color: var(--febros-text) !important; }
.febros-welcome footer { background: var(--febros-sidebar) !important; color: var(--febros-text-muted) !important; }
.febros-welcome footer a { color: var(--febros-orange) !important; }

.febros-welcome .febros-welcome-hero {
    object-fit: contain;
    object-position: center center;
    background: #ffffff;
    max-height: 420px;
    min-height: 280px;
    padding: 2rem 1rem;
}

.febros-error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--febros-bg);
    text-align: center;
    padding: 24px;
}

.febros-error-page h1 { font-size: 4rem; color: var(--febros-orange); margin-bottom: 8px; }
.febros-error-page p { color: var(--febros-text-muted); margin-bottom: 24px; }

/* ── Chat IA FEBROS ── */
.febros-ai-chat {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
}

.febros-ai-chat-toggle {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--febros-orange), #ea580c);
    color: #fff;
    font-size: 1.35rem;
    box-shadow: 0 8px 24px rgba(255, 122, 0, 0.35);
    cursor: pointer;
}

.febros-ai-chat-toggle:hover {
    transform: translateY(-2px);
}

.febros-ai-chat-panel {
    position: absolute;
    right: 0;
    bottom: 68px;
    width: min(380px, calc(100vw - 32px));
    height: 520px;
    background: var(--febros-white);
    border: 1px solid var(--febros-border);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.febros-ai-chat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: #fff7ed;
    border-bottom: 1px solid var(--febros-border);
}

.febros-ai-chat-header strong {
    display: block;
    font-size: 0.95rem;
    color: var(--febros-text);
}

.febros-ai-chat-header small {
    color: var(--febros-text-muted);
    font-size: 0.75rem;
}

.febros-ai-chat-close {
    border: none;
    background: transparent;
    color: var(--febros-text-muted);
    font-size: 1.1rem;
    cursor: pointer;
}

.febros-ai-chat-disclaimer {
    padding: 10px 14px;
    font-size: 0.72rem;
    line-height: 1.4;
    color: #92400e;
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
}

.febros-ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fafafa;
}

.febros-ai-msg {
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.febros-ai-msg-user {
    align-self: flex-end;
    background: var(--febros-orange);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.febros-ai-msg-bot {
    align-self: flex-start;
    background: var(--febros-white);
    color: var(--febros-text);
    border: 1px solid var(--febros-border);
    border-bottom-left-radius: 4px;
}

.febros-ai-msg-bot.typing,
.febros-ai-msg-bot.error {
    color: var(--febros-text-muted);
    font-style: italic;
}

.febros-ai-chat-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--febros-border);
    background: var(--febros-white);
}

.febros-ai-chat-input {
    flex: 1;
    border: 1px solid var(--febros-border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.875rem;
}

.febros-ai-chat-input:focus {
    outline: none;
    border-color: var(--febros-orange);
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.12);
}

.febros-ai-chat-send {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 10px;
    background: var(--febros-orange);
    color: #fff;
    cursor: pointer;
}

.febros-ai-chat-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Ayuda contextual por pantalla ── */
.febros-page-help-btn {
    color: #0284c7 !important;
    border-color: #bae6fd !important;
    background: #e0f2fe !important;
}

.febros-page-help-btn:hover {
    color: #fff !important;
    border-color: #0284c7 !important;
    background: #0284c7 !important;
}

.febros-help-modal .modal-header {
    border-bottom: 1px solid var(--febros-border);
}

.febros-help-modal-text {
    line-height: 1.65;
    color: var(--febros-text);
    white-space: pre-line;
}

/* ── POS Crear venta ── */
.febros-pos-venta {
    --febros-pos-yellow: #facc15;
    --febros-pos-yellow-text: #1a1a1a;
    padding: 0 8px 32px;
    max-width: 1600px;
    margin: 0 auto;
}

.febros-pos-venta .febros-pos-page-title {
    display: none;
}

.febros-pos-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    background: var(--febros-white);
    border-radius: 16px;
    padding: 14px 20px;
    margin-bottom: 16px;
    box-shadow: var(--febros-shadow);
    border: 1px solid var(--febros-border);
}

.febros-pos-topbar-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    font-size: 0.875rem;
    color: var(--febros-text-muted);
}

.febros-pos-topbar-meta strong {
    color: var(--febros-text);
    font-weight: 600;
}

.febros-pos-topbar-meta .febros-pos-tag {
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.febros-pos-topbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.febros-pos-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--febros-border);
    background: #f9fafb;
    color: var(--febros-text);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.febros-pos-btn-ghost:hover {
    background: #f3f4f6;
    color: var(--febros-text);
    border-color: #d1d5db;
}

.febros-pos-btn-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.febros-pos-btn-danger:hover {
    background: #fee2e2;
    color: #991b1b;
}

.febros-pos-cart-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--febros-orange);
    color: #fff;
    border: none;
    cursor: default;
}

.febros-pos-cart-icon .febros-pos-cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #fff;
    color: var(--febros-orange);
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.febros-pos-cart-badge.is-empty {
    opacity: 0.5;
}

.febros-pos-settings {
    background: var(--febros-white);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: var(--febros-shadow);
    border: 1px solid var(--febros-border);
}

.febros-pos-settings .form-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--febros-text-muted);
    margin-bottom: 6px;
}

.febros-pos-settings .bootstrap-select .dropdown-toggle,
.febros-pos-client-bar .bootstrap-select .dropdown-toggle {
    border-radius: 12px !important;
    border: 1px solid var(--febros-border) !important;
    padding: 10px 14px !important;
    font-size: 0.9rem !important;
    background: var(--febros-white) !important;
}

.febros-pos-workspace {
    align-items: stretch;
}

@media (min-width: 992px) {
    .febros-pos-workspace {
        min-height: calc(100vh - 240px);
    }

    .febros-pos-catalog-col,
    .febros-pos-cart-col {
        display: flex;
    }
}

.febros-pos-panel,
.febros-pos-sidebar-panel {
    background: var(--febros-white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--febros-shadow);
    border: 1px solid var(--febros-border);
    width: 100%;
}

.febros-pos-panel {
    display: flex;
    flex-direction: column;
    min-height: 480px;
}

.febros-pos-sidebar-panel {
    display: flex;
    flex-direction: column;
    min-height: 480px;
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 100px);
}

.febros-pos-client-bar {
    margin-bottom: 16px;
}

.febros-pos-client-bar .form-label {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.febros-pos-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.febros-pos-cat-pill {
    border: none;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: #f3f4f6;
    color: var(--febros-text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.febros-pos-cat-pill:hover {
    background: #e5e7eb;
    color: var(--febros-text);
}

.febros-pos-cat-pill.active {
    background: var(--febros-pos-yellow);
    color: var(--febros-pos-yellow-text);
}

.febros-pos-search-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 576px) {
    .febros-pos-search-row {
        grid-template-columns: 1fr;
    }
}

.febros-pos-search-field {
    position: relative;
}

.febros-pos-search-field i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--febros-text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.febros-pos-search-field input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    border: 1px solid var(--febros-border);
    border-radius: 12px;
    font-size: 0.875rem;
    font-family: inherit;
    background: #fafafa;
}

.febros-pos-search-field input:focus {
    outline: none;
    border-color: var(--febros-orange);
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.12);
    background: var(--febros-white);
}

.febros-pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 10px;
    flex: 1 1 auto;
    min-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
    align-content: start;
}

.febros-pos-product-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    min-height: 88px;
    padding: 14px 12px;
    border: 1px solid var(--febros-border);
    border-radius: 14px;
    background: var(--febros-white);
    cursor: pointer;
    text-align: left;
    transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    position: relative;
}

.febros-pos-product-card--editable {
    border-style: dashed;
    border-color: #fcd34d;
}

.febros-pos-product-editable-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #fef9c3;
    color: #a16207;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
}

.febros-pos-price-from {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--febros-text-muted);
    text-transform: lowercase;
}

.febros-pos-product-card:hover {
    border-color: var(--febros-orange);
    box-shadow: 0 4px 14px rgba(255, 122, 0, 0.15);
    transform: translateY(-1px);
}

.febros-pos-product-card:active {
    transform: translateY(0);
}

.febros-pos-product-card.is-hidden {
    display: none;
}

.febros-pos-product-name {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--febros-text);
    line-height: 1.3;
    margin-bottom: 8px;
    word-break: break-word;
}

.febros-pos-product-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--febros-orange);
    margin-top: auto;
}

.febros-pos-grid-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 32px 16px;
    color: var(--febros-text-muted);
    font-size: 0.875rem;
    display: none;
}

.febros-pos-grid-empty.is-visible {
    display: block;
}

.febros-pos-hidden-controls {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.febros-pos-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--febros-border);
}

.febros-pos-cart-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.febros-pos-cart-header-count {
    font-size: 0.8125rem;
    color: var(--febros-text-muted);
    font-weight: 500;
}

.febros-pos-cart-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 0;
    padding-right: 2px;
}

.febros-pos-cart-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--febros-border);
    background: var(--febros-white);
}

.febros-pos-cart-body #tabla_detalle {
    width: 100%;
    border-collapse: collapse;
}

.febros-pos-cart-body #tabla_detalle thead {
    display: none;
}

.febros-pos-cart-body #tabla_detalle tbody tr {
    display: block;
}

.febros-pos-cart-body #tabla_detalle tbody tr:has(th:only-child),
.febros-pos-cart-body #tabla_detalle tbody tr:not([id^="fila"]) {
    display: none;
}

.febros-pos-cart-body #tabla_detalle tbody tr[id^="fila"] {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
}

.febros-pos-cart-body #tabla_detalle tbody td:nth-child(1) {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    border: none;
    padding: 0;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.febros-pos-cart-body #tabla_detalle tbody td:nth-child(2) {
    display: none;
}

.febros-pos-cart-body #tabla_detalle tbody td:nth-child(3) {
    flex: 0 0 auto;
    border: none;
    padding: 0;
    font-size: 0.75rem;
    color: var(--febros-text-muted);
}

.febros-pos-cart-body #tabla_detalle tbody td.febros-pos-cart-qty {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.febros-pos-cart-body #tabla_detalle tbody td.febros-pos-cart-qty .cantidad-fila {
    width: 36px;
    height: 28px;
    padding: 2px 4px;
    font-size: 0.75rem;
    text-align: center;
    border-radius: 6px;
    border: 1px solid var(--febros-border);
    -moz-appearance: textfield;
    appearance: textfield;
}

.febros-pos-cart-body #tabla_detalle tbody td.febros-pos-cart-qty .cantidad-fila::-webkit-outer-spin-button,
.febros-pos-cart-body #tabla_detalle tbody td.febros-pos-cart-qty .cantidad-fila::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.febros-pos-cart-unit {
    font-size: 0.72rem;
    color: var(--febros-text-muted);
    white-space: nowrap;
}

.febros-pos-cart-body #tabla_detalle tbody td:nth-child(4) {
    display: none;
}

.febros-pos-cart-body #tabla_detalle tbody td:nth-child(5) {
    flex: 0 0 auto;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--febros-text);
    text-align: right;
    border: none;
    padding: 0;
    min-width: 64px;
}

.febros-pos-cart-body #tabla_detalle tbody td:nth-child(6) {
    flex: 0 0 auto;
    border: none;
    padding: 0;
}

.febros-pos-cart-body #tabla_detalle tbody td:nth-child(6) .btn-outline-primary {
    display: none;
}

.febros-pos-cart-body #tabla_detalle tbody td:nth-child(6) .btn-danger {
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 999px;
    font-size: 0.6rem;
    line-height: 1;
    border: none;
    background: #f3f4f6;
    color: var(--febros-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.febros-pos-cart-body #tabla_detalle tbody td:nth-child(6) .btn-danger:hover {
    background: #fef2f2;
    color: var(--febros-red);
}

.febros-pos-cart-body #tabla_detalle tfoot {
    display: none;
}

.febros-pos-totals {
    padding-top: 0;
    margin-bottom: 12px;
    border-top: none;
}

.febros-pos-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--febros-text-muted);
    margin-bottom: 8px;
}

.febros-pos-total-row span:last-child {
    font-weight: 600;
    color: var(--febros-text);
}

.febros-pos-total-final {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--febros-border);
}

.febros-pos-total-final label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--febros-text);
    margin: 0;
}

.febros-pos-total-final .febros-pos-total-amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--febros-orange);
    line-height: 1;
}

.febros-pos-checkout-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.febros-pos-checkout-fields .form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.febros-pos-checkout-fields .form-control {
    border-radius: 12px;
    border: 1px solid var(--febros-border);
    padding: 10px 14px;
}

.febros-pos-btn-pagar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 14px;
    background: var(--febros-orange);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    box-shadow: 0 4px 14px rgba(255, 122, 0, 0.35);
}

.febros-pos-btn-pagar:hover {
    background: var(--febros-orange-hover);
    color: #fff;
}

.febros-pos-btn-cancelar {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--febros-red);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: underline;
    cursor: pointer;
}

.febros-pos-btn-cancelar:hover {
    color: #b91c1c;
}

.febros-pos-cart-empty {
    text-align: center;
    padding: 16px 12px;
    color: var(--febros-text-muted);
    font-size: 0.875rem;
    flex-shrink: 0;
}

.febros-pos-cart-empty.is-hidden {
    display: none;
}

@media (max-width: 991px) {
    .febros-pos-sidebar-panel {
        position: static;
        max-height: none;
        min-height: auto;
        margin-top: 16px;
    }

    .febros-pos-panel {
        min-height: auto;
    }

    .febros-pos-grid {
        max-height: 360px;
        flex: none;
    }

    .febros-pos-checkout-fields {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .febros-pos-cart-body #tabla_detalle tbody tr[id^="fila"] {
        flex-wrap: wrap;
    }

    .febros-pos-cart-body #tabla_detalle tbody td:nth-child(1) {
        flex: 1 1 calc(100% - 30px);
    }
}
