:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #192b43;
  background: #eef3fa;
  font-synthesis: none;
  --nav: #102652;
  --blue: #145ed7;
  --muted: #7b8799;
  --line: #e7ecf2;
  --yellow: #f5c451;
  --green: #14856b;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 14px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #80aeff;
  outline-offset: 3px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #a7c7fb;
  outline-offset: 0;
  border-color: #5992e4;
}
button {
  border: 0;
}
a {
  color: inherit;
}
svg.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.shell {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  background: var(--nav);
  color: #b4c1d1;
  display: flex;
  flex-direction: column;
  padding: 29px 17px 18px;
  z-index: 30;
}
.brand {
  padding: 0 14px 29px;
}
.brand img {
  width: 170px;
  height: auto;
  display: block;
}
.brand small {
  display: block;
  margin-top: 9px;
  font-size: 9px;
  letter-spacing: 2.1px;
  color: #8293aa;
  padding-left: 2px;
}
.nav-label {
  font-size: 10px;
  letter-spacing: 1.6px;
  color: #69809d;
  padding: 10px 15px;
}
.nav {
  display: grid;
  gap: 5px;
  overflow: auto;
}
.nav a {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: 0.15s;
}
.nav a:hover {
  color: white;
  background: #1b3555;
}
.nav a.active {
  background: var(--blue);
  color: white;
}
.nav a.active .icon {
  color: white;
}
.nav .count {
  margin-left: auto;
  background: #3b4d61;
  border-radius: 5px;
  padding: 2px 5px;
  font-size: 10px;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 20px;
}
.sample-note {
  font-size: 11px;
  color: #91a6bf;
  background: #1a304b;
  padding: 12px;
  border: 1px solid #2b425c;
  border-radius: 8px;
  line-height: 1.6;
}
.side-user {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 19px 7px 0;
  font-size: 12px;
}
.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #e9eef6;
  color: #456386;
  font-weight: 700;
  flex-shrink: 0;
}
.side-user .avatar {
  background: #f5c451;
  color: #1e3048;
}
.side-user small {
  display: block;
  color: #7c92ac;
  margin-top: 4px;
  font-size: 10px;
}
.side-user button {
  color: #9aacc2;
  background: none;
  margin-left: auto;
  padding: 5px;
}
.main {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  height: 80px;
  border-bottom: 1px solid var(--line);
  background: #0b1c40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #bdcbea;
  font-size: 12px;
}
.breadcrumb strong {
  font-weight: 500;
  color: white;
}
.top-right {
  display: flex;
  align-items: center;
  gap: 21px;
}
.date {
  font-size: 11px;
  color: #bdcbea;
}
.branch-select {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #50667e;
  background: #fff;
}
.branch-select .icon {
  width: 16px;
}
.branch-select select {
  border: 0;
  background: none;
  max-width: 150px;
  color: #223850;
  font-size: 12px;
  font-weight: 600;
  outline: 0;
}
.mobile-menu,
.sidebar-close {
  display: none;
  background: none;
  color: white;
  padding: 4px;
}
.content {
  padding: 32px 36px 40px;
  max-width: 1680px;
  margin: auto;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 26px;
}
.eyebrow {
  display: block;
  font-size: 10px;
  color: #8591a2;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 10px;
}
h1 {
  font-size: 28px;
  letter-spacing: -0.9px;
  font-weight: 650;
  line-height: 1.2;
  margin: 0 0 10px;
}
h2 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.2px;
  margin: 0;
}
h3 {
  font-size: 13px;
  margin: 0;
}
p {
  line-height: 1.6;
}
.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #dfe5ed;
  background: white;
  color: #34475f;
  border-radius: 7px;
  min-height: 37px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.btn .icon {
  width: 16px;
  height: 16px;
}
.btn:hover {
  background: #f4f7fb;
}
.btn.primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}
.btn.primary:hover {
  background: #1b58bd;
}
.btn.dark {
  background: var(--nav);
  color: white;
  border-color: var(--nav);
}
.btn.danger {
  color: #c53d45;
  background: #fff7f7;
  border-color: #f0d3d5;
}
.btn.small {
  padding: 5px 9px;
  min-height: 29px;
  font-size: 11px;
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px;
  margin-bottom: 25px;
}
.metric {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 21px;
  position: relative;
  min-height: 138px;
}
.metric.dark {
  background: var(--nav);
  border-color: var(--nav);
  color: white;
}
.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #738096;
  font-size: 11px;
}
.metric-top .icon {
  width: 17px;
  height: 17px;
  color: #98a7ba;
}
.metric.dark .metric-top {
  color: #b6c3d4;
}
.metric strong {
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.8px;
  display: block;
  margin: 16px 0 10px;
  white-space: nowrap;
}
.metric small {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 10px;
  color: #8b96a6;
}
.metric.dark small {
  color: #aabbd1;
}
.metric small .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #30aa8a;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 22px;
}
.card-head {
  padding: 21px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
}
.card-head p {
  font-size: 11px;
  color: #8b97a6;
  margin: 6px 0 0;
}
.card-body {
  padding: 22px;
}
.text-link {
  color: var(--blue);
  font-size: 11px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  padding: 0;
}
.text-link .icon {
  width: 13px;
  height: 13px;
}
.service-summary {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #f0f3f7;
}
.service-summary:last-child {
  border: 0;
}
.service-summary .bubble {
  height: 37px;
  width: 37px;
  display: grid;
  place-items: center;
  background: #f1f5fb;
  border-radius: 9px;
  color: #6d87ac;
}
.service-summary strong {
  display: block;
  font-size: 12px;
}
.service-summary small {
  font-size: 10px;
  color: #8c98a9;
  display: block;
  margin-top: 5px;
}
.service-summary .badge {
  margin-left: auto;
}
.table-wrap {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  white-space: nowrap;
  text-align: left;
}
th {
  font-size: 10px;
  color: #8490a1;
  font-weight: 500;
  letter-spacing: 0.2px;
  padding: 13px 20px;
  background: #fbfcfe;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 16px 20px;
  border-bottom: 1px solid #eef1f6;
  font-size: 12px;
  color: #526178;
}
tbody tr:last-child td {
  border-bottom: 0;
}
td strong {
  color: #293e57;
  font-weight: 600;
}
.sub {
  font-size: 10px;
  color: #8b97a9;
  display: block;
  margin-top: 5px;
}
.cell-name {
  display: flex;
  gap: 11px;
  align-items: center;
}
.product-icon {
  width: 35px;
  height: 39px;
  background: #f0f4fa;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #7088a8;
}
.product-icon .icon {
  width: 19px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 500;
  background: #edf2f9;
  color: #56718f;
  white-space: nowrap;
}
.badge.green {
  color: #158064;
  background: #eaf6ef;
}
.badge.amber {
  color: #a87817;
  background: #fff7e5;
}
.badge.red {
  color: #b8545a;
  background: #fceff0;
}
.badge.blue {
  color: #3678be;
  background: #edf4ff;
}
.badge.purple {
  color: #8660b3;
  background: #f2edfb;
}
.badge.service-stage-accepted {
  color: #475569;
  background: #f1f5f9;
}
.badge.service-stage-preparing {
  color: #0e7490;
  background: #cffafe;
}
.badge.service-stage-submitted {
  color: #92400e;
  background: #fef3c7;
}
.badge.service-stage-repairing {
  color: #1d4ed8;
  background: #dbeafe;
}
.badge.service-stage-return_preparing {
  color: #be123c;
  background: #ffe4e6;
}
.badge.service-stage-revising {
  color: #7e22ce;
  background: #f3e8ff;
}
.badge.service-stage-ready,
.badge.service-stage-return_ready {
  color: #0f766e;
  background: #ccfbf1;
}
.badge.service-stage-delivered {
  color: #166534;
  background: #dcfce7;
}
.badge.service-stage-cancelled {
  color: #44403c;
  background: #e7e5e4;
}
.badge .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.search {
  position: relative;
  max-width: 370px;
  width: 100%;
}
.search .icon {
  position: absolute;
  top: 11px;
  left: 12px;
  width: 16px;
  height: 16px;
  color: #90a0b4;
}
.search input {
  padding-left: 37px;
  width: 100%;
  background: #fbfcfe;
}
input,
select,
textarea {
  min-height: 38px;
  border: 1px solid #dfe6ee;
  border-radius: 7px;
  padding: 9px 11px;
  background: white;
  color: #2c405a;
  font-size: 12px;
  max-width: 100%;
}
input::placeholder,
textarea::placeholder {
  color: #a0a9b7;
}
textarea {
  resize: vertical;
  min-height: 84px;
}
label {
  display: grid;
  gap: 7px;
  font-size: 11px;
  color: #56677d;
}
.table-footer {
  padding: 14px 20px;
  font-size: 10px;
  color: #94a0b0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
}
.empty {
  padding: 42px 20px;
  text-align: center;
  color: #8a97aa;
  line-height: 1.7;
  font-size: 12px;
}
.empty .icon {
  width: 32px;
  height: 32px;
  display: block;
  margin: 0 auto 12px;
  color: #b5c1d0;
}
.section-gap {
  margin-top: 28px;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 1fr);
  gap: 22px;
  align-items: start;
}
.tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.tab {
  padding: 8px 13px;
  color: #6e7f94;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
}
.tab.active {
  background: #edf3fd;
  color: #2769d6;
  border-color: #c8daf7;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  padding: 20px;
}
.product-tile {
  padding: 15px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  color: #263e59;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 170px;
  transition: 0.15s;
}
.product-tile:hover {
  border-color: #7da5dc;
  box-shadow: 0 5px 15px #1f477710;
}
.product-tile .tile-icon {
  height: 45px;
  width: 45px;
  display: grid;
  place-items: center;
  background: #f0f4fa;
  border-radius: 10px;
  color: #7892b2;
  margin-bottom: 4px;
}
.product-tile .tile-icon .icon {
  width: 28px;
  height: 28px;
}
.product-tile strong {
  font-size: 12px;
  line-height: 1.5;
}
.product-tile small {
  font-size: 10px;
  color: #8a99ab;
}
.product-tile .tile-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
  font-size: 13px;
  font-weight: 650;
}
.tile-bottom .icon {
  width: 19px;
  color: #3676d2;
}
.cart {
  position: sticky;
  top: 103px;
}
.cart .card-body {
  padding: 20px;
}
.cart-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item strong {
  font-size: 12px;
  display: block;
  margin-bottom: 8px;
}
.cart-item small {
  color: #8390a4;
  font-size: 11px;
}
.quantity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.quantity button {
  background: #f1f5fa;
  color: #4a6480;
  width: 24px;
  height: 24px;
  border-radius: 5px;
}
.quantity .remove {
  margin-left: 10px;
  background: none;
  color: #b56c74;
}
.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 20px;
  font-weight: 650;
  padding: 21px 0;
}
.payment {
  padding: 13px;
  background: #edf7f1;
  color: #2b8766;
  border: 1px solid #cfe6da;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
}
.payment small {
  margin-left: auto;
  color: #96a8a0;
  font-size: 10px;
}
.cart .checkout {
  width: 100%;
  margin-top: 15px;
  padding: 14px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid {
  display: grid;
  gap: 17px;
}
.form-grid label.full {
  grid-column: 1/-1;
}
.form-grid.two {
  grid-template-columns: 1fr 1fr;
}
.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.5;
}
.check-label input {
  min-height: auto;
  accent-color: var(--blue);
}
.info-note {
  border: 1px solid #dce8f7;
  background: #f3f7fd;
  border-radius: 8px;
  padding: 13px 15px;
  color: #6481a4;
  font-size: 11px;
  line-height: 1.7;
}
.warning-note {
  background: #fff9e9;
  border: 1px solid #f3e5bd;
  color: #9d7a2c;
  border-radius: 7px;
  padding: 12px 15px;
  font-size: 11px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: #091b32aa;
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px;
}
.modal {
  width: 540px;
  max-width: 100%;
  max-height: 90vh;
  background: white;
  border-radius: 13px;
  box-shadow: 0 20px 100px #0003;
  overflow: auto;
}
.modal.wide {
  width: 750px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}
