/* ==========================================================================
   EL PALACIO DEL PINTOR - Enterprise CSS System
   ========================================================================== */

:root {
  /* Brand Palette (Inspired by Logo.png) */
  --brand-primary: #0f172a;        /* Deep Slate Navy */
  --brand-primary-light: #1e293b;  /* Slate Secondary */
  --brand-accent: #2563eb;         /* Royal Blue */
  --brand-accent-hover: #1d4ed8;
  --brand-gold: #f59e0b;           /* Amber / Gold */
  --brand-magenta: #ec4899;        /* Vibrant Magenta */
  --brand-cyan: #06b6d4;           /* Paint Cyan */
  --brand-green: #10b981;          /* Emerald Green */
  --brand-purple: #8b5cf6;         /* Violet Tint */

  /* Neutral Surface Colors */
  --bg-main: #f8fafc;
  --bg-sidebar: #0f172a;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  
  /* Text Colors */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-inverse: #ffffff;

  /* Status Colors */
  --status-success-bg: #d1fae5;
  --status-success-text: #065f46;
  --status-warning-bg: #fef3c7;
  --status-warning-text: #92400e;
  --status-danger-bg: #fee2e2;
  --status-danger-text: #991b1b;
  --status-info-bg: #e0f2fe;
  --status-info-text: #075985;
  --status-purple-bg: #f3e8ff;
  --status-purple-text: #6b21a8;

  /* Borders & Shadows */
  --border-color: #e2e8f0;
  --border-radius-sm: 6px;
  --border-radius: 10px;
  --border-radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);

  /* Layout Sizes */
  --sidebar-width: 270px;
  --header-height: 70px;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Utility Helpers */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.w-full { width: 100%; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--brand-accent);
  color: #ffffff;
}
.btn-primary:hover {
  background-color: var(--brand-accent-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-secondary {
  background-color: #ffffff;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background-color: var(--bg-hover);
  border-color: #cbd5e1;
}

.btn-success {
  background-color: var(--brand-green);
  color: #ffffff;
}
.btn-success:hover {
  background-color: #059669;
}

.btn-warning {
  background-color: var(--brand-gold);
  color: #ffffff;
}
.btn-warning:hover {
  background-color: #d97706;
}

.btn-danger {
  background-color: #ef4444;
  color: #ffffff;
}
.btn-danger:hover {
  background-color: #dc2626;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 4px;
}
.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
}

.btn-icon {
  padding: 8px;
  border-radius: var(--border-radius-sm);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 20px;
}

.badge-success { background: var(--status-success-bg); color: var(--status-success-text); }
.badge-warning { background: var(--status-warning-bg); color: var(--status-warning-text); }
.badge-danger { background: var(--status-danger-bg); color: var(--status-danger-text); }
.badge-info { background: var(--status-info-bg); color: var(--status-info-text); }
.badge-purple { background: var(--status-purple-bg); color: var(--status-purple-text); }

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-main);
}

.form-control, select.form-control, textarea.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background-color: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-input-group {
  position: relative;
  width: 100%;
}
.search-input-group i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.search-input-group input {
  padding-left: 40px;
}

/* App Container Layout */
#app-container {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  overflow-x: hidden;
}

/* Login View Screen */
#login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #090d16 100%);
  padding: 20px;
}

.login-box {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: var(--border-radius-lg);
  padding: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.login-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #f59e0b, #ec4899, #ef4444, #f59e0b, #10b981, #06b6d4, #2563eb);
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.login-brand img {
  height: 72px;
  margin-bottom: 12px;
  object-fit: contain;
}

.login-brand h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-primary);
}

.login-brand p {
  font-size: 13px;
  color: var(--text-muted);
}

.role-switcher-demo {
  margin-bottom: 20px;
  padding: 12px;
  background: var(--bg-main);
  border: 1px dashed var(--border-color);
  border-radius: var(--border-radius-sm);
  text-align: center;
}

.role-switcher-demo span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.role-buttons {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.role-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.role-btn.active {
  background: var(--brand-accent);
  color: #fff;
  border-color: var(--brand-accent);
}

/* Sidebar Styling */
aside#sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: all 0.3s ease;
  z-index: 100;
}

.sidebar-header {
  height: var(--header-height);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #1e293b;
}

