/* ============================================================
   Puru Rotinas — styles.css
   Mobile-first, paleta alinhada ao Puru
   ============================================================ */

:root {
  --guara-primary: #C4922A;
  --guara-primary-hover: #A87A1F;
  --guara-primary-light: #FDF6E3;
  --guara-red: #DC2626;
  --guara-red-light: #FFF0EE;
  --guara-green: #2D8A4E;
  --guara-green-light: #E8F5E9;
  --guara-amber: #D4A017;
  --guara-amber-light: #FFF8E1;
  --guara-bg: #FFF8F0;
  --guara-surface: #FFFFFF;
  --guara-text: #2A2A2A;
  --guara-text-secondary: #6B6B6B;
  --guara-title-dark: #3E2E1F;
  --guara-serif: Georgia, 'Times New Roman', 'Hoefler Text', serif;
  --guara-border: #E8E0DB;
  --guara-disabled: #BDBDBD;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);
  --transition: 0.2s ease;
  --bottom-nav-height: 56px;
  --sidebar-width: 260px;
}

/* ==================== RESET ==================== */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--guara-bg);
  color: var(--guara-text);
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
}

a {
  color: var(--guara-primary);
  text-decoration: none;
}

a:hover {
  color: var(--guara-primary-hover);
}

ul { list-style: none; }

/* ==================== TYPOGRAPHY ==================== */

h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }

.subtitle {
  color: var(--guara-title-dark);
  font-size: 0.875rem;
  font-weight: 400;
}

.placeholder-text {
  color: var(--guara-text-secondary);
  font-size: 0.875rem;
  text-align: center;
  padding: 2rem 1rem;
}

/* ==================== VIEWS ==================== */

.view {
  min-height: 100dvh;
  padding-bottom: calc(var(--bottom-nav-height) + 16px);
}

.view-content {
  padding: 0.75rem 1rem 1rem;
}

/* ==================== APP HEADER ==================== */

.app-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--guara-surface);
  border-bottom: 1px solid var(--guara-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.hamburger,
.btn-back {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--guara-text);
  padding: 0.25rem;
  line-height: 1;
}

/* ==================== BUTTONS ==================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
  font-family: inherit;
  line-height: 1.4;
}

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

.btn-primary {
  background: var(--guara-primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--guara-primary-hover);
}

.btn-danger {
  background: var(--guara-red);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #c41f15;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--guara-primary);
  color: var(--guara-primary);
}

.btn-outline:hover:not(:disabled) {
  background: var(--guara-primary-light);
}

.btn-full {
  width: 100%;
}

/* ==================== FORMS ==================== */

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--guara-text);
  margin-bottom: 0.375rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1.5px solid var(--guara-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: var(--guara-surface);
  color: var(--guara-text);
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--guara-primary);
  box-shadow: 0 0 0 3px rgba(196, 146, 42, 0.15);
}

.form-group input::placeholder {
  color: var(--guara-disabled);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 0.125rem;
  accent-color: var(--guara-primary);
}

/* ==================== CARD ==================== */

.card {
  position: relative;
  background: var(--guara-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--guara-border);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.75rem;
}

/* Card tarefa: reserva espaco no lado direito pra icones (chama + estrela). */
.card.card-tarefa {
  position: relative;
}

/* Container de icones (chama + estrela) no card da operadora. */
.card-tarefa-icons {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

/* ==================== BADGE ==================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
}

.badge-red {
  background: var(--guara-red-light);
  color: var(--guara-red);
}

.badge-green {
  background: var(--guara-green-light);
  color: var(--guara-green);
}

.badge-amber {
  background: var(--guara-amber-light);
  color: var(--guara-amber);
}

/* ==================== ZONAS (MEU DIA) ==================== */

.zona {
  margin-bottom: 0.75rem;
}

/* Base = micro (Urgencias, Prioridades, Outros). Macros (Rotinas,
   Tarefas) sobrescrevem tamanho/peso/cor logo abaixo. */
.zona-title {
  padding: 0.25rem 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--guara-text-secondary);
  margin-bottom: 0.25rem;
}

/* Cores semanticas dos micro (decisao com piloto). */
.zona-title-urgencias { color: #DC2626; }
.zona-title-prioridades { color: #D97706; }
.zona-title-outros { color: #6B7280; }

/* Macros: Rotinas e Tarefas. Tipografia maior e peso 600 marcam
   o nivel superior da hierarquia; cor padrao (texto do body). */
.zona-title-rotinas,
.zona-title-tarefas-group {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--guara-text);
}

/* Agrupador "Tarefas" no Meu Dia — espacamento antes do header
   macro pra separar de "Rotinas" e de qualquer conteudo anterior. */
.zona-tarefas-group {
  margin-top: 1rem;
  margin-bottom: 0.75rem;
}

/* Indentacao sutil das sub-zonas dentro do agrupador "Tarefas" —
   reforca visualmente a hierarquia de 2 niveis sem depender so da
   tipografia. Nao afeta .zona-rotinas (fora do agrupador). */
.zona-tarefas-group > .zona {
  margin-left: 0.5rem;
}

/* ==================== LOGIN ==================== */

.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 2rem 1.5rem;
  max-width: 360px;
  margin: 0 auto;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-bird {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--guara-primary-light);
  border: 2px solid var(--guara-border);
  object-fit: cover;
  margin-bottom: 0.75rem;
}

.login-logo h1 {
  color: var(--guara-primary);
  font-size: 1.75rem;
}

#login-form {
  width: 100%;
  margin-bottom: 1.5rem;
}

.form-group-password {
  position: relative;
}

.form-group-password input {
  padding-right: 2.75rem;
}

.btn-toggle-senha {
  position: absolute;
  right: 0.5rem;
  bottom: 0;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--guara-text-secondary);
}

.btn-toggle-senha:hover {
  color: var(--guara-text);
}

.link-forgot-senha {
  display: block;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--guara-text-secondary);
  margin-top: -0.75rem;
  margin-bottom: 1rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
  font-family: inherit;
}

.link-forgot-senha:hover {
  color: var(--guara-primary);
}

/* ==================== PWA INSTALL BANNER ==================== */
/* Banner global renderizado como primeiro filho do body (via app-ui.js).
   Fica no topo do fluxo; ao rolar sai da vista e o header sticky da view
   assume o topo. Paleta dourada suave. Ocultado quando o app roda em
   display-mode: standalone ou quando dismissado ha menos de 7 dias. */