.modal-head h2 {
  font-size: 18px;
}
.modal-head button {
  padding: 3px;
  background: none;
  color: #8b98a9;
}
.modal form,
.modal .detail-body {
  padding: 24px;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.form-error {
  font-size: 12px;
  color: #bb424e;
  line-height: 1.6;
  margin-top: 15px;
}
#cart-customer-error {
  margin-top: 4px;
}
#cart-customer-error:empty {
  margin-top: 0;
}
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-brand {
  background: var(--nav);
  padding: 50px 65px;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-brand:after {
  content: "";
  width: 550px;
  height: 550px;
  border: 1px solid #ffffff0a;
  border-radius: 50%;
  position: absolute;
  right: -250px;
  bottom: -160px;
  box-shadow:
    0 0 0 100px #ffffff03,
    0 0 0 200px #ffffff02;
  pointer-events: none;
}
.auth-brand img {
  width: 190px;
}
.auth-brand h1 {
  font-size: 44px;
  line-height: 1.25;
  max-width: 420px;
  letter-spacing: -1.5px;
}
.auth-brand p {
  font-size: 14px;
  color: #9aadc4;
  max-width: 350px;
  line-height: 1.9;
}
.auth-brand small {
  color: #738ba8;
  font-size: 11px;
}
.auth-highlight {
  width: 45px;
  height: 3px;
  background: var(--yellow);
  margin: 30px 0;
}
.auth-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px;
  background: white;
}
.auth-form form {
  max-width: 360px;
  width: 100%;
}
.auth-form h2 {
  font-size: 25px;
  margin: 0 0 11px;
}
.auth-form p {
  color: #8390a3;
  font-size: 12px;
  margin-bottom: 29px;
}
.auth-form label {
  margin-top: 18px;
}
.auth-form input {
  height: 43px;
}
.auth-form .btn {
  width: 100%;
  margin-top: 25px;
  min-height: 43px;
}
.auth-form .check-label {
  font-size: 11px;
  align-items: flex-start;
}
.auth-form .check-label input {
  height: auto;
  margin: 2px 0 0;
}
.auth-form .legal {
  font-size: 10px;
  text-align: center;
  color: #96a2b3;
  margin-top: 20px;
}
.loading {
  height: 100vh;
  display: grid;
  place-items: center;
  color: #71839d;
}
.loading:before {
  content: "☆";
  font-size: 50px;
  color: #e7b847;
  position: absolute;
  margin-top: -85px;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: calc(50% + 100px);
  transform: translateX(-50%);
  background: #173a30;
  color: #fff;
  border: 1px solid #2b5a47;
  padding: 14px 22px;
  border-radius: 9px;
  z-index: 200;
  font-size: 12px;
  box-shadow: 0 10px 40px #10233e22;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  max-width: 90vw;
}
#toast.show {
  opacity: 1;
}
#toast.error {
  background: #702f39;
  border-color: #8c4754;
}
.detail-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-bottom: 22px;
}
.detail-list span {
  font-size: 10px;
  color: #91a0b0;
  display: block;
  margin-bottom: 8px;
}
.detail-list strong {
  font-size: 13px;
  color: #2e4562;
}
.details-history {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.branch-card {
  padding: 22px;
}
.branch-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.branch-card-top .bubble {
  background: #edf3fc;
  color: #4676b4;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 9px;
}
.branch-card h2 {
  font-size: 18px;
}
.branch-card p {
  color: #8190a3;
  font-size: 12px;
  margin-bottom: 20px;
}
.branch-card .branch-stats {
  display: flex;
  gap: 30px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.branch-stats span {
  color: #8897aa;
  font-size: 10px;
}
.branch-stats strong {
  display: block;
  color: #36516e;
  font-size: 16px;
  margin-top: 7px;
}
.report-bar {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 20px 0;
}
.report-bar label {
  min-width: 135px;
  font-size: 11px;
}
.report-bar svg {
  height: 20px;
  width: 100%;
}
.report-bar strong {
  min-width: 120px;
  text-align: right;
  font-size: 12px;
}
.report-value {
  display: flex;
  justify-content: space-between;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.report-value.total {
  font-size: 17px;
  font-weight: 650;
  border: 0;
}
.footer {
  font-size: 10px;
  color: #a1acb9;
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
}
.auth-mobile-logo {
  display: none;
}
.row-actions {
  display: flex;
  gap: 6px;
}
.cash-summary {
  display: flex;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.cash-summary:last-child {
  border: 0;
}
.cash-summary span {
  color: #8491a3;
}
.muted {
  color: #8c99ab;
}
.nowrap {
  white-space: nowrap;
}
.amount {
  font-variant-numeric: tabular-nums;
}
.positive {
  color: #20816b;
}
.negative {
  color: #ba6670;
}
.profile-emblem {
  height: 28px;
  width: 28px;
  border-radius: 50%;
}
.status-filter {
  max-width: 190px;
}
.hide {
  display: none !important;
}
@media (min-width: 1600px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .content {
    padding-top: 40px;
  }
}
@media (max-width: 1150px) {
  .shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .sidebar {
    width: 210px;
  }
  .brand {
    padding-left: 6px;
  }
  .brand img {
    width: 165px;
  }
  .content {
    padding: 26px 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .metrics {
    gap: 12px;
  }
  .metric {
    padding: 17px 15px;
  }
  .metric strong {
    font-size: 23px;
  }
  .split {
    grid-template-columns: 1fr 330px;
    gap: 15px;
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .date {
    display: none;
  }
  .auth-brand {
    padding: 40px;
  }
  .auth-brand h1 {
    font-size: 36px;
  }
}
@media (max-width: 850px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.2s;
    width: 238px;
    box-shadow: 20px 0 50px #10233e33;
  }
  .shell.menu-open .sidebar {
    visibility: visible;
    transform: translateX(0);
  }
  .main {
    grid-column: 1;
  }
  .mobile-menu {
    display: block;
  }
  .shell.menu-open .mobile-menu {
    visibility: hidden;
  }
  .sidebar-close {
    position: absolute;
    inset: 6px 6px auto auto;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
  }
  .sidebar .brand {
    padding-right: 38px;
  }
  .sidebar .brand img {
    max-width: 100%;
  }
  .topbar {
    height: 66px;
    padding: 0 20px;
  }
  .breadcrumb {
    margin-right: auto;
  }
  .content {
    padding: 24px 20px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .split {
    grid-template-columns: 1fr;
  }
  .cart {
    position: static;
  }
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-brand {
    display: none;
  }
  .auth-form {
    min-height: 100vh;
    padding: 30px;
  }
  .auth-mobile-logo {
    display: block;
    background: var(--nav);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    width: 200px;
  }
  .auth-mobile-logo img {
    width: 160px;
  }
  #toast {
    left: 50%;
  }
  .page-head {
    gap: 15px;
  }
  h1 {
    font-size: 25px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .top-right {
    gap: 10px;
  }
  .top-right > .profile-emblem {
    display: none;
  }
}
@media (max-width: 550px) {
  .content {
    padding: 22px 14px;
  }
  .topbar {
    padding: 0 14px;
  }
  .breadcrumb > span,
  .breadcrumb > .icon {
    display: none;
  }
  .page-head {
    flex-direction: column;
  }
  .page-head .actions {
    width: 100%;
  }
  .page-head .actions .btn {
    flex: 1;
  }
  .metric {
    min-height: 125px;
  }
  .metric strong {
    font-size: 22px;
  }
  .metric-top {
    font-size: 10px;
  }
  .metric small {
    font-size: 9px;
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 14px;
    gap: 10px;
  }
  .toolbar {
    flex-wrap: wrap;
    padding: 14px;
  }
  .toolbar .search {
    max-width: none;
  }
  .form-grid.two,
  .field-row {
    grid-template-columns: 1fr;
  }
  .modal-overlay {
    padding: 12px;
  }
  .modal form,
  .modal .detail-body {
    padding: 20px;
  }
  .modal-head {
    padding: 20px;
  }
  .detail-list {
    gap: 15px;
  }
  .card-head,
  .card-body {
    padding: 18px;
  }
  .report-bar label {
    min-width: 100px;
  }
  .report-bar strong {
    min-width: 100px;
  }
  .footer {
    font-size: 9px;
  }
  .branch-select {
    padding: 7px;
  }
  .branch-select select {
    max-width: 100px;
  }
}
@media print {
  .sidebar,
  .topbar,
  .page-head .actions,
  .toolbar,
  .row-actions,
  .footer,
  #toast {
    display: none !important;
  }
  .shell,
  .main {
    display: block;
  }
  .content {
    padding: 0;
  }
  .card {
    break-inside: avoid;
  }
  .metrics {
    grid-template-columns: repeat(4, 1fr);
  }
  body {
    background: white;
  }
  .table-wrap {
    overflow: visible;
  }
  th,
  td {
    padding: 10px;
  }
}

body.modal-open {
  overflow: hidden;
}
/* Grid children must shrink so tables scroll inside their card on phones. */
.split > *,
.settings-grid > *,
.card {
  min-width: 0;
}
@media (max-width: 850px) {
  .split,
  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.line-section {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.line-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.entry-line {
  padding: 15px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
  align-items: center;
  gap: 12px;
}
.document-line {
  display: grid;
  grid-template-columns: minmax(130px, 2fr) 65px 100px 90px 30px;
}
.entry-line input,
.entry-line select {
  width: 100%;
  min-width: 0;
}
.line-sum {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
}
.line-sum span {
  font-size: 10px;
  color: #8594a7;
}
.entry-line > .btn {
  padding: 4px;
}
.part-line {
  display: flex;
  align-items: flex-start;
}
.approval-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 16px;
  background: #f1f6fd;
  border: 1px solid #dce7f7;
  border-radius: 8px;
  margin: 22px 0;
}
.approval-panel p {
  color: #6d829d;
  font-size: 11px;
  margin: 7px 0 0;
}
@media (max-width: 650px) {
  .document-line {
    grid-template-columns: 1fr 1fr;
  }
  .document-line .line-main {
    grid-column: 1/-1;
  }
  .approval-panel {
    flex-wrap: wrap;
  }
  .part-line .form-grid.two {
    grid-template-columns: minmax(0, 1fr);
  }
  .document-actions .btn {
    flex: 1;
    white-space: normal;
  }
  .modal .table-wrap {
    max-width: 100%;
  }
}
/* Branch context and grouped navigation */
.sidebar {
  padding-top: 16px;
}
.sidebar-branch {
  margin: 0 0 20px;
}
.sidebar-branch > label {
  display: block;
  color: #9bafc8;
  font-size: 10px;
  letter-spacing: 1.2px;
  margin: 0 9px 7px;
}
.sidebar-branch .branch-select {
  width: 100%;
  background: #233b56;
  border-color: #39506a;
  color: white;
}
.sidebar-branch select {
  width: 100%;
  max-width: none;
  color: white;
  background: transparent;
}
.sidebar-branch option {
  color: #172b46;
  background: white;
}
.sidebar .brand {
  padding-bottom: 18px;
}
.nav {
  display: block;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.nav-group {
  margin-top: 5px;
}
.nav-group summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  list-style: none;
}
.nav-group summary::-webkit-details-marker {
  display: none;
}
.nav-group summary > .icon:last-child {
  margin-left: auto;
  transition: transform 0.15s;
  width: 14px;
}
.nav-group[open] summary > .icon:last-child {
  transform: rotate(90deg);
}
.nav-group summary:hover {
  background: #1b3555;
  color: white;
}
.nav-group > div {
  margin-left: 16px;
  border-left: 1px solid #39506a;
  padding-left: 4px;
}
.nav-group a {
  padding: 10px;
  font-size: 12px;
}
.sidebar-bottom {
  flex-shrink: 0;
  padding-top: 12px;
}
.required-mark {
  color: #c34545;
  font-weight: 700;
  display: inline;
}
.form-context {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: #617289;
  padding: 8px 0;
}
.branch-checklist {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.branch-checklist legend {
  font-size: 12px;
  padding: 0 5px;
}
.branch-checklist label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
}
.branch-checklist input {
  width: auto;
}
.sale-branch-card {
  padding: 16px;
  max-width: 420px;
}
@media (max-width: 600px) {
  .sidebar-branch .branch-select {
    display: flex;
  }
  .sidebar-branch select {
    max-width: none;
  }
}
.part-content {
  flex: 1;
  min-width: 0;
}
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  padding: 20px;
}
.catalog-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: white;
  min-width: 0;
  transition: box-shadow 0.15s;
}
.catalog-card:hover {
  box-shadow: 0 6px 20px #132d4a14;
}
.catalog-open {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.catalog-cover {
  height: 175px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f7fb;
  border-bottom: 1px solid var(--line);
}
.catalog-cover > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.catalog-cover > .icon {
  width: 55px;
  height: 55px;
  color: #8a9db6;
}
.catalog-info {
  padding: 15px;
}
.catalog-info > strong {
  display: block;
  font-size: 14px;
  line-height: 1.5;
  margin: 7px 0;
}
.catalog-info > small {
  font-size: 11px;
  color: #8291a4;
}
.catalog-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 18px;
}
.catalog-price b {
  font-size: 18px;
}
.catalog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: #7b8da4;
}
.product-detail-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}
.product-hero {
  width: 100%;
  height: 260px;
  object-fit: contain;
  background: #f4f7fb;
  border-radius: 10px;
}
.product-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 10px;
}
.product-thumbs button {
  flex: 0 0 58px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  padding: 3px;
  cursor: pointer;
}
.product-thumbs img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}
.product-photo-empty {
  height: 260px;
  background: #f4f7fb;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #8291a4;
  font-size: 12px;
}
.product-photo-empty .icon {
  width: 50px;
  height: 50px;
}
.product-facts h3 {
  margin: 0 0 10px;
}
.product-facts .detail-list {
  margin-bottom: 12px;
}
.product-history-filter {
  max-width: 330px;
  margin: 20px 0;
}
.product-history-note {
  font-size: 11px;
  color: #7b8da4;
  padding: 0 20px;
}
.photo-editor {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 15px;
}
.photo-editor .muted {
  font-size: 11px;
  line-height: 1.6;
}
.photo-editor-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 10px;
  margin-top: 15px;
}
.photo-editor-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.photo-editor-item > img {
  width: 100%;
  height: 105px;
  object-fit: contain;
  background: #f4f7fb;
}
.photo-editor-item > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 5px;
  padding: 5px;
}
.photo-editor-item button {
  border: 0;
  background: #eef3fa;
  border-radius: 4px;
  padding: 5px;
  cursor: pointer;
  font-size: 10px;
  color: #456286;
}
.photo-editor-item .icon {
  width: 14px;
  height: 14px;
}
#product-photo-error {
  font-size: 12px;
  color: #bf4848;
}
@media (max-width: 600px) {
  .catalog-grid {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }
  .product-detail-top {
    grid-template-columns: minmax(0, 1fr);
  }
  .product-hero,
  .product-photo-empty {
    height: 210px;
  }
}

