/* =====================================================
   FRILLO — Views (Novas Telas)
   Estilos específicos para Mensagens, Clientes, Calendário, etc.
   ===================================================== */

/* ════════════════════════════════════════
   MENSAGENS (WhatsApp Mock)
   ════════════════════════════════════════ */
.messages-container {
  display: flex;
  height: calc(100vh - 180px);
  margin: 0 var(--space-6) var(--space-6);
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.messages-sidebar {
  width: 320px;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
}

.messages-search {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.messages-search input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.messages-search input:focus {
  border-color: var(--accent);
  outline: none;
}

.messages-list {
  flex: 1;
  overflow-y: auto;
}

.message-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.message-item:hover {
  background: var(--bg-card-hover);
}

.message-item.active {
  background: var(--bg-chip-active);
  border-left: 3px solid var(--accent);
}

.message-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: var(--accent);
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.message-info {
  flex: 1;
  overflow: hidden;
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-1);
}

.message-name {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.message-preview {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.messages-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

.chat-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-card);
}

.chat-history {
  flex: 1;
  padding: var(--space-6);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.chat-bubble {
  max-width: 70%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  line-height: 1.5;
  position: relative;
}

.chat-bubble.received {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-bottom-left-radius: 4px;
}

.chat-bubble.sent {
  align-self: flex-end;
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  display: block;
  text-align: right;
  margin-top: var(--space-1);
}

.chat-bubble.sent .chat-time {
  color: rgba(255,255,255,0.7);
}

.chat-input-area {
  padding: var(--space-4);
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.chat-input-area input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  background: var(--bg-input);
  color: var(--text-primary);
}

.chat-input-area input:focus {
  border-color: var(--accent);
  outline: none;
}

/* ════════════════════════════════════════
   CLIENTES
   ════════════════════════════════════════ */
#clients-subheader .filter-select {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 500;
  outline: none;
  cursor: pointer;
  min-width: 180px;
  transition: all var(--transition-fast);
}

#clients-subheader .filter-select:hover {
  border-color: var(--border-default);
  background-color: var(--bg-card-hover);
}

#clients-subheader .filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: var(--space-6);
  padding: var(--space-6);
  animation: fadeInUp 450ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Card Premium de Cliente */
.client-card {
  background: var(--bg-card-premium);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 300ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 300ms cubic-bezier(0.16, 1, 0.3, 1);
}



.client-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md), 0 12px 24px -10px rgba(0, 0, 0, 0.15);
  border-color: var(--accent);
}



.client-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-4);
}

.client-card-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.client-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--bg-chip) 0%, var(--bg-input) 100%);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--accent);
  font-size: var(--text-md);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

.client-card-name {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.client-card-actions {
  display: flex;
  gap: 2px;
  margin-top: -4px;
  margin-right: -4px;
}

.client-card-actions .btn-action {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.client-card-actions .btn-action:hover {
  background-color: var(--bg-chip);
  color: var(--text-primary);
}

.client-card-actions .btn-action.btn-delete:hover {
  background-color: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

.client-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-4);
}

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

.client-card-stat-label {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.client-card-stat-label svg {
  color: var(--text-muted);
}

.client-card-stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.client-card-stat-value.demand-badge {
  background-color: var(--bg-chip);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  border: 1px solid var(--border-subtle);
}

.client-card-footer {
  margin-top: auto;
}

.client-card-footer .btn-view-demands {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.client-card-footer .btn-view-demands svg {
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.client-card-footer .btn-view-demands:hover svg {
  transform: translateX(4px);
}

/* ════════════════════════════════════════
   CALENDÁRIO
   ════════════════════════════════════════ */
#calendar-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.calendar-container {
  flex: 1;
  margin: 0 var(--space-6) var(--space-6);
  display: flex;
  flex-direction: column;
}

/* ── Calendar Subheader Styles ── */
#calendar-subheader .calendar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

#calendar-subheader .calendar-nav .btn-icon {
  height: 40px !important;
  width: 40px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

#calendar-subheader .calendar-nav .btn-icon:hover {
  border-color: var(--border-default);
  background-color: var(--bg-chip);
  color: var(--text-primary);
}

#calendar-subheader .calendar-nav .btn-ghost {
  height: 40px !important;
  padding: 0 var(--space-4) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-md) !important;
  font-size: var(--text-sm) !important;
  font-weight: 500 !important;
  cursor: pointer;
  background: transparent !important;
  color: var(--text-secondary) !important;
  transition: all var(--transition-fast) !important;
}