.pwa-install-banner {
  display: block;
  margin: 0.5rem 0.75rem 0;
  padding: 0.75rem 0.875rem;
  background: linear-gradient(135deg, #FDF6E3 0%, #F5E3A8 100%);
  border: 1px solid #E8D89B;
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(196, 146, 42, 0.12);
  animation: pwa-banner-fade-in 0.3s ease-out;
}

@keyframes pwa-banner-fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pwa-install-banner-inner {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.pwa-install-banner-main {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.pwa-install-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.pwa-install-banner-content {
  flex: 1;
  min-width: 0;
}

.pwa-install-banner-text {
  font-size: 0.9375rem;
  line-height: 1.35;
  color: var(--guara-title-dark);
  font-weight: 500;
  margin: 0;
}

.pwa-install-banner-ios-hint {
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  color: var(--guara-text-secondary);
  line-height: 1.4;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.pwa-install-banner-ios-hint strong {
  color: var(--guara-title-dark);
  font-weight: 600;
}

.pwa-install-banner-share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: #fff;
  color: #007AFF;
  border: 1px solid rgba(0,0,0,0.1);
  vertical-align: middle;
  padding: 2px;
}

.pwa-install-banner-share-icon svg {
  display: block;
}

.pwa-install-banner-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
}

.pwa-install-banner-dismiss,
.pwa-install-banner-install {
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition), color var(--transition);
}

.pwa-install-banner-dismiss {
  background: transparent;
  color: var(--guara-text-secondary);
}

.pwa-install-banner-dismiss:hover {
  background: rgba(0,0,0,0.04);
  color: var(--guara-text);
}

.pwa-install-banner-install {
  background: var(--guara-primary);
  color: #fff;
}

.pwa-install-banner-install:hover {
  background: var(--guara-primary-hover);
}

.link-small {
  font-size: 0.8125rem;
  color: var(--guara-text-secondary);
}

/* ==================== PAREAMENTO ==================== */

.pareamento-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 2rem 1.5rem;
  max-width: 360px;
  margin: 0 auto;
}

.pareamento-container h2 {
  margin-bottom: 0.5rem;
}

.pareamento-container p {
  color: var(--guara-text-secondary);
  font-size: 0.875rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

#pareamento-codigo {
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.5rem;
  font-weight: 600;
}

/* ==================== CONSENTIMENTO ==================== */

.consentimento-container {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: 2rem 1.5rem;
  max-width: 480px;
  margin: 0 auto;
  justify-content: center;
}

.consentimento-container h2 {
  margin-bottom: 1rem;
}

.lgpd-text {
  background: var(--guara-surface);
  border: 1px solid var(--guara-border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

.lgpd-text ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}

.lgpd-text li {
  margin-bottom: 0.25rem;
}

/* ==================== BOTTOM NAV ==================== */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--guara-surface);
  border-top: 1px solid var(--guara-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  padding: 0.375rem 1rem;
  color: var(--guara-text-secondary);
  font-size: 0.75rem;
  transition: color var(--transition);
  text-decoration: none;
}

.bottom-nav-item.active {
  color: var(--guara-primary);
}

.bottom-nav-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.bottom-nav-label {
  font-size: 0.6875rem;
  font-weight: 500;
}

/* ==================== FAB ==================== */

.fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 16px);
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--guara-primary);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  z-index: 99;
  transition: background var(--transition), transform var(--transition);
}

.fab:hover {
  background: var(--guara-primary-hover);
  transform: scale(1.05);
}

.fab:active {
  transform: scale(0.95);
}

/* ==================== SIDEBAR ==================== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100dvh;
  background: var(--guara-surface);
  z-index: 200;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s ease;
  transform: translateX(calc(-1 * var(--sidebar-width)));
  overflow-y: auto;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--guara-border);
}

.sidebar-brand-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: block;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  line-height: 1.1;
}

.sidebar-brand-title {
  font-family: Georgia, 'Times New Roman', 'Hoefler Text', serif;
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--guara-primary);
  letter-spacing: -0.01em;
}

.sidebar-brand-subtitle {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--guara-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
}

.sidebar-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--guara-text-secondary);
  line-height: 1;
  padding: 0.25rem;
  margin-left: 0.25rem;
  flex-shrink: 0;
}

.sidebar-nav li {
  border-bottom: 1px solid var(--guara-border);
}

.sidebar-link {
  display: block;
  padding: 0.875rem 1.25rem;
  color: var(--guara-text);
  font-size: 0.9375rem;
  transition: background var(--transition);
}

.sidebar-link:hover {
  background: var(--guara-primary-light);
}

.sidebar-link.active {
  color: var(--guara-primary);
  font-weight: 600;
  background: var(--guara-primary-light);
}

.sidebar-link-danger {
  color: var(--guara-red);
}

.sidebar-divider {
  height: 1px;
  background: var(--guara-border);
  margin: 0.5rem 0;
  border: none;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 199;
}

/* ==================== MODAL ==================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal {
  background: var(--guara-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  max-height: 90dvh;
  overflow-y: auto;
  animation: modal-in 0.2s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--guara-text-secondary);
  line-height: 1;
}

.modal-body {
  padding: 1.25rem;
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--guara-border);
}

/* ==================== TOAST ==================== */

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 340px;
}

