/* Painéis Admin + Cliente — estende a identidade visual do site */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT,WONK@0,9..144,300..800,0..100,0..1;1,9..144,300..800,0..100,0..1&family=Karla:ital,wght@0,400..800;1,400..700&display=swap");

:root {
  --red-900: #6e140f;
  --red-800: #8e2119;
  --red-700: #a82a1f;
  --red-600: #c2312c;
  --red-500: #d2453c;
  --red-400: #e0716a;
  --cream-50: #fffcf5;
  --cream-100: #f7f1e3;
  --cream-200: #efe5d1;
  --chocolate: #3a2318;
  --chocolate-soft: #6e5445;
  --text-muted: #705a4c;
  --border: rgba(58, 35, 24, 0.14);
  --border-strong: rgba(58, 35, 24, 0.24);
  --white: #fff;
  --surface: #fffcf5;
  --ink-deep: #2a1710;
  --success: #1a6b43;
  --warning: #b8860b;
  --info: #1a5f7a;
  --shadow: 0 2px 4px rgba(58, 35, 24, 0.04), 0 22px 44px -28px rgba(58, 35, 24, 0.45);
  --shadow-sm: 0 1px 2px rgba(58, 35, 24, 0.05), 0 10px 26px -20px rgba(58, 35, 24, 0.4);
  --radius: 16px;
  --sidebar-w: 262px;
  --font: "Karla", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  --vf-display: "opsz" 120, "SOFT" 28, "WONK" 1;
}

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

body {
  font-family: var(--font);
  background-color: var(--cream-100);
  background-image: radial-gradient(circle at 1px 1px, rgba(58, 35, 24, 0.05) 1px, transparent 0);
  background-size: 34px 34px;
  color: var(--chocolate);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-variation-settings: var(--vf-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}

:focus-visible {
  outline: 2px solid var(--red-600);
  outline-offset: 2px;
  border-radius: 4px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background-image: radial-gradient(
      ellipse 60% 50% at 20% 0%,
      rgba(194, 49, 44, 0.1),
      transparent 60%
    ),
    radial-gradient(circle at 1px 1px, rgba(58, 35, 24, 0.05) 1px, transparent 0);
  background-size: auto, 34px 34px;
}

.auth-card {
  width: min(100%, 420px);
  background: var(--white);
  border-radius: 22px;
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.auth-card .logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  display: block;
  box-shadow: 0 0 0 1px var(--border-strong);
}

.auth-card h1 {
  text-align: center;
  color: var(--red-800);
  font-size: 1.65rem;
  margin-bottom: 0.3rem;
}

.auth-card .sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 0.9rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--chocolate-soft);
  margin-bottom: 0.35rem;
}

.form-group label {
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.72rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--cream-50);
  color: var(--chocolate);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--red-500);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(194, 49, 44, 0.14);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.72rem 1.3rem;
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
  background: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--red-600);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

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

.btn-secondary {
  background: transparent;
  color: var(--red-800);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: rgba(194, 49, 44, 0.08);
  border-color: var(--red-500);
}

.btn-ghost {
  background: transparent;
  color: var(--chocolate-soft);
}

.btn-ghost:hover {
  background: rgba(58, 35, 24, 0.07);
  color: var(--red-800);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
}

.btn-block {
  width: 100%;
}

.btn-danger {
  background: #9b1c1c;
  color: #fff;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.alert-error {
  background: #fde8ec;
  color: #9b1c1c;
}

.alert-success {
  background: #e6f6ee;
  color: var(--success);
}

.alert-info {
  background: #e8f4f8;
  color: var(--info);
}

.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.text-center {
  text-align: center;
}

/* Layout painel */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, var(--ink-deep), #180c07);
  color: #fff;
  padding: 1.25rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.6rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 1rem;
}

.sidebar-brand img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
}

