/* ==========================================================================
   SOUL MALLS | RGD WEB — UI COMPONENTS
   ==========================================================================
   Biblioteca completa de componentes corporativos:
   Navbar, Sidebar Retrátil, Botões, Cards de Métricas, Painéis, Badges,
   Tabelas, Tabs (Fichário), Modais, Formulários e Toasts.
   ========================================================================== */

/* ==========================================================================
   1. RESET & BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
  border: none;
  background: transparent;
}

/* ==========================================================================
   2. ESTRUTURA GLOBAL (SHELL)
   ========================================================================== */
.saas-platform-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-app);
}

.saas-body-wrapper {
  display: flex;
  flex: 1;
  min-height: calc(100vh - var(--header-height));
  position: relative;
}

.saas-main-viewport {
  flex: 1;
  min-width: 0;
  padding: 24px 32px 48px;
  transition: all var(--transition-normal);
}

@media (max-width: 768px) {
  .saas-main-viewport {
    padding: 16px 16px 32px;
  }
}

/* ==========================================================================
   3. HEADER GLOBAL (TOP NAVBAR)
   ========================================================================== */
.app-global-header {
  height: var(--header-height);
  background: var(--white);
  border-bottom: 1px solid var(--line);
  z-index: 1050;
  position: sticky;
  top: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

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

.btn-sidebar-toggle {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--border-radius-sm);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  transition: all var(--transition-fast);
}

.btn-sidebar-toggle:hover {
  background: var(--green2);
  color: var(--green);
  border-color: rgba(40, 90, 123, 0.3);
}

.header-logo-soul {
  height: 32px;
  width: auto;
  object-fit: contain;
  display: block;
}

.brand-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
}

.header-title-box strong {
  display: block;
  font-weight: 800;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.1;
  font-family: var(--font-title);
  letter-spacing: -0.5px;
}

.header-subtitle {
  color: var(--muted);
  font-size: 0.70rem;
  letter-spacing: 0.01em;
}

/* Navbar Filters Group (Pill com Shopping / Mês / Ano) */
.navbar-filters-group {
  display: flex;
  align-items: stretch;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-xs);
  height: 44px;
  flex-shrink: 0;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.navbar-filters-group:focus-within {
  box-shadow: 0 0 0 3px rgba(40, 90, 123, 0.12);
  border-color: rgba(40, 90, 123, 0.35);
}

.navbar-filter-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4px 14px 4px 12px;
  gap: 2px;
  cursor: pointer;
  transition: background var(--transition-fast);
  position: relative;
  min-width: 0;
}

.navbar-filter-item:hover {
  background: rgba(40, 90, 123, 0.04);
}

.navbar-filter-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-2xs);
  font-weight: var(--fw-bold);
  color: var(--muted-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  line-height: 1;
}

.navbar-filter-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: var(--fw-bold);
  color: var(--ink);
  cursor: pointer;
  padding: 0 16px 0 0;
  margin: 0;
  line-height: 1.25;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  background-size: 9px;
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition-fast);
}

.navbar-filter-select:hover,
.navbar-filter-select:focus {
  color: var(--green);
}

.navbar-filter-divider {
  width: 1px;
  align-self: stretch;
  background: var(--line);
  flex-shrink: 0;
  margin: 7px 0;
}

.navbar-filter-reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  align-self: center;
  margin-right: 6px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.navbar-filter-reset-btn:hover {
  background: var(--green2);
  color: var(--green);
}

/* User Avatar & Notifications */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.header-icon-btn:hover {
  background: var(--cream);
  color: var(--green);
  border-color: var(--green);
}

.header-icon-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-danger);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.user-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-bold);
  font-size: 13px;
  box-shadow: 0 2px 5px rgba(40, 90, 123, 0.25);
  transition: transform var(--transition-fast);
}

.user-avatar-circle:hover {
  transform: scale(1.05);
}

/* ==========================================================================
   DROPDOWN DE PERFIL DO USUÁRIO (PADRÃO SOUL MALLS)
   ========================================================================== */
.user-menu-wrapper {
  position: relative;
}

.user-profile-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 320px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--border-radius-md);
  box-shadow: 0 10px 30px rgba(16, 45, 66, 0.12), 0 4px 10px rgba(16, 45, 66, 0.05);
  padding: 18px 20px 16px;
  z-index: 1200;
  display: none;
  animation: fadeInDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-profile-dropdown.active {
  display: block;
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.user-dropdown-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #173d59;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-dropdown-info {
  min-width: 0;
  flex: 1;
}