.toast {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast-success {
  background: var(--guara-green-light);
  color: var(--guara-green);
  border-left: 4px solid var(--guara-green);
}

.toast-error {
  background: var(--guara-red-light);
  color: var(--guara-red);
  border-left: 4px solid var(--guara-red);
}

.toast-warning {
  background: var(--guara-amber-light);
  color: var(--guara-amber);
  border-left: 4px solid var(--guara-amber);
}

.toast-info {
  background: var(--guara-primary-light);
  color: var(--guara-primary);
  border-left: 4px solid var(--guara-primary);
}

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

/* ==================== LOADING ==================== */

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--guara-border);
  border-top-color: var(--guara-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ==================== RESPONSIVE ==================== */

@media (min-width: 768px) {
  .login-container,
  .pareamento-container {
    max-width: 400px;
  }

  .view-content {
    max-width: 720px;
    margin: 0 auto;
  }

  .toast-container {
    max-width: 400px;
  }
}

@media (min-width: 1024px) {
  .sidebar {
    left: 0;
    transform: translateX(0);
    box-shadow: none;
    border-right: 1px solid var(--guara-border);
    display: block !important;
  }

  /* Em telas pre-app (login, consentimento, onboarding, pareamento),
     esconder o sidebar mesmo em desktop largo — sobrepoe o display:block
     !important da regra .sidebar acima. */
  body.no-app .sidebar {
    display: none !important;
  }

  /* Modo operador: sidebar e admin-only e nunca deve aparecer, nem em
     desktop. Espelha a regra no-app acima — mesma tecnica pra vencer o
     display:block !important da regra .sidebar neste breakpoint. */
  body.operador-mode .sidebar {
    display: none !important;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  body.admin-mode:not(.no-app) .view,
  body.admin-mode:not(.no-app) .pwa-install-banner {
    margin-left: var(--sidebar-width);
  }

  /* Respiro do topo em desktop — o sticky .app-header fica no topo
     do scroll container e precisa de folga visual; mobile nao muda. */
  .app-header {
    padding: 2rem 1.5rem 1.25rem;
  }

  .view-content {
    padding: 0.75rem 1.5rem 1.5rem;
  }

  .hamburger {
    display: none;
  }

  .sidebar-close {
    display: none;
  }

  .sidebar-overlay {
    display: none !important;
  }
}

/* ==================== OPERADOR: PERFIL ==================== */

.perfil-card {
  margin: 1rem 0;
}

.perfil-nome {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--guara-text);
  margin-bottom: 0.25rem;
}

.perfil-email {
  font-size: 0.9375rem;
  color: var(--guara-text-secondary);
  margin-bottom: 0.75rem;
  word-break: break-all;
}

.perfil-cargo {
  font-size: 0.75rem;
  color: var(--guara-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==================== OPERADOR: MEU DIA ==================== */

.card-rotina {
  transition: opacity 0.3s ease;
}

.card-rotina-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-rotina-titulo {
  font-family: var(--guara-serif);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--guara-title-dark);
  flex: 1;
  line-height: 1.3;
}

.card-done {
  opacity: 0.6;
}

.card-done-check {
  color: var(--guara-green);
  font-weight: 700;
  font-size: 1.25rem;
}

/* Instrucoes inline no card de rotina (campo descricao). */

.card-rotina-desc {
  font-size: 0.8125rem;
  color: var(--guara-text-secondary);
  font-weight: 400;
  margin: 0.25rem 0 0;
  line-height: 1.4;
  white-space: pre-wrap;
}

/* Tarefa Card */

.card-tarefa-header {
  padding-right: 4.5rem;
}

.card-tarefa-titulo {
  font-family: var(--guara-serif);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--guara-title-dark);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-tarefa-descricao {
  font-size: 0.8125rem;
  color: var(--guara-text-secondary);
  font-weight: 400;
  margin: 0.25rem 0 0;
  cursor: pointer;
  line-height: 1.4;
  white-space: pre-wrap;
}

.card-tarefa-descricao:hover {
  color: var(--guara-text);
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 0.5rem 0;
}

.badge-prioridade {
  background: var(--guara-primary-light);
  color: var(--guara-primary);
}

.badge-definida-por {
  background: var(--guara-surface);
  border: 1px solid var(--guara-border);
  color: var(--guara-text-secondary);
}

/* Feito Button */

.btn-feito {
  display: block;
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.75rem;
  background: var(--guara-green);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  font-family: inherit;
}

.btn-feito:hover {
  background: #247040;
}

.btn-feito:active {
  transform: scale(0.98);
}

/* Zona Urgencias (manual do admin — destaque quente, nao alarme vermelho) */

.zona-urgente {}

/* Zona Prioridades */

.zona-prioridades {
  border-radius: var(--radius-lg);
}

/* Toast with Undo */

.toast-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.toast-text {
  flex: 1;
}

.btn-undo {
  background: none;
  border: none;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0;
}

/* ==================== BOTTOM SHEET ==================== */

.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--guara-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  z-index: 301;
  max-height: 80dvh;
  overflow-y: auto;
  animation: sheet-in 0.3s ease;
}

@keyframes sheet-in {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--guara-border);
  border-radius: 2px;
  margin: 0.75rem auto 0;
}

.bottom-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
}

.bottom-sheet-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--guara-text-secondary);
  line-height: 1;
}

.bottom-sheet-body {
  padding: 0 1.25rem 1.5rem;
}

/* ==================== FEITAS ==================== */

.feitas-section-title {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--guara-text-secondary);
  padding: 0.5rem 0;
  border-bottom: 2px solid var(--guara-border);
  margin: 1rem 0 0.5rem;
}

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

.card-feita-titulo {
  font-family: var(--guara-serif);
  font-weight: 700;
  color: var(--guara-title-dark);
}

.card-feita-hora {
  font-size: 0.8125rem;
  color: var(--guara-text-secondary);
}

@media (min-width: 768px) {
  .bottom-sheet {
    max-width: 480px;
    margin: 0 auto;
    left: 0;
    right: 0;
  }
}

/* ==================== ADMIN: SECTION TITLES ==================== */

.admin-section-title {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--guara-text-secondary);
  padding: 0.75rem 0 0.5rem;
  border-bottom: 2px solid var(--guara-border);
  margin-bottom: 0.75rem;
}

.admin-section-title-atencao {
  color: var(--guara-red);
  border-color: var(--guara-red);
}

/* ==================== ADMIN: BACKUP BANNER ==================== */

