/* Approved prototype: index.html + visual-system/compact-system refinements.
   Shared UI only; authorization and business values remain API controlled. */
:root {
  font-family: Inter, 'Segoe UI', Arial, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  color: #1e293b;
  background: #f5f7fb;
  --border: #dfe3e9;
  --muted: #737d8b;
  --green: #168b6d;
  --sidebar: 236px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  min-height: 32px;
  font-size: 11px;
  font-weight: 600;
  color: inherit;
}
button:hover {
  background: #f4f5f7;
}
button.primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
button.dark {
  background: #252b34;
  color: #fff;
  border-color: #252b34;
}
button.success {
  background: #168b6d;
  color: #fff;
  border-color: #168b6d;
}
button.danger {
  color: #ae3448;
  background: #fff8f8;
  border-color: #eed9de;
}
button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
input,
select,
textarea {
  border: 1px solid #d8dee7;
  border-radius: 6px;
  padding: 7px 9px;
  min-height: 34px;
  background: white;
  min-width: 0;
  color: inherit;
}
input:focus-visible,
button:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid #5278a2;
  outline-offset: 2px;
}
input[type='checkbox'] {
  min-height: 0;
  width: 15px;
  height: 15px;
  accent-color: #242424;
}
a {
  color: #226ca5;
}
h1 {
  font-size: 20px;
  line-height: 1.3;
  margin: 0;
}
h2 {
  font-size: 14px;
  margin: 0 0 10px;
}
h3 {
  font-size: 13px;
  margin: 0;
}
p {
  margin: 7px 0;
}
.muted {
  color: var(--muted);
  font-size: 11px;
}
.icon {
  width: 17px;
  height: 17px;
  display: block;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.shell {
  min-height: 100vh;
  padding-left: var(--sidebar);
}
.sidebar {
  background: #000;
  color: #fff;
  width: var(--sidebar);
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
}
.navigation-backdrop,
.sidebar-close {
  display: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 16px 18px;
  font-size: 15px;
  font-weight: 650;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid #bac5d1;
  border-radius: 50%;
  background: white;
  padding: 3px;
  display: grid;
  place-items: center;
  flex: none;
}
.brand-mark span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 1px solid #dce2ea;
  background: #f3f7fb;
  color: #243b53;
  border-radius: 50%;
  font-size: 12px;
}
.sidebar nav {
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 9px 12px;
  overflow: auto;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 11px;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  color: #bdbdbd;
  background: transparent;
  text-decoration: none;
  font-size: 12px;
  position: relative;
}
.nav-link:hover {
  background: #191919;
  color: #fff;
}
.nav-link.active {
  background: #242424;
  color: #fff;
}
.nav-link.active:after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  margin-left: auto;
}
.nav-link.active:before {
  content: '';
  position: absolute;
  left: -12px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  background: #fff;
  border-radius: 0 3px 3px 0;
}
.nav-link[data-route='account'] {
  margin-top: 12px;
}
.shell-main {
  min-width: 0;
}
.topbar {
  height: 62px;
  padding: 9px 18px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(150px, 1fr);
  align-items: center;
  gap: 10px;
  background: #fff;
  border-bottom: 1px solid #e2e5ea;
}
.top-left,
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.header-actions {
  grid-column: 3;
  justify-content: flex-end;
  gap: 8px;
}
.topbar h1 {
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #171717;
}
.menu {
  width: 34px;
  height: 34px;
  padding: 7px;
  color: #777;
  min-width: 34px;
}
.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: #eff4fa;
  border: 1px solid #e4eaf2;
  color: #5e718a;
  font-size: 12px;
  font-weight: 500;
}
.staging-label {
  font-size: 9px;
  letter-spacing: 0.6px;
  color: #7e8794;
}
.mobile-preview-toggle {
  min-width: 34px;
  color: #566170;
}
.mobile-preview-dialog {
  width: min(414px, calc(100vw - 20px));
  height: min(880px, calc(100dvh - 20px));
  max-height: calc(100dvh - 20px);
  overflow: hidden;
}
.mobile-preview-dialog > .modal-head {
  min-height: 50px;
  padding: 8px 12px;
}
.mobile-preview-dialog > .modal-head h2 {
  font-size: 14px;
}
.mobile-preview-dialog > .modal-body {
  height: calc(100% - 50px);
  max-height: none;
  padding: 0;
  overflow: hidden;
}
.mobile-preview-body,
.mobile-preview-frame {
  display: block;
  width: 100%;
  height: 100%;
}
.mobile-preview-frame {
  border: 0;
  background: #f5f7fb;
}
.content {
  padding: 15px 18px;
  margin: auto;
}
.sidebar-collapsed {
  --sidebar: 72px;
}
.sidebar-collapsed .brand {
  padding: 16px 15px;
}
.sidebar-collapsed .brand-name,
.sidebar-collapsed .nav-link span,
.sidebar-collapsed .nav-link:after {
  display: none;
}
.sidebar-collapsed .nav-link {
  justify-content: center;
}
.sidebar-collapsed .sidebar nav {
  padding: 9px;
}
.period {
  position: relative;
}
.period > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 650;
  min-height: 34px;
}
.period > summary::-webkit-details-marker {
  display: none;
}
.period-panel {
  position: absolute;
  z-index: 40;
  top: 42px;
  left: 50%;
  transform: translateX(-50%);
  width: 290px;
  background: #fff;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: 0 12px 35px #16263b25;
}
.period-panel > button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
}
.custom-dates {
  display: grid;
  gap: 8px;
  padding: 10px 0;
}
.custom-dates label {
  display: grid;
  gap: 4px;
  font-size: 11px;
}
.custom-dates[hidden] {
  display: none;
}
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.toolbar input[type='search'] {
  flex: 1;
  min-width: 150px;
  max-width: 440px;
}
.toolbar .push {
  margin-left: auto;
}
.toolbar > .search-field {
  flex: 1 1 240px;
  min-width: min(100%, 180px);
  max-width: 100%;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #d4dbe5;
  border-radius: 7px;
  padding: 0 11px;
  flex: 1;
  min-width: 0;
  color: #6a7c91;
}
.search-field input {
  border: 0;
  flex: 1;
  width: 100%;
  padding: 8px 0;
  min-height: 34px;
  background: transparent;
  font-size: 12px;
  outline: none;
}
.toolbar .search-field input[type='search'] {
  min-width: 0;
}
.search-field:focus-within {
  outline: 2px solid #5278a2;
  outline-offset: 1px;
}
.panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 13px 14px;
  margin-bottom: 10px;
  min-width: 0;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.page-heading p {
  color: var(--muted);
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: white;
  scrollbar-width: thin;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  font-size: 9px;
  text-transform: uppercase;
  color: #617086;
  background: #f0f4f9;
  font-weight: 650;
}
th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid #e1e4e9;
  vertical-align: middle;
}
td {
  font-size: 12px;
}
tr:last-child td {
  border-bottom: 0;
}
.badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #dadde2;
  background: #f5f5f6;
  border-radius: 5px;
  padding: 4px 7px;
  font-size: 11px;
  min-width: 74px;
  min-height: 27px;
  text-align: center;
  text-transform: capitalize;
}
.badge.paid,
.badge.received,
.badge.active,
.badge.confirmed {
  color: #217d5d;
  background: #edf8f1;
  border-color: #c5e6d2;
}
.badge.pending,
.badge.partial,
.badge.requested,
.badge.review {
  color: #9e711d;
  background: #fff8e5;
  border-color: #eddcac;
}
.badge.processing {
  color: #2568ad;
  background: #eef5ff;
  border-color: #c8dbfa;
}
.badge.shipped {
  color: #7454a3;
  background: #f2edfc;
  border-color: #d7c8ed;
}
.badge.canceled,
.badge.unpaid,
.badge.disabled {
  color: #b94358;
  background: #fff2f4;
  border-color: #f2c5ce;
}
.mini-badge {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 9px;
  padding: 2px 5px;
  background: #fff;
  color: #56616f;
}
.link-button {
  border: 0;
  min-height: 20px;
  padding: 0;
  background: none;
  color: #2977ad;
  font-weight: 650;
  font-size: 12px;
}
.link-button:hover {
  background: none;
  text-decoration: underline;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}
