/* ============================================================
   CMV SYSTEM – Global Styles
   ============================================================ */

:root {
  --primary: #FF6B35;
  --primary-dark: #e55a25;
  --primary-light: #fff3ee;
  --secondary: #2D3748;
  --accent: #48BB78;
  --accent-dark: #38a169;
  --danger: #FC5C65;
  --warning: #FED330;
  --info: #4ECDC4;
  --purple: #9B59B6;
  --bg: #F7F8FC;
  --sidebar-bg: #1A202C;
  --sidebar-hover: #2D3748;
  --card-bg: #FFFFFF;
  --text: #2D3748;
  --text-muted: #718096;
  --border: #E2E8F0;
  --shadow: 0 2px 16px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --transition: all 0.2s ease;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page { background: linear-gradient(135deg, #1A202C 0%, #2D3748 50%, #1A202C 100%); }

.login-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 32px;
}

.login-brand { text-align: center; color: white; }
.login-logo {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 32px; color: white; margin-bottom: 16px;
  box-shadow: 0 8px 32px rgba(255,107,53,0.4);
}
.login-brand h1 { font-size: 32px; font-weight: 800; letter-spacing: -1px; }
.login-brand h1 span { color: var(--primary); }
.login-brand p { color: rgba(255,255,255,0.6); font-size: 14px; margin-top: 4px; }

.login-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
}
.login-card h2 { font-size: 24px; font-weight: 700; color: var(--text); }
.login-subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 8px;
}
.form-group label i { margin-right: 6px; color: var(--primary); }

.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif; font-size: 14px; color: var(--text);
  background: white; transition: var(--transition);
  outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255,107,53,0.1);
}
.form-group textarea { resize: vertical; min-height: 100px; }

.input-password { position: relative; }
.input-password input { padding-right: 44px; }
.eye-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-muted);
}

.login-error {
  background: #FFF5F5; border: 1px solid #FED7D7;
  color: var(--danger); padding: 10px 14px;
  border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px;
}
.login-hint { text-align: center; margin-top: 16px; color: var(--text-muted); font-size: 12px; }
.login-hint i { margin-right: 4px; }

/* ============================================================
   LAYOUT
   ============================================================ */
#mainApp { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-width); background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  flex-shrink: 0; height: 100vh; overflow-y: auto;
  transition: var(--transition);
  position: relative; z-index: 100;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; color: white; font-weight: 700; font-size: 16px; }
.sidebar-logo i { color: var(--primary); font-size: 20px; }
.sidebar-close { display: none; background: none; border: none; color: white; cursor: pointer; font-size: 18px; }