.backup-banner {
  background: var(--guara-amber-light);
  color: var(--guara-amber);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
  border-left: 4px solid var(--guara-amber);
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ==================== ADMIN: QUICK ACTIONS ==================== */

.quick-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.btn-quick {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  font-size: 0.8125rem;
  padding: 0.5rem 0.75rem;
}

/* ==================== ADMIN: SHARED SCORECARD BITS ==================== */
/* Usados por Equipe (avatar) e Historico (avatar, info, nome, bar).
   Nao usar no Resumo — veja .op-card* abaixo. */

.scorecard-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.scorecard-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.scorecard-nome {
  font-weight: 600;
  font-size: 0.9375rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scorecard-bar {
  height: 6px;
  background: var(--guara-border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.scorecard-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ==================== ADMIN: RESUMO — OPERATOR CARDS ==================== */

.op-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.op-card {
  background: var(--guara-surface);
  border: 1px solid var(--guara-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
  min-width: 0;
}

.op-card:hover {
  border-color: #C7BDB6;
  background: #FDFBF8;
}

.op-card-head {
  margin-bottom: 1.25rem;
}

.op-card-name {
  font-family: Georgia, 'Times New Roman', 'Hoefler Text', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--guara-text);
  line-height: 1.2;
  margin: 0 0 0.125rem 0;
}

.op-card-role {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--guara-text-secondary);
  line-height: 1.2;
  margin: 0;
}

.op-card-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.op-card-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
  min-width: 0;
}

.op-card-stat-value {
  font-family: Georgia, 'Times New Roman', 'Hoefler Text', serif;
  font-size: 1.875rem;
  font-weight: 600;
  color: var(--guara-text);
  line-height: 1;
}

.op-card-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--guara-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.2;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ==================== ADMIN: ATENCAO ==================== */

.atencao-list {
  background: var(--guara-red-light);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  margin-bottom: 1.5rem;
}

.atencao-item {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(232, 38, 26, 0.1);
}

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

.atencao-titulo {
  font-weight: 500;
  font-size: 0.9375rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

.atencao-meta {
  font-size: 0.8125rem;
  color: var(--guara-red);
}

/* ==================== ADMIN: EQUIPE ==================== */

.equipe-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.equipe-card {
  background: var(--guara-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--guara-border);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.equipe-card-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.equipe-card-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.equipe-card-nome {
  font-weight: 600;
  font-size: 0.9375rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipe-card-email {
  font-size: 0.8125rem;
  color: var(--guara-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipe-card-badges {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  padding-left: 3.25rem;
}

.badge-papel {
  background: var(--guara-primary-light);
  color: var(--guara-primary);
}

.equipe-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--guara-border);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-excluir {
  border-color: var(--guara-red) !important;
  color: var(--guara-red) !important;
}

.btn-excluir:hover:not(:disabled) {
  background: var(--guara-red-light) !important;
}

/* ==================== ADMIN: CONVITE RESULTADO ==================== */

.convite-resultado {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.convite-instrucao {
  font-size: 0.875rem;
  color: var(--guara-text-secondary);
}

.convite-campo label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--guara-text-secondary);
  margin-bottom: 0.25rem;
}

.convite-valor-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--guara-primary-light);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
}

.convite-codigo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.3rem;
  color: var(--guara-primary);
  flex: 1;
}

.convite-senha {
  font-size: 0.875rem;
  font-weight: 500;
  font-family: monospace;
  flex: 1;
  word-break: break-all;
}

/* Credencial generica (email/senha longos no modal de clinica criada).
   Fonte menor + quebra por palavra pra nao vazar do modal em emails tipo
   nomeseparadopor.ponto.muitogrande@dominio.com.br. */
.convite-credencial {
  font-size: 0.875rem;
  font-weight: 500;
  font-family: monospace;
  color: var(--guara-text);
  flex: 1 1 0;
  min-width: 0;
  word-break: break-all;
  overflow-wrap: break-word;
}

/* Botao Copiar nao pode ser esmagado pelo flex do .convite-valor-wrapper —
   garantir que fique em tamanho intrinseco. */
.convite-valor-wrapper .btn-copiar {
  flex: 0 0 auto;
}

.convite-nota {
  font-size: 0.8125rem;
  color: var(--guara-text-secondary);
  font-style: italic;
}

/* ==================== ADMIN: PREFERENCIAS ==================== */

.prefs-info {
  background: var(--guara-surface);
  border: 1px solid var(--guara-border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.prefs-value {
  font-size: 0.9375rem;
  color: var(--guara-text);
}

.prefs-toggles {
  background: var(--guara-surface);
  border: 1px solid var(--guara-border);
  border-radius: var(--radius);
  padding: 0 1rem;
}

/* Toggle switch */

.toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 0;
  cursor: pointer;
  border-bottom: 1px solid var(--guara-border);
  gap: 1rem;
}

.toggle-label:last-child {
  border-bottom: none;
}

.toggle-text {
  font-size: 0.9375rem;
}

.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--guara-disabled);
  border-radius: 12px;
  transition: background var(--transition);
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-input:checked + .toggle-switch {
  background: var(--guara-green);
}

.toggle-input:checked + .toggle-switch::after {
  transform: translateX(20px);
}

/* ==================== RESPONSIVE: ADMIN ==================== */

/* ==================== ADMIN: ROTINAS LIST ==================== */

.filter-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.75rem 0;
  margin-bottom: 0.75rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-pills::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  border: 1.5px solid var(--guara-border);
  background: var(--guara-surface);
  color: var(--guara-text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  font-family: inherit;
  flex-shrink: 0;
}

.filter-pill:hover {
  border-color: var(--guara-primary);
  color: var(--guara-primary);
}

.filter-pill-active {
  background: var(--guara-primary);
  border-color: var(--guara-primary);
  color: #fff;
}

.filter-pill-active:hover {
  background: var(--guara-primary-hover);
  border-color: var(--guara-primary-hover);
  color: #fff;
}

.filter-pill-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Secondary filter row: label + pills menores (usado em view-tarefas). */

.filter-pills-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 1rem;
  margin-bottom: 0.75rem;
}

.filter-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--guara-text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-pills-secondary {
  display: flex;
  gap: 0.375rem;
  overflow-x: auto;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-pills-secondary::-webkit-scrollbar {
  display: none;
}

.filter-pills-secondary .filter-pill {
  padding: 0.3125rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-width: 1px;
}

.filter-pills-secondary .filter-pill-active {
  background: transparent;
  color: var(--guara-primary);
  border-color: var(--guara-primary);
}

.filter-pills-secondary .filter-pill-active:hover {
  background: var(--guara-primary-light);
  color: var(--guara-primary);
  border-color: var(--guara-primary);
}

/* ==================== TAG PICKER (form de rotina) ==================== */

.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  border: 1.5px dashed var(--guara-border);
  background: transparent;
  color: var(--guara-text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  font-family: inherit;
}

.tag-pill:hover {
  border-color: var(--guara-primary);
  color: var(--guara-primary);
}

.tag-pill-selected {
  background: var(--guara-primary);
  border-style: solid;
  border-color: var(--guara-primary);
  color: #fff;
}

.tag-pill-selected:hover {
  background: var(--guara-primary-hover);
  border-color: var(--guara-primary-hover);
  color: #fff;
}

.tag-pill-todos {
  border-color: var(--guara-primary);
  color: var(--guara-primary);
  font-weight: 600;
}

.tag-pill-todos.tag-pill-selected {
  background: var(--guara-primary);
  color: #fff;
}

.tag-pill-x {
  display: inline-block;
  margin-left: 0.125rem;
  font-size: 0.9375rem;
  line-height: 1;
  opacity: 0.85;
}

/* ==================== RADIO PILLS (execucao toggle) ==================== */

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.radio-pill {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--guara-border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9375rem;
  color: var(--guara-text);
  transition: border-color var(--transition), background var(--transition);
}

.radio-pill:hover {
  border-color: var(--guara-primary);
}

.radio-pill input[type="radio"] {
  accent-color: var(--guara-primary);
  margin: 0;
  cursor: pointer;
}

.radio-pill:has(input[type="radio"]:checked) {
  border-color: var(--guara-primary);
  background: var(--guara-primary-light);
}

/* Badge de execucao na lista de rotinas */
.badge-exec {
  background: var(--guara-primary-light);
  color: var(--guara-primary);
}

.rotinas-group {
  margin-bottom: 1.25rem;
}

.rotinas-group-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid var(--guara-border);
}

.rotinas-group-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rotinas-group-nome {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--guara-text-secondary);
}

.rotina-card {
  background: var(--guara-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--guara-border);
  padding: 0.875rem 1rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: opacity var(--transition), box-shadow var(--transition);
}

.rotina-card:hover {
  box-shadow: var(--shadow-md);
}