.sidebar-header img {
  height: 42px;
  width: auto;
  border-radius: 6px;
  background: #fff;
  padding: 3px;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-text .title {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.sidebar-brand-text .subtitle {
  font-size: 11px;
  color: var(--brand-cyan);
  font-weight: 600;
  letter-spacing: 1px;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #475569;
  margin: 16px 8px 8px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  color: #64748b;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-item:hover i {
  color: var(--brand-accent);
}

.nav-item.active {
  background: var(--brand-accent);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.nav-item.active i {
  color: #ffffff;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid #1e293b;
  background: #090d16;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.user-role {
  font-size: 11px;
  color: var(--brand-cyan);
}

.btn-logout {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: color 0.2s;
}
.btn-logout:hover {
  color: #ef4444;
}

/* Main Content Layout */
#main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Header Bar */
header#top-bar {
  height: var(--header-height);
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-main);
  cursor: pointer;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.role-badge-top {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-primary);
}

.weather-badge-top {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.quick-action-btn {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.quick-action-btn:hover {
  background: #e2e8f0;
}

/* View Content Container */
#content-area {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

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

.view-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--brand-primary);
}

.view-header p {
  color: var(--text-muted);
  font-size: 13px;
}

/* Cards & Grid Layouts */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.kpi-card {
  background: #ffffff;
  border-radius: var(--border-radius);
  padding: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--brand-primary);
  line-height: 1.1;
}

.kpi-trend {
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-trend.up { color: var(--brand-green); }
.kpi-trend.down { color: #ef4444; }

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.kpi-icon.blue { background: #eff6ff; color: var(--brand-accent); }
.kpi-icon.green { background: #ecfdf5; color: var(--brand-green); }
.kpi-icon.gold { background: #fffbeb; color: var(--brand-gold); }
.kpi-icon.red { background: #fef2f2; color: #ef4444; }
.kpi-icon.purple { background: #faf5ff; color: var(--brand-purple); }

/* Main Card Container */
.content-card {
  background: #ffffff;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-primary);
}

.card-body {
  padding: 20px;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

table.data-table th {
  background: #f8fafc;
  padding: 12px 16px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

table.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

table.data-table tbody tr:hover {
  background-color: var(--bg-hover);
}

/* Action Buttons Table */
.action-btns {
  display: flex;
  gap: 6px;
}

/* Color Preview Swatch (Paint Store Special) */
.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #cbd5e1;
  display: inline-block;
  vertical-align: middle;
}

/* Tabs */
.tabs-header {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 18px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--brand-primary);
}

.tab-btn.active {
  color: var(--brand-accent);
  border-bottom-color: var(--brand-accent);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* POS & Ordering Split Screen */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .pos-layout {
    grid-template-columns: 1fr;
  }
}

.pos-cart-panel {
  background: #ffffff;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  padding: 20px;
  position: sticky;
  top: 90px;
}

/* Paint Catalog Cards */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.product-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  position: relative;
}

.product-card:hover {
  border-color: var(--brand-accent);
  box-shadow: var(--shadow-md);
}

.product-thumb {
  height: 100px;
  background: #f8fafc;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  position: relative;
}

.product-thumb img {
  max-height: 80px;
  max-width: 80px;
  object-fit: contain;
}

/* ==========================================================================
   ULTRA MODERN MODALS & POPUPS (GLASSMORPHISM & ELEGANT ANIMATIONS)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-container {
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 60px -12px rgba(15, 23, 42, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.2) inset, 0 12px 30px -5px rgba(37, 99, 235, 0.2);
  transform: scale(0.92) translateY(24px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

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

.modal-header {
  padding: 20px 28px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header h3 i {
  font-size: 20px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.modal-header .btn-logout, .modal-header .btn-close-modal {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0;
  padding: 0;
}

.modal-header .btn-logout:hover, .modal-header .btn-close-modal:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.modal-body {
  padding: 28px;
  overflow-y: auto;
  flex: 1;
  max-height: calc(85vh - 140px);
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.modal-body .form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.modal-body .form-control, .modal-body select.form-control {
  border-radius: 8px;
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  background-color: #f8fafc;
  font-size: 14px;
  transition: all 0.2s ease;
}

.modal-body .form-control:focus, .modal-body select.form-control:focus {
  background-color: #ffffff;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  outline: none;
}

.modal-footer {
  padding: 18px 28px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border-radius: 0 0 20px 20px;
}

.modal-footer .btn {
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.modal-footer .btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.modal-footer .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.modal-footer .btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
}

.modal-footer .btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

/* Viajante Mobile Optimization Header */
.viajante-mobile-bar {
  display: none;
  background: var(--brand-primary);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
}

/* Responsive Rules */
@media (max-width: 900px) {
  aside#sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -270px;
  }
  aside#sidebar.open {
    left: 0;
  }
  .mobile-toggle {
    display: block;
  }
  .viajante-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}

/* Print Header hidden on screen */
.print-header {
  display: none;
}

/* Print Styles for Quote/Invoice */
@media print {
  aside#sidebar, header#top-bar, .btn, .no-print {
    display: none !important;
  }
  #main-wrapper, #content-area {
    padding: 0 !important;
    margin: 0 !important;
  }
  .print-header {
    display: flex !important;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 2px solid #000;
  }
  .print-header img {
    height: 50px;
    width: auto;
  }
  .print-header h2 {
    margin: 0;
    font-size: 24px;
    color: #000;
  }
}

/* ==========================================================================
   PRODUCT IMAGE & EXTERNAL LINK STYLES
   ========================================================================== */
.prod-img-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-color);
  background-color: #f1f5f9;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.prod-img-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 18px;
  flex-shrink: 0;
}

