.btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:37px;
  padding:8px 14px;
  border:1px solid #dce3eb;
  background:white;
  color:#46576c;
  border-radius:7px;
  font-size:12px;
  font-weight:500;
  line-height:1.5;
  white-space:nowrap;
  transition:background .15s,border-color .15s
}
.btn:hover {
  background:#f7f9fc;
  border-color:#c4cfdc
}
.btn .icon {
  width:16px;
  height:16px
}
.btn-primary {
  background:var(--navy);
  border-color:var(--navy);
  color:white
}
.btn-primary:hover {
  background:#28405b;
  border-color:#28405b
}
.btn-danger {
  background:var(--red);
  border-color:var(--red);
  color:white
}
.btn-danger:hover {
  background:#a33940;
  border-color:#a33940
}
.btn-soft {
  background:var(--blue-light);
  border-color:transparent;
  color:var(--blue)
}
.btn-small {
  min-height:29px;
  padding:4px 9px;
  font-size:11px
}
.btn-text {
  background:none;
  border-color:transparent;
  padding:5px 7px;
  min-height:29px;
  color:var(--blue)
}
.btn-text:hover {
  background:var(--blue-light);
  border-color:transparent
}
.btn-text.danger {
  color:var(--red)
}
.icon-button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:6px;
  background:transparent;
  padding:6px;
  color:var(--muted);
  line-height:1
}
.icon-button:hover {
  background:#edf1f6;
  color:var(--navy)
}
.icon-button .icon {
  width:18px;
  height:18px
}
.card {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  min-width:0
}
.card-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:21px 24px;
  border-bottom:1px solid var(--line)
}
.card-header h2 {
  font-size:14px
}
.card-header p {
  font-size:11px;
  color:var(--muted);
  margin-top:5px
}
.card-body {
  padding:24px
}
.card+.card {
  margin-top:20px
}
.section-label {
  font-size:10px;
  letter-spacing:1.1px;
  color:var(--muted);
  text-transform:uppercase
}
.badge {
  display:inline-flex;
  align-items:center;
  gap:5px;
  font-size:10px;
  line-height:1.5;
  padding:4px 8px;
  border-radius:5px;
  white-space:nowrap;
  font-weight:500
}
.status-dot {
  width:4px;
  height:4px;
  border-radius:50%;
  background:currentColor;
  flex-shrink:0
}
.badge.success {
  color:var(--green);
  background:var(--green-light)
}
.badge.neutral {
  color:#7b8797;
  background:#f1f3f6
}
.badge.info {
  color:var(--blue);
  background:var(--blue-light)
}
.badge.danger {
  color:var(--red);
  background:var(--red-light)
}
.badge.warning {
  color:var(--amber);
  background:var(--amber-light)
}
.table-wrap {
  width:100%;
  overflow:auto;
  border-radius:0 0 var(--radius) var(--radius)
}
table {
  width:100%;
  border-collapse:collapse;
  font-size:12px;
  text-align:left
}
thead {
  background:#fafbfd
}
th {
  font-size:10px;
  font-weight:500;
  color:#8390a1;
  padding:13px 17px;
  border-bottom:1px solid var(--line);
  white-space:nowrap;
  letter-spacing:.25px
}
td {
  padding:17px;
  border-bottom:1px solid #edf0f4;
  vertical-align:middle;
  color:#546376
}
tr:last-child td {
  border-bottom:0
}
tbody tr:hover {
  background:#fcfdff
}
.cell-title {
  display:block;
  color:var(--text);
  font-weight:550;
  font-size:12px;
  line-height:1.5
}
.cell-subtitle {
  display:block;
  color:var(--muted);
  font-size:10px;
  margin-top:4px;
  line-height:1.5
}
.cell-actions {
  display:flex;
  gap:3px;
  align-items:center;
  flex-wrap:wrap;
  min-width:80px
}
.copy-text {
  color:inherit;
  font:inherit;
  text-align:left;
  background:none;
  border:0;
  padding:0;
  cursor:copy;
  max-width:100%;
  overflow-wrap:anywhere;
  line-height:inherit
}
.copy-text:hover {
  color:var(--blue)
}
.copy-text.dashed {
  border-bottom:1px dashed #bdc7d3
}
.search-toolbar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:18px 22px;
  flex-wrap:wrap
}
.search-form {
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  flex:1;
  min-width:0
}
.search-input {
  position:relative;
  min-width:190px;
  max-width:310px;
  flex:1
}
.search-input>.icon {
  position:absolute;
  left:12px;
  top:10px;
  width:16px;
  height:16px;
  color:#97a3b1;
  pointer-events:none
}
.search-input input {
  padding-left:36px
}
.toolbar-note {
  font-size:11px;
  color:var(--muted)
}
input,select,textarea {
  border:1px solid #dce3eb;
  background:#fff;
  color:var(--text);
  width:100%;
  min-width:0;
  border-radius:6px;
  min-height:38px;
  padding:9px 11px;
  font-size:12px;
  line-height:1.6;
  transition:border-color .15s,box-shadow .15s
}
input::placeholder,textarea::placeholder {
  color:#a3adba
}
input:hover,select:hover,textarea:hover {
  border-color:#bdcbd9
}
input:focus,select:focus,textarea:focus {
  border-color:#7e9cb9;
  box-shadow:0 0 0 3px #345d8709;
  outline:none
}
input:disabled,select:disabled,textarea:disabled {
  background:#f5f7fa;
  color:#8f9aaa
}
select {
  appearance:auto;
  padding-right:24px
}
textarea {
  resize:vertical;
  min-height:110px
}
.filter-select {
  width:128px
}
.field {
  display:flex;
  flex-direction:column;
  gap:7px;
  min-width:0
}
.field-label {
  font-size:12px;
  color:#4c5b6e;
  font-weight:500
}
.field-help {
  font-size:10px;
  color:var(--muted);
  line-height:1.7
}
.field-help code {
  font-size:10px;
  background:#f2f5f8;
  padding:1px 3px;
  border-radius:3px
}
.required {
  color:var(--red);
  margin-left:3px
}
.form-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px 18px
}
.field-wide {
  grid-column:1/-1
}
.form-section+.form-section {
  padding-top:23px;
  margin-top:23px;
  border-top:1px solid var(--line)
}
.form-section-title {
  font-size:12px;
  margin-bottom:16px;
  color:var(--navy);
  display:flex;
  gap:8px;
  align-items:center
}
.form-section-title .section-number {
  display:grid;
  place-items:center;
  background:var(--blue-light);
  font-size:9px;
  color:var(--blue);
  width:19px;
  height:19px;
  border-radius:5px
}
.checkbox-field {
  display:flex;
  align-items:center;
  gap:9px;
  font-size:12px;
  cursor:pointer
}
.checkbox-field input {
  width:15px;
  min-height:15px;
  height:15px;
  accent-color:var(--navy);
  padding:0;
  margin:0;
  cursor:pointer
}
.field-inline-note {
  font-size:10px;
  color:var(--muted);
  margin-left:auto
}
.alert {
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:13px 16px;
  border:1px solid #dce7f0;
  background:#f4f8fc;
  color:#56708b;
  border-radius:8px;
  font-size:11px;
  line-height:1.8
}
.alert>.icon {
  width:17px;
  height:17px;
  margin-top:2px
}
.alert.warning {
  background:#fffaf0;
  border-color:#f0e3c9;
  color:#92713a
}
.alert.danger {
  background:var(--red-light);
  border-color:#f2d6d8;
  color:var(--red)
}
.alert+.card {
  margin-top:20px
}
.form-error {
  margin-top:18px;
  padding:11px 14px;
  color:var(--red);
  background:var(--red-light);
  border:1px solid #f4dbdc;
  border-radius:6px;
  font-size:12px;
  overflow-wrap:anywhere
}
.empty-state {
  text-align:center;
  padding:55px 24px 58px
}
.empty-icon {
  display:grid;
  place-items:center;
  width:48px;
  height:48px;
  background:#f3f6fa;
  border-radius:14px;
  margin:0 auto 18px;
  color:#7e94ac
}
.empty-icon .icon {
  width:23px;
  height:23px
}
.empty-state h3 {
  font-size:14px;
  color:#4b5d73
}
.empty-state p {
  font-size:11px;
  color:var(--muted);
  max-width:380px;
  margin:9px auto 0;
  line-height:1.9
}
.empty-state>.btn {
  margin-top:20px
}
.loading-state {
  min-height:230px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  color:var(--muted);
  font-size:12px
}
.error-state {
  margin:20px 0;
  background:white;
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:55px 24px;
  text-align:center
}
.error-state p {
  color:var(--muted);
  font-size:12px;
  margin:10px 0 20px
}
.pagination {
  border-top:1px solid var(--line);
  padding:15px 22px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:11px;
  color:var(--muted);
  gap:15px
}
.pagination-actions {
  display:flex;
  align-items:center;
  gap:12px
}
.modal {
  border:1px solid var(--line);
  border-radius:13px;
  width:min(600px,calc(100% - 32px));
  max-height:calc(100dvh - 48px);
  padding:0;
  box-shadow:0 24px 80px #10203630;
  color:var(--text);
  background:white
}
.modal-wide {
  width:min(760px,calc(100% - 32px))
}
.modal::backdrop {
  background:#10203670;
  backdrop-filter:blur(3px)
}
.modal-form {
  display:flex;
  flex-direction:column;
  max-height:calc(100dvh - 50px)
}
.modal-header {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
  padding:24px 26px 19px;
  border-bottom:1px solid var(--line);
  flex-shrink:0
}
.modal-header h2 {
  font-size:18px
}
.modal-header p {
  font-size:11px;
  color:var(--muted);
  margin-top:6px;
  line-height:1.8
}
.modal-body {
  overflow:auto;
  padding:24px 26px;
  overscroll-behavior:contain
}
.modal-footer {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  padding:17px 26px;
  border-top:1px solid var(--line);
  background:#fafbfd;
  flex-shrink:0
}
.submit-note {
  font-size:10px;
  color:var(--muted);
  margin-right:auto
}
.confirmation-text {
  font-size:13px;
  line-height:1.9;
  color:#59697c
}
.picker-message {
  font-size:10px;
  color:var(--muted)
}
.picker-message:empty {
  display:none
}
.toast-region {
  position:fixed;
  bottom:25px;
  right:25px;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:10px;
  z-index:1000;
  max-width:min(440px,calc(100vw - 32px));
  pointer-events:none
}
.toast {
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:15px 16px;
  border:1px solid var(--line);
  border-radius:10px;
  background:white;
  box-shadow:0 8px 35px #17283e18;
  font-size:12px;
  pointer-events:auto;
  color:var(--text)
}
.toast>.icon {
  color:var(--green);
  width:17px;
  height:17px;
  margin-top:2px
}
.toast.info>.icon {
  color:var(--blue)
}
.toast.danger>.icon {
  color:var(--red)
}
.toast .icon-button {
  padding:0;
  margin-left:5px
}
.clipboard-fallback {
  position:fixed;
  left:-9999px;
  top:0
}
.tabs {
  display:flex;
  gap:22px;
  align-items:center;
  border-bottom:1px solid var(--line);
  padding:0 24px
}
.tab {
  border:0;
  background:none;
  padding:15px 0 13px;
  font-size:12px;
  border-bottom:2px solid transparent;
  color:var(--muted);
  cursor:pointer
}
.tab.active {
  color:var(--navy);
  border-color:var(--gold);
  font-weight:600
}
.detail-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:22px
}
.detail-item dt {
  font-size:10px;
  color:var(--muted);
  margin-bottom:5px
}
.detail-item dd {
  margin:0;
  font-size:12px;
  color:#44576e;
  overflow-wrap:anywhere
}
.detail-item dd strong {
  font-size:14px
}
.inline-actions {
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap
}
.stack-gap {
  display:flex;
  flex-direction:column;
  gap:18px
}
.text-link {
  color:var(--blue);
  background:none;
  border:0;
  padding:0;
  text-align:left;
  font-size:inherit
}
.text-link:hover {
  text-decoration:underline
}
.danger-text {
  color:var(--red)
}
.summary-number {
  font-family:"Segoe UI",sans-serif;
  font-variant-numeric:tabular-nums
}
.progress-bar {
  display:block;
  width:100%;
  height:5px;
  border:0;
  border-radius:5px;
  overflow:hidden;
  background:#eaf0f5;
  appearance:none
}
.progress-bar::-webkit-progress-bar {
  background:#eaf0f5
}
.progress-bar::-webkit-progress-value {
  background:#7c98b1;
  border-radius:5px
}
.progress-bar::-moz-progress-bar {
  background:#7c98b1;
  border-radius:5px
}
.cell-message {
  max-width:260px;
  overflow-wrap:anywhere;
  font-size:11px;
  color:var(--muted)
}
@media(max-width:1180px) {
  th,td {
    padding-left:13px;
    padding-right:13px
  }
  .card-header {
    padding:18px 20px
  }
  .card-body {
    padding:20px
  }
  .search-toolbar {
    padding:16px 18px
  }
  .cell-actions {
    gap:2px
  }
  .btn-small {
    padding-left:7px;
    padding-right:7px
  }
  .detail-grid {
    grid-template-columns:repeat(2,minmax(0,1fr))
  }
}
@media(max-width:760px) {
  .btn {
    min-height:39px;
    font-size:12px;
    padding:8px 13px
  }
  .btn-small {
    min-height:31px;
    font-size:11px;
    padding:5px 9px
  }
  .card {
    border-radius:10px
  }
  .card-header {
    padding:17px 18px;
    gap:10px
  }
  .card-header h2 {
    font-size:14px
  }
  .card-body {
    padding:18px
  }
  .search-toolbar {
    padding:15px
  }
  .search-form {
    gap:8px
  }
  .search-input {
    max-width:none;
    min-width:140px
  }
  .filter-select {
    width:105px
  }
  .toolbar-note {
    width:100%;
    font-size:10px
  }
  .form-grid {
    grid-template-columns:1fr;
    gap:17px
  }
  .field-wide {
    grid-column:auto
  }
  .field-label {
    font-size:12px
  }
  input,select,textarea {
    font-size:16px;
    min-height:43px;
    padding:9px 10px
  }
  select {
    font-size:13px
  }
  .search-input input {
    font-size:13px;
    min-height:38px
  }
  .search-input>.icon {
    top:11px
  }
  .filter-select {
    min-height:38px
  }
  .field-help {
    font-size:10px
  }
  .table-wrap {
    overflow:visible
  }
  .responsive-table thead {
    display:none
  }
  .responsive-table,.responsive-table tbody,.responsive-table tr,.responsive-table td {
    display:block;
    width:100%
  }
  .responsive-table tr {
    padding:17px 18px;
    border-bottom:1px solid var(--line)
  }
  .responsive-table tr:last-child {
    border-bottom:0
  }
  .responsive-table td {
    display:grid;
    grid-template-columns:82px minmax(0,1fr);
    gap:10px;
    border:0;
    padding:5px 0;
    font-size:12px;
    align-items:start;
    min-height:30px
  }
  .responsive-table td::before {
    content:attr(data-label);
    color:var(--muted);
    font-size:10px;
    padding-top:2px
  }
  .responsive-table td[data-label="客户"] {
    display:block;
    padding:0 0 11px;
    margin-bottom:7px;
    border-bottom:1px solid #f0f3f6
  }
  .responsive-table td[data-label="客户"]::before {
    display:none
  }
  .responsive-table td[data-label="客户"] .cell-title {
    font-size:14px
  }
  .responsive-table td[data-label="操作"] {
    align-items:center;
    padding-top:9px
  }
  .responsive-table td>.badge {
    justify-self:start
  }
  .responsive-table .cell-actions {
    gap:6px
  }
  .responsive-table td>.cell-message {
    max-width:none
  }
  .responsive-table .cell-subtitle {
    font-size:11px
  }
  .pagination {
    padding:15px;
    font-size:10px;
    flex-wrap:wrap;
    gap:12px
  }
  .pagination-actions {
    gap:8px;
    margin-left:auto
  }
  .modal {
    width:calc(100% - 20px);
    max-height:calc(100dvh - 24px);
    border-radius:12px;
    margin:auto
  }
  .modal-form {
    max-height:calc(100dvh - 26px)
  }
  .modal-header {
    padding:20px 20px 16px
  }
  .modal-body {
    padding:20px;
    overflow-x:hidden
  }
  .modal-footer {
    padding:14px 20px
  }
  .modal-footer .btn {
    min-width:86px
  }
  .modal-header h2 {
    font-size:17px
  }
  .modal-header p {
    font-size:11px
  }
  .detail-grid {
    grid-template-columns:1fr 1fr;
    gap:20px 15px
  }
  .detail-item dt {
    font-size:10px
  }
  .detail-item dd {
    font-size:12px
  }
  .toast-region {
    bottom:16px;
    right:16px;
    left:16px;
    max-width:none;
    align-items:stretch
  }
  .toast {
    padding:13px;
    font-size:12px
  }
  .toast .icon-button {
    margin-left:auto
  }
  .alert {
    font-size:11px;
    padding:12px 14px
  }
  .tabs {
    padding:0 18px;
    gap:20px;
    overflow:auto
  }
  .tab {
    white-space:nowrap;
    font-size:12px
  }
  .empty-state {
    padding:40px 20px
  }
  .heading-actions .btn-text {
    flex:none
  }
  .inline-actions {
    gap:7px
  }
}

/* Full-width single-line access details keep the form usable at mobile widths. */
.access-input { min-width: 0; font-size: 14px; }
@media (max-width: 600px) { .access-input { font-size: 16px; } }