.rotina-card-inativa {
  opacity: 0.5;
}

.rotina-card-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rotina-card-info {
  flex: 1;
  min-width: 0;
}

.rotina-card-titulo {
  font-family: var(--guara-serif);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--guara-title-dark);
  line-height: 1.3;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rotina-card-desc {
  font-size: 0.8125rem;
  color: var(--guara-text-secondary);
  font-weight: 400;
  margin: 0.25rem 0 0;
  line-height: 1.4;
  white-space: pre-wrap;
}

.rotina-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.375rem;
}

.badge-ordem {
  background: var(--guara-surface);
  border: 1px solid var(--guara-border);
  color: var(--guara-text-secondary);
}

.toggle-label-inline {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle-switch-sm {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--guara-disabled);
  border-radius: 10px;
  transition: background var(--transition);
  flex-shrink: 0;
}

.toggle-switch-sm::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-input:checked + .toggle-switch-sm {
  background: var(--guara-green);
}

.toggle-input:checked + .toggle-switch-sm::after {
  transform: translateX(16px);
}

.rotina-card-actions {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.5rem;
  justify-content: flex-end;
}

.btn-reorder {
  background: none;
  border: 1.5px solid var(--guara-border);
  border-radius: var(--radius);
  width: 32px;
  height: 32px;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--guara-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
  font-family: inherit;
}

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

.form-actions {
  margin-top: 1.5rem;
}

.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--guara-text-secondary);
  margin-top: 0.25rem;
}

/* ==================== ESTRELA DE PRIORIDADE (Etapa 1.7+6) ==================== */
/* Estrela binaria pedagogica. Vazia (cinza) = desmarcada; preenchida
   (cor primaria guara) = marcada. Lado direito do card, ao lado da chama. */

.star-priority {
  width: 2rem;
  height: 2rem;
  padding: 0.25rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #9CA3AF;
  transition: color var(--transition), transform var(--transition);
}

.star-priority:hover:not(:disabled) {
  transform: scale(1.15);
}

.star-priority--marked {
  color: var(--guara-primary);
}

.star-priority--disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.star-priority-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ==================== CHAMA DE URGENCIA ==================== */
/* Chama (flame) ao lado da estrela, direita do card.
   Admin: toggle; operadora: display-only. Amber quando marcado. */

.flame-urgente {
  width: 2rem;
  height: 2rem;
  padding: 0.25rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #9CA3AF;
  transition: color var(--transition), transform var(--transition);
}

.flame-urgente:hover:not(:disabled) {
  transform: scale(1.15);
}

.flame-urgente--marked {
  color: var(--guara-red);
}

.flame-urgente--readonly {
  cursor: default;
}

.flame-urgente-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Card urgente (admin e operador): sem decoracao lateral. O marker
   visual da urgencia e a chama vermelha; a barra ambar residual
   contradizia a cor e achatava a hierarquia do card. */

/* Deadline badges */
.badge-deadline {
  background: var(--guara-surface);
  border: 1px solid var(--guara-border);
  color: var(--guara-text-secondary);
}

.badge-deadline--today {
  background: var(--guara-amber-light);
  border-color: var(--guara-amber);
  color: var(--guara-amber);
}

.badge-deadline--overdue {
  background: var(--guara-red-light);
  border-color: var(--guara-red);
  color: var(--guara-red);
  font-weight: 600;
}

/* Marcadores de autoria (texto pequeno cinza abaixo do titulo). */
.tarefa-meta-marcador {
  font-size: 0.75rem;
  color: var(--guara-text-secondary);
  margin: 0.125rem 0 0 0;
  line-height: 1.2;
}

.tarefa-meta-marcador.priorizada-por {
  color: var(--guara-primary);
  opacity: 0.8;
}

.tarefa-meta-marcador.alterada-por {
  font-style: italic;
}

/* Descricao bloqueada pos-transicao (Principio 2). */
.tarefa-descricao-bloqueada {
  opacity: 0.75;
  cursor: not-allowed;
}

/* ==================== ADMIN: TAREFAS LIST ==================== */

.tarefa-admin-card {
  position: relative;
  background: var(--guara-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--guara-border);
  padding: 0.875rem 1rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: box-shadow var(--transition);
}

/* Container de icones (chama + estrela) — direita, contiguos. */
.tarefa-admin-card-icons {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.125rem;
  z-index: 1;
}

.tarefa-admin-card:hover {
  box-shadow: var(--shadow-md);
}

.tarefa-admin-card-done {
  opacity: 0.6;
}

.tarefa-admin-card-header {
  padding-right: 4.5rem;
}

.tarefa-admin-card-titulo {
  font-family: var(--guara-serif);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--guara-title-dark);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tarefa-admin-card-desc {
  font-size: 0.8125rem;
  color: var(--guara-text-secondary);
  font-weight: 400;
  margin: 0.25rem 0 0;
  line-height: 1.4;
  white-space: pre-wrap;
}

.tarefa-admin-card-actions {
  display: flex;
  gap: 0.375rem;
  margin-top: 0.5rem;
  align-items: center;
}

.btn-feito-sm {
  padding: 0.375rem 0.75rem;
  background: var(--guara-green);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition);
}

.btn-feito-sm:hover {
  background: #247040;
}

/* Priority section */

.prioridades-section {
  margin-bottom: 1rem;
}

/* Priorizar button (operador) */

.btn-priorizar {
  margin-top: 0.5rem;
}

/* ==================== RESPONSIVE: ADMIN ==================== */

@media (min-width: 768px) {
  .op-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-actions {
    justify-content: flex-start;
  }

  .btn-quick {
    flex: 0 0 auto;
  }
}

