/** Custom CSS for SmartPOS
    * This file contains custom styles for the SmartPOS application.
    * It is loaded after the main styles to allow for overrides and additional styling.
*/
:root {
  /* Secondary Shades */
  --secondary-50: #f8fafc;
  --secondary-100: #f1f5f9;
  --secondary-200: #e2e8f0;
  --secondary-300: #cbd5e1;
  --secondary-400: #94a3b8;
  --secondary-500: #64748b;
  --secondary-600: #475569;
  --secondary-700: #334155;
  --secondary-800: #1e293b;
  --secondary-900: #0f172a;
  --sidebar-bg: #ffffff;
  --sidebar-text: #64748b;
  --sidebar-text-hover: #334155;
  --sidebar-border: rgba(226, 232, 240, 0.6);
  --sidebar-item-hover: #f8fafc;
  --sidebar-active: #3b82f6;
  --sidebar-active-bg: rgba(59, 130, 246, 0.1);
  --sidebar-radius: 8px;
  --sidebar-spacing: 12px;
}

/* Backgrounds */
.bg-secondary-50 {
  background-color: var(--secondary-50) !important;
}
.bg-secondary-100 {
  background-color: var(--secondary-100) !important;
}
.bg-secondary-200 {
  background-color: var(--secondary-200) !important;
}
.bg-secondary-300 {
  background-color: var(--secondary-300) !important;
}
.bg-secondary-400 {
  background-color: var(--secondary-400) !important;
}
.bg-secondary-500 {
  background-color: var(--secondary-500) !important;
}
.bg-secondary-600 {
  background-color: var(--secondary-600) !important;
}
.bg-secondary-700 {
  background-color: var(--secondary-700) !important;
}
.bg-secondary-800 {
  background-color: var(--secondary-800) !important;
}
.bg-secondary-900 {
  background-color: var(--secondary-900) !important;
}

/* Text colors */
.text-secondary-50 {
  color: var(--secondary-50) !important;
}
.text-secondary-100 {
  color: var(--secondary-100) !important;
}
.text-secondary-200 {
  color: var(--secondary-200) !important;
}
.text-secondary-300 {
  color: var(--secondary-300) !important;
}
.text-secondary-400 {
  color: var(--secondary-400) !important;
}
.text-secondary-500 {
  color: var(--secondary-500) !important;
}
.text-secondary-600 {
  color: var(--secondary-600) !important;
}
.text-secondary-700 {
  color: var(--secondary-700) !important;
}
.text-secondary-800 {
  color: var(--secondary-800) !important;
}
.text-secondary-900 {
  color: var(--secondary-900) !important;
}

.btn-secondary-50 {
  background-color: var(--secondary-50);
  color: var(--secondary-900);
  border-color: var(--secondary-200);
}
.btn-secondary-100 {
  background-color: var(--secondary-100);
  color: var(--secondary-900);
  border-color: var(--secondary-300);
}
.btn-secondary-200 {
  background-color: var(--secondary-200);
  color: var(--secondary-800);
  border-color: var(--secondary-300);
}
.btn-secondary-300 {
  background-color: var(--secondary-300);
  color: var(--secondary-800);
  border-color: var(--secondary-400);
}
.btn-secondary-400 {
  background-color: var(--secondary-400);
  color: var(--secondary-900);
  border-color: var(--secondary-500);
}
.btn-secondary-500 {
  background-color: var(--secondary-500);
  color: #fff;
  border-color: var(--secondary-500);
}
.btn-secondary-600 {
  background-color: var(--secondary-600);
  color: #fff;
  border-color: var(--secondary-600);
}
.btn-secondary-700 {
  background-color: var(--secondary-700);
  color: #fff;
  border-color: var(--secondary-700);
}
.btn-secondary-800 {
  background-color: var(--secondary-800);
  color: #fff;
  border-color: var(--secondary-800);
}
.btn-secondary-900 {
  background-color: var(--secondary-900);
  color: #fff;
  border-color: var(--secondary-900);
}

