:root {
  --primary: #1b2a4a;
  --primary-dark: #101c36;
  --accent: #f5a623;
  --accent-dark: #c67f0a;
  --success: #4caf50;
  --error: #e53935;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --muted: #6b7280;
  --border: #e5e7eb;
  --text: #1f2937;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06),
    0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Poppins", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
}
p {
  margin: 0;
}
a {
  color: var(--primary);
  text-decoration: none;
}
button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
button:hover {
  box-shadow: var(--shadow-sm);
}
button:active {
  transform: translateY(1px);
}
button.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
button.accent {
  background: var(--accent);
  color: #fff;
}
button.danger {
  background: var(--error);
}
button.link {
  background: transparent;
  color: var(--primary);
  padding: 0;
  font-weight: 500;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 0.8rem;
}
.error {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.brand h1 {
  font-size: 1.15rem;
  line-height: 1;
}

/* ===== AUTH ===== */
.auth-section {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(
      ellipse at 0 0,
      rgba(245, 166, 35, 0.2),
      transparent 60%
    ),
    linear-gradient(160deg, #0e1a36, #1b2a4a 55%, #2a3e69);
}
.auth-card {
  width: 380px;
  max-width: calc(100% - 32px);
  background: var(--surface);
  padding: 28px;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  color: #1f2937;
  border: 1px solid var(--border);
  padding: 0.8rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  width: 100%;
}
.google-btn:hover {
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.1);
}
.google-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.85rem;
}
input,
textarea,
select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 42, 74, 0.12);
}
textarea {
  min-height: 140px;
  resize: vertical;
  font-family: "Menlo", "Monaco", monospace;
  font-size: 0.82rem;
}

/* ===== SHELL ===== */
#shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--primary);
  color: #fff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.sidebar .brand h1,
.sidebar .muted {
  color: #fff;
}
.sidebar .muted {
  opacity: 0.7;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.sidebar nav a {
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}
.sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.sidebar nav a.active {
  background: rgba(245, 166, 35, 0.18);
  color: var(--accent);
}
.badge {
  background: rgba(245, 166, 35, 0.9);
  color: #101c36;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 22px;
  text-align: center;
}
.badge:empty {
  display: none;
}
.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-footer .link {
  color: var(--accent);
}

main {
  padding: 28px 32px;
  overflow-y: auto;
}

/* ===== PAGE ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}
.page-header h2 {
  font-size: 1.4rem;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar input,
.toolbar select {
  width: auto;
  min-width: 240px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  border: 1px solid var(--border);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.commerce-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.commerce-card .photo {
  aspect-ratio: 16 / 9;
  background: #eef0f6;
  border-radius: 10px;
  object-fit: cover;
  width: 100%;
}
.commerce-card h3 {
  font-size: 1rem;
}
.commerce-card .meta {
  color: var(--muted);
  font-size: 0.82rem;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(27, 42, 74, 0.08);
  color: var(--primary);
}
.chip.pending {
  background: rgba(245, 166, 35, 0.15);
  color: var(--accent-dark);
}
.chip.approved {
  background: rgba(76, 175, 80, 0.15);
  color: var(--success);
}
.chip.rejected {
  background: rgba(229, 57, 53, 0.12);
  color: var(--error);
}
.chip.private {
  background: rgba(107, 114, 128, 0.15);
  color: var(--muted);
}

.socials {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.socials a {
  font-size: 0.78rem;
  padding: 3px 10px;
  background: var(--bg);
  border-radius: 999px;
  border: 1px solid var(--border);
}
.actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.actions button {
  flex: 1;
  padding: 0.5rem 0.5rem;
}

.empty {
  text-align: center;
  padding: 48px;
  color: var(--muted);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

/* ===== TABLE ===== */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
thead {
  background: #f8fafc;
}
th,
td {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
}
th {
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.72rem;
}

/* ===== MODAL ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: grid;
  place-items: center;
  z-index: 80;
  padding: 16px;
}
.modal {
  width: 520px;
  max-width: 100%;
  background: var(--surface);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 90vh;
  overflow-y: auto;
}

/* ===== TOAST ===== */
#toasts {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 90;
}
.toast {
  background: var(--primary-dark);
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  max-width: 320px;
  font-size: 0.88rem;
  animation: slide 0.25s ease;
}
.toast.error {
  background: var(--error);
}
.toast.success {
  background: var(--success);
}
@keyframes slide {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ===== PUBLIC PAGES (/public) ===== */
.public-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}
.public-card {
  width: 100%;
  max-width: 640px;
  background: var(--surface);
  padding: 32px;
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.public-card h1 {
  font-size: 1.6rem;
}
.public-card .version {
  color: var(--muted);
  font-size: 0.85rem;
}
.terms-content {
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Small screens */
@media (max-width: 720px) {
  #shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }
  .sidebar nav {
    flex-direction: row;
  }
  .sidebar-footer {
    display: none;
  }
  main {
    padding: 20px;
  }
}