.sidebar-brand img {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.sidebar-brand strong {
  display: block;
  font-family: var(--display);
  font-variation-settings: var(--vf-display);
  font-weight: 600;
  font-size: 1.1rem;
}

.sidebar-brand span {
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.6;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0.25rem;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.nav-link.active {
  background: var(--red-600);
  color: #fff;
}

.nav-link .badge {
  margin-left: auto;
  background: #fff;
  color: var(--red-700);
  font-size: 0.7rem;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 5px;
}

.main {
  padding: 1.5rem 1.75rem 3rem;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.topbar h1 {
  font-size: 1.8rem;
  color: var(--red-800);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem 0.35rem 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.user-chip .av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red-600);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.stat-card .label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.stat-card .value {
  font-family: var(--display);
  font-variation-settings: var(--vf-display);
  font-size: 1.85rem;
  font-weight: 600;
  color: var(--red-800);
  font-variant-numeric: tabular-nums;
  margin-top: 0.25rem;
}

.panel {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.panel-head h2 {
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.panel-body {
  padding: 1rem 1.2rem;
}

.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.data th,
table.data td {
  text-align: left;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.data th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  font-weight: 700;
  background: var(--cream-50);
}

table.data tr:hover td {
  background: rgba(194, 49, 44, 0.035);
}

.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.st-pending {
  background: #fef3c7;
  color: #92400e;
}
.st-wait {
  background: #e0e7ff;
  color: #3730a3;
}
.st-paid,
.st-ok {
  background: #d1fae5;
  color: #065f46;
}
.st-prep {
  background: #ffedd5;
  color: #9a3412;
}
.st-ready {
  background: #cffafe;
  color: #155e75;
}
.st-ship {
  background: #dbeafe;
  color: #1e40af;
}
.st-done {
  background: #16a34a;
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.25);
}
.st-cancel {
  background: #fee2e2;
  color: #991b1b;
}

/* Timeline de status do pedido (cliente) */
.status-track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin: 0.65rem 0 0.75rem;
}

.track-step {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
}

.track-step.done {
  background: #bbf7d0;
  color: #166534;
}

.track-step.current {
  background: #16a34a;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25);
}

.track-step.cancel {
  background: #fee2e2;
  color: #991b1b;
}

.track-line {
  width: 10px;
  height: 2px;
  background: #e5e7eb;
  flex-shrink: 0;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.chip {
  border: 1px solid var(--border-strong);
  background: transparent;
  border-radius: 999px;
  padding: 0.42rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--chocolate-soft);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.chip:hover {
  border-color: var(--red-500);
  color: var(--red-800);
}

.chip.active {
  background: var(--red-800);
  border-color: var(--red-800);
  color: var(--cream-50);
}

.order-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: var(--cream-50);
}

.order-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.order-card-head strong {
  color: var(--red-800);
}

.order-items {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0.4rem 0;
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 16, 11, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 20px;
  width: min(100%, 520px);
  max-height: 90vh;
  overflow: auto;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.modal h3 {
  color: var(--red-800);
  font-size: 1.45rem;
  margin-bottom: 1rem;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--chocolate);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 300;
  transition: transform 0.3s;
  max-width: 90vw;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.notify {
  background: var(--red-700);
  animation: pulse 1s ease 2;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(194, 49, 44, 0.5);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(194, 49, 44, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

.settings-section-title {
  font-size: 1.2rem;
  color: var(--red-800);
  margin: 1.35rem 0 0.85rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.settings-section-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.logo-upload-row {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.logo-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  background: #fff;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.55rem;
}

.theme-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 0.55rem;
  cursor: pointer;
  background: #fff;
  text-align: left;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

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

.theme-card.active {
  border-color: var(--red-600);
  box-shadow: 0 0 0 2px rgba(194, 49, 44, 0.16);
}

.theme-swatch {
  height: 28px;
  border-radius: 8px;
  margin-bottom: 0.4rem;
  background: linear-gradient(90deg, var(--a), var(--b));
}

.theme-card strong {
  display: block;
  font-size: 0.75rem;
  line-height: 1.25;
  color: var(--chocolate);
}

.theme-card small {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.mobile-toggle {
  display: none;
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 150;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--red-600);
  color: #fff;
  font-size: 1.3rem;
  box-shadow: 0 10px 30px -8px rgba(194, 49, 44, 0.55);
  cursor: pointer;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-w);
    transform: translateX(-105%);
    transition: transform 0.25s;
    z-index: 120;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-toggle {
    display: grid;
    place-items: center;
  }
  .main {
    padding: 1rem;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Gallery on public (extra) */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.gallery-item {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.gallery-item .cap {
  padding: 0.65rem 0.75rem;
}

.gallery-item .cap strong {
  display: block;
  font-size: 0.88rem;
  color: var(--red-800);
}

.gallery-item .cap span {
  font-size: 0.78rem;
  color: var(--text-muted);
}