/* Hover específico para cada tono */
.btn-secondary-50:hover {
  background-color: var(--secondary-100);
  color: var(--secondary-900);
}
.btn-secondary-100:hover {
  background-color: var(--secondary-200);
  color: var(--secondary-900);
}
.btn-secondary-200:hover {
  background-color: var(--secondary-300);
  color: var(--secondary-900);
}
.btn-secondary-300:hover {
  background-color: var(--secondary-400);
  color: var(--secondary-900);
}
.btn-secondary-400:hover {
  background-color: var(--secondary-500);
  color: #fff;
}
.btn-secondary-500:hover {
  background-color: var(--secondary-600);
  color: #fff;
}
.btn-secondary-600:hover {
  background-color: var(--secondary-700);
  color: #fff;
}
.btn-secondary-700:hover {
  background-color: var(--secondary-800);
  color: #fff;
}
.btn-secondary-800:hover {
  background-color: var(--secondary-900);
  color: #fff;
}
.btn-secondary-900:hover {
  background-color: var(--secondary-800);
  color: #fff;
}

.form-control::placeholder {
  color: #94a3b8;
  font-size: 0.9em !important;
  font-weight: 300;
  opacity: 1;
}

.form-control:focus::placeholder {
  color: #cbd5e1;
  transform: translateX(4px);
  transition: all 0.2s ease;
}

.ts-wrapper .ts-control {
  background-color: var(--primary-50);
  border-radius: 8px;
}
.ts-wrapper .ts-control input {
  font-style: italic;
  color: var(--neutral-600);
}
/* Configuracion en Datatable */
/* Botones con iconos para Datatable */
.bordered-table thead tr th {
  background-color: rgba(59, 130, 246, 0.1) !important;
  border-bottom: 2px solid #3b82f6 !important;
  color: var(--text-primary-light) !important;
  padding: 10px !important;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
}

table tbody tr {
  font-size: 0.875rem;
}

.btn-uniform {
  min-width: 140px; /* mismo ancho */
  height: 38px; /* misma altura */
  justify-content: center;
}

/* Efecto hover con elevación */
.hover-raise {
  transition: all 0.2s ease;
}
.hover-raise:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}
.hover-raise:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Tamaño y alineación de iconos */
.btn .icon {
  line-height: 1;
}

/* Titulos de SweetAlert */
#swal2-title {
  font-size: 1.875em !important;
}

/* Contenedor de acciones (para Datatable) */
.table-actions a, .action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  transition: transform 0.2s ease-in-out, color 0.2s ease-in-out;
  margin: 0 2px;
  position: relative;
}

/* Hover base */
.table-actions a:hover, .action-btn:hover {
  transform: translateY(-2px) scale(1.1);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
  background-color: var(--neutral-50); /* color de fondo suave */
}

/* Colores personalizados por acción */
.table-actions a.text-warning-main:hover {
  background-color: var(--warning-50);
  color: var(--warning-700);
}

.table-actions a.text-primary:hover {
  background-color: var(--primary-50);
  color: var(--primary-700);
}

.table-actions a.text-danger-main:hover {
  background-color: var(--danger-50);
  color: var(--danger-700);
}

/* Efecto boton renovar suscripción */
a#icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.25s ease-in-out;
  margin: 0 2px;
  position: relative;
}
a#icon-btn:hover {
  background-color: var(--primary-50);
  color: var(--primary-700);
  transform: rotate(15deg) scale(1.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Enlaces en el listado de empresas */
a.view-company-link {
  color: var(--primary-600);
  font-weight: 600;
  position: relative;
  font-size: 1rem;
  -webkit-transition: all 0.2s ease-in-out;
  transition: all 0.1s linear;
}

a.view-company-link:hover {
  -webkit-transform: scale(1.05);
  -moz-transform: scale(1.05);
  -ms-transform: scale(1.05);
  -o-transform: scale(1.05);
  transform: scale(1.05);
}

/* Side panel */

.side-panel {
  position: fixed; inset: 0; z-index: 1050;
  pointer-events: none;   
}
.side-panel.active {
  right: 0;
}
.side-panel-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.4);
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
  z-index: 0;
}

