:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #292725;
  background: #f5f4f1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1080px;
  background: #f5f4f1;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  height: 36px;
  padding: 0 14px;
  color: #292725;
  background: #fff;
  border: 1px solid #d7d3cc;
  border-radius: 6px;
  cursor: pointer;
}

button:hover {
  border-color: #8f867b;
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

input,
select,
textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  color: #292725;
  background: #fff;
  border: 1px solid #d7d3cc;
  border-radius: 6px;
}

textarea {
  min-height: 72px;
  resize: vertical;
}

.hidden {
  display: none !important;
}

.topbar {
  height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: #2e2a27;
}

.topbar strong {
  font-size: 19px;
}

.topbar span {
  margin-left: 14px;
  color: #c8c1b7;
  font-size: 13px;
}

.quiet-button {
  color: #fff;
  background: transparent;
  border-color: #706960;
}

main {
  padding: 24px 28px 48px;
}

.login-panel {
  width: 460px;
  margin: 70px auto;
  padding: 28px;
  background: #fff;
  border: 1px solid #dedbd5;
  border-radius: 8px;
}

.login-panel h1,
.module-panel h2 {
  margin: 0;
  font-size: 22px;
}

.login-panel p,
.module-head p {
  margin: 8px 0 0;
  color: #777067;
  font-size: 14px;
}

.login-form {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: #514c46;
  font-size: 14px;
}

.primary-button {
  color: #fff;
  background: #0e7c7b;
  border-color: #0e7c7b;
}

.export-button {
  color: #fff;
  background: #2e2a27;
  border-color: #2e2a27;
}

.danger-button {
  color: #a52a21;
  background: #fff;
  border-color: #d9aaa5;
}

.danger-button:hover {
  color: #fff;
  background: #a52a21;
  border-color: #a52a21;
}

.error-text {
  color: #b42318;
  font-size: 14px;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #e9e6e0;
  border-radius: 8px;
}

.tab {
  position: relative;
  min-width: 120px;
  border-color: transparent;
  background: transparent;
}

.tab.has-notification::after {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 9px;
  height: 9px;
  content: '';
  background: #e1251b;
  border: 2px solid #e9e6e0;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(120, 15, 10, 0.12);
}

.tab.active.has-notification::after {
  border-color: #2e2a27;
}

.tab.active {
  color: #fff;
  background: #2e2a27;
}

.module-panel {
  margin-top: 18px;
  padding: 22px;
  background: #fff;
  border: 1px solid #dedbd5;
  border-radius: 8px;
}

.module-head,
.toolbar,
.inline-actions,
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.content-state {
  margin-top: 20px;
  color: #777067;
}

.list-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px 110px 120px auto;
  gap: 10px;
  margin-bottom: 14px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  color: #777067;
  font-size: 13px;
}

.pagination button {
  min-width: 74px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #e4e1dc;
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  color: #383431;
  font-size: 13px;
}

th,
td {
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #ebe8e3;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #5d574f;
  background: #f7f6f3;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

.muted {
  color: #817a71;
}

.tag {
  display: inline-flex;
  padding: 3px 8px;
  color: #755727;
  background: #f4ead8;
  border-radius: 4px;
  white-space: nowrap;
}

.tag.completed-status {
  color: #176b45;
  background: #dff3e8;
}

.order-card.return-requested {
  color: #b42318;
  border: 2px solid #cf493f;
  background: #fff8f7;
}

.order-card.return-requested table,
.order-card.return-requested strong,
.order-card.return-requested h4,
.order-card.return-requested .muted,
.order-card.return-requested .tool-hint {
  color: #b42318;
}

.return-alert {
  margin: 12px 0;
  padding: 10px 12px;
  color: #b42318;
  background: #fde7e5;
  border-radius: 6px;
  font-weight: 700;
}

.order-list {
  display: grid;
  gap: 16px;
}

.order-card {
  padding: 18px;
  border: 1px solid #dedbd5;
  border-radius: 8px;
}

.order-summary {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 2fr;
  gap: 16px;
}

.order-summary strong,
.info-grid strong {
  display: block;
  margin-bottom: 4px;
  color: #736c63;
  font-size: 12px;
  font-weight: 600;
}

.item-table {
  margin-top: 16px;
  background: #faf9f6;
}

.damage-input {
  min-width: 240px;
  min-height: 58px;
}

.item-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.media-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.media-strip img {
  width: 88px;
  height: 70px;
  object-fit: cover;
  border: 1px solid #ddd8d0;
  border-radius: 4px;
}

.case-file-input {
  max-width: 280px;
  padding: 8px;
  background: #fff;
}

.case-maintenance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.case-maintenance-card {
  overflow: hidden;
  border: 1px solid #e1ddd6;
  border-radius: 6px;
  background: #fff;
}

.case-maintenance-card img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #f4f2ee;
}

.case-maintenance-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.order-tools {
  margin-top: 16px;
  padding-top: 16px;
  display: grid;
  grid-template-columns: 1.05fr 0.8fr 1.25fr 1.25fr;
  gap: 14px;
  border-top: 1px solid #e7e3dd;
}

.tool-box {
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 9px;
  background: #f8f7f4;
  border-radius: 6px;
}

.tool-box h4 {
  margin: 0;
  font-size: 14px;
}

.tool-box button {
  width: 100%;
}

.file-input {
  padding: 6px;
  font-size: 12px;
}

.compact-media {
  min-height: 4px;
  margin-top: 0;
}

.compact-media:empty {
  display: none;
}

.tool-hint {
  color: #817a71;
  font-size: 12px;
  line-height: 1.5;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.company-summary {
  margin: 10px 0;
  border: 1px solid #e4e1dc;
  border-radius: 6px;
}

.company-name-button {
  width: 100%;
  height: auto;
  padding: 12px 14px;
  text-align: left;
  border: 0;
  border-radius: 0;
  background: #f7f6f3;
  font-weight: 700;
}

.company-detail {
  padding: 14px;
}

.log-check {
  width: 16px;
  min-height: 16px;
}

dialog {
  width: min(960px, 90vw);
  max-height: 86vh;
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
}

dialog::backdrop {
  background: rgba(33, 30, 27, 0.45);
}

.dialog-head {
  padding: 18px 22px;
  border-bottom: 1px solid #e6e2dc;
}

.dialog-head h2 {
  margin: 0;
  font-size: 20px;
}

.icon-button {
  width: 36px;
  padding: 0;
  font-size: 24px;
}

#userDialogContent {
  padding: 22px;
  overflow: auto;
}

#toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 420px;
  padding: 12px 16px;
  color: #fff;
  background: #2e2a27;
  border-radius: 6px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 0.2s ease;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

#toast.error {
  background: #a52a21;
}

.support-unread {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  margin-left: 4px;
  color: #b42318;
  border: 0;
  background: #fff1f0;
  white-space: nowrap;
}

.support-unread-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #e53935;
}