@media (min-width: 1200px) {
  .op-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ==================== ADMIN: HISTORICO ==================== */

.historico-mode-selector {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 0;
  margin-bottom: 0.5rem;
}

.mode-btn {
  flex: 1;
  padding: 0.5rem;
  border: 1.5px solid var(--guara-border);
  border-radius: var(--radius);
  background: var(--guara-surface);
  color: var(--guara-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  font-family: inherit;
}

.mode-btn:hover {
  border-color: var(--guara-primary);
  color: var(--guara-primary);
}

.mode-btn-active {
  background: var(--guara-primary);
  border-color: var(--guara-primary);
  color: #fff;
}

.mode-btn-active:hover {
  background: var(--guara-primary-hover);
  border-color: var(--guara-primary-hover);
  color: #fff;
}

/* Period input */

.historico-period-input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1.5px solid var(--guara-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: var(--guara-surface);
  color: var(--guara-text);
  margin-bottom: 0.5rem;
}

.historico-period-input:focus {
  outline: none;
  border-color: var(--guara-primary);
  box-shadow: 0 0 0 3px rgba(196, 146, 42, 0.15);
}

/* Historico card */

.historico-card {
  background: var(--guara-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--guara-border);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.75rem;
}

.historico-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

/* Scorecard inside historico */

.historico-scorecard {
  margin-bottom: 0.75rem;
}

.historico-scorecard-text {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-top: 0.25rem;
}

.historico-scorecard-green { color: var(--guara-green); }
.historico-scorecard-amber { color: var(--guara-amber); }
.historico-scorecard-red { color: var(--guara-red); }

.scorecard-bar-fill-green { background: var(--guara-green); }
.scorecard-bar-fill-amber { background: var(--guara-amber); }
.scorecard-bar-fill-red { background: var(--guara-red); }

/* "O que faltou" — red section */

.historico-missed {
  background: var(--guara-red-light);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.historico-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.historico-section-missed-title {
  color: var(--guara-red);
}

.historico-missed-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.historico-missed-item {
  display: flex;
  flex-direction: column;
  padding: 0.375rem 0;
  border-bottom: 1px solid rgba(232, 38, 26, 0.1);
}

.historico-missed-item:last-child {
  border-bottom: none;
}

.historico-missed-titulo {
  font-weight: 500;
  font-size: 0.9375rem;
}

.historico-missed-tarefa {
  border-left: 3px solid var(--guara-amber);
  padding-left: 0.5rem;
}

.historico-missed-meta {
  font-size: 0.8125rem;
  color: var(--guara-amber);
}

/* "Tudo atendido" — green check */

.historico-all-done {
  background: var(--guara-green-light);
  border-radius: var(--radius);
  padding: 0.75rem;
  color: var(--guara-green);
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.75rem;
}

.historico-all-done-check {
  font-size: 1.25rem;
  margin-right: 0.375rem;
}

/* "Concluido" — collapsible */

.historico-done {
  border: 1px solid var(--guara-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.historico-done-summary {
  padding: 0.625rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--guara-green);
  background: var(--guara-green-light);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.historico-done-summary::-webkit-details-marker {
  display: none;
}

.historico-done-summary::before {
  content: '\25B8';
  transition: transform var(--transition);
}

.historico-done[open] .historico-done-summary::before {
  transform: rotate(90deg);
}

.historico-done-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.historico-done-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  border-top: 1px solid var(--guara-border);
}

.historico-done-hora {
  font-size: 0.8125rem;
  color: var(--guara-text-secondary);
  flex-shrink: 0;
}

.historico-done-tarefa {
  color: var(--guara-text-secondary);
}

/* Month mode: day list */

.historico-day-list {
  margin-bottom: 0.75rem;
}

.historico-day-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.375rem;
  cursor: pointer;
  border-bottom: 1px solid var(--guara-border);
  transition: background var(--transition);
}

.historico-day-row:hover {
  background: var(--guara-primary-light);
}

.historico-day-row:last-of-type {
  border-bottom: none;
}

.historico-day-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.historico-dot-green { background: var(--guara-green); }
.historico-dot-amber { background: var(--guara-amber); }
.historico-dot-red { background: var(--guara-red); }

.historico-day-label {
  font-weight: 500;
  font-size: 0.875rem;
  min-width: 3rem;
}

.historico-day-pct {
  font-size: 0.8125rem;
  color: var(--guara-text-secondary);
  flex: 1;
}

.historico-day-missed {
  font-size: 0.75rem;
  color: var(--guara-red);
  font-weight: 500;
}

.historico-day-chevron {
  font-size: 0.75rem;
  color: var(--guara-text-secondary);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.historico-day-row-expanded .historico-day-chevron {
  transform: rotate(90deg);
}

.historico-day-expanded {
  padding: 0.5rem 0.75rem 0.5rem 1.5rem;
  background: var(--guara-bg);
  border-bottom: 1px solid var(--guara-border);
  font-size: 0.875rem;
}

.historico-day-all-done {
  color: var(--guara-green);
  font-weight: 500;
  margin: 0;
}

.historico-day-missed-item {
  padding: 0.25rem 0;
  color: var(--guara-text);
}

.historico-day-missed-item small {
  color: var(--guara-text-secondary);
}

.historico-day-missed-tarefa {
  color: var(--guara-amber);
}

/* Month mode: negligenciadas */

.historico-negligenciadas {
  background: var(--guara-red-light);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.historico-negligenciadas-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.historico-negligenciadas-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
  font-size: 0.875rem;
}

.historico-negligenciadas-count {
  font-weight: 700;
  color: var(--guara-red);
}

/* Month mode: score mensal */

.historico-score-mensal {
  font-size: 0.875rem;
  font-weight: 600;
}

/* Totals bar */

.historico-totals {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.625rem 0;
  font-size: 0.8125rem;
  color: var(--guara-text-secondary);
  border-top: 1px solid var(--guara-border);
}

.historico-totals-separator {
  color: var(--guara-border);
}

.historico-totals-red {
  color: var(--guara-red);
}

/* Year mode: bars */

.historico-year-bars {
  margin-bottom: 0.75rem;
}

.historico-year-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0;
}

.historico-year-bar-label {
  font-size: 0.8125rem;
  font-weight: 500;
  min-width: 2.25rem;
  color: var(--guara-text);
}

.historico-year-bar {
  flex: 1;
  height: 16px;
  background: var(--guara-border);
  border-radius: 8px;
  overflow: hidden;
}

.historico-year-bar-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.4s ease;
}

.historico-bar-green { background: var(--guara-green); }
.historico-bar-amber { background: var(--guara-amber); }
.historico-bar-red { background: var(--guara-red); }

.historico-year-bar-text {
  font-size: 0.75rem;
  color: var(--guara-text-secondary);
  min-width: 7rem;
  white-space: nowrap;
}

/* Year mode: problem months */

.historico-problematicos {
  background: var(--guara-red-light);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.historico-problematicos-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.historico-problematico-badge {
  display: inline-flex;
  padding: 0.25rem 0.625rem;
  background: #fff;
  border: 1px solid var(--guara-red);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--guara-red);
}

/* ==================== ONBOARDING ==================== */

.onboarding-container {
  max-width: 520px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: 100dvh;
}

.onboarding-header {
  text-align: center;
  margin-bottom: 2rem;
}

.onboarding-header h1 {
  color: var(--guara-primary);
  margin-bottom: 0.25rem;
}

/* Progress indicator */

.onboarding-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.5rem;
}

.progress-step {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  background: var(--guara-border);
  color: var(--guara-text-secondary);
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}

.progress-step-active {
  background: var(--guara-primary);
  color: #fff;
}

.progress-step-done {
  background: var(--guara-green);
  color: #fff;
}

.progress-line {
  width: 40px;
  height: 2px;
  background: var(--guara-border);
  flex-shrink: 0;
  transition: background var(--transition);
}

.progress-line-done {
  background: var(--guara-green);
}

/* Step content */

.onboarding-step-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.onboarding-step-subtitle {
  font-size: 0.875rem;
  color: var(--guara-text-secondary);
  margin-bottom: 1.25rem;
}

.onboarding-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.onboarding-actions .btn {
  flex: 1;
}

/* Operator rows (Step 2) */

.onboarding-op-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.onboarding-op-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.onboarding-op-row input {
  flex: 1;
  padding: 0.625rem 0.75rem;
  border: 1.5px solid var(--guara-border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--guara-surface);
  color: var(--guara-text);
}

.onboarding-op-row input:focus {
  outline: none;
  border-color: var(--guara-primary);
  box-shadow: 0 0 0 3px rgba(196, 146, 42, 0.15);
}

.onboarding-op-remove {
  background: none;
  border: 1.5px solid var(--guara-border);
  border-radius: var(--radius);
  width: 38px;
  height: 38px;
  cursor: pointer;
  color: var(--guara-text-secondary);
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--transition), color var(--transition);
  font-family: inherit;
  line-height: 1;
}

