/* Stylesheet for Cevichería Caña Brava AI Administrator */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-deep: #080d1a;
  --bg-panel: rgba(15, 23, 42, 0.65);
  --bg-surface: rgba(30, 41, 59, 0.45);
  --bg-surface-hover: rgba(30, 41, 59, 0.7);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --primary: #06b6d4;
  --primary-glow: rgba(6, 182, 212, 0.35);
  --primary-gradient: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
  --secondary: #10b981;
  --secondary-glow: rgba(16, 185, 129, 0.25);
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.2);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --sidebar-width: 260px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --blur: blur(16px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  overflow-x: hidden;
  height: 100vh;
  display: flex;
  background-image: 
    radial-gradient(at 0% 0%, rgba(14, 165, 233, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(6, 182, 212, 0.05) 0px, transparent 60%);
  background-attachment: fixed;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(8, 13, 26, 0.5);
}
::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Application Container Layout */
.app-container {
  display: flex;
  width: 100%;
  height: 100vh;
  position: relative;
}

/* Sidebar Navigation Styles */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(10, 17, 34, 0.8);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  height: 100%;
  backdrop-filter: var(--blur);
  z-index: 10;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-logo {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.5px;
}

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

.sidebar-status {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--secondary);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--secondary);
  animation: pulse 2s infinite;
}

.sidebar-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.nav-item:hover {
  color: var(--text-main);
  background: var(--bg-surface);
  border-color: var(--border-light);
}

.nav-item.active {
  color: #fff;
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: inset 0 0 12px rgba(6, 182, 212, 0.05);
}

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

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* Daily Exchange Rate Widget */
.exchange-rate-widget {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  background: rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exchange-rate-widget label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.exchange-rate-input-container {
  display: flex;
  gap: 8px;
  align-items: center;
}

.exchange-rate-input {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: var(--transition);
}

.exchange-rate-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

.exchange-rate-btn {
  padding: 0;
  font-size: 13px;
  border-radius: 8px;
  white-space: nowrap;
  height: 36px;
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  min-width: unset;
  flex-shrink: 0;
  cursor: pointer;
  transition: var(--transition);
}


/* Main Content Area */
.main-content {
  flex-grow: 1;
  height: 100%;
  overflow-y: auto;
  padding: 30px;
  position: relative;
}

/* Glassmorphism Section panels */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: var(--blur);
  padding: 24px;
  margin-bottom: 24px;
  animation: fadeIn 0.4s ease-out;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 16px;
}

.panel-title {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-description {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Tabs Visibility */
.tab-content {
  display: none;
}

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

/* Buttons Styling */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

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

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.6);
  color: var(--text-main);
  border-color: var(--border-light);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
}

.btn-danger {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  color: #fff;
  box-shadow: 0 4px 14px var(--danger-glow);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  color: #fff;
  box-shadow: 0 4px 14px var(--secondary-glow);
}

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

/* Forms and Inputs */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px 16px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* Upload Area Styling */
.upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: 16px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.3);
  transition: var(--transition);
  position: relative;
}

.upload-zone:hover {
  border-color: var(--primary);
  background: rgba(6, 182, 212, 0.03);
}

.upload-zone i {
  font-size: 40px;
  color: var(--primary);
  margin-bottom: 12px;
}

.upload-zone p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.upload-zone span {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.7);
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Chat Interface (AI Agent) Styling */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: var(--blur);
  overflow: hidden;
  animation: fadeIn 0.4s ease-out;
}

.chat-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-agent-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-agent-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.chat-agent-name {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 16px;
}

