/* Professional Fintech Stylesheet for CPS SmartCobros */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* BRANDING */
  --primary: #f28c1b;
  --primary-hover: #d9750f;
  --primary-light: rgba(242, 140, 27, 0.08);
  --primary-glow: rgba(242, 140, 27, 0.25);

  /* BACKGROUNDS */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --dark-sidebar: #0f172a;

  /* TEXT - Improved contrast for accessibility */
  --text-main: #0f172a;
  --text-secondary: #1e293b;
  --text-muted: #475569;
  --text-light: #64748b;

  /* BORDERS & DIVIDERS */
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  /* SEMANTIC COLORS */
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.1);
  --info: #3b82f6;
  --info-light: rgba(59, 130, 246, 0.1);

  /* SHADOWS */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.15);

  /* SPACING (8px base) */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-2xl: 48px;

  /* SIZES */
  --border-radius: 12px;
  --navbar-height: 70px;
  --sidebar-width: 340px;
  --sidebar-width-mobile: 280px;

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

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* FOCUS INDICATOR - Accessibility improvement */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* TEXT SELECTION */
::selection {
  background-color: var(--primary);
  color: white;
}

/* TOP HORIZONTAL NAVIGATION BAR */
.top-navbar {
  height: 70px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 36px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-img {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 21px;
  color: #0f172a;
  letter-spacing: -0.5px;
}

.logo-orange {
  color: var(--primary); /* Brand Orange */
  position: relative;
}

.navbar-links {
  display: flex;
  list-style: none;
  gap: 6px;
}

.navbar-item {
  padding: 10px 18px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.navbar-item:hover {
  color: var(--primary);
  background-color: var(--primary-light);
}

.navbar-item.active {
  color: var(--primary);
  background-color: var(--primary-light);
  border-bottom: 2px solid var(--primary);
  border-radius: 8px 8px 0 0;
}

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

.icon-btn-round {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 700;
}

.icon-btn-round:hover {
  background: var(--bg-tertiary);
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.icon-btn-round:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* DROPDOWN STYLING - Estandarizado */
.dropdown-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23475569' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.dropdown-select:hover {
  border-color: var(--primary);
}

.dropdown-select:focus {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

/* HAMBURGER MENU - Mobile toggle */
.hamburger-btn {
  display: none;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--sp-sm);
  z-index: 1001;
}

.hamburger-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-main);
  margin: 6px 0;
  transition: all var(--transition-fast);
  border-radius: 2px;
}

.hamburger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

/* MAIN BODY WORKSPACE WRAPPER */
.main-wrapper {
  flex: 1;
  display: flex;
  overflow: hidden;
  transition: gap var(--transition-base);
}

