﻿/* ═══════════════════════════════════════════════════
   Lead360 · Design Tokens · Leading.Zone Brand
   Dark mode default (vCita-style), Light mode via [data-theme=light]
═══════════════════════════════════════════════════ */
:root {
  /* LZ Brand — Primary: Red/Coral (identity color) */
  --lz-red:         #E63946;
  --lz-red-dark:    #C1121F;
  --lz-red-light:   #FF6B78;
  --lz-red-glow:    rgba(230, 57, 70, 0.25);

  /* Dark mode surfaces (GitHub-inspired, same as vCita dashboard) */
  --color-bg:        #0d1117;
  --color-surface:   #161b22;
  --color-surface-2: #1c2333;
  --color-surface-3: #2d333b;
  --color-border:    rgba(48, 54, 61, 0.9);
  --color-border-hover: rgba(99, 110, 123, 0.7);

  /* Primary = LZ Red */
  --color-primary:   #E63946;
  --color-primary-2: #FF6B78;
  --grad-primary:    linear-gradient(135deg, #E63946, #FF6B78);
  --grad-primary-hover: linear-gradient(135deg, #C1121F, #E63946);

  /* Semantic colors */
  --color-success: #3fb950;
  --color-warning: #e3b341;
  --color-danger:  #f85149;
  --color-info:    #58a6ff;

  /* Text */
  --color-text:    #e6edf3;
  --color-text-2:  #8b949e;
  --color-text-3:  #6e7681;

  /* Typography */
  --font: 'Inter', sans-serif;

  /* Spacing & Shape */
  --radius:    12px;
  --radius-sm:  8px;
  --radius-lg: 20px;

  /* Shadows */
  --shadow:    0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);

  /* Glass */
  --glass:        rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);

  /* Transitions */
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --sidebar-w: 260px;
  --topbar-h:   64px;
}

/* ── Light Mode ─────────────────────────────────── */
[data-theme="light"] {
  --color-bg:        #f6f8fa;
  --color-surface:   #ffffff;
  --color-surface-2: #f0f2f5;
  --color-surface-3: #e5e9ef;
  --color-border:    rgba(0, 0, 0, 0.10);
  --color-border-hover: rgba(0, 0, 0, 0.20);

  --color-text:    #1f2937;
  --color-text-2:  #4b5563;
  --color-text-3:  #9ca3af;

  --glass:        rgba(0, 0, 0, 0.02);
  --glass-border: rgba(0, 0, 0, 0.08);

  --shadow:    0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--color-surface-3);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* Layout */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform var(--transition);
}

.main-content {
  grid-column: 2;
  min-height: 100vh;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.page {
  display: none;
  animation: fadeIn 0.3s ease-out;
  padding: 24px;
}

.page.active {
  display: block;
}

/* Sidebar Components */
.sidebar-header {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--grad-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: white;
}

.logo-info {
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
}

.logo-sub {
  font-size: 12px;
  color: var(--color-text-2);
}

.sidebar-user {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 16px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: var(--grad-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.user-info {
  overflow: hidden;
}

.user-name {
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--color-primary-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

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

.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--color-text-3);
  font-weight: 600;
  letter-spacing: 1px;
  padding: 16px 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  color: var(--color-text);
  background: var(--glass);
  border-left-color: var(--color-primary-2);
}

.nav-item.active {
  background: var(--grad-primary);
  color: white;
  border-left-color: transparent;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  opacity: 0.8;
}

.nav-item.active svg {
  opacity: 1;
}

.nav-badge-new {
  margin-left: auto;
  background: var(--grad-primary);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
}

.nav-count {
  margin-left: auto;
  background: var(--color-surface-3);
  color: var(--color-text);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.nav-dot-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--color-success);
  border-radius: 50%;
  margin-left: auto;
  box-shadow: 0 0 8px var(--color-success);
  animation: pulse 2s infinite;
}

.sidebar-footer {
  padding: 24px;
  border-top: 1px solid var(--color-border);
}

.sidebar-prog-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-text-2);
  margin-bottom: 8px;
}

.sidebar-prog-track {
  height: 6px;
  background: var(--color-surface-2);
  border-radius: 3px;
  overflow: hidden;
}

.sidebar-prog-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 3px;
  transition: width 0.5s ease-out;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  background: rgba(10, 11, 20, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 30;
}

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

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  padding: 4px;
}

.topbar-title {
  font-size: 20px;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.action-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-2);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.action-btn:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
  border-color: var(--color-border-hover);
}

