/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f4f4f4; color: #222; }

/* === LOGIN === */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #c0000c 0%, #7a0008 100%);
}
.login-box {
  background: #fff;
  border-radius: 14px;
  padding: 48px 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}
.login-logo {
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 1px;
}
.logo-arts { color: #c0000c; }
.logo-comercial { color: #333; }
.login-box h2 { font-size: 15px; color: #666; text-align: center; font-weight: 400; }
.login-box input {
  padding: 12px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
}
.login-box input:focus { border-color: #c0000c; }
.login-box button {
  background: #c0000c;
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
}
.login-box button:hover { background: #8b0000; }
.login-error { color: #c0000c; font-size: 13px; text-align: center; min-height: 18px; }

/* === ADMIN HEADER === */
.adm-header {
  background: #c0000c;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.adm-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { font-size: 20px; font-weight: 800; letter-spacing: 1px; display: flex; align-items: center; gap: 10px; }
.adm-label {
  background: rgba(255,255,255,.2);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .5px;
}
.adm-header-actions { display: flex; gap: 10px; }
.btn-outline {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.6);
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.btn-outline:hover { background: rgba(255,255,255,.15); border-color: #fff; }

/* === ADMIN LAYOUT === */
.adm-layout {
  max-width: 1200px;
  margin: 28px auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* === STATS === */
.stats-row { display: flex; gap: 16px; }
.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px 28px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 140px;
}
.stat-card span { font-size: 32px; font-weight: 800; color: #c0000c; }
.stat-card label { font-size: 12px; color: #888; }

/* === SECTION === */
.adm-section {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.adm-section h2 { font-size: 17px; font-weight: 700; color: #222; }

/* === COLLAPSIBLE === */
.collapsible-section { padding: 0; overflow: hidden; }
.section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.section-toggle:hover { background: #fafafa; }
.toggle-arrow { transition: transform .25s; flex-shrink: 0; color: #aaa; }
.section-toggle.open .toggle-arrow { transform: rotate(180deg); }

.section-body {
  padding: 0 28px 24px;
  overflow: hidden;
  max-height: 2000px;
  transition: max-height .35s ease, padding .35s ease, opacity .3s ease;
  opacity: 1;
}
.section-body.collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

/* === FORM === */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.span2 { grid-column: span 2; }
.form-group label { font-size: 13px; font-weight: 600; color: #444; }
.form-group input,
.form-group textarea,
.form-group select {
  padding: 9px 12px;
  border: 1.5px solid #ddd;
  border-radius: 7px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus { border-color: #c0000c; }

.img-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.img-input-row input { flex: 1; min-width: 180px; }
.or-label { font-size: 13px; color: #aaa; }
.btn-download-url {
  background: #c0000c;
  color: #fff;
  border: none;
  padding: 9px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.btn-download-url:hover { background: #8b0000; }
.btn-download-url:disabled { background: #e08080; cursor: not-allowed; }

.btn-upload {
  background: #f4f4f4;
  border: 1.5px solid #ddd;
  padding: 9px 14px;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.btn-upload:hover { background: #ffeaea; border-color: #c0000c; color: #c0000c; }
.btn-remove-img {
  background: none;
  border: none;
  color: #c0000c;
  cursor: pointer;
  font-size: 13px;
  margin-left: 10px;
  font-weight: 600;
}

.form-actions { display: flex; gap: 12px; margin-top: 20px; }
.btn-primary {
  background: #c0000c;
  color: #fff;
  border: none;
  padding: 11px 28px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
}
.btn-primary:hover { background: #8b0000; }
.btn-secondary {
  background: #f4f4f4;
  color: #555;
  border: 1.5px solid #ddd;
  padding: 11px 20px;
  border-radius: 7px;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
}
.btn-secondary:hover { background: #e8e8e8; }

/* === TABLE === */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}
.list-header input {
  padding: 8px 12px;
  border: 1.5px solid #ddd;
  border-radius: 7px;
  font-size: 13px;
  outline: none;
  width: 220px;
}
.list-header input:focus { border-color: #c0000c; }
.adm-table-wrap { overflow-x: auto; }
.adm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.adm-table th {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid #f0f0f0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: #888;
}
.adm-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f5f5f5;
  vertical-align: middle;
}
.adm-table tr:hover td { background: #fffafa; }
.adm-table .thumb {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #eee;
  background: #fafafa;
}
.adm-table .thumb-placeholder {
  width: 48px;
  height: 48px;
  background: #f0f0f0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #ccc;
}
.actions-cell { display: flex; align-items: center; gap: 6px; }
.name-cell { display: flex; align-items: center; gap: 6px; }

.btn-eye {
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.btn-eye.eye-on { background: #e8f5e9; color: #2e7d32; }
.btn-eye.eye-on:hover { background: #2e7d32; color: #fff; }
.btn-eye.eye-off { background: #f4f4f4; color: #bbb; }
.btn-eye.eye-off:hover { background: #555; color: #fff; }

.row-hidden td { opacity: .55; }
.badge-hidden {
  background: #f4f4f4;
  color: #aaa;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
  margin-left: 6px;
  vertical-align: middle;
}

.btn-edit, .btn-delete {
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-edit { background: #ffeaea; color: #c0000c; }
.btn-edit:hover { background: #c0000c; color: #fff; }
.btn-delete { background: #f4f4f4; color: #888; }
.btn-delete:hover { background: #333; color: #fff; }
.adm-empty { text-align: center; padding: 48px; color: #bbb; font-size: 15px; }

.dots-menu-wrap { position: relative; }

.btn-dots {
  background: #f4f4f4;
  border: 1.5px solid #ddd;
  border-radius: 7px;
  width: 36px; height: 36px;
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  line-height: 1;
}
.btn-dots:hover { background: #e0e0e0; }

.dots-dropdown {
  display: none;
  position: absolute;
  right: 0; top: calc(100% + 6px);
  background: #fff;
  border: 1.5px solid #eee;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  min-width: 180px;
  z-index: 50;
  overflow: hidden;
}
.dots-dropdown.open { display: block; }
.dots-dropdown button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background .15s;
  color: #333;
}
.dots-dropdown button:hover { background: #ffeaea; color: #c0000c; }
.dots-dropdown button + button { border-top: 1px solid #f0f0f0; }

.btn-toggle-all {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.btn-all-on  { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.btn-all-on:hover  { background: #2e7d32; color: #fff; border-color: #2e7d32; }
.btn-all-off { background: #f4f4f4; color: #888; border-color: #ddd; }
.btn-all-off:hover { background: #555; color: #fff; border-color: #555; }
.category-badge {
  background: #ffeaea;
  color: #c0000c;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

/* === PROMO SELECTOR === */
.promo-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}
.promo-selector-card {
  border: 2px solid #eee;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: border-color .15s, background .15s;
  position: relative;
  text-align: center;
}
.promo-selector-card:hover { border-color: #c0000c; background: #fffafa; }
.promo-selector-card.selected { border-color: #c0000c; background: #ffeaea; }
.promo-selector-card img {
  width: 70px; height: 70px;
  object-fit: contain;
  border-radius: 6px;
  background: #f5f5f5;
}
.promo-selector-card .placeholder-icon {
  width: 70px; height: 70px;
  background: #f0f0f0;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.promo-selector-card span { font-size: 12px; font-weight: 600; line-height: 1.3; color: #333; }
.promo-check {
  position: absolute;
  top: 6px; right: 6px;
  width: 20px; height: 20px;
  background: #c0000c;
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.promo-selector-card.selected .promo-check { display: flex; }

/* === BANNERS === */
.banner-form {
  background: #fafafa;
  border: 1.5px solid #eee;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 4px;
}
.banner-list { display: flex; flex-direction: column; gap: 12px; }
.banner-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fafafa;
  border: 1.5px solid #eee;
  border-radius: 10px;
  padding: 12px 16px;
  transition: border-color .15s;
}
.banner-item:hover { border-color: #c0000c; }
.banner-item.inactive { opacity: .5; }
.banner-thumb {
  width: 120px; height: 60px;
  object-fit: cover;
  border-radius: 6px;
  background: #eee;
  flex-shrink: 0;
}
.banner-thumb-placeholder {
  width: 120px; height: 60px;
  background: #f0f0f0;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #ccc; flex-shrink: 0;
}
.banner-info { flex: 1; min-width: 0; }
.banner-info strong { font-size: 14px; display: block; }
.banner-info span { font-size: 12px; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 300px; }
.banner-order { display: flex; flex-direction: column; gap: 4px; }
.btn-order {
  background: #f0f0f0; border: none; border-radius: 4px;
  width: 28px; height: 28px; cursor: pointer; font-size: 14px;
  transition: background .15s;
}
.btn-order:hover { background: #c0000c; color: #fff; }

/* === TOAST === */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #222;
  color: #fff;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s;
  z-index: 999;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: #1a7a3f; }
.toast.error { background: #c0000c; }

/* === FILTROS === */
.filter-chip {
  padding: 6px 13px;
  border: 1.5px solid #ddd;
  border-radius: 20px;
  background: #fff;
  color: #666;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.filter-chip:hover { border-color: #c0000c; color: #c0000c; background: #ffeaea; }
.filter-chip.active { background: #c0000c; border-color: #c0000c; color: #fff; }

/* === PAGINAÇÃO === */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 0 4px;
  flex-wrap: wrap;
}
.page-info {
  font-size: 13px;
  color: #888;
  margin-right: 8px;
}
.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1.5px solid #e0e0e0;
  border-radius: 7px;
  background: #fff;
  color: #444;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.page-btn:hover:not(:disabled) { background: #ffeaea; border-color: #c0000c; color: #c0000c; }
.page-btn.active { background: #c0000c; border-color: #c0000c; color: #fff; }
.page-btn:disabled { opacity: .35; cursor: not-allowed; }
.page-ellipsis { font-size: 14px; color: #aaa; padding: 0 4px; }

/* === BOTÃO CÂMERA === */
.btn-camera {
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.btn-camera.has-photo { background: #e8f0ff; color: #1a56db; }
.btn-camera.has-photo:hover { background: #1a56db; color: #fff; }
.btn-camera.no-photo { background: #fff3e0; color: #e65100; }
.btn-camera.no-photo:hover { background: #e65100; color: #fff; }

/* === MODAL FOTO RÁPIDA === */
.photo-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.photo-modal-box {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 12px 48px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.photo-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.photo-modal-title { font-size: 17px; font-weight: 700; color: #222; }
.photo-modal-sub { font-size: 13px; color: #888; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
.photo-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
  padding: 0 4px;
  transition: color .15s;
}
.photo-modal-close:hover { color: #333; }

.photo-modal-preview-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fafafa;
  border: 1.5px solid #eee;
  border-radius: 10px;
  padding: 12px 16px;
}
.photo-modal-preview-wrap img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  border-radius: 8px;
  background: #f0f0f0;
  border: 1px solid #eee;
}
.photo-modal-empty {
  height: 90px;
  background: #fafafa;
  border: 1.5px dashed #ddd;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 14px;
}
.photo-modal-inputs { display: flex; flex-direction: column; }
.photo-modal-actions { display: flex; gap: 10px; }

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-group.span2 { grid-column: span 1; }
  .stats-row { flex-wrap: wrap; }
}
