:root {
  --bg: #10131a;
  --panel: #171b24;
  --muted: #98a2b3;
  --text: #f3f6fb;
  --line: #2b3242;
  --accent: #E07A5F;
  --accent-2: #D97706;
  --ok: #2db386;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "DM Sans", sans-serif;
  background: radial-gradient(circle at 15% 0%, #1a2233 0%, var(--bg) 45%);
  color: var(--text);
}

.sync-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 0.7rem 1rem;
  text-align: center;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  z-index: 30;
}

.admin-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.panel {
  background: rgba(23, 27, 36, 0.95);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
}

.login-panel {
  max-width: 420px;
  margin: 4rem auto;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.55rem;
}

p,
small {
  color: var(--muted);
}

label {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.toggle-row input[type="checkbox"] {
  width: auto;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #0f141e;
  color: var(--text);
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

.btn {
  border: 1px solid var(--line);
  color: var(--text);
  background: #121826;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  font-weight: 700;
}

.btn.primary {
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.btn.ghost {
  background: transparent;
}

.error {
  color: var(--danger);
  min-height: 1.1rem;
}

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

.head-actions {
  display: flex;
  gap: 0.6rem;
}

.search-panel {
  margin-bottom: 1rem;
}

.stock-filters {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.7rem;
  flex-wrap: wrap;
}

.filter-tab.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.grid {
  display: grid;
  grid-template-columns: 1.9fr 1fr;
  gap: 1rem;
}

.lower-grid {
  margin-top: 1rem;
}

.account-panel {
  min-height: 260px;
}

.account-email {
  margin-bottom: 0.75rem;
  color: var(--muted);
}

.account-form label input {
  margin-bottom: 0.4rem;
}

.account-form .btn {
  margin-top: 0.2rem;
}

.account-message {
  min-height: 1.2rem;
  font-size: 0.8rem;
  margin-top: 0.4rem;
}

.account-message.ok {
  color: var(--ok);
}

.account-message.error {
  color: var(--danger);
}

.blog-media-preview {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin: 0.35rem 0 0.65rem;
}

#blog-image-clear {
  margin: 0 0 0.45rem;
  width: fit-content;
}

.content-panel h3 {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.content-panel .category-list > div {
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.content-panel .category-list button {
  margin-top: 0.3rem;
   margin-right: 0.25rem;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.65rem 0.45rem;
  text-align: left;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: rgba(224, 122, 95, 0.12);
}

td img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
}

.mono {
  font-family: "JetBrains Mono", monospace;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

.category-list {
  display: grid;
  gap: 0.45rem;
}

.category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: start;
}

.category-row input {
  margin: 0;
}

.category-main {
  display: grid;
  gap: 0.45rem;
}

.category-media-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 0.5rem;
  align-items: center;
}

.category-thumb {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.category-thumb.placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  color: var(--muted);
  background: #0f141e;
}

#product-image-preview {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  margin-bottom: 0.6rem;
}

#drawer-image-preview {
  width: 88px;
  height: 88px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  margin-bottom: 0.7rem;
}

pre {
  white-space: pre-wrap;
  background: #0d121a;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem;
  font-family: "JetBrains Mono", monospace;
  max-height: 380px;
  overflow: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: min(420px, 92vw);
  height: 100vh;
  background: #121824;
  border-left: 1px solid var(--line);
  padding: 1rem;
  transition: right 0.25s ease;
  z-index: 25;
}

.drawer.open {
  right: 0;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.stock-chip {
  display: inline-block;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.stock-chip.in {
  background: rgba(45, 179, 134, 0.2);
  color: #54d7aa;
}

.stock-chip.low {
  background: rgba(224, 122, 95, 0.2);
  color: #ffc0aa;
}

.stock-chip.out {
  background: rgba(255, 107, 107, 0.2);
  color: #ff9f9f;
}

.stock-chip.order {
  background: rgba(217, 119, 6, 0.22);
  color: #ffd39b;
}

.orders-panel {
  margin-top: 1rem;
}

.orders-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.55rem 0 0.4rem;
}

.orders-queue-meta {
  margin: 0 0 0.7rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.status-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: capitalize;
}

.status-badge.pending {
  background: rgba(217, 119, 6, 0.22);
  color: #ffd39b;
}

.status-badge.paid {
  background: rgba(45, 179, 134, 0.2);
  color: #54d7aa;
}

.status-badge.flagged {
  background: rgba(255, 107, 107, 0.2);
  color: #ff9f9f;
}

.receipt-link {
  color: #c9d7ff;
  text-decoration: underline;
  font-size: 0.78rem;
}

.receipt-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  margin-top: 0.3rem;
}

.receipt-preview {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  display: block;
  margin: 0 0 0.35rem;
}

.receipt-file-tag {
  display: inline-block;
  margin: 0 0 0.35rem;
  font-size: 0.74rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.row-actions {
  display: flex;
  gap: 0.4rem;
}

.btn.danger {
  border: 1px solid rgba(255, 107, 107, 0.45);
  color: #ff9f9f;
  background: transparent;
}

.btn.mini {
  font-size: 0.75rem;
  padding: 0.35rem 0.5rem;
}

.category-actions {
  display: inline-flex;
  gap: 0.4rem;
}

@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .dashboard-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