.side-panel-content{
  position: absolute; top: 0; right: 0;
  width: 480px; height: 100%;
  background: #fff;
  box-shadow: -4px 0 12px rgba(0,0,0,.1);
  transform: translateX(100%);
  transition: transform .3s ease;
  z-index: 1;
  border-top-left-radius: 0.375rem;
  border-bottom-left-radius: 0.375rem;

  /* Layout en columna para fijar el footer al pie */
  display: flex; flex-direction: column; min-height: 100%;
}

/* ---------- SEGMENTED CONTROL (reutilizable) ---------- */
.segmented {
  display:flex; align-items:center; gap:.35rem; flex-wrap:wrap;
  padding:.35rem; border-radius:var(--radius-sm);
  background:var(--panel); border:1px solid var(--border);
  box-shadow:0 1px 0 rgba(17,17,17,.02) inset;
  user-select:none;
}

/* .segmented {
  display: inline-flex; gap: .5rem; flex-wrap: wrap;
} */
.segmented .seg-btn,
.segmented label.seg-btn {
  border:1px solid transparent; background:transparent;
  padding:.45rem .75rem; border-radius:var(--radius-sm);
  color:var(--muted); line-height: 1; cursor:pointer;
  user-select: none; outline:none;
  transition: transform .06s ease, background .2s ease, border-color .2s ease, color .2s ease;
  
}

.segmented .seg-btn[aria-checked="true"],
.segmented .seg-btn.active {
  background:linear-gradient(180deg, rgba(109,108,255,.18), rgba(109,108,255,.10));
  border-color:rgba(109,108,255,.45);
  color:#111;
  box-shadow:0 1px 0 rgba(255,255,255,.25) inset, 0 0 0 2px rgba(109,108,255,.06);
}
.segmented .seg-btn:hover{ background:rgba(109,108,255,.08); color:var(--ink); }
.segmented .seg-btn:focus-visible { box-shadow:0 0 0 3px rgba(109,108,255,.2); }

/* Radios visuales con label */
.segmented label.seg-btn input[type="radio"] { display: none; }
.segmented label.seg-btn:has(input:checked) {
  background:linear-gradient(180deg, rgba(109,108,255,.18), rgba(109,108,255,.10));
  border-color:rgba(109,108,255,.45);
  color:#111;
  box-shadow:0 1px 0 rgba(255,255,255,.25) inset, 0 0 0 2px rgba(109,108,255,.06);
}

/* ---------- PAY CHIPS ---------- */
.totals-card { position: sticky; top: 0; z-index: 1; }

.pay-chip {
  flex: 1 1 0; min-width: 140px;
  border: 1px dashed var(--border-color);
  border-radius: var(--rounded-12, .75rem);
  padding: .5rem .75rem;
}
.chip-paid .paid-amount { color: var(--success-600); font-size: var(--font-lg, 1.125rem); }
.chip-due  .due-amount  { color: var(--danger-600);  font-size: var(--font-lg, 1.125rem); }

.pay-panel { border: 1px solid var(--border-color); border-radius: .5rem; padding: .75rem; background: var(--neutral-50); }
.pay-panel.d-none { display: none !important; }

/* QUICK CASH compacto */
.quick-cash-btn .qc-chip {
  border: 1px solid var(--border-color);
  padding: .25rem .5rem;
  border-radius: 0.375rem;
  font-size: var(--font-sm, .75rem);
  line-height: 1.1;
  white-space: nowrap;
  transition: background .2s, border-color .2s, transform .06s;
}
.quick-cash-btn .qc-chip:focus-visible {
  outline: 2px solid var(--primary-600);
  outline-offset: 2px;
}
.quick-cash-btn .qc-chip:hover { transform: translateY(-1px); }