.metric {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  min-width: 0;
}
.metric > small {
  display: block;
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.3px;
  color: #788aa1;
}
.metric > strong {
  display: block;
  font-size: 21px;
  letter-spacing: -0.3px;
  margin: 5px 0 3px;
  overflow-wrap: anywhere;
}
.metric > p {
  font-size: 10px;
  color: #7c8da5;
  margin: 0;
}
.metric.green {
  background: #edf9f5;
}
.metric.rose {
  background: #fff1f2;
}
.form {
  display: grid;
  gap: 12px;
}
.form label {
  display: grid;
  gap: 4px;
  font-size: 12px;
}
.form > p {
  margin: 0;
}
.form-error:empty {
  display: none;
}
.lead-reservation-dialog {
  width: min(500px, calc(100vw - 24px));
}
.form input,
.form select,
.form textarea {
  width: 100%;
}
.form label:has(input[type='checkbox']) {
  display: flex;
  align-items: center;
  gap: 8px;
}
.form input[type='checkbox'] {
  width: 15px;
}
.form .inline,
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 8px;
}
.form-footer button {
  min-width: 100px;
}
.error {
  color: #ae3448;
}
.success,
.financial-value {
  color: var(--green);
}
#notice {
  position: fixed;
  bottom: 18px;
  right: 18px;
  max-width: min(90vw, 500px);
  background: #24262a;
  color: white;
  border-radius: 7px;
  padding: 10px 15px;
  display: none;
  z-index: 100;
}
dialog {
  border: 1px solid #dce1e8;
  border-radius: 12px;
  padding: 0;
  width: min(820px, calc(100vw - 32px));
  max-height: 92vh;
  overflow: hidden;
  color: inherit;
  box-shadow: 0 18px 60px #15233430;
}
dialog::backdrop {
  background: #16213466;
}
.self-profile-dialog {
  width: min(460px, calc(100vw - 24px));
}
.self-profile-photo {
  display: flex;
  gap: 14px;
  align-items: center;
}
.self-profile-photo .avatar {
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
}
.self-profile-photo input {
  width: 100%;
  min-width: 0;
  font-size: 11px;
}
.self-profile-photo label {
  min-width: 0;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 {
  font-size: 18px;
  margin: 0;
}
.modal-head .close {
  min-width: 34px;
  width: 34px;
  height: 34px;
  font-size: 23px;
  border: 0;
  background: #f5f6f8;
}
.modal-body {
  padding: 15px 18px;
  max-height: calc(92vh - 66px);
  overflow: auto;
  overscroll-behavior: contain;
}
.modal-body > form {
  max-width: 100%;
}
.login {
  max-width: 370px;
  margin: 15vh auto;
  padding: 25px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.actions {
  position: relative;
}
.actions > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  border: 1px solid #d3dce8;
  background: #fff;
  border-radius: 5px;
  cursor: pointer;
  padding: 7px 12px;
  font-size: 10px;
}
.actions[open] > div {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 3px;
  margin-top: 5px;
  min-width: 120px;
}
.actions button {
  width: 100%;
}
.timeline {
  padding-left: 18px;
}
.timeline li {
  padding: 7px 0;
}
.amount-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.receipt {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.loading,
.empty {
  padding: 30px;
  color: var(--muted);
  text-align: center;
}
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  margin-top: 12px;
}
.pagination .current {
  background: #222;
  color: #fff;
  border-color: #222;
}
.pagination .muted {
  margin-right: auto;
}
.tabs {
  display: flex;
  gap: 3px;
  border-bottom: 1px solid #d9e1ec;
  overflow: auto;
  margin-bottom: 10px;
}
.tabs button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #66788d;
  min-height: 36px;
  padding: 8px 12px;
  font-size: 11px;
}
.tabs button[aria-selected='true'] {
  background: #edf5ff;
  color: #1c67bd;
  border-bottom: 3px solid #2563eb;
}
.tabs .count {
  background: #e6eef8;
  border-radius: 20px;
  padding: 2px 6px;
  margin-left: 4px;
  font-size: 9px;
}
.business-chips {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding-bottom: 9px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.business-chips button {
  border-radius: 20px;
  min-height: 26px;
  font-size: 9px;
  padding: 4px 9px;
}
.business-chips button.active {
  background: #252a32;
  color: #fff;
  border-color: #252a32;
}
.avatar-square {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 9px;
  background: #edf2fa;
  color: #516c8a;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 650;
}
.product-thumb {
  width: 44px;
  height: 50px;
  min-width: 44px;
  border: 1px solid #e1e4e9;
  border-radius: 7px;
  background: linear-gradient(135deg, #f9fafb, #eef1f5);
  display: grid;
  place-items: center;
  color: #a4adba;
}
.product-thumb .icon {
  width: 24px;
  height: 24px;
}
.unavailable {
  color: #89919d;
}
.unavailable[title] {
  cursor: help;
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.permission-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.permission-group h3 {
  margin-bottom: 9px;
}
.permission-group label {
  min-height: 26px;
}
.profile-details {
  display: grid;
  gap: 12px;
}
.profile-details .avatar {
  width: 60px;
  height: 60px;
  font-size: 20px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.settings-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  white-space: normal;
  padding: 12px 14px;
  min-height: 70px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.settings-option strong {
  display: block;
  font-size: 13px;
}
.settings-option small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 5px;
}
.staging-foot {
  font-size: 10px;
  color: var(--muted);
  padding: 10px 18px;
  margin-top: 20px;
}
pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 11px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 360px) {
  .shell .topbar {
    padding: 8px;
    gap: 5px;
  }
  .topbar .top-left {
    gap: 5px;
  }
  .shell .topbar h1 {
    font-size: 12px;
  }
  .topbar .menu,
  .topbar .header-actions button {
    min-width: 32px;
    width: 32px;
    padding: 6px;
  }
  .topbar .avatar {
    width: 32px;
    height: 32px;
  }
  .topbar .period > summary {
    font-size: 10px;
    padding: 5px;
    gap: 4px;
  }
}
@media (max-width: 760px) {
  .shell {
    padding-left: 0;
  }
  .sidebar {
    display: none;
  }
  .sidebar.open {
    display: flex;
    width: 236px;
    top: 0;
    box-shadow: 8px 0 25px #0003;
  }
  .sidebar.open + .navigation-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: #1118;
    border: 0;
    border-radius: 0;
    z-index: 29;
  }
  .sidebar-close {
    display: block;
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 1px 6px;
    min-height: 25px;
    background: transparent;
    border: 0;
    color: white;
  }
  .topbar {
    height: auto;
    min-height: 62px;
    padding: 8px 10px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
  }
  .top-left {
    gap: 8px;
  }
  .topbar h1 {
    font-size: 14px;
  }
  .topbar > .period {
    grid-row: 1;
    grid-column: 2;
    justify-self: center;
  }
  .topbar > .period[hidden] {
    display: none;
  }
  .header-actions {
    grid-column: 3;
    grid-row: 1;
    gap: 5px;
  }
  .header-actions .refresh-label,
  .header-actions .mobile-preview-label,
  .staging-label {
    display: none;
  }
  .header-actions button {
    min-width: 36px;
  }
  .avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }
  .content {
    padding: 12px 10px;
  }
  .sidebar-collapsed .brand-name,
  .sidebar-collapsed .nav-link span {
    display: block;
  }
  .sidebar-collapsed .nav-link {
    justify-content: flex-start;
  }
  .toolbar {
    gap: 7px;
  }
  .toolbar button,
  .toolbar select,
  button {
    min-height: 40px;
  }
  .toolbar input[type='search'],
  .search-field input,
  input,
  select,
  textarea {
    font-size: 16px;
    min-height: 40px;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .metric {
    padding: 10px 11px;
  }
  .metric > strong {
    font-size: 18px;
  }
  th,
  td {
    padding: 9px 10px;
  }
  table {
    min-width: 720px;
  }
  .panel {
    padding: 12px;
  }
  .form .inline,
  .form-grid,
  .permission-grid {
    grid-template-columns: 1fr;
  }
  .tabs button {
    min-height: 40px;
    padding: 9px 11px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .modal-head {
    padding: 12px;
  }
  .modal-head h2 {
    font-size: 17px;
  }
  .modal-body {
    padding: 12px;
    max-height: calc(92vh - 66px);
  }
  .login {
    margin: 12vh 15px;
    max-width: none;
  }
  .business-chips button {
    min-height: 30px;
  }
  .period > summary {
    min-height: 40px;
    font-size: 11px;
    gap: 5px;
    padding: 7px 8px;
  }
  .staging-foot {
    padding: 10px;
  }
}
.lead-remarks {
  display: grid;
  gap: 16px;
}
.lead-remarks > .form + .form,
.remarks-history {
  border-top: 1px solid var(--line, #ddd);
  padding-top: 12px;
}
.lead-remarks .check-label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lead-remarks input[type='checkbox'] {
  width: 16px;
  min-height: 16px;
}
.discount-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
}
.remarks-history article {
  padding: 10px 0;
  border-bottom: 1px solid var(--line, #ddd);
}
.remarks-history article > .badge {
  margin-left: 8px;
}
.remarks-history p,
.lead-note {
  margin: 5px 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.lead-request-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.lead-request-tags:empty {
  display: none;
}
.remarks-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.remarks-choices .active {
  background: #222;
  color: #fff;
}
.lead-row.deadline-warning {
  background: #fff1f1;
  border-color: #f0c7c9;
}
.lead-row.is-selected {
  outline: 2px solid #9fa7b2;
  outline-offset: -2px;
}
.lead-select-all {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lead-select-all input {
  width: 14px;
  height: 14px;
  margin: 0;
  flex: none;
}
.lead-timing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid #d8dde1;
  border-radius: 6px;
  font-size: 11px;
  background: #f4f7fa;
}
.lead-timing.warning {
  background: #fff7f7;
  color: #99252c;
  border-color: #efc3c5;
}
.lead-timing button {
  font-size: 11px;
  padding: 3px 7px;
}
.lead-due-button {
  margin-bottom: 9px;
  color: #99252c;
  background: #fff6f6;
  border-color: #edc5c7;
}
.lead-reminder {
  padding: 8px;
  border: 1px solid #efc3c5;
  border-radius: 6px;
}
.lead-reminder small,
.canceled-item small {
  display: block;
}
.canceled-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 9px;
  background: #fff1f1;
  border: 1px solid #f0c7c9;
  border-radius: 6px;
}
.lead-history-board {
  overflow-x: auto;
}
.lead-history-group {
  min-width: 620px;
  border: 1px solid #ebcece;
  border-left: 4px solid #d35a62;
  border-radius: 6px;
  margin-bottom: 10px;
  padding: 10px;
}
.lead-history-group header {
  display: flex;
  gap: 12px;
}
.history-event {
  font-size: 11px;
  color: #963b43;
}
.canceled-item {
  display: grid;
  grid-template-columns: 42px minmax(230px, 1fr) 70px 100px;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
}
.canceled-item .product-photo {
  width: 40px;
  height: 40px;
}
.submit-overview {
  display: grid;
  gap: 12px;
}
.submit-customer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  background: #f4f7fa;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.submit-customer h3 {
  margin: 4px 0;
}
.submit-customer small,
.submit-products small,
.submit-products span {
  display: block;
}
.submit-item-count {
  display: flex;
  justify-content: space-between;
}
.submit-products article {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.submit-products .photo-button {
  width: 44px;
  height: 44px;
}
.submit-products small {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.submit-totals {
  padding: 12px;
  background: #f7f8fa;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.submit-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}
.submit-totals .submit-balance {
  padding-top: 9px;
  margin-top: 7px;
  border-top: 1px solid var(--border);
  font-size: 15px;
}
.submit-overview > p {
  margin: 0;
}
.new-lead-product,
.new-lead-cart-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}
.new-lead-product small,
.new-lead-product span,
.new-lead-cart-row small {
  display: block;
  color: var(--muted);
}
.new-lead-product .photo-button {
  width: 44px;
  height: 44px;
}
.new-lead-cart-row {
  grid-template-columns: minmax(0, 1fr) 72px auto;
}
.new-lead-cart {
  border-top: 1px solid var(--border);
}
.new-lead-cart:empty {
  display: none;
}
.concern-dialog {
  width: min(880px, calc(100vw - 24px));
}
.concern-status {
  display: block;
  font-size: 10px;
  margin-top: 4px;
  color: var(--muted);
}
.concern-content,
.concern-record {
  display: grid;
  gap: 10px;
}
.concern-content p,
.concern-record h3 {
  margin: 0;
}
.concern-record ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.concern-record li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.concern-record li small {
  grid-column: 1/-1;
  color: var(--muted);
}
.concern-product {
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  display: grid;
  gap: 8px;
}
.concern-product-name {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
}
.concern-product-name input {
  width: auto !important;
  margin-top: 4px;
}
.concern-product-name small {
  display: block;
  color: var(--muted);
}
.concern-product .form-grid {
  grid-template-columns: 1fr 1fr;
}
.concern-total {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding: 10px 0;
}
.concern-review-form,
.concern-history {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.concern-history details {
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 8px;
  padding: 8px;
}
.concern-history summary {
  cursor: pointer;
}
.pre-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.proof-upload {
  display: grid;
  gap: 8px;
}
.proof-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.proof-gallery img {
  display: block;
  width: 96px;
  height: 88px;
  object-fit: contain;
}
.proof-gallery button {
  padding: 3px;
}
.proof-draft {
  display: grid;
  gap: 4px;
}
.proof-draft button {
  font-size: 11px;
}
@media (max-width: 640px) {
  .concern-dialog .modal-body {
    padding: 12px;
  }
  .concern-dialog .action-facts {
    grid-template-columns: 1fr 1fr;
  }
  .proof-gallery img {
    width: 76px;
    height: 72px;
  }
  .concern-record li {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .concern-dialog fieldset {
    min-width: 0;
    margin: 0;
    padding: 8px;
  }
}

/* Whole-warehouse counting keeps the mobile table independently scrollable. */
.stock-taking {
  padding: 16px;
}
.stock-taking h2 {
  margin: 0;
}
.stock-taking h3 {
  margin-top: 16px;
}
.avatar img,
.avatar-square img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.stock-scan-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 90px auto;
  gap: 8px;
  margin: 12px 0;
}
.count-status {
  font-size: 12px;
  min-height: 20px;
}
.count-status button {
  margin: 4px;
}
.count-product {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 240px;
}
.count-product img,
.count-product .photo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.count-product small {
  display: block;
  color: var(--muted);
}
.count-quantity {
  display: flex;
  align-items: center;
  gap: 6px;
}
.count-quantity input {
  width: 86px;
}
.stock-taking .table-wrap {
  margin-top: 12px;
}
.stock-taking table {
  min-width: 680px;
}
.stock-taking td {
  padding: 8px 10px;
}
.stock-taking > div > input[type='search'] {
  max-width: 360px;
  width: 100%;
}
@media (max-width: 600px) {
  .stock-taking {
    padding: 10px;
  }
  .stock-scan-form {
    grid-template-columns: minmax(130px, 1fr) 64px auto;
    gap: 5px;
  }
  .stock-scan-form input {
    min-width: 0;
  }
  .stock-taking .toolbar {
    gap: 6px;
  }
  .stock-taking .toolbar button {
    padding: 6px 8px;
  }
}
