/* ============================================================
   BiotechProject — Design System v3.0
   Paleta ambiental profissional — verde musgo + azul água
   Acessibilidade WCAG AA (contraste mínimo 4.5:1 em texto normal)
   ============================================================ */

/* ── 1. Design Tokens ──────────────────────────────────────── */
:root {
  /* ── Sidebar (verde-noite ambiental) ─────────────────── */
  --sidebar-bg:            #243B36;
  --sidebar-bg-elev:       #2C463F;
  --sidebar-width:         240px;
  --sidebar-width-sm:       64px;
  --sidebar-text:          rgba(255, 255, 255, 0.72);
  --sidebar-text-active:   #ffffff;
  --sidebar-item-hover:    rgba(255, 255, 255, 0.06);
  --sidebar-item-active:   rgba(111, 163, 134, 0.18);
  --sidebar-active-bar:    #8FBFA1;
  --sidebar-divider:       rgba(255, 255, 255, 0.08);

  /* ── Header ──────────────────────────────────────────── */
  --header-height:         60px;
  --header-bg:             #ffffff;
  --header-border:         #E1E8E3;

  /* ── Accent primário (Verde musgo) ───────────────────── */
  --color-accent:          #3F6B52;
  --color-accent-dark:     #2F5240;
  --color-accent-light:    rgba(63, 107, 82, 0.10);
  --color-accent-soft:     #EAF1EC;

  /* ── Accent secundário (Azul água) ───────────────────── */
  --color-secondary:       #447B8B;
  --color-secondary-dark:  #335E6B;
  --color-secondary-light: rgba(68, 123, 139, 0.10);
  --color-secondary-soft:  #E8F0F2;

  /* ── Text (cinza levemente esverdeado) ───────────────── */
  --color-text:            #1F2A24;
  --color-text-muted:      #56655C;
  --color-text-subtle:     #62716A;

  /* ── Surfaces ────────────────────────────────────────── */
  --color-bg:              #F4F7F5;
  --color-surface:         #ffffff;
  --color-surface-alt:     #F7FAF8;
  --color-surface-hover:   #EEF3EF;
  --color-border:          #E1E8E3;
  --color-border-strong:   #CFD8D2;

  /* ── Status (sóbrios, sem saturação extrema; AA com branco) ─ */
  --color-success:         #447D5F;
  --color-success-dark:    #335E48;
  --color-success-light:   #EAF3ED;
  --color-danger:          #B5453A;
  --color-danger-dark:     #913529;
  --color-danger-light:    #F8ECEA;
  --color-warning:         #9B6A24;
  --color-warning-dark:    #7E5418;
  --color-warning-light:   #FAF1DF;
  --color-info:            #447B8B;
  --color-info-dark:       #335E6B;
  --color-info-light:      #E8F0F2;

  /* ── Gradients (sutis, sem saturação alta) ───────────── */
  --gradient-accent:       linear-gradient(135deg, #3F6B52, #2F5240);
  --gradient-secondary:    linear-gradient(135deg, #447B8B, #335E6B);
  --gradient-natural:      linear-gradient(135deg, #3F6B52 0%, #447B8B 100%);

  /* ── Typography ──────────────────────────────────────── */
  --font-sans:             'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', sans-serif;

  /* ── Shape ───────────────────────────────────────────── */
  --radius-sm:             0.375rem;   /* 6px  */
  --radius-md:             0.5rem;     /* 8px  */
  --radius-lg:             0.75rem;    /* 12px */
  --radius-xl:             1rem;       /* 16px */

  /* ── Shadows (suaves, sem peso) ──────────────────────── */
  --shadow-xs:             0 1px 2px rgba(36, 59, 54, 0.04);
  --shadow-sm:             0 1px 3px rgba(36, 59, 54, 0.06), 0 1px 2px rgba(36, 59, 54, 0.04);
  --shadow-md:             0 4px 12px rgba(36, 59, 54, 0.07), 0 2px 4px rgba(36, 59, 54, 0.04);
  --shadow-lg:             0 10px 28px rgba(36, 59, 54, 0.10), 0 4px 8px rgba(36, 59, 54, 0.05);
  --shadow-focus:          0 0 0 3px rgba(63, 107, 82, 0.18);

  /* ── Motion ──────────────────────────────────────────── */
  --ease-out:              cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast:         0.15s;
  --duration-base:         0.20s;
  --duration-slow:         0.30s;
}

/* ── 2. Base ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }

body {
  height: 100%;
  margin: 0;
  padding-top: var(--header-height);
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

/* ── 3. Sidebar ─────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1000;
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  transition: width 0.25s ease;
  overflow: hidden;
}

.sidebar.is-collapsed { width: var(--sidebar-width-sm); }

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  height: var(--header-height);
  border-bottom: 1px solid var(--sidebar-divider);
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-brand-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--sidebar-text-active);
  overflow: hidden;
  transition: opacity 0.2s ease, width 0.25s ease;
}

.sidebar.is-collapsed .sidebar-brand-name { opacity: 0; width: 0; }

/* Collapse toggle */
.sidebar-collapse-btn {
  margin: 0.625rem auto;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: 50%;
  color: var(--sidebar-text);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Nav list */
.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

.sidebar-nav li { padding: 0 0.5rem; margin-bottom: 1px; }

.sidebar-nav li.nav-divider {
  padding: 0.5rem 0.75rem 0.25rem;
  border-top: 1px solid var(--sidebar-divider);
  margin-top: 0.375rem;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text) !important;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  font-size: 0.875rem;
  transition: background 0.18s, color 0.18s;
}

.sidebar-nav .nav-link:hover {
  background: var(--sidebar-item-hover);
  color: var(--sidebar-text-active) !important;
}

.sidebar-nav .nav-link.active {
  background: var(--sidebar-item-active);
  color: var(--sidebar-text-active) !important;
  font-weight: 500;
  border-left: 3px solid var(--sidebar-active-bar);
  padding-left: calc(0.75rem - 3px);
}

.sidebar-nav .nav-link i {
  width: 18px;
  text-align: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.nav-text {
  overflow: hidden;
  transition: opacity 0.2s ease, width 0.25s ease;
}

.sidebar.is-collapsed .nav-text { opacity: 0; width: 0; }

/* ── 4. Header ──────────────────────────────────────────────── */
.main-header {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 999;
  height: var(--header-height);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  box-shadow: var(--shadow-sm);
  transition: left 0.25s ease;
}

.main-header.sidebar-collapsed { left: var(--sidebar-width-sm); }

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 1.5rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1rem;
  padding: 0.35rem 0.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: none;
  line-height: 1;
  transition: background 0.18s, color 0.18s;
}

.sidebar-toggle:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.page-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  letter-spacing: -0.01em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* Search — ver bloco completo na seção do header abaixo */

/* ── Botão de ícone genérico (sino, etc.) ── */
.icon-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1rem;
  padding: 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  line-height: 1;
}
.icon-btn:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

/* Legado — mantido para compatibilidade com páginas antigas */
.notification-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1rem;
  padding: 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  line-height: 1;
}
.notification-btn:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

/* Badge de contagem (compartilhado: .icon-btn e .notification-btn) */
.notification-count {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--color-danger);
  color: white;
  border-radius: 10px;
  min-width: 16px;
  height: 16px;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}