/* CRITICAL BUG FIX: Ensure view sections hide when inactive */
.view-section {
  display: none;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-section.active {
  display: block;
}

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

/* LEFT SIDEBAR PANEL */
.left-fixed-sidebar {
  width: 320px;
  background-color: #ffffff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-shadow: 2px 0 10px rgba(0,0,0,0.01);
}

.left-fixed-sidebar.collapsed {
  width: 0;
  border-right: none;
}

.sidebar-top-actions {
  padding: 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background-color: #fafbfc;
}

.actions-row-buttons {
  display: flex;
  gap: 8px;
}

.square-action-btn {
  width: 38px;
  height: 38px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  color: #2563eb;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.square-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.square-action-btn.task { background: #fdf2f8; border-color: #fbcfe8; color: #db2777; }
.square-action-btn.comment { background: #f0fdf4; border-color: #dcfce7; color: #16a34a; }

.search-box-container {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-search-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  outline: none;
  font-size: 13.5px;
  background-color: #f8fafc;
  transition: border 0.2s;
}

.sidebar-search-input:focus {
  border-color: var(--primary);
  background-color: #fff;
}

.sidebar-meta-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 10px;
}

.sidebar-meta-item:last-child {
  border-bottom: none;
}

.sidebar-meta-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-meta-value {
  font-size: 13.5px;
  color: var(--text-main);
  font-weight: 700;
}

.sidebar-meta-value a {
  color: var(--primary);
  text-decoration: none;
}

.sidebar-bottom-actions {
  padding: 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #f8fafc;
}

/* RIGHT CONTENT CANVAS */
.right-canvas-area {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

/* BREADCRUMB AND TABS ROW */
.breadcrumb-row-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.path-selector {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
}

.path-selector span.curr-name {
  color: var(--text-main);
  font-weight: 800;
  cursor: pointer;
  border-bottom: 2px dashed var(--primary);
}

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

.breadcrumb-search-box {
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 12px;
  width: 220px;
}

.breadcrumb-search-input {
  border: none;
  outline: none;
  font-size: 13px;
  width: 100%;
  padding-left: 8px;
}

.tabs-round-container {
  display: flex;
  gap: 8px;
}

.tab-round-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-round-btn.active, .tab-round-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  transform: scale(1.05);
}

/* BREADCRUMB DROPDOWN SWITCHER PANEL */
.quick-client-switcher {
  position: relative;
  display: inline-block;
}

.switcher-dropdown-panel {
  position: absolute;
  top: 100%;
  left: 0;
  width: 280px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 10px;
  z-index: 1000;
  display: none;
}

.switcher-dropdown-panel.active {
  display: block;
}

.switcher-search {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  outline: none;
  margin-bottom: 8px;
  font-size: 13px;
}

.switcher-list {
  max-height: 200px;
  overflow-y: auto;
  list-style: none;
}

.switcher-item {
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.2s;
}

.switcher-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* BIG MAIN TITLE */
.main-big-title {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 24px;
}

/* THREE DYNAMIC FINTECH KPIS */
.fintech-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.fintech-kpi-card {
  background: white;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s;
}

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

.fintech-kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fintech-kpi-val {
  font-size: 28px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: #0f172a;
}

/* CHARTS LAYOUT */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
  margin-bottom: 28px;
}

.panel-card {
  background: #fff;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.panel-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 16px;
  color: #0f172a;
  font-family: 'Outfit', sans-serif;
}

.chart-wrapper {
  height: 240px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* CALENDAR & TASKS BOTTOM GRID */
.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--sp-lg);
  margin-bottom: var(--sp-xl);
}

.dashboard-bottom-grid .panel-card {
  display: flex;
  flex-direction: column;
  height: 420px;
  overflow: hidden;
  padding: var(--sp-md);
  margin-bottom: 0;
}

.card-header-flex, .calendar-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.tasks-filter-pill-container {
  display: flex;
  gap: 6px;
}

.task-pill {
  background: var(--bg-tertiary);
  border: none;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s ease;
}

.task-pill:hover, .task-pill.active {
  background: var(--primary);
  color: white;
}

.tasks-widget-list {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.task-widget-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  margin-bottom: 8px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.task-widget-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-glow);
}

.task-widget-checkbox {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.task-widget-info {
  flex: 1;
}

.task-widget-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.task-widget-meta {
  font-size: 11px;
  color: var(--text-light);
  display: flex;
  gap: 8px;
  align-items: center;
}

.task-tag {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.task-tag.alta {
  background: var(--danger-light);
  color: var(--danger);
}

.task-tag.media {
  background: var(--warning-light);
  color: var(--warning);
}

/* Compact Calendar */
.cal-nav-arrows {
  display: flex;
  gap: 6px;
}

.cal-arrow-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.cal-arrow-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.compact-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 12px;
  flex-grow: 1;
}

.calendar-day-header {
  font-weight: 800;
  font-size: 11px;
  color: var(--text-light);
  text-align: center;
  padding: 4px 0;
  text-transform: uppercase;
}

.calendar-day {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  aspect-ratio: 1.1;
  min-height: 0;
  padding: 2px;
}

.calendar-day:hover {
  background: var(--primary-light);
  border-color: var(--primary-glow);
}

.calendar-day.empty {
  background: transparent;
  border: none;
  cursor: default;
  pointer-events: none;
}

.calendar-day.today {
  border: 2px solid var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.calendar-day.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.calendar-day.selected .day-dot {
  background-color: white !important;
}

.day-dot-container {
  display: flex;
  gap: 2px;
  position: absolute;
  bottom: 4px;
}

.day-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.day-dot.high {
  background-color: var(--danger);
}

.day-dot.medium {
  background-color: var(--warning);
}

.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
  margin-top: auto;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.high {
  background-color: var(--danger);
}

.legend-dot.normal {
  background-color: var(--warning);
}

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

/* STANDARD TABLES */
.table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: white;
}

.standard-table {
  width: 100%;
  border-collapse: collapse;
}

.standard-table th, .standard-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13.5px;
}