.company-selector { padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.company-selector label { color: rgba(255,255,255,0.5); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; display: block; }
.company-selector select {
  width: 100%; padding: 8px 12px; background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2); border-radius: var(--radius-sm);
  color: white; font-size: 13px; cursor: pointer;
}
.company-selector select option { background: #2D3748; }

.company-info {
  padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 12px;
}
.company-avatar {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.company-info p { color: white; font-weight: 600; font-size: 13px; line-height: 1.3; }
.company-info small { color: rgba(255,255,255,0.5); font-size: 11px; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-section {
  padding: 12px 20px 6px;
  color: rgba(255,255,255,0.35); font-size: 10px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px; color: rgba(255,255,255,0.65);
  text-decoration: none; font-size: 14px; font-weight: 500;
  transition: var(--transition); border-radius: 0;
  position: relative;
}
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.nav-item:hover { background: var(--sidebar-hover); color: white; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(255,107,53,0.25), rgba(255,107,53,0.05));
  color: var(--primary);
  border-left: 3px solid var(--primary);
}
.nav-item.active i { color: var(--primary); }

.sidebar-footer {
  padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.user-info { flex: 1; overflow: hidden; }
.user-info p { color: white; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info small { color: rgba(255,255,255,0.45); font-size: 11px; }
.btn-logout {
  background: rgba(255,255,255,0.08); border: none;
  color: rgba(255,255,255,0.5); width: 32px; height: 32px;
  border-radius: 8px; cursor: pointer; flex-shrink: 0;
  transition: var(--transition); font-size: 14px;
}
.btn-logout:hover { background: var(--danger); color: white; }

/* TOPBAR */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: var(--topbar-height); background: white;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 16px;
  flex-shrink: 0; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.hamburger { display: none; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text); }
.topbar-title { font-size: 18px; font-weight: 700; color: var(--text); flex: 1; }
.topbar-user { font-size: 13px; color: var(--text-muted); }

.content-area { flex: 1; overflow-y: auto; padding: 24px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; border: none; padding: 12px 24px;
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(255,107,53,0.4); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: white; color: var(--text);
  border: 2px solid var(--border); padding: 10px 20px;
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

.btn-success {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white; border: none; padding: 10px 20px;
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(72,187,120,0.4); }

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #e84444);
  color: white; border: none; padding: 8px 16px;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(252,92,101,0.4); }

.btn-icon {
  background: none; border: none; cursor: pointer;
  width: 34px; height: 34px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: var(--transition); font-size: 14px;
}
.btn-icon:hover { background: var(--bg); color: var(--primary); }
.btn-icon.edit:hover { color: var(--info); }
.btn-icon.delete:hover { color: var(--danger); }

.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ============================================================
   CARDS & STATS
   ============================================================ */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-header h1 { font-size: 24px; font-weight: 700; color: var(--text); }
.page-header h1 small { display: block; font-size: 13px; font-weight: 400; color: var(--text-muted); margin-top: 2px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: white; border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px;
  transition: var(--transition); position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.orange::before { background: var(--primary); }
.stat-card.green::before { background: var(--accent); }
.stat-card.blue::before { background: var(--info); }
.stat-card.purple::before { background: var(--purple); }
.stat-card.red::before { background: var(--danger); }
.stat-card.teal::before { background: #4ECDC4; }

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

.stat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-icon.orange { background: rgba(255,107,53,0.12); color: var(--primary); }
.stat-icon.green { background: rgba(72,187,120,0.12); color: var(--accent); }
.stat-icon.blue { background: rgba(78,205,196,0.12); color: var(--info); }
.stat-icon.purple { background: rgba(155,89,182,0.12); color: var(--purple); }
.stat-icon.red { background: rgba(252,92,101,0.12); color: var(--danger); }
.stat-icon.teal { background: rgba(78,205,196,0.12); color: #4ECDC4; }

.stat-info p { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.stat-info h3 { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-info small { font-size: 11px; color: var(--text-muted); }

/* CARDS */
.card {
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 24px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 16px; font-weight: 700; color: var(--text); }
.card-header .card-actions { display: flex; gap: 8px; }

/* ============================================================
   TABLE
   ============================================================ */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-sm); }
table {
  width: 100%; border-collapse: collapse; font-size: 14px;
  min-width: 600px;
}
thead tr { background: var(--bg); }
thead th {
  padding: 12px 16px; text-align: left;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  color: var(--text); vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg); }
.td-actions { display: flex; gap: 4px; align-items: center; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
}
.badge-green { background: rgba(72,187,120,0.12); color: #276749; }
.badge-orange { background: rgba(255,107,53,0.12); color: #c05621; }
.badge-red { background: rgba(252,92,101,0.12); color: #9b2335; }
.badge-blue { background: rgba(78,205,196,0.12); color: #234e52; }
.badge-purple { background: rgba(155,89,182,0.12); color: #553c9a; }
.badge-gray { background: rgba(113,128,150,0.12); color: #4a5568; }

/* ── Payment Month Cards (Contratos) ────────────────────────── */
.payment-month-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: var(--transition);
}
.payment-month-card.paid {
  background: rgba(72,187,120,0.07);
  border-color: rgba(72,187,120,0.4);
}
.payment-month-card.current {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(255,107,53,0.15);
}
.btn-payment-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px; border: none;
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: var(--transition); white-space: nowrap;
}
.btn-payment-toggle.paid {
  background: rgba(72,187,120,0.15); color: #276749;
}
.btn-payment-toggle.paid:hover {
  background: rgba(72,187,120,0.3);
}
.btn-payment-toggle.pending {
  background: rgba(252,92,101,0.12); color: #9b2335;
}
.btn-payment-toggle.pending:hover {
  background: rgba(252,92,101,0.25);
}
/* stat-card red */
.stat-card.red .stat-icon.red { background: rgba(252,92,101,0.12); color: #FC5C65; }
/* stat-card gray */
.stat-card.gray .stat-icon.gray { background: rgba(113,128,150,0.12); color: #718096; }

/* Markup Alert (aviso quando markup não configurado) */
.markup-alert {
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(252,92,101,0.08); border: 1px solid rgba(252,92,101,0.3);
  border-radius: var(--radius-sm); padding: 12px 16px;
  color: #9b2335; font-size: 14px; line-height: 1.5;
}
.markup-alert i { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.markup-alert a { color: var(--primary); font-weight: 700; }

/* Markup Impact Info (settings — fichas afetadas) */
.markup-impact-info {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px;
}
.impact-item {
  flex: 1; min-width: 180px; display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px;
}
.impact-item i { font-size: 20px; flex-shrink: 0; }
.impact-item strong { font-size: 22px; display: block; line-height: 1; }
.impact-item span { color: var(--text-muted); font-size: 12px; }
.impact-default {
  background: rgba(72,187,120,0.08); border: 1px solid rgba(72,187,120,0.25);
  color: #276749;
}
.impact-default i { color: #48BB78; }
.impact-custom {
  background: rgba(155,89,182,0.08); border: 1px solid rgba(155,89,182,0.25);
  color: #553c9a;
}
.impact-custom i { color: #9B59B6; }

/* CMV Badge */
.cmv-badge {
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
}
.cmv-ok { background: rgba(72,187,120,0.15); color: #276749; }
.cmv-warn { background: rgba(254,211,48,0.2); color: #744210; }
.cmv-bad { background: rgba(252,92,101,0.15); color: #9b2335; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.modal {
  background: white; border-radius: 20px;
  width: 100%; max-width: 600px; max-height: 90vh;
  overflow-y: auto; box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  animation: slideUp 0.25s ease;
}
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1000px; }

.modal-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: white; z-index: 1;
}
.modal-header h3 { font-size: 18px; font-weight: 700; color: var(--text); }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: var(--bg); cursor: pointer; font-size: 16px;
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: var(--danger); color: white; }
.modal-body { padding: 24px 28px; }
.modal-footer {
  padding: 20px 28px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ============================================================
   TOAST
   ============================================================ */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: white; border-radius: 12px; padding: 14px 18px;
  box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 12px;
  min-width: 280px; max-width: 380px; font-size: 14px;
  animation: slideRight 0.3s ease; border-left: 4px solid var(--accent);
}
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slideRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ============================================================
   SEARCH & FILTERS
   ============================================================ */
.search-bar {
  display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center;
}
.search-input {
  flex: 1; min-width: 200px; position: relative;
}
.search-input input {
  width: 100%; padding: 10px 14px 10px 40px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text); outline: none; transition: var(--transition);
}
.search-input input:focus { border-color: var(--primary); }
.search-input i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.filter-select {
  padding: 10px 14px; border: 2px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text); outline: none; background: white; cursor: pointer;
}
.filter-select:focus { border-color: var(--primary); }

/* ============================================================
   CHARTS GRID
   ============================================================ */
.charts-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 24px; margin-bottom: 24px;
}
@media (max-width: 900px) { .charts-grid { grid-template-columns: 1fr; } }
.chart-container { height: 280px; position: relative; }

/* ============================================================
   RECIPE ITEMS TABLE
   ============================================================ */
.recipe-items-table { width: 100%; border-collapse: collapse; }
.recipe-items-table th, .recipe-items-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.recipe-items-table th { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; background: var(--bg); }
.recipe-items-table input, .recipe-items-table select {
  width: 100%; padding: 6px 10px; border: 1.5px solid var(--border);
  border-radius: 6px; font-size: 13px; color: var(--text);
  background: white; outline: none; transition: var(--transition);
}
.recipe-items-table input:focus, .recipe-items-table select:focus { border-color: var(--primary); }
.recipe-items-table input[readonly] { background: var(--bg); color: var(--text-muted); }
.row-total { font-weight: 700; color: var(--text); }

/* ============================================================
   RECIPE CARD (grid view)
   ============================================================ */
.recipes-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.recipe-card {
  background: white; border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; transition: var(--transition); cursor: pointer;
}
.recipe-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.recipe-card-header {
  padding: 16px 20px; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}
.recipe-card-header h4 { font-size: 15px; font-weight: 700; }
.recipe-card-header small { opacity: 0.8; font-size: 12px; }
.recipe-card-body { padding: 16px 20px; }
.recipe-card-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.recipe-card-row span { color: var(--text-muted); }
.recipe-card-row strong { color: var(--text); font-weight: 600; }
.recipe-card-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.recipe-card-photo {
  width: 100%; height: 160px;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  position: relative;
}
.recipe-card-photo::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.25) 100%);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center; padding: 60px 24px; color: var(--text-muted);
}
.empty-state i { font-size: 56px; margin-bottom: 16px; opacity: 0.3; color: var(--primary); display: block; }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ============================================================
   CATEGORY CHIP
   ============================================================ */
.category-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
  border: 2px solid transparent;
}
.category-list { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.category-chip.active { border-color: currentColor; }

/* ============================================================
   UPLOAD AREA
   ============================================================ */
.upload-area {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 40px; text-align: center; cursor: pointer;
  transition: var(--transition); background: var(--bg);
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--primary); background: var(--primary-light);
}
.upload-area i { font-size: 40px; color: var(--primary); margin-bottom: 12px; display: block; }
.upload-area p { color: var(--text-muted); font-size: 14px; }
.upload-area strong { color: var(--primary); }

/* Photo upload area for recipe */
.photo-upload-area {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 24px; text-align: center; cursor: pointer;
  transition: var(--transition); background: var(--bg);
  min-height: 120px; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.photo-upload-area:hover { border-color: var(--primary); background: var(--primary-light); }
.photo-upload-area img { pointer-events: none; }

/* ============================================================
   COST BREAKDOWN
   ============================================================ */
.cost-summary {
  background: linear-gradient(135deg, #1A202C, #2D3748);
  border-radius: var(--radius); padding: 24px; color: white; margin-top: 20px;
}
.cost-summary-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px;
}
.cost-item { text-align: center; }
.cost-item label { font-size: 11px; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.5px; display: block; margin-bottom: 4px; }
.cost-item .value { font-size: 22px; font-weight: 700; }
.cost-item .value.highlight { color: var(--primary); }
.cost-item .value.success { color: #68D391; }

/* ============================================================
   FORM SECTIONS
   ============================================================ */
.form-section { margin-bottom: 24px; }
.form-section-title {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px;
  margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-full { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
}

/* ============================================================
   REPORT
   ============================================================ */
.report-card {
  background: white; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; display: flex; align-items: center; gap: 16px;
  cursor: pointer; transition: var(--transition);
}
.report-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-left: 4px solid var(--primary); }
.report-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.report-info h4 { font-size: 15px; font-weight: 700; color: var(--text); }
.report-info p { font-size: 13px; color: var(--text-muted); }

/* ============================================================
   CALCULADORA DE MARKUP
   ============================================================ */

/* Banner info */
.markup-info-banner {
  display: flex; align-items: flex-start; gap: 14px;
  background: linear-gradient(135deg, #fff8f5, #fff3ee);
  border: 1px solid #ffd4bf; border-left: 4px solid var(--primary);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 24px;
  font-size: 14px; color: var(--text);
}
.markup-info-banner i { color: var(--primary); font-size: 20px; margin-top: 2px; flex-shrink: 0; }

/* Layout grid */
.markup-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}
@media (max-width: 1100px) {
  .markup-grid { grid-template-columns: 1fr; }
}

.markup-form-col { display: flex; flex-direction: column; gap: 20px; }
.markup-result-col {
  display: flex; flex-direction: column; gap: 20px;
  position: sticky; top: 80px;
}
@media (max-width: 1100px) {
  .markup-result-col { position: static; }
}

/* Campo hint */
.field-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; display: block; }
.section-hint { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }

/* Linhas de custo */
.costs-grid { display: flex; flex-direction: column; gap: 10px; }

.cost-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.cost-row:last-child { border-bottom: none; }

.cost-row-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text); flex: 1; min-width: 0;
}
.cost-row-label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cost-row-input {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; background: white;
  width: 140px; flex-shrink: 0;
}
.cost-row-input input {
  border: none; outline: none; padding: 6px 8px;
  font-size: 13px; width: 100%; text-align: right;
  background: transparent; color: var(--text);
}
.input-prefix, .input-suffix {
  padding: 6px 8px; background: var(--bg); color: var(--text-muted);
  font-size: 12px; font-weight: 600; white-space: nowrap;
  border-right: 1px solid var(--border);
}
.input-suffix { border-right: none; border-left: 1px solid var(--border); }

/* Hint box CMV */
.markup-hint-box {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--bg); border-radius: 8px; padding: 12px;
  font-size: 12px; color: var(--text-muted); margin-top: 12px;
  border: 1px solid var(--border);
}
.markup-hint-box i { color: var(--info); margin-top: 2px; flex-shrink: 0; }

/* Resultado principal */
.markup-result-card {
  background: linear-gradient(135deg, #1A202C, #2D3748) !important;
  color: white; text-align: center; padding: 32px 24px !important;
}
.markup-result-header {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.6);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px;
}
.markup-result-header i { font-size: 16px; }
.markup-result-value {
  font-size: 56px; font-weight: 800; line-height: 1;
  margin-bottom: 10px; color: var(--accent);
  transition: color 0.3s;
}
.markup-result-label {
  font-size: 14px; color: rgba(255,255,255,0.7); margin-bottom: 8px;
}
.markup-result-formula {
  font-size: 12px; color: rgba(255,255,255,0.45);
  font-family: monospace;
}

/* Viabilidade */
.viability-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.viability-row:last-child { border-bottom: none; }
.viability-row i { font-size: 15px; margin-top: 1px; flex-shrink: 0; }

/* Breakdown */
.breakdown-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px; font-size: 13px;
}
.breakdown-label {
  display: flex; align-items: center; gap: 8px;
  width: 160px; flex-shrink: 0;
}
.breakdown-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.breakdown-bar-wrap {
  flex: 1; background: var(--border); border-radius: 99px; height: 10px; overflow: hidden;
}
.breakdown-bar {
  height: 10px; border-radius: 99px; transition: width 0.4s ease;
}
.breakdown-pct {
  width: 44px; text-align: right; font-weight: 600; color: var(--text);
}

/* Simulador */
.simulator-result {
  background: var(--bg); border-radius: var(--radius);
  padding: 16px; margin-top: 12px;
}
.sim-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.sim-row:last-child { border-bottom: none; }

/* Ponto de equilíbrio */
.breakeven-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-bottom: 20px;
}
@media (max-width: 640px) { .breakeven-grid { grid-template-columns: 1fr; } }

.breakeven-item {
  text-align: center; background: var(--bg);
  border-radius: var(--radius-sm); padding: 16px 12px;
}
.breakeven-value { font-size: 18px; font-weight: 700; }
.breakeven-desc { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }

.breakeven-progress-wrap { margin-top: 8px; }
.breakeven-bar-track {
  position: relative; height: 12px; background: var(--border);
  border-radius: 99px; overflow: visible;
}
.breakeven-bar-fill {
  height: 12px; background: linear-gradient(90deg, #FC5C65, #9B59B6);
  border-radius: 99px; transition: width 0.5s ease;
}
.breakeven-bar-goal {
  position: absolute; top: -4px;
}
.breakeven-bar-goal-line {
  width: 2px; height: 20px; background: var(--accent);
  border-radius: 2px;
}

/* Fórmula help box */
.markup-formula-box {
  background: #1A202C; color: #fff; border-radius: 8px;
  padding: 14px 16px; font-family: monospace; font-size: 14px;
  margin: 12px 0; line-height: 1.8;
}

/* Badge info */
.badge-info { background: #e0f7f5; color: #2c9c96; }
.badge-warning { background: #fff9e6; color: #b38600; }

/* Card body padding */
.card-body { padding: 20px; }

/* Report cards list (novo layout) */
.report-cards-list { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.report-card-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--bg); cursor: pointer;
  transition: var(--transition); border: 1px solid transparent;
}
.report-card-item:hover { background: white; border-color: var(--border); box-shadow: var(--shadow); transform: translateX(4px); }
.rci-icon {
  width: 44px; height: 44px; border-radius: 10px; display: flex;
  align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0;
}
.rci-icon.orange { background: var(--primary-light); color: var(--primary); }
.rci-icon.blue   { background: rgba(78,205,196,0.12); color: #234e52; }
.rci-icon.red    { background: rgba(252,92,101,0.10); color: #9b2335; }
.rci-icon.green  { background: rgba(72,187,120,0.10); color: #276749; }
.rci-body { flex: 1; }
.rci-body h4 { font-size: 14px; font-weight: 700; color: var(--text); }
.rci-body p  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.rci-arrow   { font-size: 18px; flex-shrink: 0; }

/* ============================================================
   DASHBOARD TOP DISHES
   ============================================================ */
.top-dish {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.top-dish:last-child { border-bottom: none; }
.dish-rank {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-muted); flex-shrink: 0;
}
.dish-rank.gold { background: rgba(254,211,48,0.2); color: #b7791f; }
.dish-rank.silver { background: rgba(160,174,192,0.2); color: #4a5568; }
.dish-rank.bronze { background: rgba(214,158,46,0.15); color: #975a16; }
.dish-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); }
.dish-name small { display: block; font-size: 12px; font-weight: 400; color: var(--text-muted); }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar { background: var(--border); border-radius: 20px; height: 6px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 20px; transition: width 0.6s ease; }
.progress-fill.green { background: var(--accent); }
.progress-fill.orange { background: var(--primary); }
.progress-fill.red { background: var(--danger); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; left: -100%; top: 0; bottom: 0;
    z-index: 1000; width: 280px;
  }
  .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,0.4); }
  .sidebar-close { display: flex; }
  .hamburger { display: flex; }
  .content-area { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .modal { border-radius: 16px; }
  .recipes-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Print */
@media print {
  .sidebar, .topbar, .btn-primary, .btn-secondary, .btn-icon { display: none !important; }
  .main-content { margin: 0; }
  .content-area { padding: 0; }
}