.user-dropdown-name {
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-email {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-meta {
  padding: 14px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
}

.user-meta-label {
  color: var(--muted);
  font-weight: 500;
}

.user-meta-value {
  color: var(--ink);
  font-weight: 700;
}

.user-meta-badge-azure {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  color: #7c3aed;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: var(--border-radius-pill);
  text-transform: uppercase;
  white-space: nowrap;
}

.user-dropdown-logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: #fef2f2;
  border: 1px solid #fee2e2;
  border-radius: var(--border-radius);
  color: #dc2626;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.user-dropdown-logout-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
  transform: translateY(-1px);
}

.user-dropdown-logout-btn svg {
  flex-shrink: 0;
  color: #dc2626;
}

/* ==========================================================================
   4. SIDEBAR RETRÁTIL INTELIGENTE (HOVER EXPANSION & PIN)
   ========================================================================== */
.app-global-sidebar {
  width: var(--sidebar-collapsed);
  background: var(--ink);
  color: var(--white);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1040;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: 2px 0 8px rgba(10, 30, 45, 0.08);
}

/* Expansão com Hover ou com Classe .pinned */
.app-global-sidebar:hover,
.app-global-sidebar.pinned {
  width: var(--sidebar-expanded);
}

.sidebar-nav-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-category {
  margin-bottom: 20px;
}

.sidebar-category-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.4);
  padding: 8px 12px 4px;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-global-sidebar:hover .sidebar-category-title,
.app-global-sidebar.pinned .sidebar-category-title {
  opacity: 1;
  transform: translateX(0);
}

.app-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--border-radius-sm);
  color: rgba(255, 255, 255, 0.7);
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
}

.app-nav-link svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  transition: color var(--transition-fast);
}

.app-nav-link .nav-text {
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-global-sidebar:hover .nav-text,
.app-global-sidebar.pinned .nav-text {
  opacity: 1;
  transform: translateX(0);
}

.app-nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.app-nav-link.active {
  background: var(--green);
  color: var(--white);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.app-nav-link.active svg {
  color: var(--white);
}

/* Sidebar Overlay para Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 30, 45, 0.6);
  backdrop-filter: blur(2px);
  z-index: 1030;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

@media (max-width: 768px) {
  .app-global-sidebar {
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: -260px;
    width: 240px !important;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .app-global-sidebar.open {
    left: 0;
  }

  .app-global-sidebar .nav-text,
  .app-global-sidebar .sidebar-category-title {
    opacity: 1;
    transform: none;
  }

  .sidebar-overlay.active {
    display: block;
    opacity: 1;
  }
}

/* ==========================================================================
   5. BOTÕES (BUTTON SYSTEM)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--border-radius);
  font-size: 13px;
  font-weight: var(--fw-semibold);
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  user-select: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(40, 90, 123, 0.25);
}

/* Variação Primária (Soul Malls Azul Petróleo) */
.btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(40, 90, 123, 0.2);
}

.btn-primary:hover {
  background: var(--green-hover);
  border-color: var(--green-hover);
  box-shadow: 0 4px 12px rgba(40, 90, 123, 0.28);
  color: var(--white);
}

.btn-primary:active {
  background: var(--green-active);
  transform: translateY(1px);
}

/* Variação Secundária (Branca com Borda Fina) */
.btn-secondary {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--cream);
  border-color: var(--green);
  color: var(--green);
}

/* Variação Outline */
.btn-outline {
  background: transparent;
  border-color: var(--green);
  color: var(--green);
}

.btn-outline:hover {
  background: var(--green2);
  color: var(--green-hover);
}

/* Variação Danger (Perigo / Excluir) */
.btn-danger {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: var(--white);
}

/* Variação Success (Aprovar / Sucesso) */
.btn-success {
  background: var(--color-success);
  border-color: var(--color-success);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
  background: #059669;
  border-color: #059669;
  color: var(--white);
}

/* Variação Ghost */
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--cream);
  color: var(--ink);
}

/* Modificadores de Tamanho & Forma */
.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 11.5px;
  border-radius: var(--border-radius-sm);
}

.btn-lg {
  height: 44px;
  padding: 0 22px;
  font-size: 14px;
  border-radius: var(--border-radius-md);
}

.btn-pill {
  border-radius: var(--border-radius-pill);
}

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

.btn-icon.btn-sm {
  width: 30px;
  height: 30px;
}

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

