:root {
  --accent: #f3871a;
  --accent-dark: #d97416;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
}

/* === LOGIN === */
.login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100dvh; padding: 24px;
  background: #1a1a1a; /* Darker background for better contrast with white logo */
}
.login-box {
  background: var(--card); border-radius: var(--radius); padding: 40px;
  width: 100%; max-width: 400px; box-shadow: var(--shadow); text-align: center;
}
.login-box .login-logo { height: 180px; margin-bottom: 24px; object-fit: contain; }
.login-box h1 { font-size: 1.6rem; margin-bottom: 24px; color: var(--text); font-weight: 700; text-align: center; }
.login-box .btn-primary { justify-content: center; width: 100%; }

.login-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.login-footer img {
  height: 32px; /* Slightly larger */
  margin: 12px auto 0;
  display: block;
  /* Removed grayscale to keep it colored as requested */
}

/* === LAYOUT === */
.app-container { display: flex; flex-direction: column; min-height: 100dvh; }
.app-header {
  background: #1a1a1a; color: white; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; position: sticky; top: 0; z-index: 100;
}
.app-header img { height: 36px; }
.app-header__actions { display: flex; gap: 12px; align-items: center; }
.app-body { flex: 1; padding: 20px; max-width: 960px; margin: 0 auto; width: 100%; }
.app-footer {
  background: white;
  border-top: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.app-footer strong { color: var(--accent); }
.app-footer img { height: 22px; vertical-align: middle; margin-left: 8px; } /* Slightly larger */

/* === TABS === */
.tabs {
  display: flex; gap: 4px; background: var(--card); border-radius: var(--radius);
  padding: 4px; box-shadow: var(--shadow); margin-bottom: 24px; overflow-x: auto;
}
.tab {
  flex: 1; padding: 10px 16px; border: none; background: transparent; cursor: pointer;
  font-weight: 600; color: var(--text-muted); border-radius: 8px; font-size: 0.9rem;
  white-space: nowrap; transition: 0.2s;
}
.tab:hover { color: var(--text); background: var(--bg); }
.tab.active { background: var(--accent); color: white; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* === BUTTONS === */
.btn {
  padding: 12px 24px; border: none; border-radius: 8px; cursor: pointer;
  font-weight: 600; font-size: 0.9rem; transition: 0.2s; display: inline-flex;
  align-items: center; gap: 8px; text-decoration: none;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: white; }
.btn-sm { padding: 8px 14px; font-size: 0.8rem; }
.btn-icon { padding: 8px; background: transparent; border: none; cursor: pointer; color: var(--text-muted); }
.btn-icon:hover { color: var(--danger); }
.btn-logout { background: transparent; border: 1px solid rgba(255,255,255,0.3); color: white; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 0.8rem; }
.btn-logout:hover { border-color: white; }

/* === CARDS / PANELS === */
.panel {
  background: var(--card); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.panel h2 { font-size: 1.2rem; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.panel h2 svg { color: var(--accent); }

/* === FORMS === */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-row.full { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea {
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.95rem; font-family: inherit; outline: none; transition: 0.2s;
  background: white; width: 100%;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(243,135,26,0.12);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group .help { font-size: 0.75rem; color: var(--text-muted); }
.form-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

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

/* === IMAGE UPLOAD === */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 24px;
  text-align: center; cursor: pointer; transition: 0.2s; position: relative;
  background: var(--bg); min-height: 120px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--accent); background: rgba(243,135,26,0.04); }
.upload-zone svg { color: var(--text-muted); }
.upload-zone p { color: var(--text-muted); font-size: 0.85rem; }
.upload-zone input[type="file"] { display: none; }
.upload-previews {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px;
}
.upload-preview {
  width: 80px; height: 80px; border-radius: 8px; overflow: hidden;
  position: relative; border: 2px solid var(--border);
}
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview .remove-img {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px;
  background: var(--danger); color: white; border: none; border-radius: 50%;
  cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center;
}

/* === RICH TEXT EDITOR === */
.rte-toolbar {
  display: flex; gap: 4px; padding: 6px 8px; border: 1px solid var(--border);
  border-bottom: none; border-radius: var(--radius) var(--radius) 0 0; background: var(--bg);
}
.rte-toolbar button {
  padding: 4px 10px; border: none; background: transparent; cursor: pointer;
  border-radius: 4px; font-size: 0.85rem; color: var(--text);
}
.rte-toolbar button:hover { background: var(--border); }
.rte-editor {
  border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
  padding: 12px; min-height: 80px; outline: none; font-size: 0.95rem; line-height: 1.6;
  background: white;
}
.rte-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(243,135,26,0.12); }

/* === ITEM LIST === */
.item-list { display: flex; flex-direction: column; gap: 12px; }
.item-card {
  display: flex; align-items: center; gap: 16px; background: var(--card);
  border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow);
  transition: 0.2s; border: 1px solid transparent;
}
.item-card:hover { border-color: var(--accent); }
.item-card__thumb {
  width: 60px; height: 60px; border-radius: 8px; overflow: hidden; flex-shrink: 0;
  background: var(--bg);
}
.item-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-card__info { flex: 1; min-width: 0; }
.item-card__title { font-weight: 600; font-size: 0.95rem; }
.item-card__meta { font-size: 0.8rem; color: var(--text-muted); }
.item-card__actions { display: flex; gap: 8px; flex-shrink: 0; }

/* === VARIAÇÕES === */
.variacao-card {
  background: var(--bg); border-radius: var(--radius); padding: 16px;
  margin-bottom: 12px; border: 1px solid var(--border);
}
.variacao-card__header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.variacao-card__header h4 { font-size: 0.95rem; color: var(--accent); }

/* === BRAND GRID === */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.brand-card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  text-align: center; box-shadow: var(--shadow); border: 1px solid transparent;
  transition: 0.2s; position: relative;
}
.brand-card:hover { border-color: var(--accent); }
.brand-card img { height: 40px; max-width: 100%; object-fit: contain; margin-bottom: 8px; }
.brand-card p { font-weight: 600; font-size: 0.85rem; }
.brand-card__actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }

/* === TOAST === */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1e293b; color: white; padding: 12px 24px; border-radius: 8px;
  font-size: 0.9rem; box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  opacity: 0; transition: 0.3s; pointer-events: none; z-index: 9999;
}
.toast.show { opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* === EMPTY STATE === */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--text-muted);
}
.empty-state svg { margin-bottom: 12px; }
.empty-state p { margin-bottom: 16px; }