.action-btn.has-notif::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: var(--color-danger);
  border-radius: 50%;
  border: 2px solid var(--color-surface);
}

.lang-selector {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

/* Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-glass {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

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

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.card-body {
  padding: 24px;
}

.stat-card {
  padding: 24px;
  border-top: 3px solid transparent;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-primary);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  background: var(--glass);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary-2);
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: var(--color-text-2);
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
}

.stat-trend.positive {
  background: rgba(34, 197, 94, 0.1);
  color: var(--color-success);
}
.stat-trend.negative {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}
.stat-trend.neutral {
  background: rgba(148, 163, 184, 0.1);
  color: var(--color-text-2);
}

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

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font);
  font-size: 14px;
  padding: 12px 16px;
  transition: var(--transition);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(108, 61, 232, 0.2);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-3);
}

.input-icon-wrapper {
  position: relative;
}

.input-icon-wrapper svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-3);
  pointer-events: none;
}

.input-icon-wrapper input {
  padding-left: 48px;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.radio-option {
  position: relative;
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  font-weight: 500;
  user-select: none;
}

.radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.radio-option:hover {
  border-color: var(--color-border-hover);
  background: var(--color-surface-3);
}

.radio-option.selected {
  background: var(--grad-primary);
  border-color: transparent;
  color: white;
}

.textarea-count {
  display: block;
  text-align: right;
  font-size: 11px;
  color: var(--color-text-3);
  margin-top: 4px;
}

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--color-text-3);
  margin-top: 6px;
}

.form-error {
  display: block;
  font-size: 12px;
  color: var(--color-danger);
  margin-top: 6px;
  animation: shake 0.4s ease-in-out;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  outline: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

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

.btn-primary:hover {
  background: var(--grad-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 61, 232, 0.4);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

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

.btn-ghost {
  background: transparent;
  color: var(--color-text-2);
}

.btn-ghost:hover {
  background: var(--glass);
  color: var(--color-text);
}

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

.btn-danger:hover {
  background: #DC2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
}

/* Progress / Journey */
.journey-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin: 24px 0 40px;
}

.journey-steps::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 32px;
  right: 32px;
  height: 2px;
  background: var(--color-surface-2);
  z-index: 1;
}

.journey-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
  width: 64px;
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  color: var(--color-text-3);
  transition: var(--transition);
}

.step-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-3);
  text-align: center;
  white-space: nowrap;
}

.journey-step.done .step-circle {
  background: var(--color-success);
  border-color: var(--color-success);
  color: white;
}

.journey-step.done .step-label {
  color: var(--color-text);
}

.journey-step.active .step-circle {
  background: var(--grad-primary);
  border-color: transparent;
  color: white;
  box-shadow: 0 0 0 4px rgba(108, 61, 232, 0.2);
  animation: pulse 2s infinite;
}

.journey-step.active .step-label {
  color: var(--color-text);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--color-surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-ring {
  position: relative;
  width: 120px;
  height: 120px;
}

.progress-ring svg {
  transform: rotate(-90deg);
}

.progress-ring circle {
  fill: transparent;
  stroke-width: 8;
}

.progress-ring-track {
  stroke: var(--color-surface-2);
}

.progress-ring-fill {
  stroke: var(--color-primary);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.progress-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  font-weight: 700;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  text-align: center;
}

.countdown-item {
  background: var(--color-surface-2);
  padding: 16px;
  border-radius: var(--radius-sm);
}

.countdown-val {
  font-size: 32px;
  font-weight: 800;
  color: var(--color-primary-2);
  line-height: 1;
  margin-bottom: 4px;
}

.countdown-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--color-text-2);
  font-weight: 600;
}

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

.badge-success { background: rgba(34, 197, 94, 0.1); color: var(--color-success); border: 1px solid rgba(34, 197, 94, 0.2); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--color-warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--color-danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-info { background: rgba(59, 130, 246, 0.1); color: var(--color-primary-2); border: 1px solid rgba(59, 130, 246, 0.2); }
.badge-muted { background: rgba(148, 163, 184, 0.1); color: var(--color-text-2); border: 1px solid rgba(148, 163, 184, 0.2); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}
.status-dot.success { background: var(--color-success); }
.status-dot.warning { background: var(--color-warning); }
.status-dot.danger { background: var(--color-danger); }

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

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-3);
  text-transform: uppercase;
  border-bottom: 1px solid var(--color-border);
}

