:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #101c39;
  background: #fbf8fb;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 8% 0%, #fff5f2 0, transparent 34%), #fbf8fb; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.topbar { position: sticky; top: 0; z-index: 5; border-bottom: 1px solid #e6dce9; background: rgba(255,255,255,.93); backdrop-filter: blur(14px); }
.topbar-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #13274f; font-weight: 800; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(135deg,#ff856e,#5a2f90); font-size: 13px; letter-spacing: -.02em; }
.dashboard { padding: 38px 0 64px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.intro h1 { margin: 8px 0 4px; font-size: clamp(30px, 5vw, 48px); line-height: 1.04; letter-spacing: -.045em; }
.muted { color: #6f6778; }
.intro p { margin: 0; }
.test-label { display: inline-flex; width: fit-content; padding: 5px 9px; border-radius: 999px; color: #824b00; background: #fff0b5; border: 1px solid #e9b644; font-size: 12px; font-weight: 850; letter-spacing: .04em; }
.source-status { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; }
.source-state { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 7px 10px; border-radius: 999px; border: 1px solid #ddd2e2; background: #fff; font-size: 13px; font-weight: 750; }
.source-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #d24a4a; }
.source-state.ok::before { background: #268d52; }
.source-state.paused::before { background: #70509b; }
.search { display: flex; gap: 10px; padding: 14px; border: 1px solid #ded3e3; border-radius: 17px; background: #fff; box-shadow: 0 14px 32px rgba(55,33,73,.06); }
.search input { flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; border: 1px solid #cfc3d7; border-radius: 11px; color: #101c39; background: #fff; }
.search input:focus { outline: 3px solid rgba(90,47,144,.16); border-color: #7d54ad; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 14px; border: 1px solid #5a2f90; border-radius: 10px; color: #fff; background: #5a2f90; font-weight: 780; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: #492476; }
button.ghost, .button.secondary { color: #5a2f90; background: #fff; border-color: #cdbed8; }
button.ghost:hover, .button.secondary:hover { background: #f6effa; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 20px 0 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; }
.filter { min-height: 38px; padding: 7px 13px; color: #5a2f90; background: #fff; border-color: #d4c5de; }
.filter.active { color: #fff; background: #5a2f90; border-color: #5a2f90; }
.summary { margin: 0; color: #4d4357; font-weight: 750; white-space: nowrap; }
.warning { margin: 0 0 14px; padding: 12px 14px; border: 1px solid #e9b644; border-radius: 12px; color: #7a4800; background: #fff5cb; font-weight: 650; }
.orders { display: grid; gap: 18px; }
.order-card { overflow: hidden; border: 1px solid #ddd2e2; border-radius: 18px; background: #fff; box-shadow: 0 15px 34px rgba(55,33,73,.055); }
.order-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid #ebe4ee; background: linear-gradient(135deg,#fff,#faf6fc); }
.order-head h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.015em; }
.order-head p { margin: 0; font-size: 13px; }
.order-badges { display: flex; flex-wrap: wrap; justify-content: end; gap: 7px; }
.source-badge, .status-badge { display: inline-flex; width: fit-content; min-height: 28px; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 850; }
.source-badge.a4 { color: #204b7d; background: #dcecff; border: 1px solid #a7c8ee; }
.source-badge.a3 { color: #175844; background: #daf4ea; border: 1px solid #98d7c1; }
.source-badge.round { color: #6b2b7b; background: #f2def8; border: 1px solid #d6afe2; }
.source-badge.mix-round { color: #53306f; background: #eee5ff; border: 1px solid #c5afe9; }
.source-badge.mix-square { color: #6f3e19; background: #fff0dc; border: 1px solid #e8bd87; }
.source-badge.square { color: #754014; background: #ffead6; border: 1px solid #e4b37f; }
.source-badge.mixed { color: #7e4600; background: #ffedbd; border: 1px solid #e8c25d; }
.status-badge { color: #17613a; background: #e3f5ea; border: 1px solid #b8dfc7; }
.design-rows { display: grid; }
.missing-design { border-left: 4px solid #d99715; }
.missing-design + .missing-design { border-top: 1px solid #ebe4ee; }
.pagination { margin-top: 18px; justify-content: space-between; }
button:disabled { cursor: default; opacity: .5; }
.design-row { display: grid; grid-template-columns: 190px 1fr; min-width: 0; }
.design-row + .design-row { border-top: 1px solid #ebe4ee; }
.design-preview { display: grid; min-height: 190px; place-items: center; padding: 14px; background: #f4eef6; }
.design-preview img { display: block; max-width: 100%; max-height: 180px; object-fit: contain; filter: drop-shadow(0 7px 9px rgba(31,17,43,.12)); }
.design-content { min-width: 0; padding: 18px 20px; }
.design-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 13px; }
.design-id { overflow-wrap: anywhere; font-size: 14px; }
.design-details { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 24px; margin: 0 0 16px; }
.detail-row { display: grid; grid-template-columns: 86px minmax(0,1fr); gap: 8px; font-size: 13px; }
.detail-row dt { color: #776d80; }
.detail-row dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-weight: 650; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions .button { min-height: 38px; padding: 7px 12px; font-size: 13px; }
.order-footer { display: flex; justify-content: end; padding: 12px 20px; border-top: 1px solid #ebe4ee; background: #fcfafc; }
.loading, .empty { min-height: 180px; display: grid; place-content: center; padding: 28px; text-align: center; border: 1px dashed #cdbed8; border-radius: 17px; background: #fff; }
.empty h2 { margin: 0 0 5px; }
.empty p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(450px,100%); padding: 34px; border: 1px solid #e0d5e5; border-radius: 22px; background: rgba(255,255,255,.96); box-shadow: 0 24px 70px rgba(30,17,51,.13); }
.login-card .brand { margin-bottom: 22px; }
.login-card h1 { margin: 16px 0 6px; font-size: 30px; line-height: 1.08; letter-spacing: -.035em; }
.login-card > p { margin: 0 0 22px; color: #6f6778; }
.login-card form { display: grid; gap: 10px; }
.login-card label { font-weight: 750; }
.login-card input { min-height: 48px; padding: 0 13px; border: 1px solid #cfc3d7; border-radius: 10px; }
.login-error { padding: 11px 12px; border: 1px solid #e4a5a5; border-radius: 10px; color: #8a2727 !important; background: #fff0f0; }

@media (max-width: 760px) {
  .shell { width: min(100% - 20px,1180px); }
  .dashboard { padding-top: 24px; }
  .intro { align-items: start; flex-direction: column; }
  .source-status { justify-content: start; }
  .toolbar { align-items: start; flex-direction: column; }
  .summary { white-space: normal; }
  .design-row { grid-template-columns: 124px minmax(0,1fr); }
  .design-preview { min-height: 150px; padding: 9px; }
  .design-preview img { max-height: 140px; }
  .design-details { grid-template-columns: 1fr; }
  .detail-row { grid-template-columns: 76px minmax(0,1fr); }
}

@media (max-width: 520px) {
  .topbar-inner { min-height: 62px; }
  .topbar .brand span:last-child { font-size: 14px; }
  .search { flex-direction: column; }
  .search button { width: 100%; }
  .order-head { align-items: start; flex-direction: column; }
  .order-badges { justify-content: start; }
  .design-row { grid-template-columns: 1fr; }
  .design-preview { min-height: 210px; }
  .design-preview img { max-height: 190px; }
  .design-content { padding: 16px; }
  .order-footer { justify-content: stretch; }
  .order-footer .button { width: 100%; }
  .login-card { padding: 26px 20px; }
}