.standard-table th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
}

.standard-table tr:hover {
  background-color: #f8fafc;
}

.tool-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.tool-left, .tool-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* PREMIUM ACTION BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-secondary {
  background-color: white;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: #f8fafc;
}

.search-field {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  outline: none;
  font-size: 13.5px;
  width: 240px;
}

.dropdown-select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  outline: none;
  font-size: 13.5px;
  background: white;
  font-weight: 600;
  cursor: pointer;
}

/* FLOATING CALC BAR */
.floating-calc-bar {
  position: fixed;
  bottom: 24px;
  left: 55%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 900;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-calc-bar.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* EXPANDABLE DATATABLES EXACTLY LIKE SCREENSHOT */
.facturas-title-row {
  font-size: 17px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  margin-bottom: 12px;
}

.invoice-datatable {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.invoice-datatable th, .invoice-datatable td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  text-align: left;
}

.invoice-datatable th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
}

.invoice-datatable tr:hover {
  background-color: #f9fafb;
}

.table-summary-bar {
  background-color: #f1f5f9;
  font-weight: 700;
  text-align: right;
  padding: 10px 14px;
  font-size: 13px;
  color: #0f172a;
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 8px 8px;
}

/* Modals Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: var(--border-radius);
  width: 580px;
  max-width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

/* GENERAL TABS WRAPPER */
.detail-tab-workspace {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

/* INBOX MAIL CLIENT LAYOUT */
.inbox-layout {
  display: grid;
  grid-template-columns: 200px 300px 1fr;
  height: calc(100vh - 200px);
  background: white;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.inbox-folders {
  background: #f8fafc;
  border-right: 1px solid var(--border-color);
  padding: 16px 8px;
}

.folder-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border-radius: 6px;
  border: none;
  background: none;
  text-align: left;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.folder-btn.active, .folder-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.inbox-list {
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.inbox-item {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}

.inbox-item:hover, .inbox-item.active {
  background: #f1f5f9;
}

.inbox-item.unassigned {
  border-left: 3px solid var(--primary);
}

.inbox-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 12px;
}

.inbox-item-sender {
  font-weight: 800;
}

.inbox-item-subject {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--text-main);
}

.inbox-item-body {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-detail {
  padding: 24px;
  overflow-y: auto;
}

/* FLOWCHART RULES */
.flowchart-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px;
  background: #f8fafc;
  border-radius: 8px;
  margin-top: 16px;
}

.flow-node {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  min-width: 150px;
  box-shadow: var(--shadow-sm);
}

.flow-node.highlight {
  border-color: var(--primary);
  background: var(--primary-light);
}

.flow-arrow {
  font-size: 24px;
  color: var(--text-muted);
}

/* TAB CONTENT TOGGLE PANELS */
.tab-content-panel {
  display: none !important;
}
.tab-content-panel.active {
  display: block !important;
}

/* PREMIUM MODAL AND FORM STYLING IMPROVEMENTS */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  background-color: #fafbfc;
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--text-main);
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

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

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
}