td {
  padding: 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

tbody tr {
  transition: var(--transition);
}

tbody tr:hover {
  background: var(--glass);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Modal */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease-out;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--color-text-2);
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
}

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

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Notifications / Toast */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1100;
}

.toast {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  width: 320px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease-out;
}

.toast-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.toast-message {
  font-size: 13px;
  color: var(--color-text-2);
}

.toast-close {
  background: none;
  border: none;
  color: var(--color-text-3);
  cursor: pointer;
}

.toast-success .toast-icon { color: var(--color-success); }
.toast-error .toast-icon { color: var(--color-danger); }
.toast-warning .toast-icon { color: var(--color-warning); }
.toast-info .toast-icon { color: var(--color-primary-2); }

/* Loading */
#loading {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 20, 0.9);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#loading.hidden {
  display: none;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-surface-3);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Login Page Specific */
.login-page {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, var(--color-surface-2) 0%, var(--color-bg) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  width: 80px;
  height: 80px;
  background: var(--grad-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  color: white;
  margin: 0 auto 24px;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--color-text-2);
  margin-bottom: 32px;
}

/* Multi-step Form */
.step-form {
  max-width: 800px;
  margin: 0 auto;
}

.step-header {
  text-align: center;
  margin-bottom: 40px;
}

.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.competencia-section {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--color-primary);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.pergunta-group {
  margin-bottom: 32px;
}
.pergunta-group:last-child {
  margin-bottom: 0;
}

.pergunta-text {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 16px;
}

/* Dashboard Specific */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.dual-role-section {
  background: linear-gradient(to right, rgba(245, 158, 11, 0.05), transparent);
  border: 1px solid var(--color-warning);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.co-pending-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

.history-timeline {
  position: relative;
  padding-left: 32px;
}
.history-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 11px;
  width: 2px;
  background: var(--color-surface-3);
}

.history-item {
  position: relative;
  margin-bottom: 24px;
}
.history-item::before {
  content: '';
  position: absolute;
  top: 4px;
  left: -25px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid var(--color-bg);
}

/* Chart Containers */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-2);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(108, 61, 232, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(108, 61, 232, 0); }
  100% { box-shadow: 0 0 0 0 rgba(108, 61, 232, 0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
}

/* Utility Classes */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: 4px; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 32px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }

.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.text-md { font-size: 16px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 24px; }

.text-muted { color: var(--color-text-2); }
.text-primary { color: var(--color-primary-2); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.hidden { display: none !important; }
.w-full { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rounded { border-radius: var(--radius-sm); }
.rounded-full { border-radius: 9999px; }
.opacity-50 { opacity: 0.5; }

/* Mobile Responsive */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-w: 0px;
  }
  
  .app-layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
  }
  
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .main-content {
    grid-column: 1;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .page {
    padding: 16px;
  }
  
  .topbar {
    padding: 12px 16px;
  }
  
  .card-header, .card-body, .modal-header, .modal-body, .modal-footer {
    padding: 16px;
  }
  
  .countdown {
    gap: 8px;
  }
  
  .toast {
    width: calc(100vw - 48px);
  }
}

/* ═══════════════════════════════════════════════════════════
   DYNAMIC COMPONENTS (generated by app.js)
═══════════════════════════════════════════════════════════ */

/* Topbar avatar */
.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--transition), box-shadow var(--transition);
}
.topbar-avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px rgba(108,61,232,0.3);
}

/* Notification bell */
.notification-bell {
  position: relative;
}
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--color-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* Notification panel (dropdown) */
.notif-panel {
  position: fixed;
  top: 64px;
  right: 16px;
  width: 320px;
  max-height: 400px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 200ms ease;
}
.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
  font-size: 14px;
}
.notif-panel-body {
  overflow-y: auto;
  max-height: 340px;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background var(--transition);
}
.notif-item:hover { background: var(--glass); }
.notif-item.unread { background: rgba(108,61,232,0.06); }
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  flex-shrink: 0;
  margin-top: 5px;
}
.notif-item:not(.unread) .notif-dot { background: transparent; }
.notif-msg { font-size: 13px; color: var(--color-text); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--color-text-3); margin-top: 3px; }

/* User menu dropdown */
.user-menu-dropdown {
  position: fixed;
  top: 64px;
  right: 16px;
  width: 200px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  overflow: hidden;
  animation: slideUp 200ms ease;
}
.user-menu-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.user-menu-header strong { font-size: 13px; font-weight: 600; }
.user-menu-header small { font-size: 11px; color: var(--color-text-3); }
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  width: 100%;
  background: none;
  border: none;
  color: var(--color-text-2);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}