/* ── Dropdown de notificações ── */
.notification-dropdown {
  width: 340px;
  padding: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.notif-mark-all {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.75rem;
  color: var(--color-accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}
.notif-mark-all:hover { color: var(--color-accent-dark); }

.notification-list { max-height: 300px; overflow-y: auto; }

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  transition: background 0.15s;
}
.notification-item:last-child { border-bottom: none; }
.notification-item:hover { background: var(--color-bg); }

.notification-item.unread { background: var(--color-accent-soft); }
.notification-item.unread:hover { background: rgba(63,107,82,0.12); }

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
  margin-top: 5px;
}
.notification-item.unread .notif-dot { background: var(--color-accent); }

.notif-body { flex: 1; min-width: 0; }
.notif-text {
  font-size: 0.8125rem;
  line-height: 1.45;
  margin: 0 0 2px;
  white-space: normal;
  color: var(--color-text);
}
.notif-time {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.notification-footer {
  padding: 0.6rem 1rem;
  text-align: center;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}
.notification-footer a {
  font-size: 0.8125rem;
  color: var(--color-accent);
  text-decoration: none;
}
.notification-footer a:hover { text-decoration: underline; }

.notification-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 1rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}
.notification-empty i { font-size: 1.5rem; opacity: 0.4; }

/* Legado */
.notification-content { white-space: normal; }
.notification-text { margin-bottom: 3px; line-height: 1.4; font-size: 0.875rem; }

/* ── Search box ── */
.search-box {
  position: relative;
  width: 210px;
}
.search-box input {
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.875rem;
  padding: 0.35rem 2.25rem 0.35rem 0.875rem;
  transition: border-color 0.18s, box-shadow 0.18s, width 0.25s;
  width: 100%;
}
.search-box input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
  outline: none;
  background: #fff;
  width: 280px;
}
.search-submit-btn {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  color: var(--color-text-subtle);
  font-size: 0.8rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}
.search-submit-btn:hover { color: var(--color-accent); }

/* ── User menu ── */
.user-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.18s;
}
.user-dropdown-btn:hover { background: var(--color-bg); }

