.service-tools { display:flex; flex-wrap:wrap; gap:12px; margin:20px 0; }
.service-tools a { display:inline-block; padding:12px 16px; border-radius:8px; background:#edf2e8; color:#234e40; }
.service-working-panel { margin:24px 0; }
.service-working-panel form { max-width:850px; }
.service-working-panel details { margin:16px 0; }
.service-working-panel summary { cursor:pointer; font-weight:600; }
@media(max-width:900px) { .service-tools a { flex:1 1 220px; } }
.archive-result-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.archive-result-heading h3 { margin:0; }
.archive-status { display:inline-block; padding:7px 12px; border-radius:8px; background:#e7eddf; color:#234e40; font-size:13px; font-weight:600; }
.archive-result-status { flex-shrink:0; max-width:45%; text-align:right; }
.archive-result-status small { display:block; margin-top:6px; }
.archive-status-summary { margin:20px 0; }
.archive-status-summary>div { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0; }
@media(max-width:600px) { .archive-result-heading { flex-wrap:wrap; } .archive-result-status { max-width:100%; margin-left:auto; } }
.admin-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 28px;
}
.sidebar a {
  display: block;
  padding: 11px 15px;
  border-radius: 7px;
  margin: 4px 0;
  color: #6b7b60;
}
.sidebar a.active {
  background: #e7eddf;
  color: #254e40;
  font-weight: 600;
}
.panel + .panel {
  margin-top: 22px;
}
.panel h2 {
  margin-top: 15px;
}
.panel input:not([type="checkbox"]),
.field input {
  display: block;
  width: 100%;
  padding: 11px;
  border: 1px solid #d4dfce;
  border-radius: 7px;
  background: white;
  color: #263c31;
  margin: 7px 0 15px;
}
.panel button {
  margin: 8px 5px 8px 0;
}
.access-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e0e6dc;
  padding: 14px 0;
}
.filters {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.filters label {
  flex: 1;
  min-width: 140px;
}
.pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mail-message {
  margin: 18px 0;
  max-width: 92%;
}
.mail-message.outgoing {
  margin-left: auto;
}
.mail-message.outgoing .mail-bubble {
  background: #edf3e8;
}
.mail-message.incoming .mail-bubble {
  background: #eef1f7;
}
.mail-message .mail-bubble {
  padding: 16px;
  border-radius: 12px;
}
.mail-message img {
  max-width: 150px;
  max-height: 130px;
  object-fit: contain;
}
.panel form button.primary,
.primary {
  background: #234e40 !important;
  color: #fff !important;
}
.header {
  height: auto;
  min-height: 92px;
  flex-wrap: wrap;
  padding-top: 12px;
  padding-bottom: 12px;
}
main {
  padding-left: 24px;
  padding-right: 24px;
}
.table-wrap {
  margin-top: 20px;
}
.admin-layout table {
  min-width: 600px;
}
.error,
[role="alert"] {
  color: #963d35;
}
.login {
  max-width: 500px;
  margin: 65px auto;
}
.warranty-logo {
  width: 90px;
  height: 90px;
  object-fit: contain;
}
.thread-refresh {
  float: right;
}
.flagbtn {
  font-size: 20px !important;
}
.flagbtn.on {
  color: #a58547;
}
@media (max-width: 850px) {
  .admin-layout,
  .detail {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: flex;
    flex-wrap: wrap;
  }
  .header nav {
    flex-wrap: wrap;
    gap: 14px;
  }
  .brand {
    display: none;
  }
  .summary {
    grid-template-columns: 1fr;
  }
  .access-row {
    flex-wrap: wrap;
  }
}
.intro h1 {
  font-weight: 400;
}
.intro h1 strong {
  font-weight: 750;
}
#error[role="alert"]:not(:empty),
#partnerError[role="alert"]:not(:empty),
#adminError:not(:empty) {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: #fff5ef;
  border: 1px solid #d9aea3;
  border-radius: 10px;
  padding: 16px 24px;
  max-width: 90vw;
  box-shadow: 0 6px 24px #26382f20;
}
.partner-flow {
  margin: 24px 0 28px !important;
  border-color: #becfba !important;
}
.flow-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.device-route {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  margin: 28px 0;
  padding: 0;
}
.device-route li {
  position: relative;
  background: #f5f6f2;
  padding: 18px 12px;
  border: 1px solid #dfe5da;
  border-radius: 10px;
  min-width: 0;
}
.device-route li:not(:last-child):after {
  content: "→";
  position: absolute;
  right: -17px;
  top: 20px;
  color: #59715e;
}
.device-route strong,
.device-route small {
  display: block;
}
.device-route small {
  margin-top: 8px;
  color: #738075;
  font-size: 11px;
}
.device-route p {
  font-size: 12px;
}
.track-dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e1e7de;
  margin-bottom: 12px;
  color: #547047;
}
.device-route .done .track-dot {
  background: #234e40;
  color: #fff;
}
.device-route .current {
  border: 2px solid #819b71;
  background: #eef4e8;
}
.flow-durations,
.flow-result {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid #e0e6dc;
}
.flow-durations span,
.flow-durations strong {
  display: block;
}
.flow-durations span {
  font-size: 12px;
  color: #738075;
}
.flow-result {
  grid-template-columns: 1fr 2fr;
}
.flow-note {
  font-size: 11px !important;
  margin-bottom: 18px !important;
}
.flow-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px;
  background: #edf3e8;
  border-radius: 9px;
  margin-top: 16px;
}
.journey-history summary {
  cursor: pointer;
  color: #234e40;
}
.journey-history ol {
  list-style: none;
  padding: 0;
}
.journey-history li {
  display: flex;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid #e0e6dc;
}
.journey-history time {
  min-width: 145px;
  color: #738075;
}
.partner-next {
  margin-bottom: 22px;
}
.partner-next strong {
  display: block;
}
@media (max-width: 850px) {
  .device-route {
    grid-template-columns: 1fr;
  }
  .device-route li:not(:last-child):after {
    content: "↓";
    right: 50%;
    top: auto;
    bottom: -20px;
  }
  .flow-result,
  .flow-durations {
    grid-template-columns: 1fr;
  }
  .flow-heading,
  .flow-next {
    flex-direction: column;
    align-items: flex-start;
  }
}