.onboarding-op-remove:hover {
  border-color: var(--guara-red);
  color: var(--guara-red);
}

/* Template cards (Step 3) */

.onboarding-templates {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.onboarding-template {
  background: var(--guara-surface);
  border: 1px solid var(--guara-border);
  border-radius: var(--radius);
  padding: 0.75rem;
  transition: opacity var(--transition);
}

.onboarding-template-unchecked {
  opacity: 0.5;
}

.onboarding-template-header {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.onboarding-template-header input[type="checkbox"] {
  margin-top: 0.25rem;
  accent-color: var(--guara-primary);
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

.onboarding-template-titulo {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--guara-text);
  padding: 0;
  line-height: 1.4;
}

.onboarding-template-titulo:focus {
  outline: none;
  border-bottom: 1px solid var(--guara-primary);
}

.onboarding-template-assign {
  margin-top: 0.5rem;
  padding-left: 1.625rem;
}

.onboarding-assign {
  width: 100%;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--guara-border);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-family: inherit;
  background: var(--guara-surface);
  color: var(--guara-text);
}

.onboarding-assign:focus {
  outline: none;
  border-color: var(--guara-primary);
}

/* Custom rotinas (Step 3) */

.onboarding-custom-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--guara-border);
}

.onboarding-custom-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.onboarding-custom-row input[type="text"] {
  flex: 1;
  padding: 0.625rem 0.75rem;
  border: 1.5px solid var(--guara-border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--guara-surface);
  color: var(--guara-text);
}

.onboarding-custom-row input[type="text"]:focus {
  outline: none;
  border-color: var(--guara-primary);
  box-shadow: 0 0 0 3px rgba(196, 146, 42, 0.15);
}

.onboarding-custom-row select {
  width: 35%;
  flex-shrink: 0;
}

/* Loading state */

.onboarding-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  gap: 1rem;
}

.onboarding-loading-text {
  font-size: 0.9375rem;
  color: var(--guara-text-secondary);
}

/* Result screen */

.onboarding-result {
  text-align: center;
}

.onboarding-result-check {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--guara-green);
  color: #fff;
  font-size: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.onboarding-result-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--guara-green);
  margin-bottom: 0.5rem;
}

.onboarding-result-subtitle {
  font-size: 0.875rem;
  color: var(--guara-text-secondary);
  margin-bottom: 1.5rem;
}

.onboarding-result-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.onboarding-result-card {
  background: var(--guara-surface);
  border: 1px solid var(--guara-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.onboarding-result-error {
  border-color: var(--guara-red);
  background: var(--guara-red-light);
}

.onboarding-result-card-nome {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.onboarding-result-card-err {
  font-size: 0.875rem;
  color: var(--guara-red);
}

.onboarding-result-card-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.375rem 0;
}

.onboarding-result-card-field + .onboarding-result-card-field {
  border-top: 1px solid var(--guara-border);
}

.onboarding-result-card-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--guara-text-secondary);
}

.onboarding-result-card-value {
  font-weight: 600;
  font-family: monospace;
  font-size: 0.9375rem;
}

.onboarding-result-rotinas {
  font-size: 0.875rem;
  color: var(--guara-text-secondary);
  margin-bottom: 1.5rem;
}

/* ==================== EMPTY STATES ==================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 1.25rem;
  margin: 1rem auto;
  max-width: 480px;
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--guara-text);
  margin-bottom: 0.75rem;
}

.empty-state-description {
  font-size: 0.9375rem;
  color: var(--guara-text-secondary);
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

.empty-state-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
}

.empty-state-actions .btn {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 420px) {
  .empty-state {
    padding: 2rem 1rem;
  }
  .empty-state-actions {
    flex-direction: column;
  }
  .empty-state-actions .btn {
    width: 100%;
  }
}

/* ==================== OPERADOR: HISTORICO (3 dias) ==================== */

.historico-op-day {
  margin-bottom: 1.5rem;
}

.historico-op-day-title {
  font-family: var(--guara-serif);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--guara-text-secondary);
  margin: 0 0 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--guara-border);
}

.historico-op-day-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.historico-op-event {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  background: var(--guara-surface);
  border-radius: var(--radius);
  border: 1px solid var(--guara-border);
  font-size: 0.9375rem;
}

.historico-op-event-tipo {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.125rem 0.4375rem;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.historico-op-event-rotina .historico-op-event-tipo {
  background: var(--guara-primary-light);
  color: var(--guara-primary);
}

.historico-op-event-tarefa .historico-op-event-tipo {
  background: var(--guara-amber-light);
  color: var(--guara-amber);
}

.historico-op-event-titulo {
  flex: 1;
  color: var(--guara-text);
  line-height: 1.3;
}

.historico-op-event-hora {
  color: var(--guara-text-secondary);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* ==================== ADMIN: OPERADORA DRAWER ==================== */

.op-card {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.op-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.op-card:focus-visible {
  outline: 2px solid var(--guara-primary);
  outline-offset: 2px;
}

.op-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 250;
  animation: op-drawer-overlay-in 0.2s ease;
}

@keyframes op-drawer-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.op-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: 100%;
  max-width: 100%;
  background: var(--guara-bg);
  z-index: 251;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: op-drawer-in 0.2s ease;
  overflow: hidden;
}

@keyframes op-drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@media (min-width: 768px) {
  .op-drawer {
    width: 500px;
  }
}

body.op-drawer-open {
  overflow: hidden;
}

.op-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--guara-border);
  background: var(--guara-surface);
  flex-shrink: 0;
}

.op-drawer-title {
  font-family: var(--guara-serif);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--guara-title-dark);
  margin: 0;
}