.serial-editor {
  grid-column: 1 / -1;
  padding: 14px;
  border-top: 1px solid var(--border);
}
.serial-editor textarea {
  min-height: 100px;
}
.serial-editor .check-label {
  margin: 8px 0;
}
.product-history-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.product-history-filter label {
  flex: 1;
}

/* Inventory presentation is shared across the catalogue, sales and stock alerts. */
.metric-link {
  display: block;
  text-decoration: none;
  text-align: left;
  color: inherit;
  width: 100%;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.metric-link:hover {
  border-color: var(--blue);
  box-shadow: 0 3px 12px #10233e0d;
}
.inventory-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stock-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}
.stock-mode > span {
  color: var(--muted);
  margin-right: 5px;
}
.stock-mode button {
  background: #f3f6fa;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #586b85;
  padding: 9px 12px;
  min-height: 40px;
}
.stock-mode button[aria-pressed="true"] {
  background: #eaf1fd;
  color: #205bbb;
  border-color: #9ebced;
}
.inventory-results {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}
.toolbar:has(.stock-mode) {
  flex-wrap: wrap;
}
.toolbar:has(.stock-mode) .search {
  flex: 1 1 230px;
}
.toolbar > label {
  font-size: 11px;
  color: var(--muted);
  min-width: 155px;
}
.card-head:has(.stock-mode) {
  flex-wrap: wrap;
  gap: 12px;
}
.stock-alert-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 20px 12px;
  align-items: center;
  justify-content: space-between;
}
.stock-alert-item {
  width: 100%;
  background: transparent;
  text-align: left;
  color: inherit;
  border-radius: 7px;
}
.stock-alert-item:hover {
  background: #f4f7fc;
}
.stock-total-link {
  background: transparent;
  padding: 3px 0;
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-align: left;
}
.branch-stats > button {
  background: transparent;
  padding: 0;
  text-align: left;
  color: var(--muted);
  font-size: 11px;
}
.branch-stats > button:hover strong {
  color: var(--blue);
  text-decoration: underline;
}
@media (max-width: 700px) {
  .inventory-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .inventory-metrics .metric:last-child {
    grid-column: 1/-1;
  }
  .toolbar:has(.stock-mode) .stock-mode {
    flex: 1 1 100%;
  }
  .stock-mode button {
    min-height: 44px;
  }
}

