/* Painel administrativo — visual simples e funcional, reaproveita as cores do site público */
:root {
  --a-primary: #b3c441;
  --a-primary-dark: #8fa02b;
  --a-dark: #24262b;
  --a-sidebar: #2f3237;
  --a-bg: #f4f5f7;
  --a-border: #e1e3e8;
  --a-danger: #c0392b;
  --a-text: #24262b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Arial, sans-serif;
  background: var(--a-bg);
  color: var(--a-text);
}

a { color: var(--a-primary-dark); }

.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 230px;
  background: var(--a-sidebar);
  color: #fff;
  flex-shrink: 0;
  padding: 20px 0;
}

.admin-sidebar__brand {
  font-weight: 700;
  font-size: 18px;
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 10px;
}

.admin-sidebar nav a {
  display: block;
  padding: 11px 20px;
  color: #cfd2d6;
  text-decoration: none;
  font-size: 14px;
}

.admin-sidebar__group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  margin-top: 4px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8b8f96;
  cursor: pointer;
}

.admin-sidebar__group-label:hover { color: #cfd2d6; }

.admin-sidebar__group-arrow {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  margin-right: 2px;
}

.admin-sidebar__group.is-open .admin-sidebar__group-arrow { transform: rotate(45deg); }

.admin-sidebar__group-items { display: none; }

.admin-sidebar__group.is-open .admin-sidebar__group-items { display: block; }

.admin-sidebar nav a:hover,
.admin-sidebar nav a.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-left: 3px solid var(--a-primary);
}

.admin-main { flex: 1; min-width: 0; }

.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--a-border);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-topbar .user-info { font-size: 14px; color: #666; }

.admin-content { padding: 28px; }

.card {
  background: #fff;
  border: 1px solid var(--a-border);
  border-radius: 8px;
  padding: 22px;
  margin-bottom: 20px;
}

.card h2, .card h3 { margin-top: 0; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--a-border); font-size: 14px; }
th { color: #666; font-weight: 600; font-size: 13px; text-transform: uppercase; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge--green { background: #e9f7e0; color: #2e6b1f; }
.badge--gray { background: #eee; color: #666; }
.badge--yellow { background: #fff6db; color: #8a6d00; }
.badge--red { background: #fbe3e3; color: #8a1f1f; }
.sac-status-btn { border: none; font: inherit; cursor: pointer; }
.sac-status-btn:hover { filter: brightness(0.95); }

.btn {
  display: inline-block;
  background: var(--a-primary);
  color: #1c2000;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
}
.btn:hover { background: var(--a-primary-dark); text-decoration: none; }
.btn--secondary { background: #e5e6ea; color: #333; }
.btn--secondary:hover { background: #d5d7dc; }
.btn--danger { background: var(--a-danger); color: #fff; }
.btn--danger:hover { background: #a53225; }
.btn--sm { padding: 5px 12px; font-size: 13px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.form-group .hint { font-size: 12px; color: #888; margin-top: 4px; }

input[type=text], input[type=email], input[type=password], input[type=url], input[type=number],
select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--a-border);
  border-radius: 5px;
  font-size: 14px;
  font-family: inherit;
}

textarea { resize: vertical; }

.actions-row { display: flex; gap: 10px; margin-top: 18px; }

.sac-modal { position:fixed; inset:0; background:rgba(0,0,0,.45); display:flex; align-items:center; justify-content:center; z-index:100; }
.sac-modal[hidden] { display:none; }
.sac-modal__box { background:#fff; border-radius:10px; padding:24px; max-width:420px; width:90%; max-height:85vh; overflow-y:auto; }
.sac-modal__box h3 { margin-top:0; }
.sac-modal__actions { display:flex; gap:10px; margin-top:18px; }

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--a-sidebar);
}

.login-box {
  background: #fff;
  padding: 36px;
  border-radius: 10px;
  width: 100%;
  max-width: 380px;
}

.login-box h1 { font-size: 20px; margin-top: 0; }

.flash { padding: 10px 14px; border-radius: 5px; margin-bottom: 16px; font-size: 13px; }
.flash--success { background: #e9f7e0; color: #2e6b1f; border: 1px solid #b8dfa4; }
.flash--error { background: #fdeaea; color: #a02121; border: 1px solid #f3b6b6; }
.flash--info { background: #eaf2fb; color: #205a9e; border: 1px solid #b6d3f3; }
.flash--warning { background: #fff3cd; color: #8a6d00; border: 1px solid #ffe69c; font-weight: 600; }

.text-muted { color: #888; font-size: 13px; }
.sort-controls a { text-decoration: none; font-size: 16px; padding: 0 4px; }

.sac-product-picker { position: relative; }
.sac-product-suggestions { position: absolute; z-index: 50; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--a-border); border-radius: 8px; margin-top: 4px; max-height: 220px; overflow-y: auto; box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.sac-product-suggestion { padding: 8px 12px; cursor: pointer; font-size: 14px; }
.sac-product-suggestion:hover { background: #f0f1f3; }
.sac-product-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.sac-product-row .sac-product-picker { flex: 1; }
.sac-product-row__meta { display: flex; gap: 8px; align-items: center; }
.sac-product-row .pp-qty { width: 70px; padding: 10px 8px; border: 1px solid var(--a-border); border-radius: 8px; }
.sac-product-row .pp-cost { width: 110px; padding: 10px 8px; border: 1px solid var(--a-border); border-radius: 8px; }
.sac-product-row .pp-cost:disabled { background: #f4f5f7; color: #888; }
.sac-product-row--stacked { flex-direction: column; align-items: stretch; }
.sac-product-row--stacked .sac-product-picker { flex: none; width: 100%; }
.sac-product-row--stacked .sac-product-row__meta { flex-wrap: wrap; }

.sac-pending-files { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.sac-pending-files li { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #f4f5f7; border: 1px solid var(--a-border); border-radius: 6px; padding: 6px 10px; font-size: 13px; }
.sac-pending-files button { background: none; border: none; color: #a02121; cursor: pointer; font-size: 13px; padding: 0; }

.icon-refresh-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--a-border); background: #fff; color: #555; font-size: 16px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-refresh-btn:hover { background: #f0f1f3; }
.icon-refresh-btn.is-cooldown { opacity: .4; cursor: not-allowed; }
.icon-refresh-btn.is-spinning { animation: icon-refresh-spin .8s linear; }
@keyframes icon-refresh-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