.quick-cash-btn .qc-row {
  scrollbar-width: thin;
}
.quick-cash-btn .qc-row::-webkit-scrollbar {
  height: 6px;
}
.quick-cash-btn .qc-row::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: 4px;
}

/* Dropdown interno */
.dropdown-menu .btn { text-align: left; }


/* Estado abierto */
.side-panel.is-open{ pointer-events: auto; }
.side-panel.is-open .side-panel-overlay{ opacity: 1; visibility: visible; }
.side-panel.is-open .side-panel-content{ transform: translateX(0); }

.side-panel-header,
.side-panel-footer {
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
}
.side-panel-footer {
  border-bottom: 0; border-top: 1px solid #eee;
}
.side-panel-body {
  padding: 20px;
  flex: 1 1 auto;           /* crece y permite scroll interno */
  overflow-y: auto;
}

#btnSubmit:disabled { opacity: .6; pointer-events: none; }

@media (max-width: 576px){
  .side-panel-content{ width: min(92vw, 420px); }
}

/* Tenant Switcher */
/* Estilos básicos para el avatar placeholder */
/* Tenant Switcher Styles - Basado en Aerobox */

.menu-icon {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  opacity: 0.7;
}

/* TENANT SWITCHER ESTANDARIZADO */
.tenant-switcher {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--sidebar-border);
  padding-bottom: 16px;
}

/* Botón principal - siguiendo el patrón del sidebar */
.tenant-switcher .btn {
  background: transparent;
  border: 1px solid var(--sidebar-border);
  border-radius: var(--sidebar-radius);
  color: var(--sidebar-text);
  padding: var(--sidebar-spacing);
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.tenant-switcher .btn:hover,
.tenant-switcher .btn:focus,
.tenant-switcher .btn.show {
  background: var(--sidebar-item-hover);
  border-color: var(--sidebar-border);
  color: var(--sidebar-text-hover);
  box-shadow: none;
}

/* Avatar simplificado - más acorde al sidebar */
.avatar-placeholder {
  width: 32px;
  height: 32px;
  background: var(--sidebar-active);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
  margin-right: 12px;
}

/* Info de la empresa - estilo más simple */
.company-info {
  flex-grow: 1;
  min-width: 0;
}

.company-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--sidebar-text-hover);
  margin: 0 0 2px 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-role {
  font-size: 12px;
  color: var(--sidebar-text);
  margin: 0;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Icono chevron simplificado */
.chevron-icon {
  margin-left: 8px;
  opacity: 0.6;
  transition: all 0.2s ease;
  color: var(--sidebar-text);
}

.tenant-switcher .btn[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

/* Dropdown menu - siguiendo el estilo del sidebar */
.tenant-switcher .dropdown-menu {
  background: var(--sidebar-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--sidebar-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 4px;
  margin-top: 4px;
  width: 100%;
}

/* Items del dropdown - como los items del sidebar */
.tenant-switcher .dropdown-item {
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 2px;
  transition: all 0.2s ease;
  color: var(--sidebar-text);
  display: flex;
  align-items: center;
  font-size: 14px;
}

.tenant-switcher .dropdown-item:hover {
  background: var(--sidebar-item-hover);
  color: var(--sidebar-text-hover);
}

.tenant-switcher .dropdown-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active);
}

.tenant-switcher .dropdown-item.active .avatar-placeholder {
  background: var(--sidebar-active);
}

/* Avatar en dropdown más pequeño */
.tenant-switcher .dropdown-item .avatar-placeholder {
  width: 24px;
  height: 24px;
  font-size: 12px;
  margin-right: 8px;
}

.tenant-switcher .dropdown-item:not(.active) .avatar-placeholder {
  background: #e2e8f0;
  color: var(--sidebar-text);
}

/* Info de empresa en dropdown */
.dropdown-company-info {
  flex-grow: 1;
  min-width: 0;
}

.dropdown-company-name {
  font-size: 13px;
  font-weight: 500;
  margin: 0 0 1px 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-company-role {
  font-size: 11px;
  opacity: 0.7;
  margin: 0;
  line-height: 1.2;
}

/* Badge de status más simple */
.status-badge {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  margin-left: 8px;
  page-break-inside: avoid;
}

/* Botón agregar empresa */
.add-company-btn {
  border: 1px dashed var(--sidebar-border);
  color: var(--sidebar-text);
  font-size: 13px;
  justify-content: center;
  margin-top: 4px;
}

.add-company-btn:hover {
  background: var(--sidebar-item-hover);
  border-color: var(--sidebar-active);
  color: var(--sidebar-active);
}

/* Alert cuando no hay empresa */
.no-company-alert {
  background: #fef3cd;
  border: 1px solid #f6d55c;
  border-radius: var(--sidebar-radius);
  color: #92400e;
  padding: 16px 12px;
  text-align: center;
  font-size: 13px;
}

.no-company-alert .alert-icon {
  font-size: 20px;
  margin-bottom: 6px;
  color: #d97706;
}

/* Divider */
.tenant-switcher .dropdown-divider {
  border-color: var(--sidebar-border);
  margin: 4px 0;
}

/* subtitulo en secciones del sidebar */
.sidebar-menu-group-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--secondary-500);
  padding: 0.75rem 1rem 0.25rem;
  letter-spacing: 0.05em;
}