.user-menu-item:hover { background: var(--glass); color: var(--color-text); }
.user-menu-item i { width: 16px; height: 16px; }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 199;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* Sidebar close button */
.sidebar-close {
  display: none;
}
@media (max-width: 768px) {
  .sidebar-close { display: flex; }
}

/* Language selector compact (in sidebar footer) */
.lang-selector-compact {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.lang-btn {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: none;
  color: var(--color-text-3);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.lang-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.lang-btn.active {
  background: var(--grad-primary);
  border-color: transparent;
  color: #fff;
}

/* Topbar left group */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* User info in sidebar */
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role { font-size: 11px; color: var(--color-text-3); }
.user-badge {
  font-size: 10px;
  color: var(--color-primary);
  background: rgba(108,61,232,0.12);
  border-radius: 999px;
  padding: 1px 6px;
  margin-top: 2px;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Logo text in sidebar */
.logo-text { display: flex; flex-direction: column; }
.logo-name { font-size: 18px; font-weight: 800; color: var(--color-text); }
.logo-sub { font-size: 10px; color: var(--color-text-3); }

/* ─── Extra utility classes ─── */
.opacity-0 { opacity: 0; }
.pointer { cursor: pointer; }
.no-select { user-select: none; }
.border-top { border-top: 1px solid var(--color-border); }
.border-bottom { border-bottom: 1px solid var(--color-border); }
.gap-xs { gap: 4px; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.p-sm { padding: 8px; }
.p-md { padding: 16px; }
.p-lg { padding: 24px; }
.mt-xs { margin-top: 4px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-xs { margin-bottom: 4px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.flex-1 { flex: 1; }
.min-w-0 { min-width: 0; }
.overflow-hidden { overflow: hidden; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.uppercase { text-transform: uppercase; letter-spacing: 0.05em; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 15px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 22px; }
.text-2xl { font-size: 28px; }
.text-3xl { font-size: 36px; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.text-muted { color: var(--color-text-2); }
.text-faint { color: var(--color-text-3); }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }
.bg-surface { background: var(--color-surface); }
.bg-surface-2 { background: var(--color-surface-2); }
.rounded-full { border-radius: 999px; }
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.hidden { display: none !important; }
.visible { display: block !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { inset: 0; }


/* ═══════════════════════════════════════════════════════
   LIGHT MODE CONTRAST OVERRIDES
   !important needed to beat hardcoded inline color:#fff
═══════════════════════════════════════════════════════ */

/* Sidebar */
[data-theme="light"] .sidebar { background: #ffffff !important; border-right-color: rgba(0,0,0,0.1) !important; }
[data-theme="light"] .sidebar .logo-name { color: #111827 !important; -webkit-text-fill-color: #111827 !important; }
[data-theme="light"] .sidebar .logo-sub, [data-theme="light"] .sidebar .nav-label { color: #6b7280 !important; }
[data-theme="light"] .sidebar .user-name { color: #111827 !important; }
[data-theme="light"] .sidebar .user-role { color: #6b7280 !important; }
[data-theme="light"] .sidebar .nav-item { color: #374151 !important; }
[data-theme="light"] .sidebar .nav-item:hover { background: rgba(230,57,70,0.06) !important; color: #c1121f !important; }
[data-theme="light"] .sidebar .nav-item.active { background: rgba(230,57,70,0.12) !important; color: #c1121f !important; }
[data-theme="light"] .sidebar .nav-item span, [data-theme="light"] .sidebar .nav-item i { color: inherit !important; }
[data-theme="light"] .sidebar .user-badge { background: rgba(230,57,70,0.1) !important; color: #c1121f !important; }
[data-theme="light"] .sidebar .lang-btn { color: #4b5563 !important; }
[data-theme="light"] .sidebar .btn-ghost { color: #374151 !important; }
[data-theme="light"] .sidebar .btn-ghost:hover { background: rgba(0,0,0,0.05) !important; }

/* Topbar */
[data-theme="light"] .topbar { background: rgba(255,255,255,0.92) !important; border-bottom: 1px solid rgba(0,0,0,0.08) !important; }
[data-theme="light"] .topbar-title { color: #111827 !important; }
[data-theme="light"] .topbar .btn-icon { color: #374151 !important; }
[data-theme="light"] .topbar-avatar, [data-theme="light"] .user-avatar { color: #ffffff !important; }

/* Cards */
[data-theme="light"] .card { background: #ffffff !important; border-color: rgba(0,0,0,0.08) !important; box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important; }
[data-theme="light"] .card-glass { background: rgba(255,255,255,0.9) !important; border-color: rgba(0,0,0,0.08) !important; }
[data-theme="light"] .card-title { color: #111827 !important; }
[data-theme="light"] .card-header { border-bottom-color: rgba(0,0,0,0.06) !important; }

/* Main content headings (beat inline color:#fff) */
[data-theme="light"] .main-content h1,
[data-theme="light"] .main-content h2,
[data-theme="light"] .main-content h3,
[data-theme="light"] .main-content h4 { color: #111827 !important; -webkit-text-fill-color: #111827 !important; }
/* Preserve gradient text */
[data-theme="light"] .main-content [style*="-webkit-text-fill-color: transparent"],
[data-theme="light"] .main-content [style*="-webkit-text-fill-color:transparent"] { -webkit-text-fill-color: transparent !important; }
[data-theme="light"] .main-content p { color: #374151 !important; }
[data-theme="light"] .main-content label { color: #374151 !important; }
[data-theme="light"] .main-content small { color: #6b7280 !important; }
[data-theme="light"] .stat-value { color: #111827 !important; }

/* Badges */
[data-theme="light"] .badge-muted { background: rgba(0,0,0,0.07) !important; color: #4b5563 !important; }
[data-theme="light"] .badge-info { background: rgba(37,99,235,0.1) !important; color: #1d4ed8 !important; }
[data-theme="light"] .badge-warning { background: rgba(217,119,6,0.1) !important; color: #92400e !important; }
[data-theme="light"] .badge-success { background: rgba(22,163,74,0.1) !important; color: #15803d !important; }
[data-theme="light"] .badge-danger { background: rgba(220,38,38,0.1) !important; color: #b91c1c !important; }

/* Buttons */
[data-theme="light"] .btn-secondary { color: #374151 !important; border-color: rgba(0,0,0,0.15) !important; }
[data-theme="light"] .btn-ghost { color: #374151 !important; }
[data-theme="light"] .btn-primary { color: #ffffff !important; }
[data-theme="light"] .nav-count, [data-theme="light"] .nav-badge-new { color: #ffffff !important; }

/* Inputs */
[data-theme="light"] input:not([type="submit"]):not([type="button"]), [data-theme="light"] select, [data-theme="light"] textarea {
  background: #f9fafb !important; border-color: rgba(0,0,0,0.15) !important; color: #111827 !important;
}
[data-theme="light"] input::placeholder { color: #9ca3af !important; }

/* Tables */
[data-theme="light"] thead th { color: #6b7280 !important; border-color: rgba(0,0,0,0.08) !important; }
[data-theme="light"] tbody td { color: #374151 !important; border-color: rgba(0,0,0,0.05) !important; }
[data-theme="light"] tbody tr:hover { background: rgba(0,0,0,0.025) !important; }

/* Scrollbar */
[data-theme="light"] ::-webkit-scrollbar-track { background: #f3f4f6; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #d1d5db; }

/* ═══════════════════════════════════════════════════════
   LIGHT MODE — LOGIN PAGE OVERRIDES
   login.js uses inline styles outside .main-content
═══════════════════════════════════════════════════════ */
[data-theme="light"] .login-container {
  background: #f6f8fa !important;
}
[data-theme="light"] .login-branding h1,
[data-theme="light"] .login-branding h1 span {
  -webkit-text-fill-color: transparent !important; /* preserve gradient */
}
[data-theme="light"] .login-branding p {
  color: #374151 !important;
}
[data-theme="light"] .login-form-wrapper .glass-card {
  background: #ffffff !important;
  border-color: rgba(0,0,0,0.1) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1) !important;
}
/* Card header title */
[data-theme="light"] .login-form-wrapper .card-header h2,
[data-theme="light"] .login-form-wrapper h2 {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}
/* Language buttons */
[data-theme="light"] .lang-btn {
  color: #374151 !important;
  border-color: rgba(0,0,0,0.15) !important;
}
[data-theme="light"] .lang-btn[style*="rgba(255,255,255,0.1)"] {
  background: rgba(230,57,70,0.1) !important;
  color: #c1121f !important;
}
/* Form labels */
[data-theme="light"] .login-form-wrapper label {
  color: #374151 !important;
}
/* Inputs */
[data-theme="light"] .login-form-wrapper input {
  background: #f9fafb !important;
  border-color: rgba(0,0,0,0.15) !important;
  color: #111827 !important;
}
[data-theme="light"] .login-form-wrapper input::placeholder {
  color: #9ca3af !important;
}
[data-theme="light"] .login-form-wrapper small {
  color: #6b7280 !important;
}
/* Divider text */
[data-theme="light"] .divider span {
  color: #6b7280 !important;
}
[data-theme="light"] .divider div {
  background: rgba(0,0,0,0.1) !important;
}
/* Demo buttons */
[data-theme="light"] .demo-btn,
[data-theme="light"] .demo-btn-token {
  background: rgba(0,0,0,0.04) !important;
  border-color: rgba(0,0,0,0.12) !important;
  color: #374151 !important;
}
[data-theme="light"] .demo-btn:hover,
[data-theme="light"] .demo-btn-token:hover {
  background: rgba(230,57,70,0.08) !important;
  border-color: rgba(230,57,70,0.3) !important;
  color: #c1121f !important;
}
/* Footer */
[data-theme="light"] .login-footer {
  color: #6b7280 !important;
}

/* Login theme toggle button - light mode adjustment */
[data-theme="light"] .login-theme-btn {
  background: rgba(0,0,0,0.06) !important;
  border-color: rgba(0,0,0,0.15) !important;
}
[data-theme="light"] .login-theme-btn:hover {
  background: rgba(0,0,0,0.12) !important;
}

/* ═══════════════════════════════════════════════════════
   MOBILE RESPONSIVE — Lead360
   Breakpoint principal: 768px
═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── LOGIN ──────────────────────────────────────────── */
  .login-container {
    flex-direction: column !important;
  }
  /* Esconde painel esquerdo (branding) no mobile */
  .login-branding {
    display: none !important;
  }
  /* Form ocupa tela toda */
  .login-form-wrapper {
    flex: 1 !important;
    width: 100% !important;
    min-height: 100vh !important;
    padding: 1rem !important;
    justify-content: center !important;
  }
  .glass-card {
    padding: 1.5rem !important;
    border-radius: 16px !important;
    max-width: 100% !important;
  }

  /* ── APP LAYOUT (dashboard) ─────────────────────────── */
  .app-layout {
    grid-template-columns: 1fr !important;
  }
  /* Sidebar vira overlay deslizante */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 200;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  /* Overlay escuro atrás da sidebar aberta */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
    backdrop-filter: blur(2px);
  }
  .sidebar.open ~ .sidebar-overlay,
  .sidebar-overlay.show {
    display: block;
  }
  /* Main content ocupa tela toda */
  .main-content {
    margin-left: 0 !important;
    padding: 1rem !important;
    padding-top: calc(var(--topbar-h) + 1rem) !important;
    width: 100% !important;
  }
  /* Topbar: hamburguer visível */
  .topbar {
    padding: 0 1rem !important;
  }
  .topbar-title {
    font-size: 1rem !important;
  }
  /* Grids de dashboard: 1 coluna */
  .dashboard-grid,
  .stats-grid,
  [style*="grid-template-columns: repeat(4"] ,
  [style*="grid-template-columns: repeat(3"] ,
  [style*="grid-template-columns: repeat(2"] {
    grid-template-columns: 1fr !important;
  }
  /* Cards: margem menor */
  .card {
    border-radius: 12px !important;
  }
  /* Botões demo: 2 colunas no mobile */
  .demo-buttons {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* Tabelas: scroll horizontal */
  .table-wrapper, table {
    overflow-x: auto;
    display: block;
  }
  /* Modais: tela cheia no mobile */
  .modal {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
  }
  /* Topbar: esconde label longo se necessário */
  .nav-label { display: none; }

  /* ── TOUCH TARGETS ──────────────────────────────────── */
  .btn, button[type="submit"] {
    min-height: 44px !important;
    font-size: 0.95rem !important;
  }
  input, select, textarea {
    min-height: 44px !important;
    font-size: 16px !important; /* evita zoom automático iOS */
  }
}

/* Tablet (768px–1024px): sidebar recolhida mas visível */
@media (min-width: 769px) and (max-width: 1024px) {
  :root { --sidebar-w: 200px; }
  .main-content { padding: 1.25rem !important; }
  .dashboard-grid,
  [style*="grid-template-columns: repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
