/* ===================================
   PORTAL WANKE — ESTILOS PRINCIPALES
   =================================== */

:root {
  --primary: #1a56db;
  --primary-dark: #1e429f;
  --primary-light: #e8f0fe;
  --success: #0e9f6e;
  --success-light: #def7ec;
  --warning: #c27803;
  --warning-light: #fdf6b2;
  --danger: #e02424;
  --danger-light: #fde8e8;
  --purple: #7e3af2;
  --purple-light: #edebfe;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --sidebar-width: 240px;
  --header-height: 64px;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --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.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --transition: all 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ====== SIDEBAR ====== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--gray-900);
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: 2px 0 8px rgba(0,0,0,0.15);
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo .brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.5px;
}

.sidebar-logo .brand span {
  color: #60a5fa;
}

.sidebar-logo .subtitle {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gray-500);
  padding: 8px 20px 4px;
  margin-top: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--gray-300);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover {
  background: rgba(255,255,255,0.07);
  color: var(--white);
}

.nav-link.active {
  background: var(--primary);
  color: var(--white);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #60a5fa;
}

.nav-link i {
  width: 18px;
  text-align: center;
  font-size: 14px;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 11px;
  color: var(--gray-500);
}

/* ====== MAIN CONTENT ====== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ====== TOPBAR ====== */
.topbar {
  height: var(--header-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-title i {
  color: var(--primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-date {
  font-size: 12px;
  color: var(--gray-500);
}

/* ====== PAGE CONTENT ====== */
.page-content {
  padding: 28px;
  flex: 1;
}

/* ====== CARDS ====== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title i {
  color: var(--primary);
  font-size: 14px;
}

.card-body {
  padding: 20px;
}

/* ====== KPI CARDS ====== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.kpi-icon.blue { background: var(--primary-light); color: var(--primary); }
.kpi-icon.green { background: var(--success-light); color: var(--success); }
.kpi-icon.yellow { background: var(--warning-light); color: var(--warning); }
.kpi-icon.red { background: var(--danger-light); color: var(--danger); }
.kpi-icon.purple { background: var(--purple-light); color: var(--purple); }

.kpi-info .label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
}

.kpi-info .value {
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.1;
}

/* ====== PIPELINE STATES (LOGÍSTICA) ====== */
.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1100px) {
  .pipeline-grid { grid-template-columns: repeat(2, 1fr); }
}

.pipeline-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  border: 2px solid transparent;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.pipeline-card:hover, .pipeline-card.active {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pipeline-card.all { border-color: var(--primary); }
.pipeline-card.por_enviar { border-color: var(--warning); }
.pipeline-card.en_transito { border-color: var(--purple); }
.pipeline-card.entregado { border-color: var(--success); }

.pipeline-card .pipeline-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.pipeline-card.all .pipeline-icon { background: var(--primary-light); color: var(--primary); }
.pipeline-card.por_enviar .pipeline-icon { background: var(--warning-light); color: var(--warning); }
.pipeline-card.en_transito .pipeline-icon { background: var(--purple-light); color: var(--purple); }
.pipeline-card.entregado .pipeline-icon { background: var(--success-light); color: var(--success); }

.pipeline-card .pipeline-count {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.pipeline-card.all .pipeline-count { color: var(--primary); }
.pipeline-card.por_enviar .pipeline-count { color: var(--warning); }
.pipeline-card.en_transito .pipeline-count { color: var(--purple); }
.pipeline-card.entregado .pipeline-count { color: var(--success); }

.pipeline-card .pipeline-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
}

/* ====== BADGES/PILLS ====== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-yellow { background: var(--warning-light); color: var(--warning); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ====== TABLES ====== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  background: var(--gray-50);
  padding: 11px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
  color: var(--gray-700);
  font-size: 13.5px;
}

table tr:last-child td {
  border-bottom: none;
}

table tbody tr:hover {
  background: var(--gray-50);
}

/* ====== BUTTONS ====== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover { opacity: 0.88; }

.btn-warning {
  background: #f59e0b;
  color: white;
}
.btn-warning:hover { opacity: 0.88; }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { opacity: 0.88; }

.btn-outline {
  background: transparent;
  color: var(--gray-700);
  border: 1.5px solid var(--gray-300);
}
.btn-outline:hover { background: var(--gray-100); }

.btn-ghost {
  background: transparent;
  color: var(--gray-500);
  padding: 6px 10px;
}
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-800); }

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-icon {
  padding: 7px;
  border-radius: 7px;
}

/* ====== FORMS ====== */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
  margin-left: 3px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition);
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

.form-control::placeholder {
  color: var(--gray-400);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

select.form-control {
  cursor: pointer;
}

/* File upload zone */
.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--gray-50);
  position: relative;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-zone .upload-icon {
  font-size: 32px;
  color: var(--gray-400);
  margin-bottom: 8px;
}

.upload-zone .upload-text {
  font-size: 13px;
  color: var(--gray-600);
  font-weight: 500;
}

.upload-zone .upload-hint {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 4px;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--primary-light);
  border: 1.5px solid var(--primary);
  border-radius: 8px;
  margin-top: 8px;
}

.file-preview i {
  font-size: 20px;
  color: var(--primary);
}

.file-preview .file-name {
  flex: 1;
  font-size: 13px;
  color: var(--gray-800);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview .file-size {
  font-size: 11px;
  color: var(--gray-500);
}

.file-preview .remove-file {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 14px;
  border-radius: 4px;
}

.file-preview .remove-file:hover {
  background: var(--danger-light);
}

/* ====== MODALS ====== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(12px);
  transition: var(--transition);
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-lg {
  max-width: 800px;
}

.modal-xl {
  max-width: 960px;
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--gray-100);
  color: var(--gray-500);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.modal-close:hover { background: var(--gray-200); color: var(--gray-800); }

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ====== DOCUMENT VIEWER ====== */
.doc-viewer-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: var(--gray-100);
  padding: 4px;
  border-radius: 8px;
}

.doc-viewer-tab {
  flex: 1;
  padding: 7px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.doc-viewer-tab.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow);
}

.doc-viewer-content {
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  overflow: hidden;
  min-height: 300px;
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.doc-viewer-content iframe,
.doc-viewer-content img {
  width: 100%;
  height: 420px;
  border: none;
  object-fit: contain;
  display: block;
}

.doc-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-400);
}

