/* ================================================================
   POS SYSTEM — GLOBAL DESIGN SYSTEM
   Premium dark theme with vibrant gradients
   ================================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  /* Primary palette */
  --primary: #6C5CE7;
  --primary-light: #A29BFE;
  --primary-dark: #5A4BD1;

  /* Accent */
  --accent: #00D2FF;
  --accent-light: #48E8FF;
  --accent-dark: #00B4D8;

  /* Success / Warning / Danger */
  --success: #00C853;
  /* Darker green for light bg */
  --success-dark: #00A040;
  --warning: #FFAB00;
  /* Darker yellow/orange for light bg */
  --warning-dark: #FF6F00;
  --danger: #FF5252;
  --danger-dark: #D32F2F;

  /* Neutrals (Light Theme Default) */
  --bg-primary: #F4F6F8;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #EEF2F6;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8F9FA;

  /* Surface */
  --surface-1: #FFFFFF;
  --surface-2: #F1F3F5;
  --surface-3: #E9ECEF;

  /* Text */
  --text-primary: #2D3436;
  --text-secondary: #636E72;
  --text-muted: #B2BEC3;
  --text-accent: #6C5CE7;

  /* Borders */
  --border-color: rgba(108, 92, 231, 0.2);
  --border-light: rgba(0, 0, 0, 0.08);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6C5CE7 0%, #00D2FF 100%);
  --gradient-hero: linear-gradient(135deg, #F4F6F8 0%, #FFFFFF 100%);
  --gradient-card: linear-gradient(145deg, #FFFFFF 0%, #F4F6F8 100%);
  --gradient-success: linear-gradient(135deg, #00E676 0%, #00B4D8 100%);
  --gradient-danger: linear-gradient(135deg, #FF5252 0%, #FF7043 100%);
  --gradient-warning: linear-gradient(135deg, #FFB300 0%, #FF8F00 100%);

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.05);
  --glass-blur: 10px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 4px 20px rgba(108, 92, 231, 0.2);
  --shadow-glow-accent: 0 4px 20px rgba(0, 210, 255, 0.2);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 50%;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --header-height: 60px;
}

/* Dark Theme Override */
[data-theme="dark"] {
  /* Neutrals (dark theme) */
  --bg-primary: #0F0F1A;
  --bg-secondary: #1A1A2E;
  --bg-tertiary: #16213E;
  --bg-card: rgba(26, 26, 46, 0.7);
  --bg-card-hover: rgba(26, 26, 46, 0.9);

  /* Surface */
  --surface-1: #1E1E36;
  --surface-2: #252542;
  --surface-3: #2D2D50;

  /* Text */
  --text-primary: #FFFFFF;
  --text-secondary: #B0B0D0;
  --text-muted: #6C6C8A;
  --text-accent: #A29BFE;

  /* Borders */
  --border-light: rgba(255, 255, 255, 0.08);

  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #0F0F1A 0%, #1A1A2E 50%, #16213E 100%);
  --gradient-card: linear-gradient(145deg, rgba(108, 92, 231, 0.1) 0%, rgba(0, 210, 255, 0.05) 100%);

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

ul,
ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

/* ---------- Utility Classes ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-3xl) 0;
}

.text-center {
  text-align: center;
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  flex-direction: column;
}

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.gap-lg {
  gap: var(--space-lg);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.btn:hover::before {
  opacity: 1;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(108, 92, 231, 0.5);
}

.btn-secondary {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary-light);
}

.btn-success {
  background: var(--gradient-success);
  color: #fff;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(0, 230, 118, 0.4);
}

.btn-danger {
  background: var(--gradient-danger);
  color: #fff;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(255, 82, 82, 0.4);
}

.btn-warning {
  background: var(--gradient-warning);
  color: #1a1a2e;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.1rem;
  border-radius: var(--radius-lg);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
  font-size: 1rem;
}

/* Outline button variants */
.btn-outline-primary {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-outline-primary:hover {
  background: rgba(108, 92, 231, 0.1);
  border-color: var(--primary-light);
  color: var(--primary-light);
}

.btn-outline-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-outline-secondary:hover {
  background: var(--surface-2);
  border-color: var(--primary-light);
  color: var(--primary);
}

.btn-outline-success {
  background: transparent;
  border: 1px solid var(--success);
  color: var(--success);
}

.btn-outline-success:hover {
  background: rgba(0, 230, 118, 0.1);
  border-color: var(--success-dark);
  color: var(--success-dark);
}

/* ---------- Glass Cards ---------- */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-base);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-flat {
  background: var(--surface-1);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

/* ---------- Form Inputs ---------- */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  margin-bottom: var(--space-xs);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23B0B0D0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

/* ---------- Tables ---------- */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th {
  background: var(--surface-2);
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

.table tr:hover td {
  background: rgba(108, 92, 231, 0.05);
}

.table tr:last-child td {
  border-bottom: none;
}

/* Table scroll wrapper (e.g. Directorios/Productos) */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  margin-bottom: 16px;
  /* Evita que la columna Acciones quede oculta por elementos fijos */
  padding-right: 16px;
}

/* Tabla de productos/directorio: letras más pequeñas y compacta */
.page-content .table-responsive .table {
  font-size: 0.8rem;
}

.page-content .table-responsive .table th {
  padding: 10px 12px;
  font-size: 0.7rem;
}

.page-content .table-responsive .table td {
  padding: 8px 12px;
  font-size: 0.8rem;
}

.page-content .table-responsive .table td strong {
  font-size: 0.8rem;
}

/* Columna Acciones siempre visible: ancho mínimo y sin recortar */
.page-content .table-responsive .table th:last-child,
.page-content .table-responsive .table td:last-child {
  white-space: nowrap;
  min-width: 120px;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-primary {
  background: rgba(108, 92, 231, 0.15);
  color: var(--primary-light);
}

.badge-success {
  background: rgba(0, 230, 118, 0.15);
  color: var(--success);
}

.badge-warning {
  background: rgba(255, 179, 0, 0.15);
  color: var(--warning);
}

.badge-danger {
  background: rgba(255, 82, 82, 0.15);
  color: var(--danger);
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.modal-header h3 {
  font-size: 1.25rem;
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--danger);
  color: #fff;
}

/* ---------- Modal Tabs ---------- */
.tab-btn {
  background: transparent;
  border: none;
  padding: 12px 20px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-weight: 500;
}

.tab-btn:hover {
  color: var(--primary);
  background: var(--surface-2);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.modal-tab-content {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Toast Notifications ---------- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  min-width: 300px;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.4s ease;
  border-left: 4px solid var(--primary);
}

.toast.toast-success {
  border-left-color: var(--success);
}

.toast.toast-warning {
  border-left-color: var(--warning);
}

.toast.toast-danger {
  border-left-color: var(--danger);
}

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-size: 0.9rem;
}

.toast-close {
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-100px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

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

.animate-fadeIn {
  animation: fadeIn 0.6s ease;
}

.animate-fadeInUp {
  animation: fadeInUp 0.6s ease;
}

.animate-fadeInDown {
  animation: fadeInDown 0.5s ease;
}

.animate-scaleIn {
  animation: scaleIn 0.5s ease;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* Scroll-triggered animation classes */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Loading Spinner ---------- */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 220px;
  }

  .container {
    padding: 0 var(--space-md);
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .section {
    padding: var(--space-2xl) 0;
  }

  .hide-mobile {
    display: none !important;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
}

/* ================================================================
   INVOICE SYSTEM — Ticket Editor & Customization
   ================================================================ */

/* Invoice tabs */
.invoice-tabs {
  display: flex;
  gap: 8px;
}

.inv-kpi-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 24px;
}

/* Form rows */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.inv-totals-row {
  grid-template-columns: 1fr 1fr 1fr;
}

.inv-total-input {
  font-weight: 700;
  color: var(--success) !important;
  font-size: 1.1rem !important;
}

/* Invoice products list inside modal */
.inv-products-list {
  background: var(--surface-1);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  max-height: 200px;
  overflow-y: auto;
}

.inv-products-empty {
  padding: 30px;
  text-align: center;
  color: var(--text-muted);
}

.inv-products-empty i {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.inv-products-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.inv-products-table th {
  background: var(--surface-2);
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.inv-products-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

/* Voided invoice row */
.row-voided td {
  opacity: 0.5;
  text-decoration: line-through;
}

/* Folio code style */
.folio-code {
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* Action buttons group */
.action-btns {
  display: flex;
  gap: 4px;
}

/* Table empty state */
.table-empty-state {
  text-align: center;
  padding: 40px 20px !important;
  color: var(--text-muted);
}

.table-empty-state i {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

/* -------- Ticket Editor Layout -------- */
.ticket-editor-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

.ticket-editor-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ticket-preview-panel {
  position: sticky;
  top: 80px;
}

.ticket-preview-panel h3 {
  margin-bottom: 12px;
  font-size: 1rem;
  color: var(--text-secondary);
}

.ticket-preview-panel h3 i {
  color: var(--primary-light);
  margin-right: 6px;
}

/* Editor sections */
.editor-section {
  background: var(--surface-1);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
}

.editor-section h3 {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.editor-section h3 i {
  color: var(--primary-light);
  margin-right: 6px;
}

.editor-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.editor-section-header h3 {
  margin-bottom: 0;
}

/* Rich text editor */
.editor-toolbar {
  display: flex;
  gap: 4px;
  padding: 8px;
  background: var(--surface-2);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1px solid var(--border-light);
  border-bottom: none;
  flex-wrap: wrap;
}

.editor-toolbar button {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  font-size: 0.85rem;
}

.editor-toolbar button:hover {
  background: var(--primary);
  color: #fff;
}

.rich-editor {
  min-height: 120px;
  padding: 12px;
  background: #fff;
  color: #000;
  border: 1px solid var(--border-light);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.5;
  outline: none;
}

.rich-editor:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.2);
}

.rich-editor ul,
.rich-editor ol {
  list-style: disc;
  padding-left: 20px;
}

/* Logo preview */
.logo-preview-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-preview-box {
  width: 120px;
  height: 80px;
  background: var(--surface-2);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
  overflow: hidden;
}

.logo-preview-box i {
  font-size: 1.5rem;
}

.logo-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Settings grid */
.ticket-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.setting-item label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.setting-input-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.setting-input-group input {
  width: 70px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  text-align: center;
}

.setting-input-group input:focus {
  border-color: var(--primary);
}

.setting-input-group span {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 24px;
}

/* -------- Ticket Preview -------- */
.ticket-preview-wrapper {
  background: var(--surface-1);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  justify-content: center;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}

.ticket-preview {
  width: 80mm;
  background: #fff;
  color: #000;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  padding: 8mm;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  line-height: 1.4;
}

.ticket-preview .ticket-header {
  text-align: center;
  margin-bottom: 6px;
}

.ticket-preview .ticket-logo {
  display: block;
  margin: 0 auto 4px;
}

.ticket-preview .ticket-divider {
  border-top: 1px dashed #000;
  margin: 6px 0;
}

.ticket-preview .ticket-items table,
.ticket-preview .ticket-totals table {
  width: 100%;
  border-collapse: collapse;
}

.ticket-preview .ticket-items th,
.ticket-preview .ticket-items td {
  padding: 2px 0;
  text-align: left;
}

.ticket-preview .ticket-footer {
  margin-top: 6px;
  font-size: 9px;
}

.ticket-preview .ticket-footer ul {
  list-style: disc;
  padding-left: 14px;
}

/* Print content in modal */
.ticket-print-content {
  background: #fff;
  color: #000;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  padding: 12px;
  border-radius: var(--radius-sm);
  line-height: 1.4;
  max-height: 60vh;
  overflow-y: auto;
}

.ticket-print-content .ticket-header {
  text-align: center;
  margin-bottom: 6px;
}

.ticket-print-content .ticket-logo {
  display: block;
  margin: 0 auto 4px;
  max-height: 40mm;
}

.ticket-print-content .ticket-divider {
  border-top: 1px dashed #000;
  margin: 6px 0;
}

.ticket-print-content table {
  width: 100%;
  border-collapse: collapse;
}

.ticket-print-content th,
.ticket-print-content td {
  padding: 2px 0;
  text-align: left;
}

.ticket-print-content .ticket-footer {
  margin-top: 6px;
  font-size: 9px;
}

.ticket-print-content .ticket-footer ul {
  list-style: disc;
  padding-left: 14px;
}

/* Responsive */
@media (max-width: 1024px) {
  .ticket-editor-layout {
    grid-template-columns: 1fr;
  }

  .ticket-preview-panel {
    position: static;
  }

  .inv-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {

  .form-row,
  .inv-totals-row {
    grid-template-columns: 1fr;
  }

  .ticket-settings-grid {
    grid-template-columns: 1fr;
  }

  .inv-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Product Modal Refinements ---------- */
.modal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.modal-full-width {
  grid-column: 1 / -1;
}

.modal-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 4px;
}

.package-info-banner {
  background: rgba(52, 152, 219, 0.1);
  border-left: 4px solid #3498db;
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.package-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.package-table-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
}

.package-table th {
  background: var(--bg-tertiary);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 10px;
  text-align: left;
}

.package-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border-light);
}

.btn-icon-danger {
  color: var(--danger);
  background: rgba(255, 82, 82, 0.1);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon-danger:hover {
  background: var(--danger);
  color: white;
}

/* ---------- Navigation Tabs (Custom Style) ---------- */
.nav-tabs {
  display: flex;
  padding-left: 20px;
  margin-bottom: 0;
  list-style: none;
  border-bottom: 0;
  /* Removing border to merge with card */
  gap: 5px;
}

.nav-item {
  margin-bottom: 0;
}

.nav-link {
  display: block;
  padding: 10px 25px;
  text-decoration: none;
  border-top-left-radius: 10px;
  border-top-right-radius: 25px;
  /* Asymmetric pleasant curve */
  color: var(--text-secondary);
  background: #e9ecef;
  /* Inactive gray */
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  top: 1px;
  /* To overlap the content border if needed */
  border: 1px solid transparent;
}

.nav-link:hover {
  background: #dfe6e9;
  color: var(--primary);
}

.nav-link.active {
  color: var(--primary);
  background-color: #ffffff;
  font-weight: 600;
  border-top: 3px solid var(--accent);
  /* The blue top visual */
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
}