/* ========================================================
   RoutineOS PWA - Master Stylesheet
   Design System: Obsidian Dark, Glassmorphism & High Contrast
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Theme Palette */
  --bg-dark: #070a13;
  --bg-card: #0d1527;
  --bg-card-hover: #131e36;
  --bg-glass: rgba(13, 21, 39, 0.75);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.3);

  /* Workspace Brand Colors */
  --color-claro: #ef4444;
  --color-claro-glow: rgba(239, 68, 68, 0.25);
  --color-agencia: #0284c7;
  --color-agencia-glow: rgba(2, 132, 199, 0.25);
  --color-startlive: #10b981;
  --color-startlive-glow: rgba(16, 185, 129, 0.25);
  --color-julio: #8b5cf6;
  --color-julio-glow: rgba(139, 92, 246, 0.25);
  --color-pessoal: #f59e0b;
  --color-pessoal-glow: rgba(245, 158, 11, 0.25);

  /* Primary Accent */
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);

  /* Text & Surface */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.2);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(239, 68, 68, 0.05) 0px, transparent 60%);
  background-attachment: fixed;
}

h1, h2, h3, h4, .font-heading {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

button, input, select, textarea {
  font-family: inherit;
}

/* App Container */
.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 16px 100px 16px;
}

/* Glass Header */
.header-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 12px;
  z-index: 40;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--primary-glow);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--primary-glow);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

/* ========================================================
   Time-Blocking Widget Visualizer
   ======================================================== */
.timeblock-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.timeblock-widget::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #0284c7 0%, #ef4444 35%, #ef4444 75%, #10b981 100%);
}

.timeblock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.timeblock-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.current-turn-badge {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Pulse dot */
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.turn-claro {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.turn-claro .pulse-dot { background: #ef4444; }

.turn-noturno {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.turn-noturno .pulse-dot { background: #10b981; }

.turn-matinal {
  background: rgba(2, 132, 199, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(2, 132, 199, 0.3);
}
.turn-matinal .pulse-dot { background: #0284c7; }

/* Timeline Bar Graphic */
/* Timeline Bar Graphic */
.timeline-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.timeline-slot {
  flex: 1 1 180px;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  transition: all 0.2s ease;
  min-height: 64px;
  cursor: pointer;
}

.timeline-slot:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.timeline-slot.is-blocked {
  background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(239, 68, 68, 0.05) 10px, rgba(239, 68, 68, 0.05) 20px);
}

.slot-time {
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slot-label {
  font-size: 0.72rem;
  opacity: 0.9;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-actions {
  display: none;
  position: absolute;
  right: 6px;
  top: 6px;
  gap: 4px;
}

.timeline-slot:hover .slot-actions {
  display: flex;
}

.slot-btn {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 4px;
  width: 22px;
  height: 22px;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.slot-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.1);
}

.slot-btn.delete:hover {
  background: #ef4444;
  border-color: #ef4444;
}

.btn-timeblock-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-timeblock-action:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-timeblock-action.btn-timeblock-add {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
}

.btn-timeblock-action.btn-timeblock-add:hover {
  background: rgba(99, 102, 241, 0.35);
  color: #fff;
}

/* Badge de Exceção */
.exception-tag {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  letter-spacing: 0.02em;
}

.exception-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  color: #fef08a;
  transition: all 0.2s ease;
}

.exception-checkbox-label:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.5);
}

.exception-checkbox-label input[type="checkbox"] {
  accent-color: #f59e0b;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.conflict-alert-box.exception-mode {
  background: rgba(245, 158, 11, 0.12) !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
}

.timeblock-manage-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  transition: all 0.2s ease;
}

.timeblock-manage-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
}

/* ========================================================
   Start Live Live-Stopwatch Card
   ======================================================== */
.startlive-card {
  background: linear-gradient(145deg, #0a1f1b, #0d1527);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 22px;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.15);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.startlive-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.startlive-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  display: flex;
  align-items: center;
  justify-content: center;
}

.startlive-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6ee7b7;
  font-weight: 700;
}

.startlive-timer-display {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.04em;
  line-height: 1;
  margin-top: 2px;
}

.startlive-stats {
  display: flex;
  gap: 16px;
  align-items: center;
}

.stat-pill {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  text-align: center;
}

.stat-pill-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.stat-pill-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #34d399;
}

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

.btn-timer-start {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}

.btn-timer-stop {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
  transition: all 0.2s ease;
}

/* ========================================================
   Tabs & Workspace Filter Carousel
   ======================================================== */
.nav-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary-light);
  color: white;
  box-shadow: 0 2px 12px var(--primary-glow);
}

