:root {
  --ink: #172033;
  --muted: #647084;
  --line: #d9e1ec;
  --panel: #ffffff;
  --page: #f4f7fb;
  --blue: #1eb0e4;
  --green: #21a67a;
  --red: #d93f3f;
  --amber: #bd7a11;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
}

a { color: inherit; }
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #111827; color: #f8fafc; padding: 24px 18px; }
.brand { font-weight: 800; font-size: 18px; margin-bottom: 28px; }
.nav { display: grid; gap: 8px; }
.nav a { text-decoration: none; color: #cbd5e1; padding: 10px 12px; border-radius: 8px; }
.nav a.is-active, .nav a:hover { color: #fff; background: rgba(255,255,255,.1); }
.main { padding: 28px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
h1 { font-size: 28px; margin: 0; letter-spacing: 0; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.stat strong { display: block; font-size: 28px; margin-top: 6px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0; }
.toolbar.spread { justify-content: space-between; }
.pagination { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pagination a, .pagination span {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 8px 11px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
}
.pagination .is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.order-row { cursor: pointer; }
.order-row.is-selected, .order-row:hover { background: #f3fbff; }
.button, button {
  appearance: none;
  border: 1px solid #0d8fbe;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.button.secondary, button.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.button.danger { background: var(--red); border-color: var(--red); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 260px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
label { display: grid; gap: 6px; font-weight: 700; }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; color: var(--muted); background: #f8fafc; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 800; }
.pill.design_pending { background: #fff4d6; color: var(--amber); }
.pill.review_pending { background: #dff4ff; color: #087ca7; }
.pill.approved, .pill.production, .pill.completed { background: #dcfce7; color: var(--green); }
.pill.cancelled { background: #fee2e2; color: var(--red); }
.flash { border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; background: #dcfce7; color: #166534; }
.flash.error { background: #fee2e2; color: #991b1b; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.order-detail { grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); }
.preview-img { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; }
.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.detail-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}
.detail-item span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; font-weight: 800; }
.detail-item strong { display: block; margin-top: 4px; }
.image-box {
  min-height: 260px;
  border: 1px dashed #b9c6d8;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fbfdff;
  overflow: hidden;
}
.image-box img { width: 100%; height: 100%; object-fit: contain; max-height: 360px; }
.inline-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.inline-form label { min-width: 220px; flex: 1; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .stats, .order-detail { grid-template-columns: 1fr; }
  .main { padding: 18px; }
  table { display: block; overflow-x: auto; }
  .detail-list { grid-template-columns: 1fr; }
}
