/* ====================================================
   GELATO DELLA NONNA – Sistema de Gestão
   Cores: Azul Royal #2B3A8C | Dourado #FDB913 | Coral #E31E24 | Teal #00A19D
   ==================================================== */

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

:root {
  --blue:    #2B3A8C;
  --blue-dark: #1e2a6e;
  --blue-light: #3d51b5;
  --gold:    #FDB913;
  --gold-dark: #e0a510;
  --coral:   #E31E24;
  --teal:    #00A19D;
  --teal-dark: #007a77;
  --cream:   #FDF8F0;
  --white:   #FFFFFF;
  --gray-50: #F8F9FA;
  --gray-100:#F1F3F5;
  --gray-200:#E9ECEF;
  --gray-300:#DEE2E6;
  --gray-400:#CED4DA;
  --gray-500:#ADB5BD;
  --gray-600:#6C757D;
  --gray-700:#495057;
  --gray-800:#343A40;
  --gray-900:#212529;
  --success: #28A745;
  --warning: #FFC107;
  --danger:  #DC3545;

  /* Gradients */
  --grad-blue:  linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  --grad-gold:  linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  --grad-teal:  linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  --grad-coral: linear-gradient(135deg, var(--coral) 0%, #b3161a 100%);
  --grad-dark:  linear-gradient(180deg, #1e2a6e 0%, #0a0e27 100%);

  --sidebar-w: 260px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(43,58,140,0.10);
  --shadow-lg: 0 8px 32px rgba(43,58,140,0.16);
  --transition: all 0.22s cubic-bezier(.4,0,.2,1);
}

html { font-size: 15px; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }

/* === SIDEBAR === */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--grad-blue);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  transition: var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.logo-icon { font-size: 2rem; line-height: 1; }
.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-gelato { font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--gold); }
.logo-nonna  { font-family: 'Outfit', sans-serif; font-weight: 400; font-size: 0.78rem; color: rgba(255,255,255,0.7); letter-spacing: 0.08em; }

.sidebar-nav { flex: 1; padding: 12px 0 20px; }

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  padding: 16px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 0;
  transition: var(--transition);
  border-left: 3px solid transparent;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.active {
  background: rgba(253,185,19,0.15);
  color: var(--gold);
  border-left-color: var(--gold);
}
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 14px 20px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.25);
  border-top: 1px solid rgba(255,255,255,0.07);
}

/* === MAIN CONTENT === */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

/* === TOPBAR === */
.topbar {
  height: 64px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 4px rgba(43,58,140,0.06);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.menu-toggle { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--gray-600); padding: 6px; border-radius: 6px; }
.menu-toggle:hover { background: var(--gray-100); }
.page-title { font-family: 'Outfit', sans-serif; font-size: 1.2rem; font-weight: 700; color: var(--blue); }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.topbar-date { font-size: 0.8rem; color: var(--gray-500); }
.topbar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px;
  background: var(--grad-blue);
  color: #fff;
  border-radius: 99px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  user-select: none;
}
.topbar-user:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(43,58,140,0.25);
}
.user-avatar {
  background: rgba(255,255,255,0.2);
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 0.8rem;
}
.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 240px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  border: 1px solid var(--gray-100);
}
.user-dropdown.show { display: flex; animation: fadeInDown 0.2s ease-out; }
.dropdown-header {
  padding: 16px;
  background: var(--gray-50);
  display: flex; align-items: center; gap: 12px;
}
.user-dropdown a {
  padding: 12px 16px;
  color: var(--gray-700);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  transition: all 0.15s;
}
.user-dropdown a:hover {
  background: var(--gray-50);
  color: var(--blue);
  padding-left: 20px;
}

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

/* === PAGE CONTENT === */
.page-content { flex: 1; padding: 28px; overflow-y: auto; }