/* ==========================================================================
   6. CARDS DE MÉTRICAS & KPIS (STAT CARDS)
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--border-radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

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

.stat-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.stat-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  font-size: 11.5px;
  padding: 2px 6px;
  border-radius: var(--border-radius-pill);
}

.stat-trend.positive {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.stat-trend.negative {
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
}

.stat-trend.neutral {
  background: var(--cream);
  color: var(--muted);
}

/* ==========================================================================
   7. PAINÉIS & CONTAINERS (PANELS)
   ========================================================================== */
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  flex-wrap: wrap;
  gap: 12px;
}

.panel-title {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.panel-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

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

.panel-body {
  padding: 20px;
}

.panel-footer {
  padding: 12px 20px;
  background: var(--cream);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   8. BADGES & PILLS
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--border-radius-pill);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Badges de Departamentos Soul Malls */
.badge-dept-financeiro {
  background: var(--dept-financeiro-bg);
  color: var(--dept-financeiro-text);
  border: 1px solid var(--dept-financeiro-border);
}

.badge-dept-marketing {
  background: var(--dept-marketing-bg);
  color: var(--dept-marketing-text);
  border: 1px solid var(--dept-marketing-border);
}

.badge-dept-comercial {
  background: var(--dept-comercial-bg);
  color: var(--dept-comercial-text);
  border: 1px solid var(--dept-comercial-border);
}

.badge-dept-operacoes {
  background: var(--dept-operacoes-bg);
  color: var(--dept-operacoes-text);
  border: 1px solid var(--dept-operacoes-border);
}

/* Badges de Status de Governança */
.badge.status-solicitacao   { background: var(--cream); color: var(--muted); border: 1px solid var(--line); }
.badge.status-aprovacao     { background: var(--white); color: var(--ink-light); border: 1px solid var(--line); }
.badge.status-cotacao       { background: var(--green2); color: var(--green); border: 1px solid var(--line); }
.badge.status-kickoff       { background: var(--cream); color: var(--ink); border: 1px solid var(--line); }
.badge.status-execucao      { background: var(--green2); color: var(--green); border: 1px solid #cbdde9; }
.badge.status-concluido     { background: #ecfdf5; color: var(--color-success-text); border: 1px solid var(--color-success-border); }
.badge.status-suspenso      { background: var(--color-warning-bg); color: var(--color-warning-text); border: 1px solid var(--color-warning-border); }
.badge.status-cancelado     { background: var(--color-danger-bg); color: var(--color-danger-text); border: 1px solid var(--color-danger-border); }

/* ==========================================================================
   9. TABELAS CORPORATIVAS (DATA TABLES)
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.data-table th {
  background: var(--cream);
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background-color: rgba(40, 90, 123, 0.02);
}

.data-table .cell-mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.data-table .cell-right {
  text-align: right;
}

.data-table .cell-center {
  text-align: center;
}

/* ==========================================================================
   10. FICHÁRIO ORGANIZADOR (FOLDER TABS)
   ========================================================================== */
.folder-tabs-container {
  margin-top: 0;
}

.folder-tabs-header {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  border-bottom: 2px solid var(--line);
  padding: 0 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.folder-tabs-header::-webkit-scrollbar {
  display: none;
}

.folder-tab {
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: var(--cream);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  margin-bottom: -2px;
}

.folder-tab:hover {
  color: var(--ink);
  background: #edf2f7;
}

.folder-tab.active {
  color: var(--green);
  background: var(--white);
  border-color: var(--line);
  border-top: 3px solid var(--green);
  border-bottom: 2px solid var(--white);
  font-weight: 700;
}

.folder-tabs-body {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
  padding: 20px;
}

.folder-view {
  display: none;
}

.folder-view.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

/* ==========================================================================
   11. FORMULÁRIOS & CONTROLES
   ========================================================================== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-control,
.form-select {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--border-radius);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(40, 90, 123, 0.15);
}

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

.input-icon-wrap svg {
  position: absolute;
  left: 12px;
  color: var(--muted-light);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.input-icon-wrap .form-control {
  padding-left: 36px;
}

/* ==========================================================================
   12. MODAIS & DIÁLOGOS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 30, 45, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.15s ease-out;
}

.modal-container {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.modal-close-btn {
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modal-close-btn:hover {
  background: var(--cream);
  color: var(--ink);
}

.modal-body {
  padding: 24px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-light);
}

.modal-footer {
  padding: 14px 24px;
  background: var(--cream);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================================
   13. TOAST FEEDBACK NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-message {
  pointer-events: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-dropdown);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-message.success { border-left-color: var(--color-success); }
.toast-message.danger  { border-left-color: var(--color-danger); }
.toast-message.warning { border-left-color: var(--color-warning); }
.toast-message.info    { border-left-color: var(--color-info); }

/* ==========================================================================
   14. ANIMAÇÕES
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