.form-mobile-field .form-select#doc_tipo {
  padding: 0.5625rem 1rem 0.5625rem 1rem;
}

/* Buscador de actividades economicas */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.search-result-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-code {
    font-weight: bold;
    color: #6c757d;
    font-size: 0.6em;
}

.search-result-activity {
    font-size: 0.8em;
    color: #333;
}

.no-results {
    padding: 12px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.counting-compact .input-group > .form-control { padding-top: .25rem; padding-bottom: .25rem; }
.counting-compact .btn { padding: .25rem .5rem; }

.btn-clear-tip {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #dc3545;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-clear-tip:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.btn-clear-tip:active {
    transform: translateY(-50%) scale(0.95);
}

/* Formato DataTables SalesOrder*/

/* ======================================================
   DATATABLE BASE
   ====================================================== */
#ordersTable {
  font-size: 0.9rem;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}

#ordersTable thead th {
  background: #f3f4f6;
  color: #374151;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  border: none;
  padding: 0.75rem 1rem;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

#ordersTable tbody tr {
  background: #fff;
  transition: box-shadow 0.2s ease, transform 0.1s ease;
  border-radius: 10px;
}

#ordersTable tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

#ordersTable tbody td {
  border-top: none;
  border-bottom: 1px solid #f1f3f5;
  vertical-align: middle;
  padding: 0.8rem 1rem;
}

/* ======================================================
   ORDER CONTEXT (Mesa / Mesero / Orden)
   ====================================================== */
.order-context-cell {
  line-height: 1.3;
  font-size: 0.85rem;
  color: #1e293b;
}

.context-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.table-name {
  font-size: 0.9rem;
  color: #2563eb;
}

.order-code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  border-radius: 6px;
  padding: 0.2rem 0.4rem;
  background: #f3f4f6;
  color: #111827;
}

.context-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
}

.waiter {
  font-size: 0.8rem;
  color: #6b7280;
}

.qty-badge {
  background: #eef2ff;
  color: #3730a3;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
}

/* ======================================================
   TOTALS (Click-toggle version)
   ====================================================== */