.tab-counter {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
}

/* Workspace Pill Filters */
.workspace-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 20px;
  scrollbar-width: none;
}
.workspace-filters::-webkit-scrollbar { display: none; }

.ws-filter-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.ws-filter-chip:hover {
  background: rgba(255, 255, 255, 0.08);
}

.ws-filter-chip.active {
  color: white;
  font-weight: 600;
}

.ws-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ========================================================
   Task Cards List
   ======================================================== */
.tasks-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.task-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-md);
}

.task-card.concluida {
  opacity: 0.55;
  background: rgba(13, 21, 39, 0.4);
}

.task-card.concluida .task-title {
  text-decoration: line-through;
  color: var(--text-dim);
}

.task-workspace-stripe {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
}

/* Custom Checkbox */
.task-checkbox-wrap {
  margin-top: 2px;
  cursor: pointer;
}

.task-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #475569;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.task-checkbox.checked {
  background: #10b981;
  border-color: #10b981;
  color: white;
  animation: check-bounce 0.25s ease-out;
}

@keyframes check-bounce {
  0% { transform: scale(0.7); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.task-content {
  flex: 1;
  min-width: 0;
}

.task-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.task-workspace-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.task-priority-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
}

.priority-alta {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.priority-media {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.priority-baixa {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.task-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-word;
  line-height: 1.35;
}

.task-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.task-footer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.task-due {
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-due.overdue {
  color: #ef4444;
  font-weight: 600;
}

.conflict-tag {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.action-icon-btn.delete:hover {
  color: #ef4444;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.empty-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ========================================================
   Floating Action Bar & Modals
   ======================================================== */
.fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.fab-main {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  border: none;
  color: white;
  box-shadow: 0 8px 24px var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.fab-main:hover {
  transform: scale(1.08) rotate(90deg);
}

.fab-ai {
  background: linear-gradient(135deg, #10b981, #059669);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  color: white;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fab-ai:hover {
  transform: scale(1.08);
}

/* Modal Backdrop & Dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  z-index: 99;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

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

.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  padding: 24px;
  transform: translateY(15px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
}

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

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: rgba(255, 255, 255, 0.07);
}

.form-select option {
  background: #0f172a;
  color: white;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Conflict Banner in Modal */
.conflict-alert-box {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: shake 0.3s ease;
}

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

.conflict-alert-icon {
  color: #ef4444;
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.conflict-alert-text {
  font-size: 0.8rem;
  color: #fca5a5;
  line-height: 1.4;
}

.btn-reschedule {
  background: rgba(239, 68, 68, 0.3);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 6px;
  cursor: pointer;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #1e293b;
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success { border-color: rgba(16, 185, 129, 0.5); }
.toast.error { border-color: rgba(239, 68, 68, 0.5); }

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

/* PWA Install Banner */
.install-pwa-bar {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(16, 185, 129, 0.25));
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.install-text {
  font-size: 0.85rem;
  font-weight: 600;
}

.btn-install {
  background: white;
  color: #0f172a;
  border: none;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

/* WhatsApp Preview Box */
.whatsapp-chat-bubble {
  background: #0b141a;
  border-left: 4px solid #25d366;
  border-radius: 8px;
  padding: 16px;
  font-family: monospace, monospace;
  font-size: 0.85rem;
  color: #e9edef;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}


/* ========================================================
   Tela de Login (Glassmorphism & Obsidian Dark)
   ======================================================== */
.login-overlay-container {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at 50% 20%, #151e36 0%, #070a13 70%, #03060a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.login-overlay-container.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Ambient Floating Lights */
.login-ambient-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.35;
  animation: pulse-ambient 8s ease-in-out infinite alternate;
}

.glow-purple {
  top: 15%;
  left: 20%;
  background: #6366f1;
}

.glow-emerald {
  bottom: 20%;
  right: 20%;
  background: #10b981;
}

@keyframes pulse-ambient {
  0% { transform: scale(1) translate(0, 0); opacity: 0.25; }
  100% { transform: scale(1.15) translate(20px, 20px); opacity: 0.4; }
}

.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  background: rgba(13, 21, 39, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 36px 30px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(99, 102, 241, 0.15);
  animation: slide-up-card 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-up-card {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-brand-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px auto;
  border-radius: 18px;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.login-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-left {
  position: absolute;
  left: 14px;
  color: #64748b;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.input-field-padded {
  padding-left: 42px !important;
  padding-right: 42px !important;
  height: 48px;
  font-size: 0.95rem;
}

.input-toggle-password {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  transition: color 0.15s ease;
}

.input-toggle-password:hover {
  color: #ffffff;
}

.login-btn-primary {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--primary-glow);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 20px;
}

.login-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.45);
  background: linear-gradient(135deg, #7174f8, #5b53ed);
}

.login-btn-primary:active {
  transform: translateY(0);
}

.login-hint-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 24px;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.login-hint-badge {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.login-hint-badge:hover {
  background: rgba(99, 102, 241, 0.35);
  color: #ffffff;
}

/* ========================================================
   Header User Badge & Quick Controls
   ======================================================== */
.user-badge-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px 4px 5px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-main);
}

.user-badge-header:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
  text-transform: uppercase;
  flex-shrink: 0;
}

.user-name-text {
  font-size: 0.82rem;
  font-weight: 600;
  max-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e2e8f0;
}

.user-badge-gear {
  font-size: 0.72rem;
  opacity: 0.7;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ========================================================
   MODAL: Configurações do Usuário & Perfil
   ======================================================== */
.user-profile-card {
  max-width: 520px;
  width: 100%;
}

.profile-hero-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.profile-hero-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  flex-shrink: 0;
  text-transform: uppercase;
}

.profile-hero-info {
  flex: 1;
  min-width: 0;
}

.profile-hero-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-hero-email {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-top: 6px;
}

.profile-tabs-nav {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.profile-tabs-nav::-webkit-scrollbar { display: none; }

.profile-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.profile-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.profile-tab-btn.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}

.profile-tab-content {
  animation: fadeIn 0.25s ease;
}

.session-info-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
}

/* ========================================================
   SISTEMA DE DESIGN RESPONSIVO MULTI-DISPOSITIVOS
   (Desktop • Tablet • Mobile • Ultra-Mobile)
   ======================================================== */

/* 1. DESKTOP PADRÃO E TELAS GRANDES (> 1024px) */
@media (min-width: 1025px) {
  .app-container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 24px 20px;
  }
  
  .header-glass {
    padding: 14px 22px;
  }
  
  .timeline-bar {
    grid-template-columns: 1fr 2.2fr 1fr;
    gap: 12px;
  }

  .startlive-card {
    padding: 18px 24px;
  }

  .user-name-text {
    max-width: 130px;
  }
}

/* 2. TABLETS E TELAS MÉDIAS (641px até 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
  .app-container {
    padding: 16px 16px 90px 16px;
  }

  .header-glass {
    padding: 12px 16px;
    gap: 12px;
  }

  .brand-title {
    font-size: 1.15rem;
  }

  .timeline-bar {
    grid-template-columns: 1fr 1.6fr 1fr;
    gap: 8px;
  }

  .slot-label {
    font-size: 0.75rem;
  }

  .slot-time {
    font-size: 0.68rem;
  }

  .startlive-card {
    gap: 14px;
    padding: 16px;
  }

  .startlive-stats {
    gap: 10px;
  }

  .stat-pill {
    padding: 6px 10px;
  }

  .stat-pill-val {
    font-size: 0.88rem;
  }

  .modal-card {
    max-width: 90%;
  }
}

/* 3. SMARTPHONES E MOBILE GERAL (<= 640px) */
@media (max-width: 640px) {
  html, body {
    overflow-x: hidden;
    position: relative;
    width: 100%;
  }

  .app-container {
    padding: 10px 10px 100px 10px;
    width: 100%;
    overflow-x: hidden;
  }

  /* Header com visual organizado em 2 linhas elegantes */
  .header-glass {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
    gap: 12px;
    margin-bottom: 14px;
  }

  .brand-wrapper {
    width: 100%;
    justify-content: space-between;
  }

  .brand-title {
    font-size: 1.15rem;
  }

  .header-actions {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
  }

  .user-badge-header {
    flex: 1;
    min-width: 100px;
    justify-content: flex-start;
    padding: 5px 8px;
  }

  .user-name-text {
    max-width: 75px;
    font-size: 0.78rem;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
  }

  .btn-logout {
    padding: 6px 9px;
  }

  .btn-logout-text {
    display: none; /* Mantém apenas o ícone de logout para economizar espaço */
  }

  .btn-primary.btn-new-task {
    padding: 7px 12px;
    font-size: 0.82rem;
  }

  /* Time-Blocking Widget: Estilização em cartões empilhados verticais super legíveis */
  .timeblock-widget {
    padding: 14px 12px;
    margin-bottom: 16px;
  }

  .timeblock-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 12px;
  }

  .timeline-bar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .timeline-slot {
    padding: 12px 14px;
    border-radius: var(--radius-md);
  }

  .slot-label {
    font-size: 0.82rem;
  }

  .slot-time {
    font-size: 0.72rem;
    margin-bottom: 4px;
  }

  /* Start Live Stopwatch: Layout card mobile com métricas em grade 3 colunas */
  .startlive-card {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 14px;
    margin-bottom: 18px;
  }

  .startlive-meta {
    width: 100%;
  }

  .startlive-timer-display {
    font-size: 1.8rem;
  }

  .startlive-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
  }

  .stat-pill {
    padding: 8px 6px;
  }

  .stat-pill-label {
    font-size: 0.62rem;
  }

  .stat-pill-val {
    font-size: 0.86rem;
  }

  .startlive-actions {
    width: 100%;
    margin-top: 2px;
  }

  .startlive-actions button {
    width: 100%;
    height: 46px;
    justify-content: center;
    font-size: 0.95rem;
  }

  /* Navegação Horizontal por abas com Momentum Touch */
  .nav-tabs {
    gap: 8px;
    padding-bottom: 6px;
    margin-bottom: 14px;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    padding: 9px 14px;
    font-size: 0.82rem;
    min-height: 40px;
  }

  .workspace-filters {
    gap: 6px;
    padding-bottom: 6px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
  }

  .ws-filter-chip {
    padding: 7px 12px;
    font-size: 0.78rem;
    min-height: 34px;
  }

  /* Tarefas: cartões com toque confortável */
  .task-card {
    padding: 12px 14px 12px 14px;
    gap: 12px;
  }

  .task-title {
    font-size: 0.92rem;
  }

  .task-desc {
    font-size: 0.78rem;
  }

  .task-header-row {
    gap: 6px;
  }

  .task-footer-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .task-actions {
    margin-left: auto;
  }

  .action-icon-btn {
    width: 34px;
    height: 34px;
  }

  /* Prevenção de Zoom automático no iPhone em todos os inputs */
  .form-input, .form-select, .form-textarea, .input-field-padded {
    font-size: 16px !important;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Modais no Mobile: estilo folha ajustada com rolagem suave */
  .modal-overlay {
    padding: 12px;
    align-items: flex-end;
  }

  .modal-card {
    max-width: 100%;
    width: 100%;
    max-height: 90vh;
    padding: 22px 18px 24px 18px;
    border-radius: 20px 20px 14px 14px;
    border-bottom: none;
    margin-bottom: 0;
  }

  .profile-hero-card {
    padding: 14px;
    gap: 12px;
  }

  .profile-hero-avatar {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }

  .profile-hero-name {
    font-size: 1rem;
  }

  /* Floating Action Buttons: posição ergonômica para polegares */
  .fab-container {
    bottom: 24px;
    right: 20px;
    gap: 12px;
  }

  .fab-main {
    width: 54px;
    height: 54px;
  }

  .fab-ai {
    width: 44px;
    height: 44px;
  }
}

/* 4. DISPOSITIVOS PEQUENOS / ULTRA-COMPACTOS (<= 380px) */
@media (max-width: 380px) {
  .app-container {
    padding: 8px 8px 100px 8px;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .brand-badge {
    display: none;
  }

  .user-name-text {
    display: none; /* Mostra apenas o avatar com iniciais e o ícone de engrenagem */
  }

  .user-badge-header {
    padding: 4px 6px;
    min-width: auto;
  }

  .btn-task-text {
    display: none;
  }

  .btn-primary.btn-new-task {
    padding: 6px 10px;
  }

  .stat-pill {
    padding: 6px 3px;
  }

  .stat-pill-val {
    font-size: 0.78rem;
  }

  .stat-pill-label {
    font-size: 0.58rem;
  }

  .startlive-timer-display {
    font-size: 1.55rem;
  }
}

/* ========================================================
   Agência de Marketing • Clientes, Sites & Boletos Ads
   ======================================================== */
.app-container.container-wide {
  max-width: 1360px;
  transition: max-width 0.3s ease;
}

.agency-header-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(2, 132, 199, 0.25);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.agency-header-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #0284c7, #38bdf8);
}

.agency-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #38bdf8;
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid rgba(2, 132, 199, 0.3);
  padding: 2px 8px;
  border-radius: 9999px;
  margin-bottom: 6px;
}

.agency-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 4px;
}

.agency-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 650px;
}

.agency-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-secondary-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-secondary-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-secondary-action.btn-reset-week:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* Lembrete Diário de Checagem de Sites */
.agency-site-reminder-bar {
  background: rgba(2, 132, 199, 0.12);
  border: 1px solid rgba(2, 132, 199, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.btn-check-sites-done {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f8fafc;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-check-sites-done:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.btn-check-sites-done.is-checked {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}

/* KPI Stats Grid */
.agency-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.agency-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s ease;
}

.agency-stat-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.agency-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.agency-stat-label {
  font-size: 0.73rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.agency-stat-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.2;
}

.agency-stat-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Filter Bar & Search */
.agency-filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.agency-search-wrapper {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.agency-search-wrapper .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  pointer-events: none;
  opacity: 0.6;
}

.agency-search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 36px 10px 34px;
  color: var(--text-main);
  font-size: 0.86rem;
  outline: none;
  transition: border-color 0.2s;
}

.agency-search-input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.btn-clear-search {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px;
}

.agency-filter-selects {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.agency-filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 0.84rem;
  outline: none;
  cursor: pointer;
}

.agency-filter-select:focus {
  border-color: #0284c7;
}

/* Quick Action Pills */
.agency-quick-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.quick-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-pill:hover, .quick-pill.active {
  background: rgba(2, 132, 199, 0.2);
  border-color: rgba(2, 132, 199, 0.5);
  color: #38bdf8;
}

.quick-pill.pill-reset {
  color: #f87171;
}

.quick-pill.pill-reset:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Tabela Planilha de Clientes */
.agency-table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.table-scroll-wrapper {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.agency-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
}

.agency-table thead tr {
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.agency-table th {
  padding: 12px 14px;
  font-weight: 700;
  color: #cbd5e1;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.agency-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease;
}

.agency-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.agency-table tbody tr.row-paused {
  opacity: 0.6;
}

.agency-table td {
  padding: 10px 14px;
  color: var(--text-main);
  vertical-align: middle;
}

.client-name-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.client-company-title {
  font-weight: 700;
  color: #f1f5f9;
  font-size: 0.88rem;
}

.client-site-link {
  font-size: 0.73rem;
  color: #38bdf8;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.2s;
}

.client-site-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

/* Status Pills dos Boletos */
.billing-status-select {
  border: none;
  border-radius: 9999px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: transform 0.15s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.billing-status-select:hover {
  transform: scale(1.03);
}

.billing-status-concluido {
  background: #0284c7;
  color: #ffffff;
}

.billing-status-em_andamento {
  background: #f59e0b;
  color: #000000;
}

.billing-status-pendente {
  background: #dc2626;
  color: #ffffff;
}

.billing-status-pausada {
  background: #475569;
  color: #f1f5f9;
}

/* Site Monitor Badges */
.site-check-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
}

.site-online {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.site-offline {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.site-unverified {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.btn-test-site {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.7rem;
  cursor: pointer;
  margin-left: 4px;
  transition: all 0.2s;
}

.btn-test-site:hover {
  background: #0284c7;
  color: #fff;
  border-color: #0284c7;
}

/* Account Status */
.account-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}

.account-badge.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.account-badge.badge-paused {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Table Actions */
.table-actions-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-table-action {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.15s ease;
}

.btn-table-action:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-table-action.btn-action-delete:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

/* Badges e Ações de Demandas / Pedidos da Agência */
.demand-pill-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-demand-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-demand-badge:hover {
  background: rgba(245, 158, 11, 0.28);
  border-color: rgba(245, 158, 11, 0.7);
  transform: translateY(-1px);
}

.btn-demand-badge.all-done {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.btn-add-demand-inline {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed var(--border-subtle);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add-demand-inline:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
  color: #fbbf24;
}

/* Card de Cada Demanda no Modal */
.demand-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.2s;
}

.demand-item-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.demand-item-card.is-completed {
  opacity: 0.55;
  background: rgba(0, 0, 0, 0.2);
}

.demand-item-card.is-completed .demand-title {
  text-decoration: line-through;
  color: var(--text-dim);
}

.demand-check-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border-subtle);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: 2px;
  flex-shrink: 0;
  transition: all 0.2s;
  font-size: 0.75rem;
  color: transparent;
}

.demand-check-btn.checked {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.demand-info-body {
  flex: 1;
  min-width: 0;
}

.demand-title {
  font-weight: 600;
  font-size: 0.86rem;
  color: #f1f5f9;
  line-height: 1.3;
  margin-bottom: 3px;
}

.demand-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 6px;
  white-space: pre-wrap;
}

.demand-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.72rem;
}

.demand-due-tag {
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.demand-priority-tag {
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
}

.demand-priority-alta {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.demand-priority-media {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.demand-priority-baixa {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.demand-task-synced-badge {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  padding: 1px 6px;
  border-radius: 4px;
}

.demand-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.demand-delete-btn:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
}


