:root {
  --orange: #ee4d2d;
  --orange-dark: #d73211;
  --bg: #f5f5f5;
  --card: #fff;
  --line: #e5e5e5;
  --text: #222;
  --muted: #757575;
  --gold: #ffb400;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; }
a { color: var(--orange); }

.dash-header { background: var(--orange); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.dash-header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 12px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.logo { color: #fff; text-decoration: none; font-size: 18px; }
.logo-sub { font-weight: 400; opacity: .9; }
.shop-name { flex: 1; font-size: 14px; opacity: .95; }
.btn-header {
  border: 1px solid #fff; background: transparent; color: #fff;
  border-radius: 6px; padding: 7px 14px; font-weight: 700;
}

.dash-layout { max-width: 1200px; margin: 0 auto; display: grid; gap: 12px; padding: 12px; }
.sidebar {
  display: flex; gap: 6px; overflow-x: auto;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px;
}
.nav-btn {
  border: 0; background: transparent; border-radius: 6px;
  padding: 9px 12px; font-weight: 600; white-space: nowrap;
}
.nav-btn.active { background: #fff5f2; color: var(--orange); }
.dash-main {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px; min-width: 0;
}
.view h2 { margin: 0 0 12px; font-size: 19px; }
.note { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); }

.search-row { display: flex; gap: 8px; margin-bottom: 12px; }
.search-row input {
  flex: 1; min-width: 0;
  padding: 10px; border: 1px solid var(--line); border-radius: 6px;
}
.btn {
  border: 1px solid var(--orange); background: #fff; color: var(--orange);
  border-radius: 6px; padding: 9px 16px; font-weight: 700;
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); }
.btn-big { padding: 12px 18px; font-size: 16px; width: 100%; }
.btn-danger { border-color: #c62828; color: #c62828; }
.btn:disabled { opacity: .55; cursor: default; }

.item-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.item-card h3 { margin: 0 0 4px; font-size: 15px; }
.item-card p { margin: 3px 0; font-size: 14px; }
.item-card .meta { color: var(--muted); font-size: 13px; }
.badge-status {
  display: inline-block; font-size: 12px; font-weight: 800;
  padding: 2px 10px; border-radius: 20px;
  background: #e8f5e9; color: #2e7d32;
}
.badge-status.pending { background: #fff8e1; color: #e65100; }
.badge-status.cancelled { background: #fdecea; color: #c62828; }
.stars { color: var(--gold); letter-spacing: 1px; }
.seller-reply {
  background: #fff5f2; border-left: 3px solid var(--orange);
  padding: 8px 10px; margin-top: 8px; font-size: 14px;
}
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.reply-form { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.reply-form textarea {
  flex: 1; min-width: 220px;
  padding: 9px; border: 1px solid var(--line); border-radius: 6px;
}

#productForm label, #pwForm label, #loginForm label {
  display: block; margin-bottom: 12px; font-weight: 600;
}
#productForm textarea, #pwForm input, #loginForm input {
  display: block; width: 100%; margin-top: 4px;
  padding: 10px; border: 1px solid var(--line); border-radius: 6px;
  font-weight: 400;
}
.form-error { color: #c62828; background: #fdecea; border-radius: 6px; padding: 8px 10px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.stat-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px; text-align: center; }
.stat-card strong { display: block; font-size: 26px; color: var(--orange); }
.stat-card span { color: var(--muted); font-size: 13px; }

.panel {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 16px; overflow-y: auto;
}
.panel-box {
  background: #fff; border-radius: 12px; padding: 20px;
  width: 100%; max-width: 420px; margin-top: 12vh;
}
.panel-box h2 { margin: 0 0 4px; }
.toast {
  position: fixed; left: 50%; bottom: 24px;
  transform: translateX(-50%); z-index: 200;
  background: #222; color: #fff;
  padding: 10px 18px; border-radius: 24px; font-size: 14px;
  max-width: calc(100vw - 32px); text-align: center;
}

@media (min-width: 900px) {
  .dash-layout { grid-template-columns: 210px 1fr; align-items: start; }
  .sidebar { flex-direction: column; overflow: visible; position: sticky; top: 12px; }
  .nav-btn { text-align: left; }
}

/* hidden must win over author display rules (e.g. .panel{display:flex});
   otherwise the browser's default [hidden]{display:none} is overridden and hidden panels stay visible. */
[hidden] { display: none !important; }