.product-detail-image {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: var(--border-radius);
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 12px;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease;
}

.product-detail-image:hover {
  transform: scale(1.02);
}

.img-preview-box {
  width: 100%;
  height: 120px;
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  overflow: hidden;
  position: relative;
}

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

.btn-info-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-accent);
  font-weight: 600;
  text-decoration: none;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  transition: all 0.2s ease;
}

/* Tabs Component */
.tabs-header {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: -2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--brand-accent);
}

.tab-btn.active {
  color: var(--brand-accent);
  border-bottom-color: var(--brand-accent);
  background: rgba(37, 99, 235, 0.05);
  border-radius: 6px 6px 0 0;
}

.tab-content {
  display: none !important;
}

.tab-content.active {
  display: block !important;
}

/* ==========================================================================
   INTERACTIVE MONTHLY CALENDAR STYLES
   ========================================================================== */
.calendar-wrapper-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  background: #ffffff;
  scrollbar-width: thin;
}

.calendar-container {
  min-width: 750px;
  width: 100%;
  overflow: hidden;
  background: #ffffff;
}

.calendar-weekdays-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
  gap: 1px;
  background: #e2e8f0;
}

.calendar-day-cell {
  background: #ffffff;
  min-height: 110px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.calendar-day-cell:hover {
  background: #f8fafc;
}

.calendar-day-cell.other-month {
  background: #f8fafc;
  opacity: 0.55;
}

.calendar-day-cell.today {
  background: #f0f7ff;
  border: 2px solid var(--brand-accent);
}

.calendar-day-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.calendar-day-number {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.calendar-day-cell.today .calendar-day-number {
  background: var(--brand-accent);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

.calendar-events-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  max-height: 80px;
}

.calendar-event-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.calendar-event-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.calendar-event-pill.event-cobranza { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.calendar-event-pill.event-visita { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }
.calendar-event-pill.event-llamada { background: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.calendar-event-pill.event-entrega { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.calendar-event-pill.event-reunion { background: #fce7f3; color: #9d174d; border: 1px solid #fbcfe8; }



/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  padding: 16px 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 400px;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast i {
  font-size: 20px;
}

.toast-success i { color: #10b981; }
.toast-error i { color: #ef4444; }
.toast-warning i { color: #f59e0b; }
.toast-info i { color: #3b82f6; }

.toast-content {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  transition: color 0.2s ease;
}

.toast-close:hover {
  color: #475569;
}


/* ==========================================================================
   TICKET PRINT STYLES
   ========================================================================== */
.print-only {
  display: none;
}

@media print {
  body.is-printing-ticket #app-container {
    display: none !important;
  }
  body.is-printing-ticket .print-header {
    display: none !important;
  }
  body.is-printing-ticket .print-only {
    display: block !important;
  }
  
  .ticket-wrapper {
    width: 300px; /* Thermal printer width approx */
    margin: 0 auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    color: #000;
  }
  
  .ticket-header {
    text-align: center;
    margin-bottom: 10px;
  }
  
  .ticket-logo {
    width: 80px;
    height: auto;
    margin-bottom: 10px;
  }
  
  .ticket-header h2 {
    font-size: 16px;
    margin: 0 0 5px 0;
    text-transform: uppercase;
  }
  
  .ticket-header p {
    margin: 2px 0;
  }
  
  .ticket-divider {
    border-top: 1px dashed #000;
    margin: 10px 0;
  }
  
  .ticket-client p {
    margin: 3px 0;
  }
  
  .ticket-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
  }
  
  .ticket-item-name {
    flex: 1;
    padding-right: 10px;
  }
  
  .ticket-total-row {
    display: flex;
    justify-content: space-between;
    margin: 3px 0;
  }
  
  .ticket-final {
    font-size: 14px;
    font-weight: bold;
    margin-top: 5px;
  }
  
  .ticket-footer {
    text-align: center;
    margin-top: 20px;
    font-style: italic;
  }
}


.kpi-card.hover-lift:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.kpi-card { transition: transform 0.2s ease, box-shadow 0.2s ease; }

/* Logo Animation */
@keyframes logo-spin-bounce {
  0% { transform: scale(1) rotate(0deg); }
  40% { transform: scale(1.15) rotate(-10deg); }
  60% { transform: scale(1.15) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.sidebar-header:hover .brand-logo-anim {
  animation: logo-spin-bounce 0.6s ease-in-out;
}

/* Notificaciones */
.notif-item { padding: 12px 15px; border-bottom: 1px solid var(--border-color); display: flex; gap: 12px; transition: background 0.2s; }
.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: #eff6ff; }
.notif-icon { font-size: 18px; width: 24px; text-align: center; margin-top: 2px; }
.notif-content { flex: 1; }
.notif-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; color: var(--text-color); }
.notif-msg { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.notif-date { font-size: 10px; color: #94a3b8; margin-top: 4px; }

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE SYSTEM (ENHANCED UX FOR SMARTPHONES)
   ========================================================================== */

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar-close-btn {
  display: none;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
}

@media (max-width: 900px) {
  aside#sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -290px;
    width: 280px;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.4);
    z-index: 999;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  aside#sidebar.open {
    left: 0;
  }

  .sidebar-close-btn {
    display: inline-flex;
  }

  .mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #f1f5f9;
    color: var(--brand-primary);
    font-size: 17px;
    cursor: pointer;
    transition: background 0.2s ease;
  }

  .mobile-toggle:hover {
    background: #e2e8f0;
  }

  header#top-bar {
    padding: 0 16px;
  }

  #content-area {
    padding: 16px;
  }

  .view-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .view-header > div:last-child {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
  }
}

@media (max-width: 640px) {
  /* Prevent browser auto-zoom on mobile text inputs */
  input, select, textarea, .form-control {
    font-size: 16px !important;
  }

  #content-area {
    padding: 10px;
  }

  /* Header compact */
  header#top-bar {
    padding: 0 10px;
    height: 60px;
  }

  .role-badge-top {
    display: none !important;
  }

  .weather-badge-top {
    padding: 4px 8px;
    font-size: 11px;
  }

  #weather-city, .weather-badge-top span:nth-child(3) {
    display: none;
  }

  .quick-action-btn span {
    display: none;
  }

  .quick-action-btn {
    padding: 8px 10px;
    border-radius: 8px;
  }

  /* Login Screen */
  .login-box {
    padding: 24px 16px;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
  }

  .role-buttons {
    flex-wrap: wrap;
    gap: 6px;
  }

  .role-btn {
    flex: 1 1 30%;
    padding: 8px 4px;
    font-size: 11px;
    text-align: center;
  }

  /* Products & Catalog Grid */
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .product-card {
    padding: 10px;
  }

  .product-thumb {
    height: 85px;
    margin-bottom: 8px;
  }

  .product-thumb img {
    max-height: 65px;
    max-width: 65px;
  }

  .product-card h4 {
    font-size: 12px;
    line-height: 1.3;
    min-height: 32px;
  }

  .product-card .price {
    font-size: 14px;
  }

  .product-card .btn {
    padding: 6px 8px;
    font-size: 11px;
  }

  /* KPI Cards */
  .card-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .kpi-card {
    padding: 14px;
  }

  .kpi-value {
    font-size: 20px;
  }

  .kpi-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  /* Tables */
  .table-responsive {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    -webkit-overflow-scrolling: touch;
    margin-bottom: 12px;
  }

  table.data-table {
    min-width: 580px;
  }

  table.data-table th, table.data-table td {
    padding: 10px 12px;
  }

  /* Tabs Horizontal Scroll */
  .tabs-header {
    gap: 4px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    margin-bottom: 14px;
  }

  .tab-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  /* Modals - Mobile Bottom Sheet Style */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal-container {
    max-width: 100%;
    width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    transform: translateY(100%);
    margin: 0;
  }

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

  .modal-header {
    padding: 16px 20px;
  }

  .modal-header h3 {
    font-size: 16px;
  }

  .modal-body {
    padding: 16px 20px;
    max-height: calc(90vh - 130px);
  }

  .modal-footer {
    padding: 14px 20px;
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-footer .btn {
    width: 100%;
    min-height: 44px;
  }

  /* Buttons */
  .btn {
    min-height: 40px;
  }

  .btn-sm {
    min-height: 32px;
  }

  .action-btns {
    gap: 4px;
  }
}