.chat-agent-title {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-messages {
  flex-grow: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.message {
  max-width: 80%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: messageSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.message.agent {
  align-self: flex-start;
}

.message.user {
  align-self: flex-end;
}

.message-bubble {
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.message.agent .message-bubble {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  border-top-left-radius: 4px;
}

.message.user .message-bubble {
  background: var(--primary-gradient);
  color: #fff;
  border-top-right-radius: 4px;
}

.message-time {
  font-size: 10px;
  color: var(--text-muted);
  align-self: flex-start;
}

.message.user .message-time {
  align-self: flex-end;
}

/* Special Message Elements (HTML inside Agent Responses) */
.chat-table-wrapper {
  margin-top: 10px;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border-light);
}

.chat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: rgba(15, 23, 42, 0.4);
}

.chat-table th, .chat-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.chat-table th {
  background: rgba(15, 23, 42, 0.8);
  color: var(--primary);
  font-weight: 600;
}

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

.chat-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.chat-stat-card {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}

.chat-stat-val {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.chat-stat-lbl {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.chat-chart-sim {
  margin-top: 10px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px;
}

.chat-chart-bar-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-chart-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}

.chat-chart-bar-name {
  width: 110px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.chat-chart-bar-outer {
  flex-grow: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.chat-chart-bar-inner {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 4px;
}

.chat-chart-bar-val {
  width: 70px;
  text-align: right;
  font-weight: 600;
}

/* Chat Input Bar */
.chat-input-container {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-input {
  flex-grow: 1;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 12px 18px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  transition: var(--transition);
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* Quick Queries Pill Grid */
.quick-queries {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 24px 16px;
  background: rgba(15, 23, 42, 0.4);
}

.query-pill {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.query-pill:hover {
  background: rgba(6, 182, 212, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}

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

.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  backdrop-filter: var(--blur);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
}

.stat-icon.primary { background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%); }
.stat-icon.success { background: linear-gradient(135deg, #34d399 0%, #10b981 100%); }
.stat-icon.warning { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); }
.stat-icon.danger { background: linear-gradient(135deg, #f87171 0%, #ef4444 100%); }

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

.stat-val {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.stat-lbl {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Table Style */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border-light);
}

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

.custom-table th {
  background: rgba(15, 23, 42, 0.8);
  padding: 14px 18px;
  font-weight: 600;
  color: var(--primary);
  border-bottom: 1px solid var(--border-light);
}

.custom-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.2);
}

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

.custom-table tr:hover td {
  background: rgba(30, 41, 59, 0.4);
}

/* Badge styling */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.badge-low {
  background: rgba(16, 185, 129, 0.15);
  color: var(--secondary);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-high {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-primary {
  background: rgba(6, 182, 212, 0.15);
  color: var(--primary);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

/* Progress bar inside panel */
.progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.progress-bar-outer {
  flex-grow: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 3px;
  transition: width 0.5s ease-out;
}

.progress-bar-inner.low {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
}

.progress-bar-inner.warning {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.progress-text {
  font-size: 11px;
  color: var(--text-muted);
  width: 50px;
  text-align: right;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 14px 20px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  backdrop-filter: var(--blur);
  transform: translateY(150%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
}

.toast-icon {
  color: var(--primary);
  font-size: 16px;
}

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

.toast-success .toast-icon {
  color: var(--secondary);
}

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

.toast-error .toast-icon {
  color: var(--danger);
}

/* Mobile elements hidden on desktop */
.mobile-header {
  display: none;
}
.sidebar-overlay {
  display: none;
}
.sidebar-mobile-close-container {
  display: none;
}

/* Two-column layout */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
}

@media (max-width: 992px) {
  .grid-2col {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  .app-container {
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
  }
  .mobile-header {
    display: flex;
    height: 60px;
    background: rgba(10, 17, 34, 0.95);
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: var(--blur);
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    flex-shrink: 0;
  }
  .mobile-logo {
    font-family: var(--font-title);
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
  }
  .mobile-logo i {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  .mobile-toggle-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    transition: var(--transition);
  }
  .mobile-toggle-btn:hover {
    background: rgba(255,255,255,0.1);
  }
  .sidebar-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(8, 13, 26, 0.98);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    border-right: 1px solid var(--border-light);
    flex-direction: column !important;
    display: flex !important;
  }
  .sidebar.active {
    left: 0;
  }
  .sidebar-mobile-close-container {
    display: flex;
    justify-content: flex-end;
    padding: 12px 16px 0 16px;
  }
  .mobile-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
  }
  .mobile-close-btn:hover {
    color: #fff;
  }
  .sidebar-nav {
    flex-direction: column !important;
    overflow-y: auto;
    padding: 16px 12px;
    gap: 6px;
    width: 100%;
  }
  .nav-item {
    width: 100%;
    padding: 12px 16px;
    white-space: normal;
  }
  .sidebar-header {
    padding: 12px 24px 20px 24px;
    border-bottom: 1px solid var(--border-light);
  }
  .sidebar-footer {
    display: flex !important;
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    margin-top: auto;
  }
  .exchange-rate-widget {
    display: flex !important;
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    margin-top: auto;
  }
  .main-content {
    height: calc(100vh - 60px) !important;
    padding: 12px !important;
  }
  .chat-container {
    height: 100% !important;
  }
  .panel {
    padding: 16px !important;
    margin-bottom: 16px !important;
    border-radius: 14px !important;
  }
  .custom-table th, .custom-table td {
    padding: 10px 12px !important;
    font-size: 12px !important;
  }
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  #analytics-kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  #analytics-charts-container {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  canvas {
    max-width: 100% !important;
  }
}

/* Print utility */
@media print {
  body {
    background: #fff;
    color: #000;
  }
  .sidebar, .chat-input-container, .quick-queries, .btn {
    display: none !important;
  }
  .main-content {
    width: 100%;
    padding: 0;
  }
  .panel {
    border: none;
    box-shadow: none;
    background: none;
    backdrop-filter: none;
    padding: 0;
    margin-bottom: 30px;
  }
  .custom-table th {
    color: #000;
    border-bottom: 2px solid #000;
  }
  .custom-table td {
    color: #000;
    border-bottom: 1px solid #ddd;
    background: none !important;
  }
}

/* Keyframes */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   OCR LOADER STYLES
   ========================================================================== */
.upload-zone {
  position: relative;
}

.ocr-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.95);
  border-radius: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-out;
}

.ocr-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(6, 182, 212, 0.1);
  border-left-color: var(--primary);
  border-radius: 50%;
  animation: ocr-spin 1s linear infinite;
  margin-bottom: 16px;
  box-shadow: 0 0 15px var(--primary-glow);
}

#ocr-loader-text {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  margin-bottom: 12px;
  text-align: center;
}

.ocr-progress-container {
  width: 80%;
  max-width: 250px;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.ocr-progress-bar {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 3px;
  width: 0%;
  transition: width 0.2s ease-out;
}

#ocr-progress-percent {
  font-size: 12px;
  color: var(--primary);
  font-weight: 700;
}

@keyframes ocr-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Sales Analytics Dashboard ("Análisis de Ventas") Styles
   ========================================================================== */

/* Period Selector Buttons */
.btn-period {
  transition: var(--transition);
}

.btn-period.active {
  background: var(--primary-gradient) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 0 10px var(--primary-glow) !important;
}

/* KPI Cards Layout & Visual Styling */
.kpi-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  backdrop-filter: var(--blur);
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.kpi-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 20px -8px var(--primary-glow);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary-gradient);
  opacity: 0;
  transition: var(--transition);
}

.kpi-card:hover::before {
  opacity: 1;
}

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

.kpi-card-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-card-icon {
  font-size: 16px;
  color: var(--primary);
  opacity: 0.8;
  background: rgba(6, 182, 212, 0.1);
  padding: 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.kpi-card-value {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.kpi-card-subtext {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.trend-up {
  color: var(--secondary) !important;
}

.trend-down {
  color: var(--danger) !important;
}

/* Collapsible Alerts Sidebar */
#analytics-alerts-sidebar {
  transition: var(--transition);
}

#analytics-alerts-sidebar.collapsed {
  width: 60px !important;
  min-width: 60px !important;
  overflow: hidden;
  padding: 16px 8px;
}

#analytics-alerts-sidebar.collapsed .panel-header h3,
#analytics-alerts-sidebar.collapsed #analytics-alerts-list {
  display: none !important;
}

#analytics-alerts-sidebar.collapsed .panel-header {
  justify-content: center !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
  margin-bottom: 0 !important;
}

/* Alert Item Cards inside the Alert Center */
.analytics-alert-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.2);
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.analytics-alert-item:hover {
  background: rgba(30, 41, 59, 0.4);
  border-color: var(--border-hover);
}

.analytics-alert-item.alert-danger {
  border-left: 4px solid var(--danger);
}

.analytics-alert-item.alert-warning {
  border-left: 4px solid var(--warning);
}

.analytics-alert-item.alert-success {
  border-left: 4px solid var(--secondary);
}

.analytics-alert-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.analytics-alert-icon.danger {
  color: var(--danger);
}

.analytics-alert-icon.warning {
  color: var(--warning);
}

.analytics-alert-icon.success {
  color: var(--secondary);
}

.analytics-alert-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.analytics-alert-title {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.analytics-alert-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.analytics-alert-time {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Interactive Sortable Headers */
th.sortable:hover {
  background: var(--bg-surface-hover) !important;
  color: var(--primary) !important;
}

th.sortable.asc i,
th.sortable.desc i {
  color: var(--primary) !important;
}

/* Product Search Autocomplete List */
#analytics-autocomplete-list div {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-main);
  transition: var(--transition);
}

#analytics-autocomplete-list div:hover {
  background: var(--primary-gradient);
  color: #fff;
}

