/* ==============================================================================
   BENCHMARKING SINERGY 2026 - SPREADSHEET DATAGRID UI STYLES
   Design System: Agribusiness Premium (Emerald / Wheat / Deep Slate Glassmorphism)
   ============================================================================== */

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

:root {
  --primary-green: #1b4d3e;
  --primary-green-light: #256d58;
  --accent-gold: #e5a93c;
  --accent-gold-light: #fef4dd;
  --bg-slate: #0f172a;
  --bg-surface: #1e293b;
  --bg-card: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --text-light: #f8fafc;
  
  --cell-yellow-bg: #fffbeb;
  --cell-yellow-border: #fcd34d;
  --cell-yellow-text: #92400e;
  --cell-yellow-focus: #f59e0b;

  --cell-gray-bg: #f1f5f9;
  --cell-gray-border: #cbd5e1;
  --cell-gray-text: #334155;

  --cell-orange-bg: #fff7ed;
  --cell-orange-border: #fdba74;
  --cell-orange-text: #9a3412;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-subtle: 0 4px 20px -2px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 0 25px rgba(27, 77, 62, 0.25);
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #f8fafc;
  color: var(--text-dark);
  line-height: 1.5;
  min-height: 100vh;
}

/* ------------------------------------------------------------------------------
   1. LOGIN OVERLAY & CONTEXT SELECTION MODAL
   ------------------------------------------------------------------------------ */
html.is-authenticated #loginScreen {
  display: none !important;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('../assets/login-background.png') center/cover no-repeat;
  backdrop-filter: blur(8px);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.3);
  text-align: center;
  animation: fadeIn 0.4s ease-out;
}

.brand-header {
  margin-bottom: 1.5rem;
  height: 130px;
  background-image: url('../assets/logo-login.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.brand-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
  color: white;
  border-radius: 50%;
  font-size: 1.75rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-glow);
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-green);
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.375rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  transition: var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(27, 77, 62, 0.15);
}