/* Avatar — cor consistente com sidebar */
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}
.user-avatar-lg {
  width: 38px;
  height: 38px;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

/* Cartão do usuário no dropdown */
.dropdown-user-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
}
.dropdown-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dropdown-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropdown-user-email {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 5. Main content ────────────────────────────────────────── */
.main-content,
.main-content-container {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.25s ease;
}

.main-content.sidebar-collapsed,
.main-content-container.sidebar-collapsed {
  margin-left: var(--sidebar-width-sm);
}

/* ── 6. Modals ──────────────────────────────────────────────── */
.modal-content {
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 1.25rem;
}

.modal-header.modal-header-dark {
  background: linear-gradient(135deg, var(--sidebar-bg), var(--sidebar-bg-elev));
  color: white;
  border-bottom-color: var(--sidebar-divider);
}

.modal-header.modal-header-success {
  background: linear-gradient(135deg, var(--color-success), var(--color-success-dark));
  color: white;
  border-bottom-color: rgba(255,255,255,0.15);
}

.modal-header.modal-header-danger {
  background: linear-gradient(135deg, var(--color-danger), var(--color-danger-dark));
  color: white;
  border-bottom-color: rgba(255,255,255,0.15);
}

.modal-footer {
  border-top: 1px solid var(--color-border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.btn-close-white { filter: invert(1) grayscale(100%) brightness(200%); }

.modal.fade .modal-dialog {
  transform: translateY(-24px) scale(0.98);
  opacity: 0;
  transition: transform var(--duration-slow) var(--ease-out),
              opacity var(--duration-base) var(--ease-out);
}

.modal.show .modal-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-backdrop.fade { transition: opacity var(--duration-base) ease; }

/* ── 7. Alerts ──────────────────────────────────────────────── */
.alert {
  position: fixed;
  top: calc(var(--header-height) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1050;
  width: 82%;
  max-width: 540px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.alert-dismissible {
  position: fixed;
  top: calc(var(--header-height) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: 82%;
  max-width: 540px;
  border-radius: var(--radius-md);
}

.alert-dismissible .btn-close {
  position: absolute;
  right: 10px;
  top: 10px;
}

/* ── 8. Login ───────────────────────────────────────────────── */
body.login-page {
  background: var(--sidebar-bg);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.login-box {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.25rem 2rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  overflow: hidden;
}

.login-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-accent);
}

.login-logo {
  display: block;
  max-width: 150px;
  height: auto;
  margin: 0 auto 0.875rem;
}

.login-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: 1.75rem;
}

.btn-login {
  background: var(--gradient-accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  width: 100%;
  margin-top: 0.875rem;
  cursor: pointer;
  transition: opacity 0.18s, box-shadow 0.18s;
}

.btn-login:hover {
  opacity: 0.95;
  box-shadow: 0 6px 18px rgba(63, 107, 82, 0.28);
  color: white;
  transform: translateY(-1px);
}

.password-container { position: relative; }

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--color-text-subtle);
  background: none;
  border: none;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: color 0.18s;
}

.password-toggle:hover { color: var(--color-accent); }

.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.625rem;
  font-size: 0.875rem;
}

.forgot-password {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

.forgot-password:hover { color: var(--color-accent-dark); }

.footer-text {
  text-align: center;
  margin-top: 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.error-message {
  background-color: var(--color-danger-light);
  color: #991b1b;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-danger);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  display: none;
}

/* ── 9. Cards ───────────────────────────────────────────────── */
.card {
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
}

.card-header {
  background: var(--color-surface-alt);
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
  padding: 0.875rem 1.25rem;
  font-weight: 600;
}

.card-header.bg-primary,
.card-header.bg-dark {
  background: var(--gradient-accent) !important;
  color: white !important;
  border-bottom-color: transparent;
}

.card-header.bg-light,
.card-header.bg-white {
  background: var(--color-surface-alt) !important;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}

/* Stats Cards */
.stats-card { transition: transform 0.18s, box-shadow 0.18s; }
.stats-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Info Labels */
.info-label {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

/* Status Badge */
.status-badge { font-size: 0.8rem; padding: 0.3em 0.6em; }

/* Form Section Title */
.form-section-title {
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 0.5rem;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.9375rem;
}

/* Required Field */
.required-field::after,
.required-label::after {
  content: " *";
  color: var(--color-danger);
}

/* Empty State */
.empty-state {
  padding: 3rem;
  text-align: center;
  background-color: var(--color-surface-alt);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
}

/* Table */
.table th {
  border-top: none;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  background-color: var(--color-surface-alt);
}

/* Task/Project Row hover */
.task-row,
.project-row { transition: background-color 0.15s; }

.task-row:hover,
.project-row:hover { background-color: var(--color-surface-alt); }

/* Links padrão */
.task-link,
.project-link,
.client-link {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.15s;
}

.task-link:hover,
.project-link:hover,
.client-link:hover {
  color: var(--color-accent-dark);
  text-decoration: underline;
}

/* Priority / Prazo Badges */
.priority-badge,
.prazo-badge { font-size: 0.75rem; }

/* Contato Card */
.contato-card { transition: transform 0.18s, box-shadow 0.18s; }
.contato-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.contato-principal { border-left: 3px solid var(--color-warning); }

/* Action Buttons */
.action-buttons .btn { margin-right: 0.25rem; }
.action-buttons { white-space: nowrap; }

/* Badge Tipos */
.badge-principal { background-color: var(--color-warning); color: #fff; }
.badge-pf { background-color: var(--color-info); color: white; }
.badge-pj { background-color: var(--color-accent); color: white; }

/* Badge Usuário */
.badge-admin      { background-color: var(--color-danger);  color: white; }
.badge-gerente    { background-color: var(--color-info);    color: white; }
.badge-colaborador{ background-color: var(--color-success); color: white; }

/* ── Calendar ──────────────────────────────────────────────── */
.calendar-header {
  background: var(--gradient-accent);
  color: white;
  padding: 1.125rem 1.5rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background-color: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
}

.calendar-day-header {
  background-color: var(--color-surface-alt);
  padding: 0.625rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calendar-day {
  background-color: var(--color-surface);
  min-height: 110px;
  padding: 0.5rem;
  position: relative;
  transition: background-color 0.15s;
}

.calendar-day:hover { background-color: var(--color-surface-alt); }

.calendar-day.other-month {
  background-color: var(--color-surface-alt);
  opacity: 0.55;
}

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

.day-number {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.calendar-day.today .day-number { color: var(--color-accent); }

.task-count {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 0.65rem;
}

.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.month-nav h3 {
  margin: 0;
  font-weight: 600;
  font-size: 1.125rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

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

/* ── Projeto Item ──────────────────────────────────────────── */
.projeto-item {
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--color-accent);
  background: var(--color-surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 0.375rem;
  transition: box-shadow 0.18s, border-left-color 0.18s;
}

.projeto-item:hover { box-shadow: var(--shadow-sm); }

/* Projeto Card */
.projeto-card,
.contato-card { transition: transform 0.18s, box-shadow 0.18s; }
.projeto-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Progress Card */
.progress-card {
  background: var(--gradient-accent);
  color: white;
}

/* Project / Page Header */
.project-header,
.page-header {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  border-left: 3px solid var(--color-accent);
}

/* Projeto Content (tree view) */
.projeto-content {
  cursor: pointer;
  background: var(--color-surface-alt) !important;
  border-left: 3px solid var(--color-accent);
  transition: background-color 0.15s;
}

.projeto-content:hover { background-color: var(--color-surface-hover) !important; }

/* Card Section */
.card-section {
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

/* Task Item (lista) */
.task-item {
  transition: all 0.18s;
  border-left: 3px solid transparent;
}

.task-item:hover {
  border-left-color: var(--color-accent);
  background-color: var(--color-surface-alt);
}

/* Card Tarefa */
.card-tarefa {
  transition: all 0.18s;
  border-left: 3px solid transparent;
}

.card-tarefa:hover {
  border-left-color: var(--color-accent);
  background-color: var(--color-surface-alt);
}

/* Atraso Badge */
.atraso-badge {
  background-color: var(--color-danger);
  color: white;
  padding: 0.25em 0.6em;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

/* Avatar */
.avatar {
  font-weight: 600;
  font-size: 0.875rem;
}

/* Date Input Group */
.date-input-group { position: relative; }
.date-input-group input { padding-right: 35px; }
.date-input-group i {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--color-text-subtle);
}

/* Field Error */
.field-error {
  border-color: var(--color-danger) !important;
  box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.2) !important;
}

.field-error-msg {
  color: var(--color-danger);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* Action Buttons (circular) */
.btn-action {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Stat Card com ícone colorido */
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Select múltiplo */
.select[multiple] { height: auto !important; }

/* Botão comentário */
.btn-comentario {
  padding: 0.2rem 0.45rem;
  font-size: 0.8rem;
  margin-left: 0.3rem;
}

/* ── 10. Page-specific shared patterns ──────────────────────── */

/* Dashboard stat cards */
.card-counter { font-size: 2rem; font-weight: 700; }
.stat-card { height: 100%; }

/* Dashboard activity items */
.activity-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.15s;
}
.activity-item:hover { background-color: var(--color-surface-alt); }
.activity-item:last-child { border-bottom: none; }
.priority-high { border-left: 4px solid var(--color-danger); }

/* Chart containers */
.chart-container { position: relative; height: 280px; padding: 15px; }

/* ── Kanban ─────────────────────────────────────────────────── */
.kanban-container { overflow-x: auto; padding-bottom: 20px; }
.kanban-board { display: flex; gap: 15px; min-width: 100%; }
.kanban-column {
  min-width: 280px;
  min-height: 500px;
  background-color: var(--color-surface-alt);
  border-radius: 8px;
  padding: 15px;
}
.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}
.card-task-kanban {
  cursor: move;
  margin-bottom: 12px;
  border-left: 4px solid;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card-task-kanban:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}
.card-task-kanban.atrasada { border-left-color: var(--color-danger); }
.card-task-kanban.pendente { border-left-color: var(--color-info); }
.card-task-kanban.em_andamento { border-left-color: var(--color-warning); }
.card-task-kanban.concluida { border-left-color: var(--color-success); }
.select-filter { max-width: 250px; }
.task-priority { font-size: 0.75rem; padding: 0.2rem 0.5rem; border-radius: 4px; }
.task-date { font-size: 0.8rem; }
.task-dragging { opacity: 0.7; transform: rotate(3deg); }
.column-dropzone {
  min-height: 100px;
  border: 2px dashed var(--color-border);
  border-radius: 6px;
  background-color: rgba(0,0,0,0.02);
  transition: background-color 0.2s;
}
.column-dropzone.active {
  border-color: var(--color-accent);
  background-color: var(--color-accent-light);
}
.kanban-task-count {
  background-color: rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 0.15rem 0.5rem;
  font-size: 0.8rem;
}

/* ── Projetos page ──────────────────────────────────────────── */
.page-content { padding: 1.5rem; }

.bg-planejado    { background-color: var(--color-text-subtle) !important; }
.bg-em_andamento { background-color: var(--color-accent)      !important; }
.bg-concluido    { background-color: var(--color-success)     !important; }
.bg-cancelado    { background-color: var(--color-danger)      !important; }

.cliente-group {
  margin: 0.875rem 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.cliente-header {
  background: var(--color-surface-alt);
  padding: 0.875rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cliente-header:hover { background: var(--color-surface-hover); }
.cliente-title { margin: 0; font-weight: 600; color: var(--color-text); }
.cliente-projetos { padding: 0 1rem; background: var(--color-surface); display: none; }
.cliente-toggle i { transition: transform 0.25s ease; }

.projeto-item-list {
  transition: transform 0.18s, box-shadow 0.18s;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  margin: 3px 0;
}
.projeto-item-list:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); background: var(--color-surface-alt); }
.projeto-toggle { transition: transform 0.25s ease; }

.projeto-nivel-1 { margin-left: 1.5rem; }
.projeto-nivel-2 { margin-left: 3rem; }
.projeto-nivel-3 { margin-left: 4.5rem; }

/* ── Minhas Tarefas ──────────────────────────────────────────── */
.stat-card-minhas {
    background: var(--gradient-accent);
    color: white;
    border: none;
    transition: transform 0.18s, box-shadow 0.18s;
}
.stat-card-minhas:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-number { font-size: 2rem; font-weight: 700; margin-bottom: 0; }
.stat-label  { font-size: 0.875rem; opacity: 0.88; }

.card-header-custom {
    background: var(--color-surface-alt);
    color: var(--color-text);
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
}

.table-tarefas { border-collapse: separate; border-spacing: 0; margin-bottom: 0; }
.table-tarefas thead th {
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
    border-bottom: 2px solid var(--color-border);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.875rem 0.75rem;
    vertical-align: middle;
}
.table-tarefas tbody tr { transition: background-color 0.15s; border-left: 3px solid transparent; }
.table-tarefas tbody tr:hover { background-color: var(--color-surface-alt); }
.table-tarefas tr td { vertical-align: middle; padding: 0.75rem; }

.badge-status { font-size: 0.75rem; padding: 0.35em 0.65em; }
.badge-anexo  { background-color: var(--color-text-subtle); color: white; padding: 0.35em 0.65em; }

.prioridade-urgente { border-left: 3px solid var(--color-danger);    background-color: rgba(181, 69, 58, 0.05); }
.prioridade-alta    { border-left: 3px solid var(--color-warning);   background-color: rgba(155, 106, 36, 0.06); }
.prioridade-media   { border-left: 3px solid var(--color-secondary); background-color: rgba(68, 123, 139, 0.06); }
.prioridade-baixa   { border-left: 3px solid var(--color-success);   background-color: rgba(68, 125, 95, 0.06); }

.coluna-tarefa { max-width: 300px; }
.coluna-tarefa h6 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; margin-bottom: 0.25rem; }
.coluna-tarefa .text-muted { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; font-size: 0.875rem; }
.coluna-acoes { width: 140px; }
.btn-acao { padding: 0.25rem 0.5rem; font-size: 0.875rem; }

.paginacao { display: flex; justify-content: center; margin-top: 1.25rem; }
.paginacao .btn { margin: 0 2px; }

.filtros-avancados {
    background-color: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

/* ── Tarefas page ────────────────────────────────────────────── */
.nivel-indent { flex-shrink: 0; }
.toggle-icon  { transition: transform 0.25s ease; }
.projeto-item.active .toggle-icon { transform: rotate(180deg); }

.card-tarefa-list { margin-bottom: 0.25rem; border-radius: var(--radius-md); }
.card-tarefa-list:hover { transform: translateX(4px); }

.descricao-tarefa { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.loading-spinner  { display: none; text-align: center; padding: 2rem; }
.no-results       { display: none; text-align: center; padding: 2rem; color: var(--color-text-muted); }
.filter-loading   { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: none; }
.status-filter-container { position: relative; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.projeto-content-anim { animation: fadeIn 0.25s ease; }

/* ── Profile ─────────────────────────────────────────────────── */
.profile-card {
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}
.profile-header {
    background: var(--gradient-accent);
    color: white;
    border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
    padding: 1.5rem;
}
.profile-avatar {
    width: 76px; height: 76px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.875rem; font-weight: 700;
    margin: 0 auto 1rem;
}
.info-box {
    background-color: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.25rem;
}

/* ── Configurações ───────────────────────────────────────────── */
.settings-tab {
    border: 1px solid var(--color-border);
    border-top: none;
    padding: 1.25rem;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.nav-tabs .nav-link { color: var(--color-text-muted); font-weight: 500; }
.nav-tabs .nav-link.active {
    background: var(--gradient-accent);
    color: white !important;
    border-color: var(--color-border) var(--color-border) #fff;
}
.btn-submit {
    background: var(--gradient-accent);
    border: none;
    color: white;
    padding: 0.5rem 1.5rem;
    transition: opacity 0.18s, box-shadow 0.18s;
}
.btn-submit:hover { opacity: 0.9; box-shadow: var(--shadow-md); color: white; }
.logo-preview { max-width: 200px; max-height: 100px; margin-top: 10px; }
.color-preview {
    width: 28px; height: 28px;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
    border: 1px solid var(--color-border);
}

/* ── 11. Bootstrap Overrides (harmoniza com a paleta) ──────── */

/* Botões — radius consistente, transição suave, foco acessível */
.btn {
    border-radius: var(--radius-md);
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: background-color var(--duration-base) var(--ease-out),
                border-color   var(--duration-base) var(--ease-out),
                color          var(--duration-base) var(--ease-out),
                box-shadow     var(--duration-base) var(--ease-out),
                transform      var(--duration-base) var(--ease-out);
}
.btn:focus,
.btn:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}
.btn:active { transform: translateY(1px); }

.btn-primary,
.btn-primary:focus {
    background-color: var(--color-accent);
    border-color:     var(--color-accent);
    color: #fff;
}
.btn-primary:hover {
    background-color: var(--color-accent-dark);
    border-color:     var(--color-accent-dark);
    color: #fff;
}

.btn-outline-primary {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background-color: transparent;
}
.btn-outline-primary:hover {
    background-color: var(--color-accent);
    border-color:     var(--color-accent);
    color: #fff;
}

.btn-success,
.btn-success:focus {
    background-color: var(--color-success);
    border-color:     var(--color-success);
}
.btn-success:hover {
    background-color: var(--color-success-dark);
    border-color:     var(--color-success-dark);
}

.btn-danger,
.btn-danger:focus {
    background-color: var(--color-danger);
    border-color:     var(--color-danger);
}
.btn-danger:hover {
    background-color: var(--color-danger-dark);
    border-color:     var(--color-danger-dark);
}

.btn-warning,
.btn-warning:focus {
    background-color: var(--color-warning);
    border-color:     var(--color-warning);
    color: #fff;
}
.btn-warning:hover {
    background-color: var(--color-warning-dark);
    border-color:     var(--color-warning-dark);
    color: #fff;
}

.btn-info,
.btn-info:focus {
    background-color: var(--color-info);
    border-color:     var(--color-info);
    color: #fff;
}
.btn-info:hover {
    background-color: var(--color-info-dark);
    border-color:     var(--color-info-dark);
    color: #fff;
}

.btn-secondary,
.btn-secondary:focus {
    background-color: #6B7B71;
    border-color:     #6B7B71;
}
.btn-secondary:hover {
    background-color: #54625A;
    border-color:     #54625A;
}

/* Inputs / Selects / Textarea */
.form-control,
.form-select {
    border-radius: var(--radius-md);
    border-color: var(--color-border);
    color: var(--color-text);
    transition: border-color var(--duration-base) var(--ease-out),
                box-shadow   var(--duration-base) var(--ease-out);
}
.form-control:focus,
.form-select:focus {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-focus);
}
.form-control::placeholder { color: var(--color-text-subtle); }
.form-label { font-weight: 500; color: var(--color-text); margin-bottom: 0.375rem; }

/* Bootstrap bg-* / text-* utilities harmonizadas com a paleta */
.bg-primary   { background-color: var(--color-accent)    !important; }
.bg-success   { background-color: var(--color-success)   !important; }
.bg-danger    { background-color: var(--color-danger)    !important; }
.bg-warning   { background-color: var(--color-warning)   !important; }
.bg-info      { background-color: var(--color-info)      !important; }
.text-primary { color: var(--color-accent)  !important; }
.text-success { color: var(--color-success) !important; }
.text-danger  { color: var(--color-danger)  !important; }
.text-warning { color: var(--color-warning-dark) !important; }
.text-info    { color: var(--color-info-dark)    !important; }
.text-muted   { color: var(--color-text-muted) !important; }

/* Badges — radius pill suave, tipografia mais legível */
.badge {
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 0.35em 0.65em;
    border-radius: var(--radius-md);
}

/* Alerts — bordas suaves e ícones alinhados */
.alert-success { background: var(--color-success-light); color: var(--color-success-dark); border-color: rgba(68, 125, 95, 0.25); }
.alert-danger  { background: var(--color-danger-light);  color: var(--color-danger-dark);  border-color: rgba(181, 69, 58, 0.25); }
.alert-warning { background: var(--color-warning-light); color: var(--color-warning-dark); border-color: rgba(155, 106, 36, 0.30); }
.alert-info    { background: var(--color-info-light);    color: var(--color-info-dark);    border-color: rgba(68, 123, 139, 0.25); }

/* Tabelas — espaçamento mais generoso, hover suave */
.table {
    --bs-table-hover-bg: var(--color-surface-alt);
    color: var(--color-text);
    border-color: var(--color-border);
}
.table > :not(caption) > * > * { padding: 0.85rem 0.875rem; }
.table-hover > tbody > tr {
    transition: background-color var(--duration-base) var(--ease-out);
}

/* Form check / switches no acento novo */
.form-check-input:checked {
    background-color: var(--color-accent);
    border-color:     var(--color-accent);
}
.form-check-input:focus {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-focus);
}

/* Pagination */
.page-link { color: var(--color-accent); border-color: var(--color-border); }
.page-link:hover { background: var(--color-accent-soft); color: var(--color-accent-dark); border-color: var(--color-border); }
.page-item.active .page-link { background: var(--color-accent); border-color: var(--color-accent); }

/* Dropdowns */
.dropdown-menu {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 0.375rem;
}
.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.75rem;
    transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease;
}
.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--color-accent-soft);
    color: var(--color-accent-dark);
}

/* Status de projeto/tarefa harmonizados */
.bg-planejado    { background-color: #586660 !important; color: #fff; }
.bg-em_andamento { background-color: var(--color-secondary) !important; color: #fff; }
.bg-concluido    { background-color: var(--color-success)   !important; color: #fff; }
.bg-cancelado    { background-color: var(--color-danger)    !important; color: #fff; }

/* ── 12. Microinterações ───────────────────────────────────── */

/* Fade-in de página ao carregar */
.main-content,
.main-content-container {
    animation: pageFadeIn var(--duration-slow) var(--ease-out) both;
}
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Botão em estado de loading (.is-loading) — usado pelo helper JS */
.btn.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
    opacity: 0.85;
}
.btn.is-loading::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 1.05em; height: 1.05em;
    margin-top: -0.525em; margin-left: -0.525em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    color: #fff;
    animation: btnSpin 0.7s linear infinite;
}
.btn-outline-primary.is-loading::after,
.btn-outline-secondary.is-loading::after,
.btn-light.is-loading::after { color: var(--color-accent); }
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* Skeleton loaders — uso: <div class="skeleton skeleton-text"></div> */
.skeleton {
    display: block;
    background: linear-gradient(90deg,
        var(--color-surface-alt) 0%,
        var(--color-surface-hover) 50%,
        var(--color-surface-alt) 100%);
    background-size: 200% 100%;
    border-radius: var(--radius-sm);
    animation: skeletonShimmer 1.4s ease-in-out infinite;
}
.skeleton-text   { height: 0.875rem; margin: 0.4rem 0; width: 100%; }
.skeleton-text.short { width: 55%; }
.skeleton-title  { height: 1.25rem; width: 60%; margin-bottom: 0.75rem; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-card   { height: 96px; border-radius: var(--radius-md); }
@keyframes skeletonShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Overlay de loading para conteúdo (.is-loading-overlay em qualquer container) */
.is-loading-overlay { position: relative; pointer-events: none; }
.is-loading-overlay::before {
    content: '';
    position: absolute; inset: 0;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(1.5px);
    z-index: 5;
    animation: fadeInOverlay var(--duration-base) ease both;
    border-radius: inherit;
}
.is-loading-overlay::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 28px; height: 28px;
    margin: -14px 0 0 -14px;
    border: 3px solid var(--color-accent-light);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: btnSpin 0.7s linear infinite;
    z-index: 6;
}
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }

/* Hover universal sutil em links */
a { transition: color var(--duration-fast) ease; }

/* Foco visível acessível em qualquer elemento interativo */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
    border-radius: var(--radius-sm);
}

/* Bordas suaves padronizadas em cards/wrappers */
.card,
.card-section,
.cliente-group,
.filtros-avancados,
.info-box,
.settings-tab { border-radius: var(--radius-md); }

/* Botão primário com leve elevação no hover (sem ser "pesado") */
.btn-primary:hover,
.btn-success:hover,
.btn-danger:hover,
.btn-warning:hover,
.btn-info:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVIDADE — BiotechProject
   Abordagem: sidebar como overlay no mobile (< 992px)
   ══════════════════════════════════════════════════════════════ */

/* ── Backdrop da sidebar mobile ──────────────────────────────── */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity var(--duration-base) var(--ease-out);
}
.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

/* ── Kanban — scroll horizontal em telas intermediárias ──────── */
@media (max-width: 1200px) {
    .kanban-column { min-width: 250px; }
}

/* ── Tablet / Mobile (≤ 992px): sidebar escondida como overlay ─ */
@media (max-width: 992px) {

    /* Sidebar: sai para fora da tela pela esquerda */
    .sidebar {
        width: var(--sidebar-width);           /* largura completa ao abrir */
        transform: translateX(-100%);
        z-index: 1050;
        box-shadow: none;
        transition: transform 0.28s var(--ease-out), box-shadow 0.28s var(--ease-out);
    }

    /* Sidebar aberta (toggle pelo botão hamburguer) */
    .sidebar.sidebar-open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    /* Texto e nomes sempre visíveis quando aberta */
    .sidebar.sidebar-open .sidebar-brand-name,
    .sidebar.sidebar-open .nav-text {
        opacity: 1;
        width: auto;
    }

    /* Botão hamburguer: aparece somente no mobile */
    .sidebar-toggle { display: flex; align-items: center; justify-content: center; }

    /* Botão de colapso desktop fica oculto no mobile */
    .sidebar-collapse-btn { display: none !important; }

    /* Header ocupa toda a largura (sem espaço para sidebar) */
    .main-header {
        left: 0 !important;
        right: 0;
    }

    /* Conteúdo principal ocupa toda a largura */
    .main-content-container,
    .main-content { margin-left: 0 !important; width: 100%; }

    /* Page header empilha verticalmente */
    .page-header { flex-direction: column; align-items: flex-start !important; gap: 0.75rem; }

    /* Filtros e selects tomam largura total */
    #filtro-status,
    .select-filter,
    .select-filter-wide { width: 100% !important; min-width: 0 !important; }

    /* Kanban: scroll horizontal sem quebra */
    .kanban-board { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 1rem; }
    .kanban-column { min-width: 80vw; }
}

/* ── Mobile médio (≤ 768px) ─────────────────────────────────── */
@media (max-width: 768px) {
    body { padding-top: var(--header-height); }

    /* Conteúdo: padding reduzido */
    .page-content  { padding: 0.875rem 0.625rem; }
    .page-content .container-fluid { padding-left: 0.625rem; padding-right: 0.625rem; }

    /* Header: campo de busca oculto, nome do usuário oculto */
    .search-box  { display: none !important; }
    .user-name   { display: none; }
    .status-text { display: none; }

    /* Cards */
    .stats-card    { padding: 1rem; }
    .stat-number   { font-size: 1.5rem; }
    .card-header   { flex-direction: column; align-items: flex-start !important; gap: 0.5rem; }

    /* Tabelas responsivas (rolagem horizontal) */
    .table-responsive-force {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-tarefas,
    .table-clientes,
    .table-usuarios,
    .table-projetos {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        min-width: 480px;           /* garante que a tabela não quebre feio */
    }

    /* Colunas de ação: largura mínima */
    .coluna-acoes { width: 130px; min-width: 130px; }

    /* Botões de ação (editar/excluir/ver): alvo de toque mínimo ~38px
       para evitar mis-tap em telas pequenas — nunca reduzir abaixo disso */
    .btn-acao,
    .btn-table-action,
    .btn-action,
    .btn-group-sm > .btn,
    .card-move-btn {
        min-width: 38px !important;
        min-height: 38px !important;
        padding: 0.4rem 0.55rem !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Hierarquia de projetos: indentações menores */
    .projeto-nivel-1 { margin-left: 0.5rem; }
    .projeto-nivel-2 { margin-left: 1rem; }
    .projeto-nivel-3 { margin-left: 1.5rem; }
    .projeto-container { margin-left: 14px; }
    .nivel-indent    { width: 14px !important; }

    /* Cliente header */
    .cliente-header { padding: 0.75rem; }

    /* Formulários: inputs empilhados */
    .form-row-mobile { flex-direction: column !important; }
    .form-row-mobile > * { width: 100% !important; margin-bottom: 0.5rem; }

    /* Botões de formulário: bloco em mobile */
    .btn-group-mobile-stack { flex-direction: column; gap: 0.5rem; }
    .btn-group-mobile-stack .btn { width: 100%; }

    /* Kanban: coluna quasi-fullscreen */
    .kanban-column { min-width: 88vw; }

    /* Ações de linha na tabela: sem texto, só ícone */
    .btn-table-action span.btn-label { display: none; }

    /* Badges de status: texto menor */
    .badge { font-size: 0.7rem; }

    /* Modais: largura máxima no mobile */
    .modal-dialog { margin: 0.5rem; }
    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl { max-width: calc(100vw - 1rem) !important; }
}

/* ── Mobile pequeno (≤ 576px) ───────────────────────────────── */
@media (max-width: 576px) {
    body { padding-top: var(--header-height); }

    /* Padding ainda menor */
    .page-content { padding: 0.625rem 0.375rem; }

    /* Header: avatar menor, sem nome */
    .user-avatar { width: 30px; height: 30px; font-size: 0.7rem; }
    .header-content { padding: 0 0.75rem; }

    /* Botão hamburguer mais acessível */
    .sidebar-toggle { width: 36px; height: 36px; }

    /* Cards: sem margin lateral */
    .card { margin-left: 0; margin-right: 0; }
    .stats-card { padding: 0.875rem; }
    .stat-number { font-size: 1.35rem; }

    /* Títulos de página menores */
    .page-title { font-size: 1rem; }

    /* Tabelas: scroll com indicador visual */
    .table > :not(caption) > * > * { padding: 0.45rem 0.5rem; font-size: 0.82rem; }

    /* Paginação DataTables */
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 0.2rem 0.45rem !important;
        font-size: 0.8rem !important;
    }
    .dataTables_wrapper .dataTables_filter input,
    .dataTables_wrapper .dataTables_length select { font-size: 0.85rem; }

    /* Formulários: labels menores */
    .form-label { font-size: 0.85rem; }
    .form-control, .form-select { font-size: 0.9rem; }

    /* Botões de ação: menores (exceto ícones de ação — ver alvo de
       toque mínimo reforçado logo abaixo) */
    .btn-sm { padding: 0.25rem 0.5rem; font-size: 0.78rem; }
    .btn-action-float { bottom: 1.25rem; right: 1.25rem; }

    .btn-acao,
    .btn-table-action,
    .btn-action,
    .btn-group-sm > .btn,
    .card-move-btn {
        min-width: 38px !important;
        min-height: 38px !important;
        padding: 0.4rem 0.5rem !important;
    }

    /* Kanban: quase tela cheia */
    .kanban-column { min-width: 94vw; }

    /* Modais fullscreen em mobile */
    .modal-dialog { margin: 0.25rem; }

    /* Grid de stats: 1 coluna em telas muito pequenas */
    .stats-grid-auto { grid-template-columns: 1fr 1fr !important; gap: 0.625rem !important; }
}

/* ── Telas muito pequenas (≤ 375px) ─────────────────────────── */
@media (max-width: 375px) {
    .stats-grid-auto { grid-template-columns: 1fr !important; }
    .header-actions  { gap: 0.375rem; }
    .notification-btn { width: 32px; height: 32px; }
}

/* ── Acessibilidade: reduzir movimento ──────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .projeto-item, .card-tarefa, .toggle-icon,
    .sidebar, .main-content, .main-header,
    .stats-card, .projeto-card, .contato-card,
    .btn, .modal.fade .modal-dialog,
    .sidebar-backdrop { transition: none !important; animation: none !important; }
    .projeto-content-anim { animation: none; }
    .skeleton { animation: none; }
}

/* ── 13. Utilitárias customizadas (substitui style="..." inline) ── */

/* Cores de texto / borda */
.text-accent       { color: var(--color-accent) !important; }
.text-accent-dark  { color: var(--color-accent-dark) !important; }
.text-secondary-c  { color: var(--color-secondary) !important; }
.text-base         { color: var(--color-text) !important; }
.text-subtle       { color: var(--color-text-subtle) !important; }

/* Backgrounds */
.bg-gradient-accent    { background: var(--gradient-accent) !important;    color: #fff; }
.bg-gradient-secondary { background: var(--gradient-secondary) !important; color: #fff; }
.bg-gradient-natural   { background: var(--gradient-natural) !important;   color: #fff; }
.bg-soft-dark          { background-color: rgba(36, 59, 54, 0.04) !important; }
.bg-accent-soft        { background-color: var(--color-accent-soft) !important; }

/* Borda decorativa esquerda */
.border-l-accent {
    border-left: 3px solid var(--color-accent);
    padding-left: 15px;
}
.border-l-secondary {
    border-left: 3px solid var(--color-secondary);
    padding-left: 15px;
}

/* Cursors */
.cursor-pointer { cursor: pointer; }

/* Card clicável (cursor + transição suave) */
.card-clickable {
    cursor: pointer;
    transition: transform var(--duration-base) var(--ease-out),
                box-shadow var(--duration-base) var(--ease-out);
}
.card-clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Tipografia — tamanhos abaixo do Bootstrap padrão (que vai até .fs-6 = 1rem) */
.fs-sm-2  { font-size: 0.8rem;   }   /* 12.8px */
.fs-xs    { font-size: 0.7rem;   }   /* 11.2px */
.fs-xxs   { font-size: 0.65rem;  }   /* 10.4px */
.fs-tiny  { font-size: 0.6rem;   }   /* 9.6px  */
.fs-micro { font-size: 0.55rem;  }   /* 8.8px  */

/* Progress de altura específica */
.progress-thin    { height: 4px;  }
.progress-thinner { height: 5px;  }
.progress-thinnest{ height: 6px;  }
.progress-md      { height: 8px;  }
.progress-lg      { height: 12px; }
.progress-xl      { height: 20px; }
.progress-2xl     { height: 24px; }
.progress-track-soft {
    background-color: var(--color-border);
}
.progress-track-light {
    background: rgba(255, 255, 255, 0.25);
}

/* Margin-left para layouts legados que precisam dar espaço para a sidebar */
.ms-sidebar { margin-left: var(--sidebar-width); }
@media (max-width: 992px) {
    .ms-sidebar { margin-left: 0; }
}

/* Tamanhos quadrados (avatares, ícones de ação) */
.size-32 { width: 32px; height: 32px; min-width: 32px; }
.size-36 { width: 36px; height: 36px; min-width: 36px; }

/* Alturas / larguras de utilitários */
.h-100px { height: 100px; }
.h-14px  { height: 14px;  }
.mw-150  { max-width: 150px; }
.mw-170  { max-width: 170px; word-break: break-word; }
.mw-180  { min-width: 180px; width: auto; }
.w-300px { width: 300px; }
.w-24px  { width: 24px;  }
.w-2px   { width: 2px;   }
.w-20    { width: 20%; }
.w-40    { width: 40%; }
.w-60    { width: 60%; }

/* Modal body com scroll vertical */
.modal-body-scroll { max-height: 70vh; overflow-y: auto; }

/* Texto que pode quebrar para qualquer linha */
.text-wrap-soft {
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.4;
}

/* Animação pulse suave (usada em indicadores) */
@keyframes pulseSoft {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}
.pulse-anim {
    animation: pulseSoft 2s infinite;
    display: inline-block;
}
@media (prefers-reduced-motion: reduce) {
    .pulse-anim { animation: none; }
}

/* Marker line (timeline/Gantt) */
.marker-line {
    width: 2px;
    height: 14px;
    opacity: 0.8;
    background: var(--color-success);
}
.marker-label {
    color: var(--color-success);
    border: 1px solid var(--color-success);
    background: rgba(68, 125, 95, 0.10);
    font-weight: 600;
    font-size: 0.68rem;
    border-radius: var(--radius-sm);
    padding: 0.1rem 0.35rem;
}

/* Select filter de largura automática mas com largura mínima */
.select-filter-wide {
    width: auto;
    min-width: 180px;
}

/* ── Footer visual ─────────────────────────────────────────── */
.main-footer {
  margin-left: var(--sidebar-width);
  padding: 0.875rem 1.5rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  transition: margin-left 0.25s ease;
  gap: 1rem;
  flex-wrap: wrap;
}
.main-footer.sidebar-collapsed {
  margin-left: var(--sidebar-width-sm);
}
.main-footer a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.main-footer a:hover { color: var(--color-accent); }
.main-footer-left  { display: flex; align-items: center; gap: 0.5rem; }
.main-footer-right { display: flex; align-items: center; gap: 1rem; }

@media (max-width: 992px) {
  .main-footer {
    margin-left: 0 !important;
    flex-direction: column;
    text-align: center;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
  }
  .main-footer-right { justify-content: center; }
}