.backup-card .card-body > p {
  color: #697b93;
  line-height: 1.7;
  margin-top: 0;
}
.backup-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 18px 0;
}
.backup-last {
  display: grid;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.backup-last strong {
  color: #405570;
  font-weight: 600;
}
.backup-last small {
  overflow-wrap: anywhere;
}

.excel-paste {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.excel-paste summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 600;
}
.excel-paste textarea {
  width: 100%;
}
.excel-result:empty {
  display: none;
}

.home-layout,
.home-details {
  display: grid;
  gap: 16px;
}
.home-layout {
  grid-template-columns: minmax(0, 3fr) minmax(200px, 1fr);
  margin-bottom: 16px;
}
.home-details {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.home-shortcuts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.home-shortcut {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 78px;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}
.home-shortcut:hover {
  border-color: var(--blue);
  background: #f8fbff;
}
.home-shortcut small {
  display: block;
  color: #52627a;
  margin-top: 4px;
}
.home-symbol {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  height: 38px;
  border-radius: 8px;
  color: white;
  background: #1761d7;
}
.home-symbol.green {
  background: #168545;
}
.home-symbol.purple {
  background: #6534cf;
}
.home-symbol.red {
  background: #c62d37;
}
.home-symbol.amber {
  background: #9e570a;
}
.home-symbol.cyan {
  background: #1375b9;
}
.home-symbol.slate {
  background: #59687d;
}
.home-summary {
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.home-summary h2 {
  margin: 0 0 8px;
}
.home-summary .metric {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 7px 8px;
  margin-top: 5px;
}
.home-summary .metric strong {
  font-size: 17px;
  margin: 3px 0;
}
@media (max-width: 1140px) {
  .home-layout,
  .home-details {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 560px) {
  .home-shortcuts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-shortcut {
    flex-direction: column;
    align-items: flex-start;
  }
  .home-symbol {
    width: 38px;
  }
}

.employee-workspace {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr);
  gap: 16px;
}
.employee-picker {
  display: grid;
  gap: 8px;
}
.employee-picker .btn {
  justify-content: flex-start;
}
.customer-screen {
  max-width: 1000px;
}
@media (max-width: 650px) {
  .employee-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
}

.table-block {
  --table-action-inset: 16px;
  min-width: 0;
}
.table-tools {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 10px var(--table-action-inset);
}
.icon-button {
  width: 34px;
  min-width: 34px;
  padding: 7px;
  justify-content: center;
}
.table-tools [data-action="excel-export"] {
  color: #137a43;
}
.table-tools [data-action="pdf-export"] {
  color: #c22d39;
}
.option-management td:last-child,
.option-management th:last-child {
  text-align: right;
  width: 64px;
}
.part-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.part-rate:empty {
  display: none;
}
.part-rate {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.customer-history-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
}
.customer-history-header p {
  margin: 0 0 6px;
}
.customer-history-header strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
}
.history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
@media (max-width: 550px) {
  .customer-history-header {
    flex-direction: column;
  }
}

.inventory-export {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.inventory-export [data-action="inventory-excel"] {
  color: #137a43;
}
.inventory-export [data-action="inventory-pdf"] {
  color: #c22d39;
}

.modal:has(#customer-events) {
  width: 1100px;
}
#customer-events th,
#customer-events td {
  padding: 12px;
}
#customer-events td:nth-child(3) {
  white-space: normal;
  overflow-wrap: anywhere;
  min-width: 180px;
  max-width: 320px;
}
@media (max-width: 650px) {
  #customer-events table,
  #customer-events tbody {
    display: block;
  }
  #customer-events thead {
    display: none;
  }
  #customer-events tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 8px;
  }
  #customer-events td {
    border: 0;
    white-space: normal;
    padding: 6px;
    overflow-wrap: anywhere;
  }
  #customer-events td:nth-child(3) {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
    min-width: 0;
  }
  #customer-events td:nth-child(5) {
    font-weight: 600;
  }
  #customer-events td:last-child {
    text-align: right;
  }
}