.doc-empty i {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
}

.doc-empty p {
  font-size: 13px;
}

/* ====== PROGRESS BAR ====== */
.progress-container {
  margin-top: 12px;
  margin-bottom: 8px;
}

.progress-bar-outer {
  height: 8px;
  background: var(--gray-100);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
}

.progress-bar-segment {
  height: 100%;
  transition: width 0.4s ease;
}

.progress-bar-segment.por_enviar { background: #f59e0b; }
.progress-bar-segment.en_transito { background: var(--purple); }
.progress-bar-segment.entregado { background: var(--success); }

.progress-legend {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.progress-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--gray-600);
}

.progress-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ====== ALERTS & BANNERS ====== */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 13px;
}

.alert i {
  margin-top: 1px;
  flex-shrink: 0;
}

.alert-warning {
  background: var(--warning-light);
  color: #92400e;
  border: 1.5px solid #fcd34d;
}

.alert-info {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1.5px solid #93c5fd;
}

.alert-success {
  background: var(--success-light);
  color: #065f46;
  border: 1.5px solid #6ee7b7;
}

/* ====== SEARCH & FILTERS ====== */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-box i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 13px;
}

.search-box input {
  padding-left: 32px;
}

/* ====== EMPTY STATE ====== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-400);
}

.empty-state i {
  font-size: 52px;
  margin-bottom: 12px;
  display: block;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  color: var(--gray-400);
}

/* ====== PAGINATION ====== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--gray-100);
  font-size: 13px;
  color: var(--gray-500);
}

.pagination-btns {
  display: flex;
  gap: 4px;
}

.page-btn {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--gray-300);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover { background: var(--gray-100); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ====== DETAIL SECTION (inside modals) ====== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  margin-bottom: 16px;
}

.detail-item .detail-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-400);
  margin-bottom: 3px;
}

.detail-item .detail-value {
  font-size: 14px;
  color: var(--gray-800);
  font-weight: 500;
}

.detail-divider {
  border: none;
  border-top: 1px solid var(--gray-100);
  margin: 16px 0;
}

/* ====== TABS ====== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 18px;
  border: none;
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-btn:hover { color: var(--gray-700); }

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ====== RECORDATORIO CARDS ====== */
.recordatorio-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.recordatorio-card:hover {
  box-shadow: var(--shadow-md);
}

.recordatorio-card.urgente {
  border-color: var(--danger);
  background: var(--danger-light);
}

.recordatorio-card.hoy {
  border-color: var(--warning);
  background: var(--warning-light);
}

.recordatorio-info {
  flex: 1;
}

.recordatorio-cliente {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
}

.recordatorio-detalle {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* ====== UTILS ====== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-400); }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ====== TOAST ====== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--gray-900);
  color: white;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.3s ease;
  max-width: 320px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: #d97706; }

@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ====== LOADING ====== */
.loading-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ====== DIAS RECORDATORIO BUTTONS ====== */
.dias-btn.active-dias {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ====== AUTOCOMPLETE ====== */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1.5px solid var(--primary);
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow-md);
  z-index: 200;
  max-height: 240px;
  overflow-y: auto;
}

.autocomplete-item {
  padding: 9px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.12s;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.focused {
  background: var(--primary-light);
}

.autocomplete-item .ac-nombre {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-900);
}

.autocomplete-item .ac-detalle {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 1px;
}

.autocomplete-highlight {
  color: var(--primary);
  font-weight: 700;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-content { padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .pipeline-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
}