#calendar-subheader .calendar-nav .btn-ghost:hover {
  border-color: var(--border-default) !important;
  background-color: var(--bg-chip) !important;
  color: var(--text-primary) !important;
}

#calendar-subheader .calendar-month-title {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  min-width: auto;
  margin-left: var(--space-2);
}

.calendar-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: auto repeat(6, 1fr);
  gap: var(--space-2);
  padding: var(--space-3);
  width: 100%;
  box-sizing: border-box;
}

.calendar-day-header {
  padding: var(--space-2) 0;
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  background: transparent;
}

.calendar-day {
  min-height: 90px;
  padding: var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-card-premium);
  transition: background var(--transition-fast);
  position: relative;
  cursor: default;
}

.calendar-day.has-events {
  cursor: pointer;
}

.calendar-day.has-events:hover {
  background: var(--bg-card);
}

.calendar-day.empty {
  background: var(--bg-primary);
  color: var(--text-muted);
}

.calendar-date {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: block;
}

.calendar-day.today {
  background: var(--accent) !important;
}

.calendar-day.today .calendar-date {
  color: #000;
  font-weight: 700;
  background: transparent;
  width: auto;
  height: auto;
  border-radius: 0;
  display: block;
}

/* ── Dots ── */
.cal-dots {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  position: absolute;
  bottom: var(--space-2);
  left: var(--space-2);
}

.cal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ── Floating Popup ── */
.cal-popup {
  position: fixed;
  z-index: 9999;
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  min-width: 220px;
  max-width: 280px;
  box-shadow: var(--shadow-lg);
}

.cal-popup-header {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
}

.cal-popup-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.cal-popup-item:hover {
  background: var(--bg-chip);
}

.cal-popup-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-popup-label {
  font-size: var(--text-xs);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ════════════════════════════════════════
   PRODUTIVIDADE (DASHBOARD)
   ════════════════════════════════════════ */
.dashboard-container {
  margin: 0 var(--space-6) var(--space-6);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-base);
}

.stat-card:hover {
  border-color: rgba(124, 58, 237, 0.25);
  box-shadow: 0 12px 24px rgba(0,0,0,0.4);
}

.stat-card.wide {
  grid-column: span 2;
}

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

.stat-card-title {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--bg-chip);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.stat-card-value {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: var(--space-1);
}

.stat-card-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 500;
}

.stat-card-trend.positive { color: #10B981; }
.stat-card-trend.negative { color: #EF4444; }

/* --- CUSTOM PRODUCTIVITY DASHBOARD VIEW STYLES --- */

#view-productivity {
  padding-top: var(--space-4);
}

/* Productivity Filter Bar */
.prod-filter-bar {
  margin: 0 var(--space-6) var(--space-6);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  animation: dashboardCardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.prod-filter-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.prod-filter-controls {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.prod-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.prod-filter-group label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 700;
}

.prod-select {
  background: var(--bg-chip);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 0 var(--space-3);
  height: 36px;
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
  min-width: 140px;
}

.prod-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Donut Chart Segment */
.prod-chart-donut-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex: 1;
}

.prod-chart-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  max-height: 160px;
  overflow-y: auto;
  padding-right: var(--space-1);
}

.prod-chart-legend::-webkit-scrollbar {
  width: 4px;
}
.prod-chart-legend::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: var(--radius-full);
}

