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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.login-box {
  background: var(--surface);
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-box h1 {
  text-align: center;
  color: var(--primary);
  margin-bottom: 10px;
}

.login-logo {
  display: block;
  margin: 0 auto 20px;
  max-width: 280px;
  height: auto;
}

.subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 30px;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 15px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-header h1 {
  font-size: 20px;
  color: var(--primary);
}

.header-logo {
  height: 78px;
  width: auto;
  margin: 5px 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  color: var(--text-light);
  font-size: 14px;
}

.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  width: 250px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 0;
}

.nav-menu {
  list-style: none;
}

.nav-link {
  display: block;
  padding: 12px 24px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s;
}

.nav-link:hover {
  background: var(--bg);
  color: var(--primary);
}

.nav-link.active {
  background: var(--primary);
  color: white;
  border-left: 4px solid var(--primary-dark);
}

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

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group input:disabled,
.form-group select:disabled {
  background: var(--bg);
  color: var(--text-light);
  cursor: not-allowed;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-block {
  width: 100%;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
  margin-right: 4px;
}

.error-message {
  background: #fee2e2;
  color: var(--danger);
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}

.error {
  background: #fee2e2;
  color: var(--danger);
  padding: 16px;
  border-radius: 6px;
  margin: 20px 0;
}

.forgot-password {
  text-align: center;
  margin-top: 16px;
}

.forgot-password a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 14px;
}

.forgot-password a.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dashboard {
  max-width: 1200px;
}

.dashboard h2 {
  margin-bottom: 30px;
  color: var(--text);
}

.shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.shortcut-card {
  background: var(--surface);
  padding: 24px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.shortcut-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
  transform: translateY(-2px);
}

.shortcut-card h3 {
  color: var(--primary);
  margin-bottom: 8px;
}

.shortcut-card p {
  color: var(--text-light);
  font-size: 14px;
}

.filters {
  background: var(--surface);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.form-section {
  background: var(--surface);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.form-section h3 {
  margin-bottom: 20px;
  color: var(--text);
}

.table-container {
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: var(--bg);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.data-table tr:hover {
  background: var(--bg);
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.badge-admin {
  background: #dbeafe;
  color: #1e40af;
}

.badge-atendimento {
  background: #d1fae5;
  color: #065f46;
}

.badge-cozinheira {
  background: #fef3c7;
  color: #92400e;
}

.badge-PF {
  background: #e0e7ff;
  color: #4338ca;
}

.badge-PJ {
  background: #fce7f3;
  color: #9f1239;
}

.status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status.active {
  background: #d1fae5;
  color: #065f46;
}

.status.inactive {
  background: #fee2e2;
  color: #991b1b;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
}

h2 {
  margin-bottom: 20px;
  color: var(--text);
}

h3 {
  margin-bottom: 16px;
  color: var(--text);
}

@media (max-width: 768px) {
  .app-body {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .shortcuts {
    grid-template-columns: 1fr;
  }
}

.ficha-tecnica-labels {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ficha-tecnica-labels .label-acao {
  width: 38px;
}

.item-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.item-ingrediente {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
}

.item-quantidade,
.item-unidade {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
}

.btn-remove-item {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background: #ef4444;
  color: white;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
}

.btn-remove-item:hover {
  background: #dc2626;
}

.form-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
}

.receita-form-section textarea {
  min-height: 100px;
  resize: vertical;
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: #3b82f6;
  color: white;
  transition: background 0.2s;
  margin-right: 4px;
}

.btn-small:hover {
  background: #2563eb;
}

.btn-small.btn-danger {
  background: #ef4444;
}

.btn-small.btn-danger:hover {
  background: #dc2626;
}

.btn-small.btn-success {
  background: #10b981;
}

.btn-small.btn-success:hover {
  background: #059669;
}

.autocomplete-wrapper {
  position: relative;
  width: 100%;
}

.autocomplete-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.autocomplete-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.autocomplete-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
}

.autocomplete-item {
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.2s;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background: #f1f5f9;
}

.autocomplete-item strong {
  font-weight: 500;
  color: #1e293b;
}

.autocomplete-item small {
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
}

.autocomplete-item mark {
  background: #fef08a;
  color: #854d0e;
  padding: 0 2px;
  border-radius: 2px;
}

.autocomplete-create {
  border-top: 2px solid #e2e8f0;
  background: #f8fafc;
}

.autocomplete-create:hover {
  background: #e0f2fe;
}

.autocomplete-create strong {
  color: #0ea5e9;
}

.color-box {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  vertical-align: middle;
  margin-right: 4px;
}

.badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  background: #e2e8f0;
  color: #475569;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Cardápio preview - dimensões A4 fixas */
.cardapio-preview {
  width: 210mm;
  min-width: 210mm;
  max-width: 210mm;
  min-height: 297mm;
  height: auto;
  margin: 20px auto;
  background: #ffffff;
  padding: 15px 22px 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.08);
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

/* Print styles for inline cardápio preview */
@page {
  size: A4 portrait;
  margin: 8mm 10mm;
}

@media print {
  body {
    background: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  .app-header,
  .sidebar,
  .nav-container,
  .actions-inline,
  .btn,
  button {
    display: none !important;
  }
  
  .main-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 210mm !important;
    max-width: 210mm !important;
  }
  
  .cardapio-preview {
    width: 210mm !important;
    max-width: 210mm !important;
    min-height: 297mm !important;
    margin: 0 auto !important;
    padding: 15px 20px 20px !important;
    box-shadow: none !important;
  }
}