.modal-panel[hidden],
.service-status-summary [hidden],
.service-approval-actions [hidden] {
  display: none !important;
}
.modal-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin: 18px 0;
  overflow-x: auto;
}
.modal-tabs [role="tab"] {
  padding: 12px 14px;
  color: var(--muted);
  background: transparent;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.modal-tabs [aria-selected="true"] {
  color: var(--blue);
  border-bottom-color: var(--blue);
  font-weight: 600;
}
.service-modal,
.product-card-modal {
  width: 1050px !important;
}
.service-status-summary {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f4f7fc;
}
.service-status-summary > div > span:first-child {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}
.service-status-summary > div {
  min-width: 0;
}
.service-status-summary .badge {
  max-width: 100%;
  gap: 8px;
  padding: 8px 12px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  white-space: normal;
}
.service-status-summary .badge .dot {
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
}
.service-status-summary strong {
  display: block;
  font-size: 24px;
}
.service-status-summary p {
  margin: 8px 0 0;
  font-size: 12px;
}
.service-accessories > div {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
}
.service-description {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.service-approval-actions {
  display: flex;
  justify-content: flex-end;
  margin: 18px 0;
}
.service-timeline {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.service-timeline summary {
  cursor: pointer;
  font-weight: 600;
}
.service-timeline ol {
  list-style: none;
  padding: 0;
}
.service-timeline li {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  border-left: 2px solid var(--line);
  padding: 12px 16px;
}
.service-timeline time,
.service-timeline small {
  font-size: 11px;
  color: var(--muted);
}
.service-timeline p {
  margin: 5px 0;
  overflow-wrap: anywhere;
}
.product-card-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.variant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  white-space: normal;
}
#product-panel-variants table {
  table-layout: fixed;
  white-space: normal;
}
#product-panel-variants td,
#product-panel-variants th {
  overflow-wrap: anywhere;
  padding: 12px;
}
#product-panel-variants td:last-child,
#product-panel-variants th:last-child {
  width: 28%;
}
#product-panel-variants .btn {
  white-space: normal;
}
@media (max-width: 650px) {
  .service-status-summary {
    gap: 12px;
  }
  .service-status-summary strong {
    font-size: 20px;
  }
  .product-card-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  #product-panel-variants table,
  #product-panel-variants tbody {
    display: block;
  }
  #product-panel-variants thead {
    display: none;
  }
  #product-panel-variants tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
    border-bottom: 1px solid var(--line);
  }
  #product-panel-variants td {
    border: none;
    padding: 8px;
  }
  #product-panel-variants td:last-child {
    grid-column: 1 / -1;
    width: auto;
  }
  .service-timeline li {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
}