.op-drawer-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--guara-text-secondary);
  line-height: 1;
  padding: 0 0.25rem;
}

.op-drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 1rem 1.25rem 1.25rem;
}

.op-drawer-section {
  margin-bottom: 1.5rem;
}

.op-drawer-section-title {
  font-family: var(--guara-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--guara-title-dark);
  margin: 0 0 0.625rem;
}

.op-drawer-empty {
  color: var(--guara-text-secondary);
  font-size: 0.875rem;
  margin: 0;
  padding: 0.5rem 0;
}

.op-drawer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.op-drawer-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  background: var(--guara-surface);
  border-radius: var(--radius);
  border: 1px solid var(--guara-border);
  font-size: 0.9375rem;
}

.op-drawer-item-done {
  opacity: 0.7;
}

.op-drawer-item-prio .op-drawer-status {
  color: var(--guara-amber);
}

.op-drawer-status {
  flex-shrink: 0;
  width: 1.25rem;
  text-align: center;
  color: var(--guara-text-secondary);
  font-size: 1rem;
}

.op-drawer-status-done {
  color: var(--guara-green);
}

.op-drawer-titulo {
  flex: 1;
  color: var(--guara-text);
  line-height: 1.3;
}

.op-drawer-hora {
  color: var(--guara-text-secondary);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.op-drawer-details {
  margin-top: 0.5rem;
}

.op-drawer-details-summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--guara-text-secondary);
  padding: 0.5rem 0;
}

.op-drawer-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.875rem;
}

.op-drawer-pill {
  background: var(--guara-surface);
  border: 1px solid var(--guara-border);
  color: var(--guara-text);
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.op-drawer-pill:hover {
  border-color: var(--guara-primary);
}

.op-drawer-pill-active {
  background: var(--guara-primary);
  color: var(--guara-on-primary, #fff);
  border-color: var(--guara-primary);
}

.op-drawer-day {
  margin-top: 1rem;
}

.op-drawer-day-label {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--guara-text-secondary);
  margin: 0 0 0.375rem;
}

.op-drawer-event {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  background: var(--guara-surface);
  border-radius: var(--radius);
  border: 1px solid var(--guara-border);
  font-size: 0.875rem;
}

.op-drawer-event-tipo {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.125rem 0.4375rem;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.op-drawer-event-rotina .op-drawer-event-tipo {
  background: var(--guara-primary-light);
  color: var(--guara-primary);
}

.op-drawer-event-tarefa .op-drawer-event-tipo {
  background: var(--guara-amber-light);
  color: var(--guara-amber);
}

.op-drawer-event-titulo {
  flex: 1;
  color: var(--guara-text);
}

.op-drawer-event-hora {
  color: var(--guara-text-secondary);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.op-drawer-footer-slot {
  flex: 0 0 auto;
  background: var(--guara-surface);
  padding: 0.875rem 1.25rem calc(0.875rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--guara-border);
}

.op-drawer-archive-btn {
  width: 100%;
}

.op-drawer-archive-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==================== ETAPA 1.9 — Dia de folga ==================== */

/* Resumo (cards de operadoras) — dia de folga substitui stats. */
.op-card-stats-folga {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
}

.op-card-folga-label {
  font-size: 0.9375rem;
  color: var(--guara-text-secondary);
  font-style: italic;
}

/* Historico — badge em card de dia de folga. */
.historico-folga-badge {
  margin: 0.5rem 0 0 0;
  padding: 0.5rem 0.75rem;
  background: var(--guara-bg-subtle, #f4f4f4);
  border-left: 3px solid var(--guara-border);
  color: var(--guara-text-secondary);
  font-size: 0.875rem;
  font-style: italic;
}

/* Linha de dia em modo mes: visual atenuado e dot cinza. */
.historico-day-folga {
  opacity: 0.6;
  cursor: default;
}

.historico-dot-folga {
  background: var(--guara-border);
}

/* ==================== OWNER — Painel Admin ==================== */

/* Sidebar: seccao "Proprietario" so visivel pro owner (body.owner-mode). */
body:not(.owner-mode) .sidebar-owner-only {
  display: none !important;
}

.sidebar-section-label {
  padding: 0.5rem 1.25rem 0.25rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--guara-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==================== PAINEL ADMIN (OWNER) ==================== */

.painel-admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.painel-admin-total {
  font-size: 0.875rem;
  color: var(--guara-text-secondary);
}

/* Botao "Presentear clinica" — visual dourado distinto. */
.btn-gift {
  background: #C9A227;
  color: #fff;
  border: 1.5px solid #C9A227;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition), border-color var(--transition);
}

.btn-gift:hover {
  background: #B8901F;
  border-color: #B8901F;
}

.painel-admin-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--guara-border);
  border-radius: 0.5rem;
  background: var(--guara-card-bg, #fff);
}

.painel-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.painel-admin-table th,
.painel-admin-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--guara-border);
  vertical-align: middle;
}

.painel-admin-table th {
  background: var(--guara-bg-subtle, #fafafa);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--guara-text-secondary);
}

.painel-admin-table tbody tr:last-child td {
  border-bottom: none;
}

.painel-admin-table tbody tr:hover {
  background: var(--guara-bg-subtle, #fafafa);
}

.painel-admin-tid {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--guara-text-secondary);
  margin-top: 0.125rem;
}

.painel-admin-table .col-actions {
  white-space: nowrap;
}

.painel-admin-table .col-actions .btn {
  margin-left: 0.25rem;
}

.painel-admin-table .col-actions .btn:first-child {
  margin-left: 0;
}

/* Badge gray pra status expirada/cancelada. */
.badge-gray {
  background: var(--guara-border);
  color: var(--guara-text-secondary);
}

/* Detalhes do tenant — layout dl. */
.painel-admin-details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1rem;
  margin: 0;
}

.painel-admin-details dt {
  font-weight: 600;
  color: var(--guara-text-secondary);
  font-size: 0.8125rem;
}

.painel-admin-details dd {
  margin: 0;
  font-size: 0.875rem;
}

/* Sidebar — secao Clinica (abaixo do brand, acima do nav).
   Tom dourado suave pra diferenciar do nav sem concorrer visualmente. */
.sidebar-clinica {
  padding: 0.875rem 1.25rem;
  background: rgba(201, 162, 39, 0.08);
  border-bottom: 1px solid var(--guara-border);
}

.sidebar-clinica-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--guara-text-secondary);
  margin-bottom: 0.25rem;
}

.sidebar-clinica-nome {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--guara-text);
  line-height: 1.25;
  word-break: break-word;
}

.sidebar-clinica-esp {
  font-size: 0.8125rem;
  color: var(--guara-text-secondary);
  margin-top: 0.125rem;
  word-break: break-word;
}