/* === CARDS === */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}
.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* === DASHBOARD STATS === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 4px solid var(--blue);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: -30px; right: -20px;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.05;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card.gold  { border-top-color: var(--gold); color: var(--gold); }
.stat-card.teal  { border-top-color: var(--teal); color: var(--teal); }
.stat-card.coral { border-top-color: var(--coral); color: var(--coral); }
.stat-card.blue  { border-top-color: var(--blue); color: var(--blue); }
.stat-card.green { border-top-color: var(--success); color: var(--success); }
.stat-icon { font-size: 1.5rem; }
.stat-label { font-size: 0.75rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value { font-family: 'Outfit', sans-serif; font-size: 1.75rem; font-weight: 800; color: var(--gray-800); }
.stat-sub { font-size: 0.75rem; color: var(--gray-500); }
.stat-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.badge-up   { background: #d4edda; color: var(--success); }
.badge-down { background: #f8d7da; color: var(--danger); }

/* === GRID LAYOUTS === */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 22px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* === TABLES === */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
thead th {
  background: var(--grad-blue);
  color: #fff;
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: var(--gray-50); }
tbody td { padding: 10px 14px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); }

/* === BADGES / STATUS === */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 99px;
  font-size: 0.72rem; font-weight: 600;
}
.badge-pago    { background: #d4edda; color: #155724; }
.badge-pendente{ background: #fff3cd; color: #856404; }
.badge-atrasado{ background: #f8d7da; color: #721c24; }
.badge-ativo   { background: #d1ecf1; color: #0c5460; }
.badge-alerta  { background: #fff3cd; color: #856404; }
.badge-critico { background: #f8d7da; color: #721c24; }
.badge-ok      { background: #d4edda; color: #155724; }
.badge-master  { background: var(--blue); color: #fff; }
.badge-vendedor{ background: #fef3c7; color: #92400e; }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  border: none; transition: var(--transition);
  font-family: 'DM Sans', sans-serif;
}
.btn-primary { background: var(--grad-blue); color: #fff; }
.btn-primary:hover { background: var(--blue-light); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(43,58,140,0.3); }
.btn-gold { background: var(--grad-gold); color: var(--gray-800); }
.btn-gold:hover { background: var(--gold-dark); }
.btn-teal { background: var(--grad-teal); color: #fff; }
.btn-teal:hover { background: var(--teal-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; color: var(--blue); border: 2px solid var(--blue); }
.btn-outline:hover { background: var(--blue); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 0.78rem; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); background: var(--gray-100); color: var(--gray-600); border: none; cursor: pointer; transition: var(--transition); }
.btn-icon:hover { background: var(--blue); color: #fff; }

/* === FORMS === */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 0.78rem; font-weight: 600; color: var(--gray-600); }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 13px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(43,58,140,0.10);
}
.form-group input.loading { background: var(--gray-50); }
.form-actions { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; }

/* === SEARCH BAR === */
.search-bar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.search-bar input {
  flex: 1; min-width: 200px;
  padding: 9px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition);
}
.search-bar input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(43,58,140,0.10); }

/* === PROGRESS BAR === */
.progress { height: 8px; background: var(--gray-200); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 99px; transition: width 0.6s ease; }
.progress-blue  { background: var(--blue); }
.progress-gold  { background: var(--gold); }
.progress-teal  { background: var(--teal); }
.progress-coral { background: var(--coral); }

/* === CHART PLACEHOLDER === */
.chart-container { position: relative; width: 100%; height: 220px; }
.mini-bars { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding: 0 4px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar {
  width: 100%; border-radius: 6px 6px 0 0;
  transition: height 0.5s ease;
  cursor: pointer;
  position: relative;
}
.bar:hover::after {
  content: attr(data-val);
  position: absolute; top: -26px; left: 50%;
  transform: translateX(-50%);
  background: var(--gray-800); color: #fff;
  font-size: 0.7rem; padding: 2px 8px; border-radius: 4px;
  white-space: nowrap;
}
.bar-label { font-size: 0.65rem; color: var(--gray-500); text-align: center; }

/* === KPI ROW === */
.kpi-row { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.kpi-item { flex: 1; min-width: 140px; }
.kpi-label { font-size: 0.72rem; color: var(--gray-500); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.kpi-value { font-family: 'Outfit', sans-serif; font-size: 1.35rem; font-weight: 800; color: var(--gray-800); }
.kpi-sub { font-size: 0.75rem; color: var(--gray-500); }

/* === DIVIDER === */
.divider { height: 1px; background: var(--gray-100); margin: 20px 0; }

/* === ALERT BOX === */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.85rem; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.alert-warning { background: #fff8e1; border-left: 4px solid var(--gold); color: #7a5a00; }
.alert-danger   { background: #fdecea; border-left: 4px solid var(--coral); color: #7a1a1a; }
.alert-success  { background: #e6f9f0; border-left: 4px solid var(--teal); color: #0a4a42; }
.alert-info     { background: #eef1ff; border-left: 4px solid var(--blue); color: #1a2a70; }

/* === TAB SYSTEM === */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--gray-200); margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  padding: 9px 20px; cursor: pointer; font-size: 0.85rem; font-weight: 600;
  color: var(--gray-500); border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: var(--transition); white-space: nowrap;
}
.tab:hover { color: var(--blue); }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* === MODAL === */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(30,40,80,0.55); backdrop-filter: blur(4px);
  z-index: 1000; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white); border-radius: var(--radius);
  width: min(640px, 95vw); max-height: 88vh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: modalIn 0.22s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(-18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  padding: 20px 24px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--gray-100);
  background: var(--grad-blue);
  border-radius: var(--radius) var(--radius) 0 0;
}
.modal-header h3 { font-family: 'Outfit', sans-serif; color: #fff; font-size: 1.05rem; }
.modal-close { background: rgba(255,255,255,0.15); border: none; color: #fff; cursor: pointer; font-size: 1rem; padding: 4px 10px; border-radius: 6px; }
.modal-close:hover { background: rgba(255,255,255,0.25); }
.modal-body { padding: 24px; }

/* === FICHA TÉCNICA === */
.ingredientes-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.ingredientes-table th { background: var(--gray-100); padding: 8px 10px; font-size: 0.75rem; color: var(--gray-600); font-weight: 700; }
.ingredientes-table td { padding: 7px 10px; border-bottom: 1px solid var(--gray-100); font-size: 0.82rem; }
.ingredientes-table td input { border: none; background: transparent; width: 100%; font-size: 0.82rem; outline: none; color: var(--gray-800); }
.ingredientes-table td input:focus { background: var(--cream); border-radius: 4px; }

/* === CUSTO RESUMO === */
.custo-box {
  background: var(--blue);
  border-radius: var(--radius-sm); padding: 16px 20px; color: #fff;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px;
}
.custo-item label { font-size: 0.7rem; opacity: 0.75; display: block; text-transform: uppercase; letter-spacing: 0.06em; }
.custo-item span { font-family: 'Outfit', sans-serif; font-size: 1.2rem; font-weight: 800; }

/* === DRE === */
.dre-table td:last-child { text-align: right; font-weight: 600; }
.dre-section { background: var(--gray-50); }
.dre-total { background: var(--grad-blue); color: #fff; font-weight: 700; }
.dre-total td { padding: 12px 14px !important; }
.dre-subtotal { background: rgba(43,58,140,0.07); font-weight: 600; }
.dre-positive { color: var(--success); }
.dre-negative { color: var(--coral); }

/* === EMPTY STATE === */
.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--gray-400);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; }

/* === TOOLTIP === */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: var(--gray-800); color: #fff;
  font-size: 0.72rem; padding: 4px 10px; border-radius: 6px;
  white-space: nowrap; pointer-events: none; opacity: 0;
  transition: opacity 0.18s; z-index: 200;
}
[data-tooltip]:hover::after { opacity: 1; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 16px; }
}

/* === ANIMATIONS === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-content > * { animation: fadeIn 0.3s ease; }

/* === PRINT === */
@media print {
  .sidebar, .topbar, .btn, .search-bar { display: none !important; }
  .main-content { margin-left: 0; }
}

/* === LOGIN SCREEN === */
.login-screen {
  display: none;
  position: fixed; inset: 0;
  background: var(--grad-dark);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.login-screen.active { display: flex; }
.login-box {
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 48px 40px;
  width: min(420px, 92vw);
  text-align: center;
  animation: modalIn 0.4s ease;
}
.login-logo { font-size: 3.5rem; margin-bottom: 8px; }
.login-title { font-family: 'Outfit', sans-serif; font-size: 1.8rem; font-weight: 800; color: var(--gold); }
.login-sub { color: rgba(255,255,255,0.6); font-size: 0.85rem; margin-bottom: 32px; }
.login-box .form-group label { color: rgba(255,255,255,0.75); }
.login-box .form-group input {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
  padding: 11px 14px;
}
.login-box .form-group input::placeholder { color: rgba(255,255,255,0.4); }
.login-box .form-group input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(253,185,19,0.2); }
.login-btn {
  width: 100%; margin-top: 8px;
  background: var(--grad-gold);
  color: var(--gray-800); font-weight: 700; font-size: 1rem;
  padding: 13px; border: none; border-radius: var(--radius-sm);
  cursor: pointer; transition: var(--transition);
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(253,185,19,0.4); }
.login-error { color: #ff8080; font-size: 0.82rem; margin-top: 8px; min-height: 20px; }

/* === TAG CAIXA === */
.tag-caixa {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 0.72rem; font-weight: 700;
  background: var(--blue);
  color: #fff;
}
.tag-250 { background: var(--blue-light); }
.tag-500 { background: var(--teal); }

/* === COMMISSION BADGE === */
.commission-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 99px;
  font-size: 0.78rem; font-weight: 700;
}
.commission-5  { background: #e3f2fd; color: #1565c0; }
.commission-10 { background: #e8f5e9; color: #2e7d32; }

/* === INGREDIENT EDITOR === */
.ing-row { display: grid; grid-template-columns: 2fr 1fr 80px 90px 90px 36px; gap: 6px; margin-bottom: 6px; align-items: center; }
.ing-row input, .ing-row select { padding: 6px 8px; border: 1.5px solid var(--gray-200); border-radius: 6px; font-size: 0.82rem; width: 100%; outline: none; }
.ing-row input:focus, .ing-row select:focus { border-color: var(--blue); }
.ing-del { background: none; border: none; cursor: pointer; color: var(--coral); font-size: 1rem; padding: 4px; }
.ing-header { font-size: 0.72rem; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.05em; }

/* === MELHORIAS v3.0 === */
.progress { background:var(--gray-200); border-radius:99px; height:10px; overflow:hidden; }
.progress-bar { height:100%; border-radius:99px; transition:width 0.6s ease; }
.btn-danger { background:var(--coral); color:#fff; }
.btn-danger:hover { background:#c53030; }
.custo-box { display:grid; gap:12px; margin-top:12px; }
.custo-item { padding:14px; background:var(--gray-50); border-radius:10px; text-align:center; }
.custo-item label { display:block; font-size:0.72rem; color:var(--gray-500); margin-bottom:4px; font-weight:600; text-transform:uppercase; }
.custo-item span { font-size:1.3rem; font-weight:800; color:var(--blue); }
.kpi-row { display:flex; gap:12px; flex-wrap:wrap; }
.kpi-item { flex:1; min-width:120px; padding:12px; background:var(--gray-50); border-radius:10px; }
.kpi-label { font-size:0.72rem; color:var(--gray-500); font-weight:600; text-transform:uppercase; }
.kpi-value { font-size:1.1rem; font-weight:800; color:var(--blue); margin-top:4px; }
@media(max-width:768px){
  .stats-grid{grid-template-columns:1fr 1fr !important;}
  .sidebar{transform:translateX(-100%);transition:transform 0.3s;}
  .sidebar.open{transform:translateX(0);}
  .main-content{margin-left:0 !important;}
  .topbar{padding:0 12px;}
  .table-wrapper{font-size:0.78rem;}
  .form-grid{grid-template-columns:1fr !important;}
  .modal{width:95vw !important;max-height:90vh;overflow-y:auto;}
}
/* === NAV GROUPS (colapsável) === */
.nav-group { border-bottom: 1px solid rgba(255,255,255,0.05); }
.nav-group-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; cursor: pointer;
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.12em;
  color: #ffffff !important; text-transform: uppercase;
  user-select: none; transition: background 0.18s;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav-group-header:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-group-body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.28s cubic-bezier(.4,0,.2,1);
}
.nav-group-body.open { max-height: 800px; }
.nav-group-body .nav-item { padding-left: 28px; font-size: 0.84rem; }
.nav-arrow { font-size: 0.9rem; transition: transform 0.22s ease; display: inline-block; transform: rotate(-90deg); }
.nav-group-header.open .nav-arrow { transform: rotate(0deg); }

/* === UI/UX PREMIUM ENHANCEMENTS === */

/* Micro-interactions: Cards & Buttons tactile effect */
.card, .stat-card {
  transition: transform 0.22s cubic-bezier(.4,0,.2,1), box-shadow 0.22s cubic-bezier(.4,0,.2,1) !important;
}
.card:hover, .stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(43,58,140,0.12) !important;
}

.btn {
  transition: all 0.18s cubic-bezier(.4,0,.2,1) !important;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(43,58,140,0.18);
}
.btn:active {
  transform: scale(0.97);
}

/* Toast Notification Styles */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--white);
  color: var(--gray-800);
  border-left: 5px solid var(--blue);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 400px;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: auto;
}
.toast.show {
  transform: translateX(0);
  opacity: 1;
}
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-icon { font-size: 1.15rem; }
.toast-msg { font-size: 0.85rem; font-weight: 600; font-family: 'DM Sans', sans-serif; }

/* Cloud Sync indicator */
.cloud-sync-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--gray-50);
  color: var(--gray-600);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--gray-200);
  transition: var(--transition);
  cursor: pointer;
  user-select: none;
}
.cloud-sync-btn:hover {
  background: var(--gray-100);
  color: var(--blue);
}
.cloud-sync-btn.syncing {
  color: var(--gold);
  border-color: var(--gold);
}
.cloud-sync-btn.synced {
  color: var(--success);
  border-color: var(--success);
}
.cloud-sync-btn .sync-spinner {
  display: inline-block;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* === SYNC STATUS PILL === */
#syncStatus {
  background: var(--gray-50) !important;
  color: var(--gray-700) !important;
  border: 1.5px solid var(--gray-200) !important;
  padding: 6px 14px !important;
  border-radius: 99px !important;
  font-weight: 700 !important;
  font-size: 0.72rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
  user-select: none !important;
}
#syncStatus:hover {
  background: var(--gray-100) !important;
  border-color: var(--blue) !important;
  color: var(--blue) !important;
}
#syncDot {
  display: inline-block !important;
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  transition: background 0.3s ease !important;
}