@media (max-width: 650px) {
  .modal-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }
  .modal-tabs [role="tab"] {
    white-space: normal;
    padding: 10px 8px;
    font-size: 12px;
  }
  .service-modal .modal-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.supplier-row { cursor: pointer; }
.supplier-row:hover { background: var(--surface-soft, #f5f7fb); }

.record-actions { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 6px; }
.record-action { display: inline-flex; }
.record-action button:disabled { opacity: .35; cursor: not-allowed; }
.record-modal-footer { position: sticky; bottom: 0; z-index: 2; margin: 0; padding: 16px 24px; background: #fff; }
.supplier-payment-action { display: flex; justify-content: flex-end; margin: 10px 0 22px; }
.record-photo-preview { display: block; max-width: 100%; max-height: 60vh; object-fit: contain; }
.table-wrap td.table-actions { position: sticky; right: 0; background: #fff; z-index: 1; text-align: right; }
/* Keep action edges aligned with exports even in tables with custom cell spacing. */
.table-wrap td.table-actions { padding-inline-end: var(--table-action-inset, 16px) !important; }
.table-actions > .record-actions { justify-content: flex-end; }
@media (max-width: 650px) {
  #product-panel-variants tr,
  #customer-events tr { padding-right: 0; }
  #customer-events td.table-actions { grid-column: 1 / -1; }
}
.table-wrap:has(.record-actions) th:last-child { position: sticky; right: 0; background: #f8fafc; z-index: 2; }
.modal-head { z-index: 5; }
.record-modal-footer { z-index: 4; }
.record-row { cursor: pointer; }
.record-row:hover > td { background-color: #f5f8ff; }
.record-row:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.supplier-modal { width: 1050px !important; }
.supplier-modal td, .supplier-modal th { padding-left: 12px; padding-right: 12px; }
.supplier-modal td:nth-child(3) { white-space: normal; min-width: 180px; max-width: 280px; overflow-wrap: anywhere; }
.service-next-actions { display:flex; flex-wrap:wrap; gap:10px; margin:18px 0; }
.service-status-summary p { max-width:650px; line-height:1.6; margin-top:10px; }
.service-notices { margin-top:24px; }
.service-notices p { padding:12px; border:1px solid var(--line); border-radius:8px; margin-top:8px; }
.service-notices small { display:block; color:var(--muted); line-height:1.6; margin-top:8px; }
.quote-history { padding:12px; border:1px solid var(--line); border-radius:8px; margin-top:8px; }
.quote-history summary { cursor:pointer; font-weight:600; }
.quote-change { margin-top:12px; overflow:hidden; }
@media(max-width:600px) { .service-next-actions .btn { flex:1 1 100%; justify-content:center; } .service-status-summary { flex-wrap:wrap; } }
.service-timeline small { display:block; margin-top:4px; }
.quote-change summary { cursor:pointer; color:var(--muted); font-size:12px; padding:6px 0; }
/* Product and device layouts share the same controls and photo tabs. */
.catalog-footer .record-actions { margin-left: auto; flex-wrap: wrap; }
.catalog-footer { justify-content: flex-end; }
.editor-main-photo { margin-bottom: 20px; }
.editor-main-photo img { max-width: 100%; width: 220px; height: 180px; object-fit: contain; border-radius: 12px; background: var(--surface-alt, #f5f7fb); }
.photo-editor-item > .badge { margin: 8px; }
.toolbar .check-label { white-space: nowrap; }
.service-tab-actions { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.device-audit-details { margin-top: 12px; }
.device-audit-details > summary { cursor: pointer; color: var(--blue); }
.device-audit-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.device-audit-photos .photo-editor-item { width: 150px; }
.device-audit-photos .photo-editor-item img { width: 100%; height: 120px; object-fit: contain; }
.device-audit-photos small { display: block; overflow-wrap: anywhere; }
@media (max-width: 650px) { .device-audit-comparison { grid-template-columns: 1fr; } }
.service-accessory-fields { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 17px; align-items: start; }
.service-accessory-fields fieldset { min-width: 0; margin: 0; }
.customer-service-note { margin-top: 20px; }
@media (max-width: 550px) { .service-accessory-fields { grid-template-columns: 1fr; } }
.select-with-create { display: flex; align-items: center; gap: 8px; min-width: 0; }
.select-with-create > select { flex: 1 1 auto; min-width: 0; width: 0; }
.select-with-create > button { flex: 0 0 auto; }
.form-grid.two:has(.select-with-create) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.two:has(.select-with-create) > label { min-width: 0; }
@media (max-width: 550px) { .form-grid.two:has(.select-with-create) { grid-template-columns: 1fr; } }
.searchable-select { display: block; min-width: 0; width: 100%; }
.searchable-select > select { width: 100%; cursor: pointer; }
.select-with-create > .searchable-select { flex: 1 1 0; width: 0; min-width: 0; }
.select-search-popup { position: fixed; z-index: 1200; display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid #cbd7e8; border-radius: 10px; background: #fff; box-shadow: 0 12px 36px #10233e30; color: #203650; box-sizing: border-box; }
.select-search-popup input { flex: 0 0 auto; width: 100%; min-width: 0; margin: 0; }
.select-search-results { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.select-search-results button { display: block; width: 100%; text-align: left; padding: 10px; background: #fff; border: 0; border-radius: 6px; color: #203650; white-space: normal; overflow-wrap: anywhere; }
.select-search-results button:hover, .select-search-results button.highlighted { background: #eaf1ff; }
.select-search-results button[aria-selected="true"] strong { color: var(--blue); }
.select-search-results strong, .select-search-results small { display: block; }
.select-search-results small { color: #6d829a; margin-top: 3px; font-size: 11px; }
.select-search-status { flex: 0 0 auto; color: #6d829a; font-size: 11px; padding: 0 3px; }
.service-next-actions > label { flex: 0 1 340px; min-width: 0; max-width: 100%; margin: 0; }
.service-decision-label { display: inline-flex; align-items: center; gap: 7px; }
.modal label:has(> input[name="delivery_discount"]) { margin-bottom: 18px; }
.service-payment-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px; gap: 10px; align-items: end; margin: 12px 0; }
.service-payment-line label { min-width: 0; margin: 0; }
.service-settlement-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; border-top: 1px solid var(--line); padding: 16px 0; margin-top: 18px; }
.service-settlement-summary span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.service-settlement-summary strong { font-size: 16px; overflow-wrap: anywhere; }
@media (max-width: 450px) { .service-settlement-summary { grid-template-columns: 1fr; gap: 10px; } .service-payment-line { gap: 6px; } }
.service-decision-alert { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; font-size: 13px; font-weight: 800; line-height: 1; }
@media (max-width: 600px) { .service-next-actions > label { flex: 1 1 100%; } }