.prod-legend-item {
  display: grid;
  grid-template-columns: 10px 1.2fr 1fr;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.01);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.prod-legend-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.prod-legend-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.prod-legend-name {
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prod-legend-value {
  color: var(--text-secondary);
  text-align: right;
  font-family: var(--font-mono);
}

/* Wave Chart SVG styling */
.prod-wave-chart-container {
  width: 100%;
  height: 180px;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.prod-wave-chart-container svg {
  width: 100%;
  height: 100%;
}

.wave-chart-node circle {
  transform-origin: center;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wave-chart-node:hover circle {
  transform: scale(1.4);
}

/* Fluid Entry Animations with Staggered Delays */
@keyframes dashboardCardIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.anim-delay-1, .anim-delay-2, .anim-delay-3, .anim-delay-4,
.anim-delay-5, .anim-delay-6, .anim-delay-7, .anim-delay-8 {
  opacity: 0;
  animation: dashboardCardIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.anim-delay-1 { animation-delay: 35ms; }
.anim-delay-2 { animation-delay: 70ms; }
.anim-delay-3 { animation-delay: 105ms; }
.anim-delay-4 { animation-delay: 140ms; }
.anim-delay-5 { animation-delay: 175ms; }
.anim-delay-6 { animation-delay: 210ms; }
.anim-delay-7 { animation-delay: 245ms; }
.anim-delay-8 { animation-delay: 280ms; }

/* Grid layout overrides on mobile screens */
@media (max-width: 1024px) {
  .prod-dashboard-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .prod-dashboard-grid .stat-card.wide {
    grid-column: span 2 !important;
  }
}

@media (max-width: 768px) {
  .prod-dashboard-grid {
    grid-template-columns: 1fr !important;
  }
  .prod-dashboard-grid .stat-card.wide {
    grid-column: span 1 !important;
  }
  .prod-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .prod-filter-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .prod-select {
    width: 100%;
  }
}

/* ════════════════════════════════════════
   AJUSTES (SETTINGS)
   ════════════════════════════════════════ */
.settings-container {
  max-width: 800px;
  margin: 0 var(--space-6) var(--space-6);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.settings-section {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section-title {
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.settings-section-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

.settings-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

.avatar-upload-area {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-top: var(--space-2);
}

.avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-chip);
  border: 2px solid var(--border-subtle);
}

.avatar-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-preview-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
  color: var(--text-secondary);
}

.avatar-upload-actions {
  display: flex;
  gap: var(--space-2);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-label {
  font-weight: 500;
  color: var(--text-primary);
  display: block;
  margin-bottom: var(--space-1);
}

.settings-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* Custom Switch/Toggle Button */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  transition: .25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 24px;
}

.slider::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: .25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: var(--accent);
  border-color: var(--accent);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
  background-color: #ffffff;
}

.switch input:focus + .slider {
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* ════════════════════════════════════════
   AJUSTES — SPLIT LAYOUT
   ════════════════════════════════════════ */
.settings-split-layout {
  display: flex;
  gap: 0;
  margin: var(--space-6) var(--space-6) var(--space-6);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  flex: 1;
  min-height: 0;
}

.settings-nav {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4);
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.settings-nav-item svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.settings-nav-item:hover {
  background: var(--bg-chip);
  color: var(--text-primary);
}

.settings-nav-item.active {
  background: var(--bg-chip-active);
  color: var(--accent);
}

.settings-panel {
  flex: 1;
  overflow-y: auto;
  min-height: 400px;
}

.settings-panel .settings-section {
  padding: var(--space-6);
}

.settings-panel .settings-section-title {
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.settings-panel .settings-section-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

.settings-panel .settings-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

.settings-panel .settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.settings-panel .settings-row:last-child {
  border-bottom: none;
}

.settings-panel .settings-label {
  font-weight: 500;
  color: var(--text-primary);
  display: block;
  margin-bottom: var(--space-1);
}

.settings-panel .settings-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ── Theme Selection Buttons ── */
.settings-panel .settings-row.theme-settings-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
}

.theme-buttons-container {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  width: 100%;
  margin-top: var(--space-1);
}

.theme-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-chip);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-btn .theme-color-preview {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  transition: transform var(--transition-fast);
}

.theme-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.theme-btn:hover .theme-color-preview {
  transform: scale(1.2);
}

/* Custom Theme Active States matching original palette colors */
.theme-btn[data-theme="violeta"]:hover,
.theme-btn[data-theme="violeta"].active {
  border-color: #7C5CFC;
}
.theme-btn[data-theme="violeta"].active {
  background: rgba(124, 92, 252, 0.1);
  color: var(--text-primary);
  box-shadow: 0 0 0 2px rgba(124, 92, 252, 0.25);
  font-weight: 600;
}

.theme-btn[data-theme="foco"]:hover,
.theme-btn[data-theme="foco"].active {
  border-color: #b8fa5b;
}
.theme-btn[data-theme="foco"].active {
  background: rgba(184, 250, 91, 0.1);
  color: var(--text-primary);
  box-shadow: 0 0 0 2px rgba(184, 250, 91, 0.25);
  font-weight: 600;
}

.theme-btn[data-theme="suave"]:hover,
.theme-btn[data-theme="suave"].active {
  border-color: #be9df6;
}
.theme-btn[data-theme="suave"].active {
  background: rgba(190, 157, 246, 0.1);
  color: var(--text-primary);
  box-shadow: 0 0 0 2px rgba(190, 157, 246, 0.25);
  font-weight: 600;
}

.theme-btn[data-theme="menta"]:hover,
.theme-btn[data-theme="menta"].active {
  border-color: #27b1a1;
}
.theme-btn[data-theme="menta"].active {
  background: rgba(39, 177, 161, 0.1);
  color: var(--text-primary);
  box-shadow: 0 0 0 2px rgba(39, 177, 161, 0.25);
  font-weight: 600;
}

.theme-btn[data-theme="mono"]:hover,
.theme-btn[data-theme="mono"].active {
  border-color: #eceef5;
}
.theme-btn[data-theme="mono"].active {
  background: rgba(236, 238, 245, 0.08);
  color: var(--text-primary);
  box-shadow: 0 0 0 2px rgba(236, 238, 245, 0.18);
  font-weight: 600;
}

.theme-btn[data-theme="rubi"]:hover,
.theme-btn[data-theme="rubi"].active {
  border-color: #ef4444;
}
.theme-btn[data-theme="rubi"].active {
  background: rgba(239, 68, 68, 0.1);
  color: var(--text-primary);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
  font-weight: 600;
}

/* ── Cropper Modal ── */
.cropper-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

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

.cropper-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 360px;
  padding: var(--space-5);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transform: scale(0.95);
  transition: transform var(--transition-bounce);
}

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

.cropper-modal-title {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.cropper-workspace {
  width: 280px;
  height: 280px;
  background: var(--bg-card-premium);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  margin: 0 auto;
  cursor: grab;
  user-select: none;
}

.cropper-workspace:active {
  cursor: grabbing;
}

.cropper-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: none;
  pointer-events: none; /* so dragging container handles the mouse movements */
}

.cropper-circle-overlay {
  position: absolute;
  top: 40px; /* (280 - 200)/2 */
  left: 40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(10, 10, 10, 0.6);
  pointer-events: none;
  z-index: 2;
}

.cropper-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0 var(--space-2);
}

.cropper-zoom-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: 500;
}

.cropper-zoom-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.cropper-zoom-slider {
  flex: 1;
  height: 4px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}

.cropper-zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  transition: transform var(--transition-fast);
}

.cropper-zoom-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.cropper-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.cropper-actions button {
  flex: 1;
}
