@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
  --blue: #2986cc;
  --orange: #e77011;
  --ink: #343a40;
  --paper: #f3f7fa;
  --surface: #ffffff;
  --line: #dce5ec;
  --muted: #687987;
  --soft-blue: #e9f4fc;
  --soft-orange: #fff2e7;
  --green: #247758;
  --red: #b74d48;
  --shadow: 0 8px 22px rgba(34, 67, 91, .07);
  --font-body: 'DM Sans', sans-serif;
  --font-display: 'Manrope', sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: #176da9; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { outline-offset: 3px; }
:focus-visible { outline: 3px solid rgba(41, 134, 204, .36); }
.app-frame { min-height: 100dvh; }
.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(18px, 4vw, 58px);
  background: var(--ink);
  color: white;
  border-bottom: 4px solid var(--blue);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: white;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.04em;
}
.brand:hover { color: white; }
.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px 8px 8px 2px;
  background: var(--blue);
  color: white;
  font-size: 12px;
  letter-spacing: -.04em;
}
.brand small {
  display: block;
  color: #bdc9d1;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.top-actions { display: flex; align-items: center; gap: 18px; }
.top-label { color: #c7d0d6; font-size: 13px; }
.top-actions form { margin: 0; }
.logout-button {
  border: 1px solid #64717b;
  border-radius: 6px;
  padding: 7px 12px;
  background: transparent;
  color: white;
  cursor: pointer;
  font-size: 13px;
}
.logout-button:hover { background: #46525b; }
.page-shell { width: min(1440px, 100%); margin: 0 auto; padding: 32px clamp(16px, 4vw, 54px) 60px; }
.breadcrumbs { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.breadcrumbs a { font-weight: 600; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 22px; margin-bottom: 25px; }
.page-heading h1, .auth-heading h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(27px, 3.6vw, 38px);
  font-weight: 800;
  letter-spacing: -.055em;
  line-height: 1.12;
}
.page-heading p { margin: 8px 0 0; color: var(--muted); }
.heading-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 15px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--blue); }
.button-primary:hover { color: white; background: #1c75b8; }
.button-secondary { color: var(--ink); border-color: var(--line); background: white; }
.button-secondary:hover { color: var(--ink); background: #f4f8fa; }
.button-danger { color: white; background: var(--red); }
.button-danger:hover { color: white; background: #9e3e3a; }
.button-warm { color: #8a3c05; background: var(--soft-orange); border-color: #f5d3b7; }
.button-small { min-height: 34px; padding: 7px 10px; font-size: 13px; }
.message-stack { display: grid; gap: 8px; margin: 0 0 20px; }
.message { padding: 11px 14px; border: 1px solid #badccc; border-radius: 6px; background: #eff8f2; color: #215e40; }
.message.error { border-color: #ecc5c1; background: #fff2f0; color: #8d3832; }
.panel { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); }
.filter-panel { padding: 17px; margin-bottom: 22px; }
.filter-grid { display: grid; grid-template-columns: minmax(220px, 1.7fr) repeat(3, minmax(135px, 1fr)) auto; gap: 11px; align-items: end; }
.field-label { display: block; margin: 0 0 6px; color: #4e606d; font-size: 12px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.control, .form-control, .form-select {
  display: block;
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd8e1;
  border-radius: 6px;
  padding: 9px 11px;
  background: white;
  color: var(--ink);
}
.control:focus, .form-control:focus, .form-select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(41, 134, 204, .12); outline: 0; }
.filter-actions { display: flex; gap: 8px; }
.view-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 15px; }
.result-count { color: var(--muted); font-size: 13px; }
.result-count strong { color: var(--ink); }
.view-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.view-switch a { padding: 6px 11px; border-radius: 4px; color: #586976; font-size: 13px; font-weight: 700; }
.view-switch a[aria-current="page"] { color: white; background: var(--ink); }
.kanban-wrap { overflow-x: auto; padding-bottom: 9px; }
.kanban { display: grid; grid-auto-columns: minmax(258px, 1fr); grid-auto-flow: column; gap: 14px; min-width: max-content; align-items: start; }
.kanban-column { width: 280px; min-height: 190px; overflow: hidden; border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: 8px; background: #edf3f7; }
.kanban-column[data-status="printing"], .kanban-column[data-status="ready"] { border-top-color: var(--orange); }
.kanban-column[data-status="failed"], .kanban-column[data-status="canceled"] { border-top-color: #9b6461; }
.column-head { padding: 13px 13px 11px; border-bottom: 1px solid #d9e3e9; }
.column-title-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.column-title-row h2 { margin: 0; font: 800 15px var(--font-display); }
.count-pill { display: inline-grid; min-width: 26px; height: 24px; place-items: center; border-radius: 12px; background: #d9eaf6; color: #1c6ca5; font-size: 12px; font-weight: 800; }
.column-totals { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 6px; color: var(--muted); font-size: 11px; }
.order-stack { display: grid; gap: 9px; padding: 10px; }
.order-card { display: block; padding: 12px; border: 1px solid #dce5eb; border-radius: 7px; background: white; color: var(--ink); box-shadow: 0 2px 5px rgba(45, 72, 89, .035); transition: transform .16s ease, border-color .16s ease; }
.order-card:hover { color: var(--ink); border-color: #9cc6e2; transform: translateY(-2px); }
.order-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.order-number { color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.order-customer { margin: 4px 0 0; font: 700 15px var(--font-display); overflow-wrap: anywhere; }
.order-kind { margin: 5px 0 10px; color: var(--muted); font-size: 13px; }
.card-meta { display: flex; justify-content: space-between; gap: 8px; color: #536571; font-size: 12px; }
.badge { display: inline-flex; align-items: center; border-radius: 4px; padding: 3px 7px; background: #edf2f5; color: #4e5e69; font-size: 11px; font-weight: 700; }
.badge-high, .badge-super_high { background: var(--soft-orange); color: #a54d0c; }
.badge-low { background: #eef2e6; color: #566d31; }
.deadline-late { color: #b64c43; font-weight: 700; }
.cap-note { margin: 0 11px 12px; padding: 9px; border-left: 3px solid var(--orange); background: #fff7f0; color: #6e5744; font-size: 12px; }
.cap-note a { font-weight: 700; }
.empty-column { padding: 16px 13px; color: #82919c; font-size: 13px; }
.table-panel { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.orders-table { width: 100%; border-collapse: collapse; text-align: left; }
.orders-table th { padding: 12px 14px; color: #62727e; background: #f4f8fa; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.orders-table td { padding: 13px 14px; border-top: 1px solid #e6edf1; vertical-align: middle; }
.orders-table tbody tr:hover { background: #f8fbfd; }
.table-customer { color: var(--ink); font-weight: 700; }
.table-customer:hover { color: var(--blue); }
.table-subline { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 400; }
.empty-state { display: grid; min-height: 230px; place-items: center; padding: 30px; text-align: center; }
.empty-mark { display: grid; width: 46px; height: 46px; margin: 0 auto 13px; place-items: center; border-radius: 50%; background: var(--soft-blue); color: var(--blue); font: 800 18px var(--font-display); }
.empty-state h2 { margin: 0; font: 800 18px var(--font-display); }
.empty-state p { max-width: 420px; margin: 7px auto 16px; color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 16px; border-top: 1px solid var(--line); }
.pagination a, .pagination span { min-width: 34px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 5px; background: white; color: var(--ink); text-align: center; font-size: 13px; }
.pagination .current { border-color: var(--blue); background: var(--blue); color: white; }
.pagination .disabled { color: #a3afb7; background: #f5f7f8; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(270px, .85fr); align-items: start; gap: 19px; }
.detail-primary, .detail-aside { display: grid; gap: 18px; }
.section-panel { padding: 20px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 15px; font: 800 17px var(--font-display); letter-spacing: -.025em; }
.section-title small { color: var(--muted); font: 500 12px var(--font-body); }
.detail-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: 13px 0 0; }
.detail-customer { margin: 0; font: 800 clamp(24px, 4vw, 32px) var(--font-display); letter-spacing: -.05em; }
.detail-type { margin: 5px 0 0; color: var(--muted); }
.data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.data-item { min-width: 0; padding: 12px 0; border-top: 1px solid #eaf0f3; }
.data-item dt { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.data-item dd { margin: 4px 0 0; color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: 12px; padding-bottom: 18px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { z-index: 1; width: 11px; height: 11px; margin-top: 4px; border: 3px solid #c5e0f2; border-radius: 50%; background: var(--blue); }
.timeline-item:not(:last-child)::after { position: absolute; top: 13px; bottom: 0; left: 5px; width: 1px; background: #dce6ec; content: ""; }
.timeline-status { font-weight: 700; }
.timeline-meta { margin-top: 3px; color: var(--muted); font-size: 12px; }
.duration-list { display: grid; gap: 10px; }
.duration-row { display: flex; justify-content: space-between; gap: 14px; padding-bottom: 9px; border-bottom: 1px solid #edf1f4; }
.duration-row:last-child { padding-bottom: 0; border-bottom: 0; }
.duration-row strong { font-variant-numeric: tabular-nums; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 275px; align-items: start; gap: 18px; }
.form-main { display: grid; gap: 15px; }
.form-section { padding: 20px; }
.form-section-header { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 15px; }
.form-section-header h2 { margin: 0; font: 800 17px var(--font-display); }
.form-section-header p { margin: 0; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-group { min-width: 0; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { display: block; margin-bottom: 6px; color: #4e606d; font-size: 13px; font-weight: 700; }
.form-group .help-text { margin-top: 5px; color: var(--muted); font-size: 12px; }
.form-control, .form-select { min-height: 42px; }
textarea.form-control { min-height: 80px; resize: vertical; }
.check-row { display: flex; align-items: center; gap: 9px; min-height: 42px; }
.form-check-input { width: 18px; height: 18px; accent-color: var(--blue); }
.field-error, .form-error { margin: 5px 0 0; color: #a23d37; font-size: 12px; }
.form-error-box { margin-bottom: 15px; padding: 12px 14px; border: 1px solid #e9c1bd; border-radius: 6px; background: #fff2f0; color: #8d3832; }
.form-error-box ul { margin: 6px 0 0; padding-left: 19px; }
.required-note { margin: 0 0 12px; color: #775631; font-size: 12px; }
.form-aside { position: sticky; top: 18px; padding: 18px; }
.form-aside h2 { margin: 0 0 8px; font: 800 16px var(--font-display); }
.form-aside p { margin: 0 0 13px; color: var(--muted); font-size: 13px; }
.status-requirements { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.status-requirements li { padding: 9px; border-radius: 5px; background: #f3f7f9; color: #52636e; font-size: 12px; }
.status-requirements strong { color: var(--ink); }
.aside-actions { display: grid; gap: 8px; margin-top: 18px; }
.delete-panel { max-width: 680px; margin: 35px auto; padding: clamp(22px, 5vw, 38px); }
.warning-band { margin: 20px 0; padding: 14px; border-left: 4px solid var(--orange); background: #fff5eb; color: #754313; }
.auth-page { display: grid; min-height: 100dvh; grid-template-columns: minmax(270px, .9fr) minmax(340px, 1.1fr); background: var(--paper); }
.auth-aside { display: flex; min-height: 100%; flex-direction: column; justify-content: space-between; padding: clamp(25px, 5vw, 62px); background: var(--ink); color: white; }
.auth-aside .brand { align-self: flex-start; }
.auth-note { max-width: 460px; padding: 32px 0; }
.auth-note .eyebrow { color: #a8d5f3; font-size: 11px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; }
.auth-note h2 { margin: 16px 0; font: 800 clamp(32px, 5vw, 51px)/1.08 var(--font-display); letter-spacing: -.06em; }
.auth-note p { max-width: 360px; color: #c6d0d6; }
.auth-foot { color: #9eabb4; font-size: 12px; }
.auth-content { display: grid; place-items: center; padding: 28px; }
.auth-card { width: min(430px, 100%); padding: clamp(22px, 4vw, 38px); border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow); }
.auth-heading { margin-bottom: 24px; }
.auth-heading p { margin: 8px 0 0; color: var(--muted); }
.auth-card .form-group { margin-bottom: 16px; }
.auth-card input[type="text"], .auth-card input[type="password"] {
  display: block;
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd8e1;
  border-radius: 6px;
  padding: 9px 11px;
  background: white;
  color: var(--ink);
}
.auth-card input[type="text"]:focus, .auth-card input[type="password"]:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(41, 134, 204, .12);
  outline: 0;
}
.auth-card .button { width: 100%; margin-top: 6px; }
.auth-error { margin-bottom: 16px; padding: 10px 12px; border-radius: 5px; background: #fff2f0; color: #8d3832; font-size: 13px; }
.delete-title { margin: 0; color: var(--ink); font: 800 clamp(27px, 3.6vw, 38px)/1.12 var(--font-display); letter-spacing: -.055em; }
.error-page { max-width: 690px; margin: 9vh auto; padding: 0 18px; }
.error-card { padding: clamp(25px, 5vw, 45px); }
.error-code { display: inline-block; margin-bottom: 10px; color: var(--orange); font: 800 13px var(--font-display); letter-spacing: .1em; }
.error-card h1 { margin: 0; font: 800 clamp(28px, 5vw, 40px) var(--font-display); letter-spacing: -.05em; }
.error-card p { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
@media (max-width: 900px) {
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-search { grid-column: 1 / -1; }
  .detail-grid, .form-layout { grid-template-columns: 1fr; }
  .form-aside { position: static; }
}
@media (max-width: 640px) {
  .topbar { min-height: 62px; padding: 0 15px; }
  .top-label { display: none; }
  .page-shell { padding: 24px 14px 40px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 19px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .filter-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .filter-actions { grid-column: 1 / -1; }
  .filter-actions .button { flex: 1; }
  .view-row { align-items: flex-start; flex-direction: column; }
  .data-grid, .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: auto; }
  .section-panel, .form-section { padding: 16px; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-aside { min-height: 230px; padding: 22px; }
  .auth-note { padding: 28px 0 4px; }
  .auth-note h2 { margin: 9px 0; font-size: 31px; }
  .auth-foot { display: none; }
  .auth-content { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