.totals-compact {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.total-main {
  font-size: 0.9rem;
  color: #059669;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
}

.total-breakdown {
  display: none;
  position: absolute;
  top: 120%;
  right: 50%;
  transform: translateX(50%);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  min-width: 160px;
  z-index: 10;
}

.total-item {
  display: flex;
  justify-content: space-between;
  color: #374151;
}

.total-item.total-negative {
  color: #dc2626;
}

/* ======================================================
   DTE STATUS
   ====================================================== */
.dte-info {
  font-size: 0.75rem;
  line-height: 1.4;
  text-align: center;
}

.dte-code {
  color: #6b7280;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  margin-top: 0.25rem;
}

.dte-sent {
  background: #dcfce7;
  color: #166534;
}

.dte-pending {
  background: #fef9c3;
  color: #92400e;
}

.dte-error {
  background: #fee2e2;
  color: #991b1b;
}

/* ======================================================
   STATUS BADGES
   ====================================================== */
.badge {
  border-radius: 20px;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-paid {
  background: #dcfce7;
  color: #166534;
}

.status-pending {
  background: #fef9c3;
  color: #92400e;
}

.status-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

/* ======================================================
   EMAIL STATUS
   ====================================================== */
.email-status {
  font-size: 0.75rem;
}

.email-sent {
  color: #16a34a;
}

.email-pending {
  color: #9ca3af;
}

/* ======================================================
   CLIENT NAME
   ====================================================== */
.company-name {
  font-weight: 600;
  color: #1f2937;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-name i {
  color: #9ca3af;
}

/* ======================================================
   DATE FORMAT
   ====================================================== */
.date-time {
  line-height: 1.3;
  color: #6b7280;
}

.date-time .date {
  font-weight: 600;
  color: #1e293b;
}

/* ======================================================
   ACTION BUTTONS
   ====================================================== */
.action-buttons {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
}

.btn-action {
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.btn-action:hover {
  transform: scale(1.05);
}

/* ======================================================
   STATUS ICONS (compact column)
   ====================================================== */
.status-icon-group i {
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.9;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.status-icon-group i:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Columna Totales con dropdown flotante */
.total-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  cursor: pointer;
}

.total-amount {
  font-weight: 700;
  color: #059669;
  font-family: "JetBrains Mono", monospace;
}

.total-toggle {
  color: #64748b;
  font-size: 0.75rem;
  transition: transform 0.2s;
}

.total-cell:hover .total-toggle {
  color: #4338ca;
  transform: rotate(180deg);
}

/* Popover */
.total-popover {
  position: absolute;
  top: 100%;
  right: 50%;
  transform: translateX(50%);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  min-width: 180px;
  z-index: 1000;
  display: none;
  animation: fadeIn 0.15s ease-out;
}

.total-popover::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 50%;
  transform: translateX(50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: white;
  border-left: 1px solid #e5e7eb;
  border-top: 1px solid #e5e7eb;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(50%) translateY(-5px); }
  to { opacity: 1; transform: translateX(50%) translateY(0); }
}

.total-popover .label {
  color: #6b7280;
}

.total-popover .value {
  font-weight: 600;
  color: #111827;
}

.total-popover .value.negative {
  color: #dc2626;
}

/* ===== Combobox de ingredientes (ARIA) ===== */
#ingredientResults .list-group-item[role="option"] { cursor: pointer; }
#ingredientResults .is-active { background: var(--primary-light, #eef6ff); }

/* Botón guardar bloqueado hasta válido */
.btn-save:disabled { opacity: .6; pointer-events: none; }

.btn-clear {
    border: none;
    background: transparent;
    color: #dc3545;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-clear:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.btn-clear:active {
    transform: translateY(5%) scale(0.95);
}

/* Contenedor de estado */
.status-cell {
    position: relative;
    min-height: 40px;
}

/* Indicador con punto pulsante */
.status-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
}

.status-dot.status-active {
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green 2s infinite;
}

.status-dot.status-inactive {
    background: #6b7280;
}

@keyframes pulse-green {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
}

/* Badge mejorado */
.status-badge {
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Switch premium */
.form-switch-lg .form-check-input {
    width: 3em;
    height: 1.5em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-switch-lg .form-check-input:hover:not(:disabled) {
    transform: scale(1.05);
}

.status-switch-premium:checked {
    background-color: #10b981;
    border-color: #10b981;
}

/* Loading state */
.status-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    backdrop-filter: blur(2px);
}

.status-cell.processing .status-content {
    opacity: 0.3;
    pointer-events: none;
}