.form-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 13.5px;
  outline: none;
  background-color: #f8fafc;
  transition: all 0.2s;
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.form-input:focus {
  border-color: var(--primary);
  background-color: white;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input[readonly] {
  background-color: #e2e8f0;
  cursor: not-allowed;
  color: var(--text-muted);
  font-weight: 600;
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

/* HIGH-FIDELITY TOAST NOTIFICATION CONTAINER */
.toast-container {
  position: fixed;
  top: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast-card {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.25);
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 320px;
  max-width: 420px;
  border-left: 4px solid var(--primary);
  animation: toastSlideIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  transition: all 0.3s ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

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

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

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

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

.toast-icon {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-message {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  flex-grow: 1;
}

.toast-close {
  cursor: pointer;
  font-size: 11px;
  opacity: 0.5;
  transition: opacity 0.2s;
  padding: 4px;
  font-weight: 800;
}

.toast-close:hover {
  opacity: 1;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(120%) translateY(-10px);
    opacity: 0;
  }
  to {
    transform: translateX(0) translateY(0);
    opacity: 1;
  }
}

.toast-card.fade-out {
  transform: translateX(120%);
  opacity: 0;
}

/* PREMIUM SCROLLBARS CUSTOMIZATION */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* MODERN PILL ACTIVE TABS FOR NAVBAR */
.navbar-item.active {
  color: var(--primary) !important;
  background-color: var(--primary-light) !important;
  border-bottom: none !important;
  border-radius: 8px !important;
  box-shadow: 0 0 0 1px var(--primary-glow) inset;
}

/* BICOLOR PROGRESS BAR */
.bicolor-progress {
  display: flex;
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  width: 100%;
}
.progress-vencido {
  background-color: var(--danger);
  height: 100%;
  transition: width 0.3s ease;
}
.progress-novencido {
  background-color: var(--info);
  height: 100%;
  transition: width 0.3s ease;
}

/* Gmail-style Floating Compose Window */
.floating-compose {
  position: fixed;
  bottom: 0;
  right: 24px;
  width: 600px;
  background: white;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.08);
  z-index: 2000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: height 0.2s ease, transform 0.2s ease;
}

.floating-compose.active {
  display: flex;
}

.floating-compose.minimized {
  height: 48px !important;
}

.floating-compose-header {
  background: #0f172a;
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.floating-compose-title {
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.floating-compose-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.floating-compose-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 13px;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.floating-compose-btn:hover {
  color: white;
}

.floating-compose-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex: 1;
  max-height: 480px;
}

/* Custom Donut Legend styles */
.custom-donut-legend {
  display: flex;
  justify-content: space-around;
  padding: 0 10px;
  margin-top: 15px;
  font-family: 'Inter', sans-serif;
}

.square-action-btn.whatsapp {
  background: #128c7e;
  color: white;
}
.square-action-btn.whatsapp:hover {
  background: #25d366;
}

/* BICOLOR PROGRESS BAR TOOLTIP */
.bicolor-progress-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}
.caudex-tooltip {
  visibility: hidden;
  position: absolute;
  z-index: 9999;
  width: 260px;
  background-color: #ffffff;
  color: #1e293b;
  text-align: left;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 12px;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(10px);
  bottom: 125%; /* Show above */
  left: 50%;
  margin-left: -130px; /* Center tooltip */
  pointer-events: none;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  line-height: 1.5;
}
.caudex-tooltip::after {
  content: "";
  position: absolute;
  top: 100%; /* At the bottom of the tooltip */
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
}
.bicolor-progress-wrapper:hover .caudex-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

/* SEARCH BOX IN ADMIN PANEL */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box span {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  font-size: 13.5px;
  pointer-events: none;
}
.search-box input {
  padding: 8px 12px 8px 30px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  outline: none;
  font-size: 13px;
  width: 200px;
  background: white;
  color: var(--text-main);
  transition: all 0.2s;
}
.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