.device-route {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.final-inspection {
  margin: 24px 0;
  border: 2px solid #b7cbbb;
}
.final-inspection form {
  max-width: 700px;
}
.inspection-error {
  color: #923e30;
}
@media (max-width: 900px) {
  .device-route {
    grid-template-columns: 1fr;
  }
}

.partner-visit-badge {
  display: inline-block;
  margin: 6px 0 6px 10px;
  padding: 7px 12px;
  border-radius: 8px;
  background: #f5ead3;
  color: #6e501e;
  font-size: 13px;
  font-weight: 600;
}
td .partner-visit-badge {
  display: block;
  margin-left: 0;
}

.repair-history {
  margin-top: 20px;
  border-top: 1px solid #dce3d9;
  padding-top: 18px;
}
.repair-history summary {
  cursor: pointer;
  font-weight: 600;
  color: #275447;
}
.repair-history-entry {
  padding: 20px 0;
  border-bottom: 1px solid #dce3d9;
}
.repair-history-entry:last-child {
  border-bottom: 0;
}
.repair-history-entry h4 {
  margin: 18px 0 6px;
}

.route-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 12px;
}
.route-badge {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
}
.route-badge > span {
  flex-shrink: 0;
}
.route-badge.success {
  background: #e0eee3;
  color: #24583b;
}
.route-badge.danger {
  background: #f7e5df;
  color: #943e30;
}
.route-badge.amber {
  background: #f6ecd7;
  color: #795820;
}
.route-badge.neutral {
  background: #e8edef;
  color: #4a6068;
}
.device-route li.failed .track-dot {
  background: #f7e5df;
  color: #943e30;
}
.device-route li.failed {
  border-color: #d9a99d;
}

.service-product-thumb {
  display: inline-block;
  vertical-align: middle;
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e0e5dc;
  border-radius: 8px;
  margin-right: 12px;
  flex-shrink: 0;
}
.service-product-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}
.service-product-heading > .service-product-thumb {
  width: 96px;
  height: 96px;
}
.missing-photo {
  font-size: 10px;
  text-align: center;
  line-height: 64px;
  color: #758074;
}

.detail.partner-communication-workspace { display:flex; flex-direction:column; gap:24px; }
.partner-chat-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; align-items:start; }
.partner-communication-workspace .panel { margin:0; min-width:0; }
.partner-chat-grid .panel { height:100%; box-sizing:border-box; overflow-wrap:anywhere; }
.partner-chat-grid .mail-message { max-width:100%; }
.partner-chat-grid h2 { margin-top:0; }
@media(max-width:850px) { .partner-chat-grid { grid-template-columns:1fr; } }

.partner-overview-grid { display:grid; width:100%; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; align-items:stretch; }
.partner-overview-grid > .panel { width:auto; box-sizing:border-box; overflow-wrap:anywhere; }
.partner-chat-grid { width:100%; }
@media(max-width:850px) { .partner-overview-grid { grid-template-columns:1fr; } }

.product-picker-trigger{border:0;background:transparent;padding:0;color:#214f42;cursor:pointer;flex-shrink:0}.product-picker-trigger .service-product-thumb{display:block;width:96px;height:96px;margin:0}.product-picker-trigger small{display:block;margin-top:6px}.product-picker{width:min(760px,90vw);max-height:85vh;overflow:auto;border:1px solid #c8d4c6;border-radius:16px;padding:24px;color:#233e40}.product-picker::backdrop{background:#102a2966}.picker-result{display:flex;align-items:center;gap:12px;padding:14px 0;border-bottom:1px solid #e0e5dc}.picker-result>div{flex:1}.picker-result small{display:block}.picker-close{margin-top:20px}@media(max-width:600px){.picker-result{flex-wrap:wrap}.picker-result>button{width:100%}}

.case-product-picker{display:inline-flex;flex-direction:column;align-items:center;vertical-align:middle;border:1px solid #c7d5c6;border-radius:8px;background:#f5f8f2;color:#214f42;padding:4px;margin:0 12px 0 0;cursor:pointer;font:inherit}.case-product-picker .service-product-thumb{margin:0}.case-product-picker>span:last-child{font-size:11px;margin:4px 2px}.case-product-picker:hover,.case-product-picker:focus-visible{background:#e5eedf;outline:2px solid #214f42;outline-offset:2px}