.btn-primary {
  width: 100%;
  padding: 0.875rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 4px 12px rgba(27, 77, 62, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(27, 77, 62, 0.35);
}

.btn-outline {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary-green);
  background: transparent;
  border: 1.5px solid var(--primary-green);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-outline:hover {
  background: rgba(27, 77, 62, 0.05);
}

/* Modal de Contexto & Modais Admin */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-box {
  background: white;
  width: 90%;
  max-width: 580px;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}

.property-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.property-option:hover, .property-option.selected {
  border-color: var(--primary-green);
  background-color: #f0fdf4;
}

.property-info strong {
  display: block;
  font-size: 0.9375rem;
  color: var(--text-dark);
}

.property-info span {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ------------------------------------------------------------------------------
   2. MAIN APPLICATION HEADER & TOP STICKY NAVIGATION
   ------------------------------------------------------------------------------ */
.sticky-top-header {
  position: sticky;
  top: 0;
  z-index: 990;
  width: 100%;
  background: white;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.app-header {
  background: var(--bg-slate);
  color: white;
  padding: 0.875rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.header-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-title span {
  color: var(--accent-gold);
  font-size: 0.8125rem;
  background: rgba(229, 169, 60, 0.15);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  border: 1px solid rgba(229, 169, 60, 0.3);
}

.context-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.context-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.84375rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-gold);
  color: var(--bg-slate);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

/* ------------------------------------------------------------------------------
   3. SPREADSHEET NAVIGATION TABS
   ------------------------------------------------------------------------------ */
.tabs-container {
  background: white;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tabs-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  color: var(--primary-green);
  background: #f8fafc;
}

.tab-btn.active {
  color: var(--primary-green);
  border-bottom-color: var(--primary-green);
  background: #f0fdf4;
}

.tab-btn-admin {
  background: #faf5ff !important;
  color: #7e22ce !important;
  border-radius: 6px 6px 0 0;
}

.tab-btn-admin.active {
  border-bottom-color: #9333ea !important;
  background: #f3e8ff !important;
}

.floating-sync-badge,
.status-sync-indicator {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 9990;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.95rem;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 9999px;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.1), 0 2px 6px -1px rgba(0, 0, 0, 0.05);
  font-size: 0.8125rem;
  color: #15803d;
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.floating-sync-badge:hover,
.status-sync-indicator:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px -3px rgba(0, 0, 0, 0.15);
}

.floating-sync-badge.saving,
.status-sync-indicator.saving {
  color: #b45309;
  border-color: #fde68a;
  background: rgba(254, 252, 232, 0.96);
}

.floating-sync-badge.error,
.status-sync-indicator.error {
  color: #b91c1c;
  border-color: #fecaca;
  background: rgba(254, 242, 242, 0.96);
}

.sync-icon {
  font-size: 0.95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.sync-dot.saving {
  background-color: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  animation: pulse 1s infinite;
}

.sync-dot.error {
  background-color: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

/* ------------------------------------------------------------------------------
   4. DATA GRID SPREADSHEET TABLE & CELL STYLES
   ------------------------------------------------------------------------------ */
.spreadsheet-wrapper {
  padding: 1.5rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.legend-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  border: 1px solid #e2e8f0;
  font-size: 0.8125rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.legend-box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid transparent;
}

.legend-yellow { background: var(--cell-yellow-bg); border-color: var(--cell-yellow-border); }
.legend-gray   { background: var(--cell-gray-bg); border-color: var(--cell-gray-border); }
.legend-orange { background: var(--cell-orange-bg); border-color: var(--cell-orange-border); }

.grid-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
  margin-bottom: 2rem;
}

.grid-card-header {
  background: #f8fafc;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grid-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--primary-green);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-responsive {
  overflow-x: auto;
}

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

.datagrid-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid #cbd5e1;
  border-right: 1px solid #e2e8f0;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.datagrid-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  vertical-align: middle;
}

/* Tipos de Células */
.cell-editable {
  width: 100%;
  padding: 0.45rem 0.65rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cell-yellow-text);
  background-color: var(--cell-yellow-bg);
  border: 1.5px solid var(--cell-yellow-border);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.cell-editable:focus {
  outline: none;
  border-color: var(--cell-yellow-focus);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.cell-calculated {
  width: 100%;
  padding: 0.45rem 0.65rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cell-gray-text);
  background-color: var(--cell-gray-bg);
  border: 1px solid var(--cell-gray-border);
  border-radius: var(--radius-sm);
  cursor: not-allowed;
}

.cell-warning {
  background-color: var(--cell-orange-bg);
  border-color: var(--cell-orange-border);
  color: var(--cell-orange-text);
}

.unit-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  background: #e2e8f0;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* ------------------------------------------------------------------------------
   5. SUPER ADMIN DASHBOARD COMPONENT STYLES
   ------------------------------------------------------------------------------ */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-subtle);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);

  line-height: 1.2;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.role-badge.admin { background: #f3e8ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.role-badge.proprietario { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.role-badge.encarregado { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }

.perm-badge-write { background: #dcfce7; color: #166534; padding: 0.15rem 0.45rem; border-radius: 4px; font-weight: 600; font-size: 0.75rem; }
.perm-badge-read  { background: #e0f2fe; color: #0369a1; padding: 0.15rem 0.45rem; border-radius: 4px; font-weight: 600; font-size: 0.75rem; }

/* Toast Notifications */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10000;
  background: #0f172a;
  color: white;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 4px solid #22c55e;
}

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

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ------------------------------------------------------------------------------
   5. CARD FOOTER, SAVE BUTTON & INPUT VALIDATION STYLES
   ------------------------------------------------------------------------------ */
.grid-card-footer {
  background: #f8fafc;
  padding: 0.875rem 1.5rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.btn-top-card {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #ffffff;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  padding: 0.55rem 1.1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-top-card:hover {
  background: #f1f5f9;
  color: var(--primary-green);
  border-color: var(--primary-green-light);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

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

/* Menu Quick Nav Pular Para... */
.tab-quick-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: #ffffff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  border: 1.5px solid #e2e8f0;
  margin-bottom: 1.25rem;
  position: relative;
}

.quick-nav-select {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid #cbd5e1;
  background-color: #f8fafc;
  font-size: 0.875rem;
  color: #0f172a;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: var(--transition-fast);
  max-width: 450px;
}

.quick-nav-select:focus, .quick-nav-select:hover {
  border-color: var(--primary-green);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(27, 77, 62, 0.15);
}

.btn-save-card {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #1b4d3e 0%, #2e7d32 100%);
  color: white;
  border: none;
  padding: 0.6rem 1.25rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(27, 77, 62, 0.25);
  transition: all 0.2s ease;
}

.btn-save-card:hover {
  background: linear-gradient(135deg, #143a2e 0%, #1b5e20 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(27, 77, 62, 0.35);
}

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

.btn-save-card.saved-flash {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5) !important;
}

/* Highlight para campos de entrada inválidos (vazios) */
input.cell-invalid {
  border: 2px solid #ef4444 !important;
  background-color: #fef2f2 !important;
  color: #991b1b !important;
}
input.cell-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}

/* ------------------------------------------------------------------------------
   6. MÓDULO DE DOCUMENTOS & UPLOAD / DOWNLOAD
   ------------------------------------------------------------------------------ */
.doc-dropzone {
  border: 2px dashed #94a3b8;
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.doc-dropzone:hover, .doc-dropzone.dragover {
  border-color: var(--primary-green);
  background: #f0fdf4;
}

.doc-dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.doc-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  position: relative;
}

.doc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -3px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.doc-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.doc-ext-badge {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  background: #f1f5f9;
}

.doc-ext-pdf { background: #fee2e2; color: #dc2626; }
.doc-ext-excel { background: #dcfce7; color: #16a34a; }
.doc-ext-word { background: #dbeafe; color: #2563eb; }
.doc-ext-ppt { background: #ffedd5; color: #ea580c; }
.doc-ext-zip { background: #f3e8ff; color: #9333ea; }
.doc-ext-default { background: #f1f5f9; color: #475569; }

.doc-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
}

.doc-card-desc {
  font-size: 0.8125rem;
  color: #64748b;
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
}

.doc-card-meta {
  font-size: 0.75rem;
  color: #94a3b8;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.doc-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.doc-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.doc-btn-download {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.doc-btn-download:hover {
  background: #16a34a;
  color: white;
  border-color: #16a34a;
}

.doc-btn-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.doc-btn-delete:hover {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
}

.doc-filter-btn {
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
  background: white;
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.doc-filter-btn:hover, .doc-filter-btn.active {
  background: #1b4d3e;
  color: white;
  border-color: #1b4d3e;
}

/* ESTILOS PARA O PAINEL DE CONFIGURAÇÕES SINERGY SUPER ADMIN */
.config-container {
    max-width: 1400px;
    margin: 1rem auto 2rem auto;
    padding: 0;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 992px) {
    .config-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.config-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: #ffffff;
    padding: 0.85rem;
    border-radius: 14px;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    position: sticky;
    top: 7.5rem;
    z-index: 10;
}

.config-nav-btn {
    padding: 0.9rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm, 8px);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    user-select: none;
}

.config-nav-btn:hover {
    color: #1b4d3e;
    background: #f1f5f9;
    transform: translateX(4px);
}

.config-nav-btn.active {
    color: white;
    background: linear-gradient(135deg, #1b4d3e 0%, #256d58 100%);
    box-shadow: 0 4px 14px rgba(27, 77, 62, 0.3);
}

.config-main-content {
    min-width: 0;
}

.card-panel {
    background: #ffffff;
    border-radius: var(--radius-md, 12px);
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.06);
    padding: 2.25rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.3s ease-out;
}

.card-panel-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1b4d3e;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.card-panel-desc {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1.75rem;
    line-height: 1.5;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.35rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.35rem;
}

.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.35rem;
}

@media (max-width: 992px) {
    .form-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .form-grid-4 {
        grid-template-columns: 1fr;
    }
}

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

.table-custom th {
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
    padding: 0.85rem 1.1rem;
    border-bottom: 2px solid #cbd5e1;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.table-custom td {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table-custom tr:hover {
    background-color: #f8fafc;
}

/* ------------------------------------------------------------------------------
   COMENTÁRIOS E MEMÓRIA DE CÁLCULO NOS CAMPOS INPUT (ESTILO EXCEL)
------------------------------------------------------------------------------ */
.excel-comment-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  vertical-align: middle;
  box-sizing: border-box;
}

/* Indicador triangular vermelho no canto superior direito (Estilo Excel) */
.excel-comment-indicator {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 0;
  height: 0;
  border-top: 9px solid #dc2626;
  border-left: 9px solid transparent;
  cursor: pointer;
  z-index: 15;
  transition: transform 0.15s ease, border-top-color 0.15s;
  display: none;
}

.excel-comment-wrapper.has-comment .excel-comment-indicator {
  display: block;
}

.excel-comment-indicator:hover {
  border-top-color: #991b1b;
  transform: scale(1.3);
}

/* Caixa flutuante de comentário (estilo Post-it Excel) */
.excel-comment-box {
  position: fixed;
  width: 280px;
  max-width: 90vw;
  background-color: #ffffe1;
  border: 1px solid #7f7f7f;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  padding: 8px 10px;
  border-radius: 4px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Tahoma, sans-serif;
  font-size: 12px;
  color: #1e293b;
  z-index: 99999;
  display: none;
  box-sizing: border-box;
  animation: excelCommentFadeIn 0.15s ease-out;
}

@keyframes excelCommentFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.excel-comment-box .excel-comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #713f12;
  border-bottom: 1px solid rgba(202, 138, 4, 0.3);
  padding-bottom: 4px;
}

.excel-comment-box .excel-comment-title {
  display: flex;
  align-items: center;
  gap: 4px;
}

.excel-comment-box .btn-header-edit {
  background: #fef08a;
  border: 1px solid #ca8a04;
  color: #854d0e;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.excel-comment-box .btn-header-edit:hover {
  background: #fde047;
  color: #713f12;
}

.excel-comment-box .excel-comment-close {
  background: transparent;
  border: none;
  font-size: 13px;
  line-height: 1;
  color: #854d0e;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 2px;
}

.excel-comment-box .excel-comment-close:hover {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
}

/* Área de Prévia do Comentário */
.excel-comment-preview {
  cursor: pointer;
  padding: 4px 2px;
}

.excel-comment-preview-text {
  font-size: 12px;
  line-height: 1.45;
  color: #1e293b;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 160px;
  overflow-y: auto;
}

.excel-comment-preview-hint {
  font-size: 10px;
  color: #854d0e;
  margin-top: 6px;
  opacity: 0.8;
  font-style: italic;
}

/* Área de Edição */
.excel-comment-edit-area textarea.excel-comment-textarea {
  width: 100%;
  height: 80px;
  resize: vertical;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  font-size: 12px;
  font-family: inherit;
  color: #1e293b;
  padding: 6px 8px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.excel-comment-edit-area textarea.excel-comment-textarea:focus {
  border-color: #ca8a04;
  box-shadow: 0 0 0 2px rgba(202, 138, 4, 0.25);
}

.excel-comment-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
}

.excel-comment-box button.btn-save-comment {
  background-color: #15803d;
  color: #ffffff;
  border: none;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.excel-comment-box button.btn-save-comment:hover {
  background-color: #166534;
}

.excel-comment-box button.btn-save-comment:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.excel-comment-box button.btn-delete-comment {
  background-color: #ef4444;
  color: #ffffff;
  border: none;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.excel-comment-box button.btn-delete-comment:hover {
  background-color: #dc2626;
}

.excel-comment-box button.btn-cancel-comment {
  background-color: #e2e8f0;
  color: #475569;
  border: none;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.excel-comment-box button.btn-cancel-comment:hover {
  background-color: #cbd5e1;
}

.excel-comment-hint {
  font-size: 10px;
  color: #854d0e;
  margin-top: 4px;
  text-align: left;
  opacity: 0.85;
}

/* Toast de Notificação */
.excel-comment-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastSlideUp 0.25s ease-out;
  pointer-events: none;
  border-left: 4px solid #16a34a;
}

.excel-comment-toast.toast-info {
  border-left-color: #3b82f6;
}

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



