/**
 * ERP / admin tool overrides — additive, compact, table-first.
 * Loads after app.css. Does not remove existing classes.
 */

/* ── Base: compact admin typography ── */
/* Admin pending-request banner + flash toast layering */
.admin-shell #flash-msg {
  z-index: 9999;
}

.admin-pending-banner {
  margin: 0;
  padding: 10px 16px;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  color: #92400e;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.admin-pending-banner[hidden] {
  display: none !important;
}

/* ── Admin 신규 요청 중앙 알림 모달 ── */
.admin-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(13, 23, 53, 0.58);
  backdrop-filter: blur(2px);
}

.admin-alert-overlay[hidden] {
  display: none !important;
}

.admin-alert-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10051;
  width: 560px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border: 2px solid #dc2626;
  border-radius: 12px;
  padding: 20px 22px 18px;
  box-shadow: 0 20px 48px rgba(13, 23, 53, 0.28);
  animation: adminAlertPop 0.22s ease-out;
}

.admin-alert-modal.is-attention {
  animation: adminAlertPop 0.22s ease-out, adminAlertPulse 1.1s ease-in-out 2;
}

.admin-alert-modal__title {
  margin: 0 0 14px;
  font-size: 24px;
  font-weight: 700;
  color: #991b1b;
  line-height: 1.3;
}

.admin-alert-modal__kv {
  margin: 0 0 18px;
}

.admin-alert-modal__row {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #eef2f1;
  font-size: 14px;
  line-height: 1.4;
}

.admin-alert-modal__row:last-child {
  border-bottom: none;
}

.admin-alert-modal__row dt {
  flex: 0 0 72px;
  margin: 0;
  color: #6b7280;
  font-weight: 600;
}

.admin-alert-modal__row dd {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  color: #0d1735;
  font-weight: 700;
  word-break: break-word;
}

.admin-alert-modal__actions {
  display: flex;
  gap: 8px;
}

.admin-alert-modal__actions .ds-btn {
  flex: 1 1 0;
  min-height: 44px;
  justify-content: center;
}

@keyframes adminAlertPop {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes adminAlertPulse {
  0%,
  100% {
    box-shadow: 0 20px 48px rgba(13, 23, 53, 0.28);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.22), 0 20px 48px rgba(13, 23, 53, 0.28);
  }
}

@media (max-width: 480px) {
  .admin-alert-modal {
    padding: 16px 16px 14px;
  }

  .admin-alert-modal__actions {
    flex-direction: column;
  }
}

/* ── Admin 출입증 삭제 확인 모달 ── */
.admin-ap-delete-modal {
  position: fixed;
  inset: 0;
  z-index: 10060;
}

.admin-ap-delete-modal[hidden] {
  display: none !important;
}

.admin-ap-delete-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(13, 23, 53, 0.58);
  backdrop-filter: blur(2px);
}

.admin-ap-delete-modal__dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10061;
  width: 420px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border: 1px solid var(--line, #dce5e3);
  border-radius: 12px;
  padding: 22px 24px 20px;
  box-shadow: 0 20px 48px rgba(13, 23, 53, 0.28);
}

.admin-ap-delete-modal__title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy, #0d1735);
}

.admin-ap-delete-modal__msg {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.5;
  color: #374151;
}

.admin-ap-delete-modal__actions {
  display: flex;
  gap: 8px;
}

.admin-ap-delete-modal__actions .ds-btn {
  flex: 1 1 0;
  min-height: 44px;
  justify-content: center;
}

.admin-content {
  padding: 16px 18px 24px;
  font-size: 14px;
  line-height: 1.35;
}

.admin-content .page-title,
.admin-topbar .page-title {
  font-size: 18px;
  line-height: 1.3;
}

.admin-content h2,
.admin-content h3,
.ds-buyer-panel h2 {
  font-size: 18px;
  line-height: 1.3;
  margin-bottom: 4px;
}

.admin-content .form-sub,
.ds-buyer-panel .form-sub {
  font-size: 13px;
  line-height: 1.35;
  margin-bottom: 10px;
}

/* ── Required field ── */
label .req,
.form-group label .req {
  color: var(--reject, #c0392b);
  margin-left: 2px;
}

/* ── Errors: flat, compact ── */
.alert-error,
.form-card .err {
  margin: 8px 0 10px;
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  font-size: 13px;
  line-height: 1.35;
}

/* ── Buttons: compact, 3 variants only ── */
.admin-content .btn-mini,
.admin-content .ds-btn,
.admin-content .btn-primary,
.admin-content .filter-tabs a {
  min-height: 32px;
  height: auto;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.25;
  box-shadow: none;
}

.admin-content .filter-tabs a {
  padding: 5px 10px;
}

.admin-content .ds-action-group {
  justify-content: flex-end;
  gap: 4px;
}

.admin-content .ds-action-group .btn-mini,
.admin-content .ds-action-group .ds-btn {
  min-height: 30px;
  padding: 4px 8px;
}

/* ── Summary / KPI: dense ── */
.admin-content .ds-admin-summary,
.ds-summary-grid,
.ds-summary-grid--5 {
  gap: 8px;
  margin-bottom: 12px;
}

.admin-content .ds-summary-card,
.ds-buyer-panel .ds-summary-card {
  padding: 10px 12px;
  border-radius: 4px;
  box-shadow: none;
  gap: 2px;
}

.admin-content .ds-summary-card .lbl,
.ds-summary-card .lbl {
  font-size: 11px;
  line-height: 1.2;
}

.admin-content .ds-summary-card .val,
.ds-summary-card .val {
  font-size: 20px;
  line-height: 1.1;
}

.ds-summary-grid--5 .ds-summary-card:nth-child(5) .val {
  color: var(--ink-soft, #5c6967);
  font-size: 18px;
}

/* ── Admin alert bar: flat ── */
.admin-content .ds-admin-alert {
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 4px;
  background: #fffbeb;
  box-shadow: none;
}

.admin-content .ds-sticky-toolbar {
  padding: 8px 0 10px;
  margin-bottom: 10px;
  backdrop-filter: none;
  background: #f0f3f5;
}

.admin-content .admin-toolbar {
  margin-bottom: 0;
  gap: 8px;
}

/* ── Cards: flat borders, no shadow ── */
.admin-content .admin-card {
  border-radius: 4px;
  box-shadow: none;
  margin-bottom: 12px;
}

.admin-content .admin-card.ds-table-wrap {
  box-shadow: none;
  border-radius: 4px;
}

/* ── Tables: priority — dense + sticky header + horizontal scroll ── */
.admin-content .admin-card.ds-table-wrap .ds-table-inner,
.admin-content .ds-table-wrap,
.ds-access-pass-history .ds-table-wrap,
.ds-buyer-panel .ds-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-height: none;
}

.admin-content .admin-table,
.admin-content .ds-table-wrap .admin-table,
.ds-access-pass-history .ap-history-table,
.ds-buyer-panel .status-table {
  min-width: 720px;
  font-size: 13px;
}

.admin-content .admin-table th,
.admin-content .admin-table td,
.ds-access-pass-history .ap-history-table th,
.ds-access-pass-history .ap-history-table td,
.ds-buyer-panel .status-table th,
.ds-buyer-panel .status-table td {
  padding: 7px 10px !important;
  line-height: 1.3;
  vertical-align: middle;
}

.admin-content .ds-table-wrap .admin-table thead th,
.ds-access-pass-history .ap-history-table thead th,
.ds-buyer-panel .status-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f4f7f6;
  box-shadow: 0 1px 0 var(--line);
  font-size: 12px;
  font-weight: 700;
}

.admin-content .admin-table tr:hover td {
  background: #fafbfb;
}

.admin-content .ds-row-pending {
  background: #fffdf5 !important;
}

.mono,
td.mono {
  font-family: Consolas, monospace;
  font-size: 12px;
  user-select: all;
}

/* Disable forced mobile card layout — keep table + scroll */
@media (max-width: 768px) {
  .admin-content .ds-table-inner.ds-mobile-cards .admin-table thead,
  .admin-content .ds-table-wrap.ds-mobile-cards .admin-table thead,
  .ds-access-pass-history .ap-history-table thead,
  .ds-access-pass-history .ds-mobile-cards thead,
  .ds-buyer-panel .status-table.ds-mobile-cards thead,
  .ds-buyer-panel .ds-table-wrap .status-table thead {
    display: table-header-group !important;
  }

  .admin-content .ds-table-inner.ds-mobile-cards .admin-table tbody tr,
  .admin-content .ds-table-wrap.ds-mobile-cards .admin-table tbody tr,
  .ds-access-pass-history .ap-history-table tbody tr,
  .ds-access-pass-history .ds-mobile-cards tbody tr,
  .ds-buyer-panel .status-table.ds-mobile-cards tbody tr,
  .ds-buyer-panel .ds-table-wrap .status-table tbody tr {
    display: table-row !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  .admin-content .ds-table-inner.ds-mobile-cards .admin-table tbody td,
  .admin-content .ds-table-wrap.ds-mobile-cards .admin-table tbody td,
  .ds-access-pass-history .ap-history-table tbody td,
  .ds-access-pass-history .ds-mobile-cards tbody td,
  .ds-buyer-panel .status-table.ds-mobile-cards tbody td,
  .ds-buyer-panel .ds-table-wrap .status-table tbody td {
    display: table-cell !important;
    padding: 7px 10px !important;
    border-bottom: 1px solid var(--line) !important;
    text-align: left !important;
    white-space: normal !important;
  }

  .admin-content .ds-table-inner.ds-mobile-cards .admin-table tbody td::before,
  .admin-content .ds-table-wrap.ds-mobile-cards .admin-table tbody td::before,
  .ds-access-pass-history .ap-history-table tbody td::before,
  .ds-access-pass-history .ds-mobile-cards tbody td::before,
  .ds-buyer-panel .status-table.ds-mobile-cards tbody td::before,
  .ds-buyer-panel .ds-table-wrap .status-table tbody td::before {
    content: none !important;
    display: none !important;
  }

  .admin-content .search-box {
    display: flex;
    gap: 6px;
    flex: 1;
    min-width: 0;
  }

  .admin-content .search-box input[type='text'] {
    min-height: 32px;
    font-size: 16px;
  }

  .admin-content .search-box button {
    min-height: 32px;
  }

  .admin-content .filter-tabs {
    flex-wrap: wrap;
    gap: 4px;
  }

  .admin-content .filter-tabs a {
    min-height: 32px;
    flex: 0 1 auto;
  }

  .ds-summary-grid,
  .ds-summary-grid--5 {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .ds-quick-btn-group .ds-btn {
    min-height: 36px;
    flex: 1 1 auto;
    width: auto;
  }
}

/* ── /admin/settings ── */
.admin-content .ds-settings-toggles,
.admin-content .ds-settings-panel {
  padding: 14px 16px;
  border-radius: 4px;
  box-shadow: none;
}

.admin-content .ds-settings-heading {
  font-size: 16px;
  margin-bottom: 4px;
}

.admin-content .ds-settings-desc {
  font-size: 13px;
  margin-bottom: 12px;
}

.admin-content .toggle-row {
  padding: 10px 12px;
  border-radius: 4px;
  gap: 10px;
}

.admin-content .toggle-row__title {
  font-size: 14px;
}

.admin-content .toggle-row__hint {
  font-size: 12px;
  line-height: 1.35;
}

.admin-content .toggle-btn {
  min-width: 64px;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
}

.admin-content .settings-site-input {
  min-height: 34px;
  border-radius: 4px;
  font-size: 14px;
}

.admin-content .btn-settings-save {
  min-height: 34px;
  border-radius: 4px;
}

/* ── /status (buyer) ── */
.ds-buyer-panel {
  padding: 16px 18px;
  border-radius: 4px;
  box-shadow: none;
}

.ds-buyer-panel .ds-status-alert {
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 13px;
}

.ds-buyer-panel .ds-quick-btn-group {
  margin-top: 12px;
  padding-top: 10px;
  gap: 6px;
}

.ds-buyer-panel .ds-btn {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 4px;
  box-shadow: none;
}

/* ── /access-pass/request — form tool, not landing ── */
.access-pass-shell {
  max-width: 640px;
  padding: 12px 12px 24px;
}

.access-pass-card.form-card {
  padding: 16px 16px 20px;
  border-radius: 4px;
  box-shadow: none;
  border: 1px solid var(--line, #c9d2d0);
}

.access-pass-head h2 {
  font-size: 18px;
  margin: 6px 0 4px;
}

.access-pass-steps {
  margin: 12px 0 14px;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  gap: 6px;
}

.access-pass-section {
  margin-bottom: 16px;
  padding-bottom: 14px;
}

.access-pass-section h3 {
  font-size: 14px;
  margin-bottom: 10px;
}

.access-pass-shell .form-group label {
  font-size: 13px;
  margin-bottom: 2px;
}

.access-pass-shell input,
.access-pass-shell select,
.access-pass-shell textarea {
  min-height: 34px;
  border-radius: 4px;
  font-size: 14px;
  padding: 6px 10px;
}

@media (max-width: 768px) {
  .access-pass-shell input,
  .access-pass-shell select {
    font-size: 16px;
  }
}

.access-pass-shell .btn-mini.ds-btn,
.access-pass-shell .access-pass-submit {
  min-height: 34px;
  border-radius: 4px;
  box-shadow: none;
}

.access-pass-upload {
  border-radius: 4px;
  padding: 12px;
}

.access-pass-done.form-card {
  padding: 24px 16px;
  box-shadow: none;
  border-radius: 4px;
}

.access-pass-done h2 {
  font-size: 18px;
}

.access-pass-done-actions {
  gap: 8px;
  margin-top: 16px;
}

.access-pass-done-actions .ds-btn {
  min-height: 34px;
  min-width: 0;
  border-radius: 4px;
}

/* ── /buyer/access-pass/history ── */
.ds-access-pass-history {
  padding: 16px 18px;
}

.ds-access-pass-history .ap-badge,
.ds-access-pass-history .status-badge {
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
}

.ds-access-pass-history .ds-pager {
  margin-top: 10px;
  padding: 8px 0;
}

.ds-access-pass-history .ds-pager .ds-btn {
  min-height: 32px;
  min-width: 72px;
}

/* ── Page overflow: allow table scroll, block body bleed ── */
@media (max-width: 768px) {
  html,
  body {
    overflow-x: clip;
  }

  .admin-content,
  .ds-buyer-panel,
  .ds-access-pass-history {
    max-width: 100%;
    overflow-x: hidden;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Member / public UI — ERP compact (no v0 tokens)
   ═══════════════════════════════════════════════════════════════ */

/* ── Shared buttons (primary / secondary) ── */
.ds-ui-status .ds-btn--primary,
.ds-ui-access-pass-buyer .ds-btn--primary,
.ds-ui-access-pass-history .ds-btn--primary,
.ds-ui-access-pass .ds-btn--primary,
.ds-ui-access-pass-done .ds-btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: none;
  font-weight: 600;
  letter-spacing: 0;
}

.ds-ui-status .ds-btn--primary:hover,
.ds-ui-access-pass-buyer .ds-btn--primary:hover,
.ds-ui-access-pass-history .ds-btn--primary:hover,
.ds-ui-access-pass .ds-btn--primary:hover,
.ds-ui-access-pass-done .ds-btn--primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

.ds-ui-status .ds-btn--secondary,
.ds-ui-access-pass-buyer .ds-btn--secondary,
.ds-ui-access-pass-history .ds-btn--secondary,
.ds-ui-access-pass .ds-btn--secondary,
.ds-ui-access-pass-done .ds-btn--secondary {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--navy);
  box-shadow: none;
  font-weight: 600;
}

.ds-ui-status .ds-btn--secondary:hover,
.ds-ui-access-pass-buyer .ds-btn--secondary:hover,
.ds-ui-access-pass-history .ds-btn--secondary:hover,
.ds-ui-access-pass .ds-btn--secondary:hover,
.ds-ui-access-pass-done .ds-btn--secondary:hover {
  background: #f5f8f7;
  border-color: var(--line);
  color: var(--navy);
}

/* ── Badges: flat outlined, readable ── */
.ds-ui-status .status-badge,
.ds-ui-status .payment-badge,
.ds-ui-access-pass-history .status-badge,
.ds-ui-access-pass-history .ap-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  border: 1px solid transparent;
  white-space: nowrap;
}

.ds-ui-status .status-badge--requested,
.ds-ui-status .payment-badge--pending,
.ds-ui-access-pass-history .status-badge--requested {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fdba74;
}

.ds-ui-status .status-badge--released,
.ds-ui-access-pass-history .status-badge--released {
  background: #ecfdf5;
  color: #047857;
  border-color: #6ee7b7;
}

.ds-ui-status .status-badge--rc_issued,
.ds-ui-status .status-badge--inspect_wait {
  background: #ecfeff;
  color: #0e7490;
  border-color: #67e8f9;
}

.ds-ui-status .payment-badge--confirmed {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.ds-ui-status .status-badge--rejected,
.ds-ui-access-pass-history .status-badge--rejected {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.ds-ui-status .status-badge--default,
.ds-ui-access-pass-history .status-badge--default {
  background: #f3f4f6;
  color: #4b5563;
  border-color: #d1d5db;
}

.ds-ui-status .status-badge--inspect_done {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.ds-ui-status .ds-status-rc-link {
  color: var(--brand-dark, #0a6157);
  font-weight: 700;
  text-decoration: none;
  font-family: Consolas, monospace;
  font-size: 12px;
}

.ds-ui-status .ds-status-rc-link:hover {
  text-decoration: underline;
  color: var(--brand, #0d9488);
}

.ds-ui-status .status-table .btn-receipt.btn-receipt--issue {
  border-color: #fdba74;
  color: #c2410c;
  background: #fff7ed;
}

/* ── Buyer shell: header + nav (layout inline → css) ── */
.buyer-portal-header {
  display: block;
  padding: 0 !important;
  background: #fff;
  border-bottom: 1px solid #d8e0e4;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.buyer-portal-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  flex-wrap: wrap;
}

.buyer-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 240px;
}

.buyer-header-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #14b8a6 0%, #0a6157 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.buyer-header-titles {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.buyer-header-title {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--navy, #0d1735);
  text-decoration: none;
  line-height: 1.2;
  letter-spacing: -0.02em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buyer-header-sub {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.2;
}

.buyer-header-title:hover {
  color: var(--brand-dark, #0a6157);
}

.buyer-header-account {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.buyer-header-who {
  text-align: right;
  min-width: 0;
}

.buyer-header-who .lbl {
  display: none;
}

.buyer-header-who .name {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy, #0d1735);
  line-height: 1.3;
}

.buyer-header-who .id {
  font-size: 11px;
  color: #64748b;
  font-family: ui-monospace, Consolas, monospace;
}

.buyer-header-logout {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 6px 14px !important;
  font-size: 12px !important;
  font-weight: 600;
  border-radius: 8px;
  border-color: #d8e0e4 !important;
  white-space: nowrap;
}

.buyer-portal-tabs {
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 0 20px 0;
  margin: 0;
  background: #f4f7f8;
  border-top: 1px solid #e8eeef;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.buyer-portal-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  margin-bottom: -1px;
  border: 1px solid transparent;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.buyer-portal-tab:hover {
  color: #0d1735;
  background: rgba(255, 255, 255, 0.6);
}

.buyer-portal-tab.is-active {
  color: #0a6157;
  background: #fff;
  border-color: #d8e0e4;
  border-bottom-color: #fff;
  font-weight: 700;
}

.buyer-portal-tab {
  position: relative;
}

.buyer-portal-tab.is-active::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #14b8a6;
}

/* legacy nav btn — keep for non-portal pages */
.buyer-portal-nav {
  display: none;
}

.buyer-nav-btn {
  display: none;
}

.buyer-header-right {
  display: none;
}

.buyer-shell .buyer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-right: 12px;
}

.buyer-shell--status .buyer-nav {
  gap: 6px;
  margin-right: 8px;
}

.buyer-shell--status .buyer-nav a {
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.25;
  border-color: #d8e0de;
  background: #fafcfb;
  color: var(--ink-soft);
  font-weight: 600;
}

.buyer-shell--status .buyer-nav a:hover {
  background: #f0f5f4;
  color: var(--navy);
}

/* ── Buyer portal: wide layout (/status, access-pass, history) ── */
.buyer-shell.buyer-portal-shell {
  background: #e8ecef;
}

.buyer-shell.buyer-portal-shell > main.buyer-content {
  max-width: 1240px;
  width: calc(100% - 48px);
  margin: 0 auto;
  padding: 10px 0 14px;
  box-sizing: border-box;
}

.buyer-shell.buyer-portal-shell .form-card,
.buyer-shell.buyer-portal-shell .ds-buyer-panel {
  max-width: none;
  width: 100%;
  margin: 0;
  min-height: 0;
  border: 1px solid #d8e0e4;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  background: #fff;
}

.buyer-shell.buyer-portal-shell .ds-ui-status,
.buyer-shell.buyer-portal-shell .ds-ui-access-pass-history,
.buyer-shell.buyer-portal-shell .ds-ui-access-pass-buyer,
.buyer-shell.buyer-portal-shell .buyer-access-pass-shell {
  max-width: none;
}

.buyer-shell.buyer-portal-shell .ds-buyer-panel {
  padding: 18px 22px 22px;
}

.buyer-shell.buyer-portal-shell .ds-buyer-release {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 18px 22px 22px;
  border: 1px solid #d8e0e4;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  background: #fff;
  box-sizing: border-box;
}

.buyer-shell.buyer-portal-shell .rv-wrap.ds-buyer-release {
  padding: 0;
}

/* ── Buyer /status notice — 개별 순차 팝업 (4 themes) ── */
.buyer-notice-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  pointer-events: none;
}

.buyer-notice-modal[hidden] {
  display: none !important;
}

.buyer-notice-modal.is-open {
  pointer-events: auto;
}

.buyer-notice-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.buyer-notice-modal__panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: min(90vh, 640px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.28);
  overflow: hidden;
  border: 2px solid transparent;
}

.buyer-notice-modal__hero {
  padding: 20px 20px 14px;
  text-align: center;
  flex-shrink: 0;
}

.buyer-notice-modal__tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.buyer-notice-modal__icon {
  display: block;
  font-size: 48px;
  line-height: 1;
  margin: 4px auto 12px;
}

.buyer-notice-modal__title {
  margin: 0 0 12px;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
}

.buyer-notice-modal__period {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.buyer-notice-modal__period-label {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
}

.buyer-notice-modal__period-value {
  font-size: 14px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 8px;
}

.buyer-notice-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 16px;
  -webkit-overflow-scrolling: touch;
}

.buyer-notice-modal__body p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.55;
}

.buyer-notice-modal__body p:last-child {
  margin-bottom: 0;
}

.buyer-notice-modal__emphasis {
  margin-top: 12px !important;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px !important;
}

.buyer-notice-modal__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 16px 16px;
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.buyer-notice-modal__btn-today {
  flex: 1 1 auto;
  min-width: 0;
}

.buyer-notice-modal__btn-ok {
  flex: 0 0 auto;
  min-width: 96px;
}

/* 1) 소방 — 붉은 계열 / 경고 헤더 */
.buyer-notice-modal--fire .buyer-notice-modal__panel {
  border-color: #fecaca;
  box-shadow: 0 20px 48px rgba(185, 28, 28, 0.22);
}

.buyer-notice-modal--fire .buyer-notice-modal__hero {
  background: linear-gradient(180deg, #fef2f2 0%, #fff 100%);
  border-bottom: 3px solid #dc2626;
}

.buyer-notice-modal--fire .buyer-notice-modal__tag {
  background: #dc2626;
  color: #fff;
}

.buyer-notice-modal--fire .buyer-notice-modal__title {
  color: #7f1d1d;
}

.buyer-notice-modal--fire .buyer-notice-modal__period-value {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.buyer-notice-modal--fire .buyer-notice-modal__body p {
  color: #450a0a;
}

.buyer-notice-modal--fire .buyer-notice-modal__btn-ok {
  background: #dc2626;
  border-color: #b91c1c;
}

/* 2) 차량 — 파랑/청록 / 등록증 느낌 */
.buyer-notice-modal--vehicle .buyer-notice-modal__panel {
  border-color: #99f6e4;
  box-shadow: 0 20px 48px rgba(13, 148, 136, 0.2);
}

.buyer-notice-modal--vehicle .buyer-notice-modal__hero {
  background: linear-gradient(180deg, #ecfeff 0%, #fff 100%);
  border-bottom: 3px solid #0d9488;
}

.buyer-notice-modal--vehicle .buyer-notice-modal__tag {
  background: #0d9488;
  color: #fff;
}

.buyer-notice-modal--vehicle .buyer-notice-modal__title {
  color: #134e4a;
}

.buyer-notice-modal--vehicle .buyer-notice-modal__period-value {
  background: #ccfbf1;
  color: #115e59;
  border: 1px dashed #5eead4;
}

.buyer-notice-modal--vehicle .buyer-notice-modal__body p {
  color: #134e4a;
}

.buyer-notice-modal--vehicle .buyer-notice-modal__emphasis {
  background: #f0fdfa;
  border: 1px solid #5eead4;
  color: #0f766e;
}

.buyer-notice-modal--vehicle .buyer-notice-modal__btn-ok {
  background: #0d9488;
  border-color: #0f766e;
}

/* 3) 입찰 — 주황/경고 박스 */
.buyer-notice-modal--bid .buyer-notice-modal__panel {
  border-color: #fcd34d;
  box-shadow: 0 20px 48px rgba(180, 83, 9, 0.22);
}

.buyer-notice-modal--bid .buyer-notice-modal__hero {
  background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);
  border-bottom: 3px solid #d97706;
}

.buyer-notice-modal--bid .buyer-notice-modal__tag {
  background: #1c1917;
  color: #fbbf24;
}

.buyer-notice-modal--bid .buyer-notice-modal__title {
  color: #78350f;
}

.buyer-notice-modal--bid .buyer-notice-modal__period-value {
  background: #fef3c7;
  color: #92400e;
  border: 2px solid #f59e0b;
}

.buyer-notice-modal--bid .buyer-notice-modal__body {
  background: #fffbeb;
  margin: 0 12px 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid #fbbf24;
}

.buyer-notice-modal--bid .buyer-notice-modal__body p {
  color: #422006;
}

.buyer-notice-modal--bid .buyer-notice-modal__emphasis {
  background: #1c1917;
  color: #fde68a;
  border: none;
}

.buyer-notice-modal--bid .buyer-notice-modal__btn-ok {
  background: #d97706;
  border-color: #b45309;
}

/* 4) 재계약 — 보라/남색 / 문서 카드 */
.buyer-notice-modal--contract .buyer-notice-modal__panel {
  border-color: #c4b5fd;
  box-shadow: 0 20px 48px rgba(91, 33, 182, 0.2);
}

.buyer-notice-modal--contract .buyer-notice-modal__hero {
  background: linear-gradient(180deg, #f5f3ff 0%, #fff 100%);
  border-bottom: 3px solid #7c3aed;
}

.buyer-notice-modal--contract .buyer-notice-modal__tag {
  background: #5b21b6;
  color: #ede9fe;
}

.buyer-notice-modal--contract .buyer-notice-modal__title {
  color: #4c1d95;
}

.buyer-notice-modal--contract .buyer-notice-modal__period-value {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #c4b5fd;
  box-shadow: inset 0 0 0 1px #fff;
}

.buyer-notice-modal--contract .buyer-notice-modal__body {
  background: #faf5ff;
  margin: 0 12px 12px;
  padding: 14px 16px;
  border-radius: 10px;
  border-left: 4px solid #7c3aed;
}

.buyer-notice-modal--contract .buyer-notice-modal__body p {
  color: #3b0764;
}

.buyer-notice-modal--contract .buyer-notice-modal__btn-ok {
  background: #7c3aed;
  border-color: #6d28d9;
}

body.buyer-notice-modal-open {
  overflow: hidden;
}

@media (max-width: 520px) {
  .buyer-notice-modal {
    padding: 10px;
    align-items: flex-end;
  }

  .buyer-notice-modal__panel {
    width: 100%;
    max-height: 92vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .buyer-notice-modal__icon {
    font-size: 40px;
  }

  .buyer-notice-modal__title {
    font-size: 17px;
  }

  .buyer-notice-modal__footer {
    flex-direction: column-reverse;
  }

  .buyer-notice-modal__btn-today,
  .buyer-notice-modal__btn-ok {
    width: 100%;
    flex: none;
  }

  .buyer-notice-modal--bid .buyer-notice-modal__body,
  .buyer-notice-modal--contract .buyer-notice-modal__body {
    margin-left: 10px;
    margin-right: 10px;
  }
}

.buyer-shell.buyer-portal-shell .app-footer.buyer-portal-footer,
.buyer-shell.buyer-portal-shell .app-footer {
  max-width: 1240px;
  width: calc(100% - 48px);
  margin: 4px auto 12px;
  padding: 8px 0;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.buyer-shell.buyer-portal-shell .ds-ui-status .ds-summary-grid--5,
.buyer-shell.buyer-portal-shell .ds-ui-access-pass-history .ds-ap-history-kpi {
  gap: 10px;
  margin-top: 10px;
}

.buyer-shell.buyer-portal-shell .ds-ui-status .ds-status-actions,
.buyer-shell.buyer-portal-shell .ds-ui-access-pass-history .ds-ap-history-actions {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding-top: 0;
  border-top: none;
}

.buyer-shell.buyer-portal-shell .ds-ui-status .ds-status-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.buyer-shell.buyer-portal-shell .ds-ui-access-pass-history .ds-ap-history-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.buyer-shell.buyer-portal-shell .ds-quick-btn-group--uniform .ds-btn {
  min-width: 0;
  width: 100%;
}

.buyer-shell.buyer-portal-shell .ds-table-wrap {
  width: 100%;
  max-width: 100%;
}

.buyer-shell.buyer-portal-shell .ds-table-wrap .status-table,
.buyer-shell.buyer-portal-shell .ds-table-wrap .admin-table {
  width: 100%;
}

.buyer-shell.buyer-portal-shell .ds-ui-status .ds-section-label,
.buyer-shell.buyer-portal-shell .ds-ui-access-pass-history .ds-section-label {
  margin-top: 12px;
}

.buyer-shell.buyer-portal-shell .ds-ui-status .ds-status-alerts {
  margin-top: 10px;
}

@media (max-width: 768px) {
  .buyer-shell.buyer-portal-shell > main.buyer-content,
  .buyer-shell.buyer-portal-shell .app-footer {
    width: calc(100% - 24px);
  }
}

@media (max-width: 360px) {
  .buyer-shell.buyer-portal-shell > main.buyer-content {
    width: 100%;
    padding: 8px 12px 14px;
    box-sizing: border-box;
  }

  .buyer-shell.buyer-portal-shell .app-footer {
    width: calc(100% - 24px);
    margin-top: 6px;
    padding: 8px 0;
  }

  .buyer-shell.buyer-portal-shell .ds-buyer-panel {
    padding: 14px 12px;
  }

  .buyer-shell.buyer-portal-shell .ds-ui-status .ds-status-actions,
  .buyer-shell.buyer-portal-shell .ds-ui-access-pass-history .ds-ap-history-actions {
    grid-template-columns: 1fr;
  }

  .buyer-shell.buyer-portal-shell .ds-ui-status .ds-summary-grid--5 {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── /status — KPI + actions ── */
.ds-ui-status {
  max-width: 1240px;
}

.ds-ui-status .ds-summary-grid--5 {
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 0;
}

.ds-ui-status .ds-status-actions {
  margin-top: 12px;
  margin-bottom: 0;
  padding-top: 0;
  border-top: none;
}

.ds-ui-status .ds-status-actions .ds-btn--primary {
  box-shadow: none;
  font-weight: 700;
}

.ds-ui-status .ds-summary-card {
  min-height: 64px;
  justify-content: center;
  border-radius: 4px;
  box-shadow: none;
  padding: 10px 12px;
}

.ds-ui-status .ds-summary-card .lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-soft);
  line-height: 1.2;
}

.ds-ui-status .ds-summary-card .val {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}

.ds-ui-status .ds-status-alerts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  margin-bottom: 0;
}

.ds-ui-status .ds-status-alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.35;
}

.ds-ui-status .ds-section-label {
  margin: 16px 0 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ds-ui-status .ds-section-sub {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-soft);
}

.ds-ui-status .ds-quick-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.ds-quick-btn-group--uniform {
  align-items: stretch;
}

.ds-quick-btn-group--uniform .ds-btn {
  flex: 1 1 0;
  min-width: 140px;
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 4px;
  text-align: center;
  justify-content: center;
  display: inline-flex;
  align-items: center;
}

.ds-ui-status .ds-quick-btn-group .ds-btn {
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 4px;
}

/* status table: override inline mobile-card → scroll table */
.ds-ui-status .ds-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 0;
}

.ds-ui-status .status-table {
  table-layout: auto;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px;
  margin-top: 0;
}

.ds-ui-status .status-table th,
.ds-ui-status .status-table td {
  white-space: normal;
  word-break: break-word;
  vertical-align: middle;
  text-align: left;
}

.ds-ui-status .status-table .col-rc,
.ds-ui-status .status-table td.col-rc {
  white-space: nowrap;
}

.ds-ui-status .status-table td:not(.col-rc) {
  min-width: 0;
}

.ds-ui-status .status-table td.center,
.ds-ui-status .status-table th.center {
  text-align: center;
}

.ds-ui-status .status-table .btn-receipt {
  vertical-align: middle;
  white-space: nowrap;
}

.ds-ui-status .status-table thead th:nth-child(1) { width: 100px; }
.ds-ui-status .status-table thead th:nth-child(2) { width: 130px; }
.ds-ui-status .status-table thead th:nth-child(3) { width: auto; }
.ds-ui-status .status-table thead th:nth-child(4) { width: 90px; }
.ds-ui-status .status-table thead th:nth-child(5) { width: 80px; }
.ds-ui-status .status-table thead th:nth-child(6) { width: 110px; }
.ds-ui-status .status-table thead th:nth-child(7) { width: 100px; }
.ds-ui-status .status-table thead th:nth-child(8) { width: 110px; }

.ds-ui-status .form-hint {
  margin-top: 12px;
}

.ds-ui-status .status-table thead th {
  background: #f4f7f6;
  border-bottom: 2px solid var(--line);
  padding: 7px 10px !important;
  font-size: 12px;
}

.ds-ui-status .status-table tbody td {
  padding: 7px 10px !important;
  font-size: 12px;
  border-bottom: 1px solid #eef2f1;
}

@media (max-width: 768px) {
  .ds-ui-status .status-table thead {
    display: table-header-group !important;
  }

  .ds-ui-status .status-table tbody tr {
    display: table-row !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  .ds-ui-status .status-table tbody td {
    display: table-cell !important;
    padding: 7px 10px !important;
    border-bottom: 1px solid var(--line) !important;
    text-align: left !important;
  }

  .ds-ui-status .status-table tbody td::before {
    content: none !important;
    display: none !important;
  }

  .ds-ui-status .status-table .btn-receipt {
    width: auto !important;
    min-height: 30px;
    padding: 4px 10px !important;
    margin-top: 0 !important;
  }

  .ds-ui-status .ds-summary-grid--5 {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
}

@media (max-width: 360px) {
  .ds-ui-status .ds-status-actions,
  .ds-ui-status .ds-quick-btn-group {
    flex-direction: column;
  }

  .ds-ui-status .ds-status-actions.ds-quick-btn-group--uniform .ds-btn,
  .ds-ui-status .ds-quick-btn-group--uniform .ds-btn {
    width: 100%;
    flex: 1 1 100%;
    text-align: center;
    justify-content: center;
  }

  .ds-ui-status .ds-summary-grid--5 {
    grid-template-columns: 1fr 1fr;
  }

  .ds-ui-status .ds-summary-card:nth-child(5) {
    grid-column: 1 / -1;
  }
}

/* ── Tenant search modal ── */
.ds-ui-tenant-modal {
  max-width: 520px;
}

.ds-ui-tenant-modal .ds-ui-field-label {
  display: block;
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
}

.ds-ui-tenant-modal input[type='search'] {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 8px;
}

.ds-ui-tenant-modal input[type='search']:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

.ds-ui-tenant-results-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 6px 10px;
  background: #f4f7f6;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
}

.ds-ui-tenant-modal .tenant-search-results {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 0 0 4px 4px;
  background: #fff;
  margin-bottom: 12px;
}

.ds-ui-tenant-modal .tenant-search-results li {
  margin: 0;
  border-bottom: 1px solid #eef2f1;
}

.ds-ui-tenant-modal .tenant-search-results li:last-child {
  border-bottom: none;
}

.ds-ui-tenant-modal .tenant-search-results li button {
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: none;
  border-radius: 0;
  background: #fff;
  font-size: 12px;
  line-height: 1.35;
  color: var(--navy);
  text-align: left;
  cursor: pointer;
}

.ds-ui-tenant-modal .tenant-search-results li button:hover {
  background: #f5f8f7;
}

.ds-ui-tenant-modal .tenant-search-results li[style] {
  padding: 10px;
  font-size: 12px;
}

.ds-ui-access-pass .tenant-selected-wrap {
  flex-wrap: wrap;
  gap: 8px;
}

.ds-ui-access-pass #tenant-search-open {
  width: 100%;
  max-width: 280px;
  min-height: 36px;
}

/* ── Public / buyer access-pass form sections ── */
.ds-ui-access-pass .access-pass-section,
.ds-ui-access-pass-buyer .form-section {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.ds-ui-access-pass .access-pass-section:first-of-type,
.ds-ui-access-pass-buyer .form-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.ds-ui-access-pass .access-pass-section h3,
.ds-ui-access-pass-buyer .form-section h3 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--navy);
}

.ds-ui-access-pass .access-pass-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 14px;
  padding: 0;
}

.ds-ui-access-pass .access-pass-steps span {
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
}

.ds-ui-access-pass .access-pass-steps span.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.ds-ui-access-pass .ds-auto-block,
.ds-ui-access-pass-buyer .ds-auto-block {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #f5f8f7;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.ds-ui-access-pass .ds-auto-block h4,
.ds-ui-access-pass-buyer .ds-auto-block h4 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.ds-ui-access-pass .email-verify-row,
.ds-ui-access-pass .email-code-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.ds-ui-access-pass .email-verify-row input,
.ds-ui-access-pass .email-code-row input {
  flex: 1 1 160px;
  min-width: 0;
}

.ds-ui-access-pass .email-verify-row .ds-btn,
.ds-ui-access-pass .email-code-row .ds-btn {
  flex: 0 0 auto;
  min-height: 34px;
  white-space: nowrap;
}

.ds-ui-access-pass .access-pass-valid-hint {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  font-size: 12px;
  color: #1e40af;
}

/* Upload zone */
.ds-ui-access-pass .access-pass-upload,
.ds-ui-access-pass-buyer .ds-upload-zone {
  margin-top: 6px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  background: #fafbfb;
  text-align: center;
}

.ds-ui-access-pass .file-drop-hint,
.ds-ui-access-pass-buyer .file-drop-hint {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.ds-ui-access-pass .license-file-info,
.ds-ui-access-pass-buyer .license-file-info {
  margin-top: 8px;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  word-break: break-all;
}

.ds-ui-access-pass .access-pass-agree,
.ds-ui-access-pass-buyer .ds-checks-emphasis {
  margin-top: 12px;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  font-size: 12px;
  line-height: 1.45;
}

.ds-ui-access-pass .access-pass-submit,
.ds-ui-access-pass-buyer .btn-submit {
  width: 100%;
  margin-top: 14px;
  min-height: 38px;
  border-radius: 4px;
}

/* Buyer access-pass — industrial application card layout */
.buyer-access-pass-shell .buyer-ap-card {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.buyer-access-pass-shell .buyer-ap-card:first-of-type {
  margin-top: 12px;
}

.buyer-access-pass-shell .buyer-ap-card__title {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.buyer-access-pass-shell .buyer-ap-card__hint {
  margin: -4px 0 10px;
  font-size: 11px;
}

.buyer-access-pass-shell .buyer-ap-auto-block {
  margin-bottom: 10px;
}

.buyer-access-pass-shell .planned-visitor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.buyer-access-pass-shell .planned-visitor-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.35;
}

.buyer-access-pass-shell .ap-readonly-field {
  background: #f5f8f7;
  color: var(--ink);
  cursor: default;
}

.buyer-access-pass-shell .ap-field-note {
  margin: 4px 0 0;
  font-size: 10px;
}

.buyer-access-pass-shell .extra-visitor-block {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.buyer-access-pass-shell .extra-visitor-add-btn,
.buyer-access-pass-shell .extra-visitor-remove-btn {
  width: 100%;
  min-height: 36px;
}

.buyer-access-pass-shell .idcard-upload-status {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}

.buyer-access-pass-shell .buyer-ap-card--submit .access-pass-agree {
  margin-top: 0;
}

.buyer-access-pass-shell .buyer-ap-submit {
  width: 100%;
  min-height: 48px;
  height: 48px;
  margin-top: 16px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: 6px;
}

.buyer-access-pass-shell .vehicle-fields-wrap {
  margin-top: 8px;
}

.buyer-access-pass-shell .form-grid .form-group input,
.buyer-access-pass-shell .form-grid .form-group select,
.buyer-access-pass-shell .birth-select-group select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ds-ui-access-pass-buyer .form-grid {
  gap: 10px;
}

.ds-ui-access-pass-buyer .form-group label[style],
.ds-ui-access-pass-buyer label[style] {
  font-size: 13px !important;
  line-height: 1.35;
}

/* ── History table + pager ── */
.ds-ui-access-pass-history {
  max-width: 1240px;
}

.ds-ui-access-pass-history .ds-ap-history-kpi {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 0;
}

.ds-ui-access-pass-history .ds-ap-history-kpi .ds-summary-card.is-expired {
  background: #f9fafb;
  border-color: #d1d5db;
}

.ds-ui-access-pass-history .ds-ap-history-kpi .ds-summary-card.is-expired .val {
  color: #4b5563;
}

.ds-ui-access-pass-history .ds-ap-history-kpi .ds-summary-card {
  min-height: 64px;
  justify-content: center;
  border-radius: 4px;
  box-shadow: none;
  padding: 10px 12px;
}

.ds-ui-access-pass-history .ds-ap-history-kpi .ds-summary-card .lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-soft);
  line-height: 1.2;
}

.ds-ui-access-pass-history .ds-ap-history-kpi .ds-summary-card .val {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}

.ds-ui-access-pass-history .ds-ap-history-actions {
  margin-top: 12px;
  margin-bottom: 0;
  padding-top: 0;
  border-top: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ds-ui-access-pass-history .ds-section-label {
  margin: 16px 0 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ds-ui-access-pass-history .ds-section-sub {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-soft);
}

.ds-ui-access-pass-history .ap-history-more-hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--ink-soft);
}

.ds-ui-access-pass-history .ds-ap-history-actions.ds-quick-btn-group--uniform .ds-btn {
  flex: 1 1 0;
  min-width: 140px;
  min-height: max(44px, 2.75rem);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .ds-ui-access-pass-history .ds-ap-history-kpi {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ds-ui-access-pass-history .ds-ap-history-actions {
    flex-direction: row;
  }

  .ds-ui-access-pass-history .ds-ap-history-actions.ds-quick-btn-group--uniform .ds-btn {
    width: auto;
    flex: 1 1 0;
  }
}

@media (max-width: 640px) {
  .ds-ui-access-pass-history .ds-ap-history-kpi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .ds-ui-access-pass-history .ds-ap-history-kpi {
    grid-template-columns: 1fr 1fr;
  }
}

.ds-ui-access-pass-history .status-badge.ap-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid transparent;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.ds-ui-access-pass-history .status-badge--requested,
.ds-ui-access-pass-history .ap-badge.status-badge--requested {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fdba74;
  box-shadow: inset 0 0 0 1px rgba(251, 146, 60, 0.15);
}

.ds-ui-access-pass-history .status-badge--released,
.ds-ui-access-pass-history .ap-badge.status-badge--released {
  background: #ecfdf5;
  color: #047857;
  border-color: #6ee7b7;
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.12);
}

.ds-ui-access-pass-history .status-badge--rejected,
.ds-ui-access-pass-history .ap-badge.status-badge--rejected {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fca5a5;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.12);
}

.ds-ui-access-pass-history .status-badge--default,
.ds-ui-access-pass-history .ap-badge.status-badge--default {
  background: #f3f4f6;
  color: #4b5563;
  border-color: #d1d5db;
  box-shadow: inset 0 0 0 1px rgba(107, 114, 128, 0.1);
}

.ds-ui-access-pass-history .ds-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 0;
}

.ds-ui-access-pass-history .ds-reject-notice__body {
  white-space: pre-line;
  line-height: 1.5;
  font-size: 12px;
}

.ds-ui-access-pass-history .ap-history-reject-warn {
  max-width: 100%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  color: #991b1b;
}

.ds-ui-access-pass-history .ap-history-reject-warn__dt {
  font-size: 11px;
  font-weight: 700;
  color: #b91c1c;
  margin-bottom: 6px;
}

.ds-ui-access-pass-history .ap-history-reject-warn__body {
  font-size: 12px;
  line-height: 1.5;
  color: #7f1d1d;
}

.ds-ui-access-pass-history .ap-history-valid-until {
  font-size: 12px;
  color: #047857;
  font-weight: 600;
}

.ds-access-pass-done {
  text-align: center;
}

.ds-access-pass-done .form-sub {
  margin-top: 8px;
  line-height: 1.6;
}

.ds-access-pass-done-actions {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.ds-access-pass-done-actions .ds-btn {
  min-width: 160px;
  min-height: 44px;
  justify-content: center;
}

.ds-access-pass-done-sub {
  margin-top: 16px;
  font-size: 12px;
}

.ds-access-pass-done-sub .link {
  color: #64748b;
  text-decoration: underline;
}

.ds-ui-access-pass-history .ap-history-table {
  table-layout: auto;
  width: 100%;
  min-width: 680px;
  margin-top: 0;
}

.ds-ui-access-pass-history .ap-history-table th,
.ds-ui-access-pass-history .ap-history-table td {
  white-space: normal;
  word-break: break-word;
  vertical-align: middle;
}

.ds-ui-access-pass-history .ap-history-table td.center,
.ds-ui-access-pass-history .ap-history-table th.center {
  text-align: center;
}

.ds-ui-access-pass-history td[data-label="방문자"] .mono {
  font-size: 9pt;
  color: #6b7280;
}

.ds-ui-access-pass-history td[data-label="비고"] > span {
  font-size: 9pt;
  color: #0a6157;
}

.ds-ui-access-pass-history .ap-history-table thead th {
  padding: 7px 10px !important;
  font-size: 12px;
  background: #f4f7f6;
  border-bottom: 2px solid var(--line);
}

.ds-ui-access-pass-history .ap-history-table tbody td {
  padding: 7px 10px !important;
  font-size: 12px;
}

.ds-ui-access-pass-history .ds-reject-notice {
  font-size: 11px;
  line-height: 1.35;
  color: #b42318;
}

.ds-ui-access-pass-history .ds-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 12px;
}

.ds-ui-access-pass-history .ds-pager .ds-btn {
  min-height: max(44px, 2.75rem);
}

/* Mobile card layout (history only, ≤640px) */
@media (max-width: 640px) {
  .ds-ui-access-pass-history .ds-ap-history-table-wrap {
    overflow-x: visible;
    margin-top: 4px;
  }

  .ds-ui-access-pass-history .ds-ap-history-table-wrap .ap-history-table {
    min-width: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }

  .ds-ui-access-pass-history .ds-ap-history-table-wrap .ap-history-table thead {
    display: none !important;
  }

  .ds-ui-access-pass-history .ds-ap-history-table-wrap .ap-history-table tbody tr {
    display: block !important;
    margin: 0 0 12px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    overflow: hidden;
  }

  .ds-ui-access-pass-history .ds-ap-history-table-wrap .ap-history-table tbody tr.ds-recent-highlight {
    border-color: #6ee7b7;
    box-shadow: 0 0 0 1px rgba(10, 97, 87, 0.15), 0 2px 8px rgba(15, 23, 42, 0.06);
  }

  .ds-ui-access-pass-history .ds-ap-history-table-wrap .ap-history-table tbody tr.ds-recent-highlight td:first-child {
    box-shadow: none !important;
  }

  .ds-ui-access-pass-history .ds-ap-history-table-wrap .ap-history-table tbody tr:has(td.empty) {
    padding: 16px;
    text-align: center;
  }

  .ds-ui-access-pass-history .ds-ap-history-table-wrap .ap-history-table tbody td {
    display: block !important;
    padding: 8px 14px !important;
    border: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    text-align: left !important;
    white-space: normal !important;
  }

  .ds-ui-access-pass-history .ds-ap-history-table-wrap .ap-history-table tbody td:last-child {
    border-bottom: none !important;
  }

  .ds-ui-access-pass-history .ds-ap-history-table-wrap .ap-history-table tbody td::before {
    content: attr(data-label) !important;
    display: block !important;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
  }

  .ds-ui-access-pass-history .ds-ap-history-table-wrap .ap-history-table tbody td.empty::before {
    content: none !important;
    display: none !important;
  }

  .ds-ui-access-pass-history .ds-ap-history-table-wrap .ap-history-table tbody td.ap-history-cell--rc {
    padding-top: 12px !important;
    font-size: 13px;
    font-weight: 700;
    background: #f8fafc;
  }

  .ds-ui-access-pass-history .ds-ap-history-table-wrap .ap-history-table tbody td.ap-history-cell--status {
    text-align: left !important;
  }

  .ds-ui-access-pass-history .ds-ap-history-table-wrap .ap-history-table tbody td.ap-history-cell--status .ap-badge {
    font-size: 12px;
    min-height: 28px;
    padding: 4px 12px;
  }

  .ds-ui-access-pass-history .ds-ap-history-table-wrap .ap-history-table tbody td.ap-history-cell--reject {
    padding-bottom: 12px !important;
  }

  .ds-ui-access-pass-history .ds-ap-history-actions.ds-quick-btn-group--uniform {
    flex-direction: column;
    align-items: stretch;
  }

  .ds-ui-access-pass-history .ds-ap-history-actions.ds-quick-btn-group--uniform .ds-btn {
    width: 100%;
    min-width: 0;
  }

  .ds-ui-access-pass-history .ds-quick-btn-group,
  .ds-ui-access-pass-history .ds-pager {
    flex-direction: column;
    align-items: stretch;
  }

  .ds-ui-access-pass-history .ds-pager .ds-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 360px) {
  .ds-ui-access-pass-history .ds-ap-history-kpi {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Done screen CTA ── */
.ds-ui-access-pass-done {
  text-align: center;
  padding: 28px 16px;
}

.ds-ui-access-pass-done .access-pass-done-icon {
  width: 44px;
  height: 44px;
  line-height: 44px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #047857;
  font-size: 22px;
  font-weight: 700;
}

.ds-ui-access-pass-done h2 {
  font-size: 17px;
  margin-bottom: 6px;
}

.ds-ui-access-pass-done .form-sub {
  font-size: 12px;
  line-height: 1.45;
  max-width: 420px;
  margin: 0 auto;
}

.ds-ui-access-pass-done .access-pass-done-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.ds-ui-access-pass-done .access-pass-done-actions .ds-btn {
  min-height: 36px;
  min-width: 140px;
  padding: 7px 14px;
  border-radius: 4px;
}

@media (max-width: 360px) {
  .ds-ui-access-pass .email-verify-row,
  .ds-ui-access-pass .email-code-row {
    flex-direction: column;
  }

  .ds-ui-access-pass .email-verify-row .ds-btn,
  .ds-ui-access-pass .email-code-row .ds-btn,
  .ds-ui-access-pass #tenant-search-open,
  .ds-ui-access-pass .access-pass-submit {
    width: 100%;
  }

  .ds-ui-access-pass-buyer .btn-submit {
    width: 100%;
  }

  .buyer-access-pass-shell .buyer-ap-card {
    padding: 12px;
  }

  .buyer-access-pass-shell .form-grid {
    grid-template-columns: 1fr !important;
  }

  .buyer-access-pass-shell .form-grid .form-group,
  .buyer-access-pass-shell .form-grid .form-group input,
  .buyer-access-pass-shell .form-grid .form-group select,
  .buyer-access-pass-shell .birth-select-group,
  .buyer-access-pass-shell .birth-select-group select,
  .buyer-access-pass-shell .extra-visitor-add-btn,
  .buyer-access-pass-shell .extra-visitor-remove-btn,
  .buyer-access-pass-shell .buyer-ap-submit,
  .buyer-access-pass-shell #idcard-pick-btn {
    width: 100%;
    max-width: 100%;
  }

  .buyer-access-pass-shell .vehicle-mode-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .ds-ui-access-pass-done .access-pass-done-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .ds-ui-access-pass-done .access-pass-done-actions .ds-btn {
    width: 100%;
    min-width: 0;
  }

  .buyer-portal-header__row {
    padding: 10px 12px;
    gap: 10px;
  }

  .buyer-header-brand {
    flex: 1 1 100%;
  }

  .buyer-header-title {
    font-size: 16px !important;
  }

  .buyer-header-account {
    flex: 1 1 100%;
    width: 100%;
    justify-content: space-between;
  }

  .buyer-header-who {
    text-align: left;
  }

  .buyer-portal-tabs {
    padding: 0 12px;
    gap: 4px;
  }

  .buyer-portal-tab {
    flex: 1 1 auto;
    min-width: calc(50% - 4px);
    font-size: 12px;
    padding: 8px 10px;
  }

  .buyer-portal-tabs .buyer-portal-tab:nth-child(3) {
    min-width: 100%;
  }

  .buyer-shell .buyer-header {
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 10px 12px !important;
    gap: 8px;
  }

  .buyer-shell .buyer-header .site-name,
  .buyer-shell .buyer-header .site-name-app {
    flex: 1 1 100%;
    font-size: 14px !important;
    line-height: 1.3;
    min-width: 0;
  }

  .buyer-shell .buyer-header .header-right {
    flex: 1 1 100%;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  .buyer-shell--status .buyer-nav {
    gap: 4px;
  }

  .buyer-shell--status .buyer-nav a {
    font-size: 10px;
    padding: 5px 6px;
  }

  .buyer-shell .buyer-nav {
    order: 1;
    flex: 1 1 100%;
    width: 100%;
    margin-right: 0;
    gap: 6px;
    justify-content: flex-start;
  }

  .buyer-shell .buyer-nav a {
    flex: 1 1 calc(50% - 3px);
    min-width: 0;
    box-sizing: border-box;
    text-align: center;
    font-size: 11px;
    line-height: 1.25;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    white-space: normal;
    word-break: keep-all;
  }

  .buyer-shell .buyer-nav a:nth-child(3) {
    flex: 1 1 100%;
  }

  .buyer-shell .buyer-header .who {
    order: 2;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 11px;
  }

  .buyer-shell .buyer-header .btn-logout {
    order: 3;
    flex: 0 0 auto;
    align-self: center;
    white-space: nowrap;
  }
}

/* access-pass-public.css loads after ui-polish — scope fixes only */
.ds-ui-access-pass .access-pass-steps span.is-on {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
}

.ds-ui-access-pass .access-pass-submit,
.ds-ui-access-pass .ds-btn--primary[data-verify-btn] {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
}

.ds-ui-access-pass .access-pass-back {
  color: var(--brand-dark) !important;
}

.ds-ui-access-pass-done .ds-btn--primary {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
}

/* ═══════════════════════════════════════════════════════════════
   Admin UI — ERP compact lists / settings (no v0 tokens)
   ═══════════════════════════════════════════════════════════════ */

.admin-content.ds-ui-admin {
  font-size: 14px;
  line-height: 1.35;
}

.admin-content.ds-ui-admin .admin-page-intro,
.admin-content.ds-ui-admin .settings-intro {
  margin-bottom: 10px;
}

.admin-content.ds-ui-admin .admin-page-intro .form-sub,
.admin-content.ds-ui-admin .settings-site-hint {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 4px 0 0;
}

.admin-content.ds-ui-admin .settings-site-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}

/* ── KPI summary bar ── */
.admin-content.ds-ui-admin .ds-admin-summary {
  gap: 8px;
  margin-bottom: 10px;
}

.admin-content.ds-ui-admin .ds-admin-summary .ds-summary-card {
  padding: 10px 12px;
  border-radius: 4px;
  box-shadow: none;
  min-height: 58px;
}

.admin-content.ds-ui-admin .ds-admin-summary .ds-summary-card .lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-soft);
}

.admin-content.ds-ui-admin .ds-admin-summary .ds-summary-card .val {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}

/* ── Alert bar ── */
.admin-content.ds-ui-admin .ds-admin-alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 4px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: none;
}

/* ── Toolbar: filter + search ── */
.admin-content.ds-ui-admin .ds-sticky-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 8px 0 10px;
  margin-bottom: 10px;
  background: #f0f3f5;
  border-bottom: 1px solid var(--line);
}

.admin-content.ds-ui-admin .admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.admin-content.ds-ui-admin .admin-toolbar > .btn-primary,
.admin-content.ds-ui-admin .admin-toolbar > .ds-btn--primary {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  box-shadow: none;
  background: var(--brand);
  border: 1px solid var(--brand);
  color: #fff;
  flex-shrink: 0;
}

.admin-content.ds-ui-admin .admin-toolbar > .btn-primary:hover,
.admin-content.ds-ui-admin .admin-toolbar > .ds-btn--primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.admin-content.ds-ui-admin .filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1 1 auto;
}

.admin-content.ds-ui-admin .filter-tabs a {
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.admin-content.ds-ui-admin .filter-tabs a:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: #fff;
}

.admin-content.ds-ui-admin .filter-tabs a.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.admin-content.ds-ui-admin .search-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1 1 280px;
  min-width: 0;
}

.admin-content.ds-ui-admin .search-box input[type='text'],
.admin-content.ds-ui-admin .search-box input[type='search'],
.admin-content.ds-ui-admin .search-box select,
.admin-content.ds-ui-admin .settings-site-input {
  min-height: 34px;
  height: auto;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  background: #fff;
  box-shadow: none;
}

.admin-content.ds-ui-admin .search-box input[type='text'] {
  flex: 1 1 160px;
  min-width: 120px;
  width: auto;
  max-width: 280px;
}

.admin-content.ds-ui-admin .search-box select.tenant-filter {
  flex: 1 1 140px;
  min-width: 120px;
  max-width: 220px;
}

.admin-content.ds-ui-admin .search-box button,
.admin-content.ds-ui-admin .btn-settings-save {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  box-shadow: none;
  background: var(--navy);
  border: 1px solid var(--navy);
  color: #fff;
  cursor: pointer;
}

.admin-content.ds-ui-admin .search-box button:hover,
.admin-content.ds-ui-admin .btn-settings-save:hover {
  filter: brightness(1.05);
}

/* ── Tables ── */
.admin-content.ds-ui-admin .admin-card.ds-table-wrap,
.admin-content.ds-ui-admin .recent-card.ds-admin-recent {
  border-radius: 4px;
  box-shadow: none;
  border: 1px solid var(--line);
  margin-bottom: 10px;
}

.admin-content.ds-ui-admin .ds-table-wrap,
.admin-content.ds-ui-admin .ds-table-inner {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-content.ds-ui-admin .admin-table,
.admin-content.ds-ui-admin .recent-table {
  min-width: 760px;
  font-size: 12px;
}

.admin-content.ds-ui-admin .admin-table thead th,
.admin-content.ds-ui-admin .recent-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f4f7f6;
  border-bottom: 2px solid var(--line);
  padding: 7px 10px !important;
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
}

.admin-content.ds-ui-admin .admin-table tbody td,
.admin-content.ds-ui-admin .recent-table tbody td {
  padding: 7px 10px !important;
  vertical-align: middle;
  border-bottom: 1px solid #eef2f1;
  line-height: 1.35;
}

.admin-content.ds-ui-admin .admin-table tbody tr:hover td {
  background: #fafbfb;
}

.admin-content.ds-ui-admin .ds-row-pending {
  background: #fffdf5 !important;
}

.admin-content.ds-ui-admin .admin-table .empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 20px 10px !important;
}

.admin-content.ds-ui-admin .ds-reject-notice {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
  color: #b42318;
}

.admin-content.ds-ui-admin .ds-reject-at {
  font-size: 10px;
  color: var(--ink-soft);
}

/* Action column */
.admin-content.ds-ui-admin .ds-action-group,
.admin-content.ds-ui-admin td.actions {
  white-space: nowrap;
  text-align: right;
}

.admin-content.ds-ui-admin .ds-action-group {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  max-width: 100%;
}

.admin-content.ds-ui-admin .ds-action-group .btn-mini,
.admin-content.ds-ui-admin .ds-action-group .ds-btn,
.admin-content.ds-ui-admin td.actions .btn-mini,
.admin-content.ds-ui-admin td.actions a.btn-mini {
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  box-shadow: none;
  line-height: 1.25;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Button variants */
.admin-content.ds-ui-admin .ds-btn--primary,
.admin-content.ds-ui-admin .btn-approve-access,
.admin-content.ds-ui-admin .btn-confirm-pay,
.admin-content.ds-ui-admin .btn-complete-release {
  background: var(--brand) !important;
  border: 1px solid var(--brand) !important;
  color: #fff !important;
}

.admin-content.ds-ui-admin .ds-btn--primary:hover,
.admin-content.ds-ui-admin .btn-approve-access:hover,
.admin-content.ds-ui-admin .btn-confirm-pay:hover,
.admin-content.ds-ui-admin .btn-complete-release:hover {
  background: var(--brand-dark) !important;
  border-color: var(--brand-dark) !important;
}

.admin-content.ds-ui-admin .ds-btn--secondary,
.admin-content.ds-ui-admin .btn-id-card,
.admin-content.ds-ui-admin .ds-admin-alert .ds-btn--secondary {
  background: #fff !important;
  border: 1px solid var(--line) !important;
  color: var(--navy) !important;
}

.admin-content.ds-ui-admin .ds-btn--secondary:hover,
.admin-content.ds-ui-admin .btn-id-card:hover {
  background: #f5f8f7 !important;
}

.admin-content.ds-ui-admin .ds-idcard-slots {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-right: 4px;
}

.admin-content.ds-ui-admin .ds-idcard-slots .btn-id-card {
  min-width: 58px;
  padding: 4px 8px !important;
  font-size: 11px !important;
  text-align: center;
}

.admin-content.ds-ui-admin .ds-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.admin-content.ds-ui-admin .ds-btn--danger,
.admin-content.ds-ui-admin .btn-reject-access {
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  color: #b91c1c !important;
}

.admin-content.ds-ui-admin .ds-btn--danger:hover,
.admin-content.ds-ui-admin .btn-reject-access:hover {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
  color: #991b1b !important;
}

.admin-content.ds-ui-admin td.actions .btn-mini:not(.ds-btn):not([class*='btn-']) {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--navy);
}

/* ── Badges ── */
.admin-content.ds-ui-admin .status-badge,
.admin-content.ds-ui-admin .payment-badge,
.admin-content.ds-ui-admin .badge,
.admin-content.ds-ui-admin .badge-green,
.admin-content.ds-ui-admin .badge-red,
.admin-content.ds-ui-admin .ap-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
  border: 1px solid transparent;
  white-space: nowrap;
  letter-spacing: 0;
}

.admin-content.ds-ui-admin .status-badge--requested,
.admin-content.ds-ui-admin .payment-badge--pending,
.admin-content.ds-ui-admin .badge-pending,
.admin-content.ds-ui-admin .badge-red,
.admin-content.ds-ui-admin .badge.badge-pending {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.admin-content.ds-ui-admin .status-badge--released,
.admin-content.ds-ui-admin .status-badge--rc_issued,
.admin-content.ds-ui-admin .payment-badge--confirmed,
.admin-content.ds-ui-admin .badge-approved,
.admin-content.ds-ui-admin .badge-green,
.admin-content.ds-ui-admin .badge.badge-approved {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.admin-content.ds-ui-admin .status-badge--rejected,
.admin-content.ds-ui-admin .badge-rejected,
.admin-content.ds-ui-admin .badge.badge-rejected {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.admin-content.ds-ui-admin .status-badge--default,
.admin-content.ds-ui-admin .status-badge--inspect_wait,
.admin-content.ds-ui-admin .badge-gray,
.admin-content.ds-ui-admin .badge.badge-gray {
  background: #f3f4f6;
  color: #4b5563;
  border-color: #d1d5db;
}

.admin-content.ds-ui-admin .status-badge--inspect_done {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.admin-content.ds-ui-admin .badge.badge-active,
.admin-content.ds-ui-admin .badge.badge-approved {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.admin-content.ds-ui-admin .badge.badge-suspended,
.admin-content.ds-ui-admin .badge.badge-inactive {
  background: #f3f4f6;
  color: #4b5563;
  border-color: #d1d5db;
}

/* ── Pager ── */
.admin-content.ds-ui-admin .ds-pager,
.admin-content.ds-ui-admin .pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 12px;
  color: var(--ink-soft);
}

.admin-content.ds-ui-admin .ds-pager .ds-btn,
.admin-content.ds-ui-admin .pager a {
  min-height: 32px;
  min-width: 72px;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 11px;
  text-decoration: none;
}

/* ── Settings ── */
.admin-content.ds-ui-admin .ds-settings-panel,
.admin-content.ds-ui-admin .ds-settings-toggles {
  padding: 14px 16px;
  border-radius: 4px;
  box-shadow: none;
  border: 1px solid var(--line);
  background: #fff;
}

.admin-content.ds-ui-admin .ds-settings-heading {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--navy);
}

.admin-content.ds-ui-admin .ds-settings-desc {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.admin-content.ds-ui-admin .settings-actions {
  margin-top: 10px;
}

.admin-content.ds-ui-admin .settings-site-row {
  max-width: 420px;
}

.admin-content.ds-ui-admin .toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.admin-content.ds-ui-admin .toggle-row:last-child {
  border-bottom: none;
}

.admin-content.ds-ui-admin .toggle-row__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}

.admin-content.ds-ui-admin .toggle-row__hint {
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.35;
  margin-top: 2px;
}

.admin-content.ds-ui-admin .toggle-btn {
  flex-shrink: 0;
  min-width: 64px;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--line);
  cursor: pointer;
  box-shadow: none;
}

.admin-content.ds-ui-admin .toggle-btn.is-on {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.admin-content.ds-ui-admin .toggle-btn.is-off {
  background: #f3f4f6;
  color: var(--ink-soft);
  border-color: #d1d5db;
}

/* ── Mobile: table scroll, no card conversion ── */
@media (max-width: 768px) {
  .admin-content.ds-ui-admin .ds-table-wrap.ds-mobile-cards .admin-table thead,
  .admin-content.ds-ui-admin .ds-table-inner.ds-mobile-cards .admin-table thead,
  .admin-content.ds-ui-admin .ds-table-wrap.ds-mobile-cards .recent-table thead {
    display: table-header-group !important;
  }

  .admin-content.ds-ui-admin .ds-table-inner.ds-mobile-cards .admin-table tbody tr,
  .admin-content.ds-ui-admin .ds-table-wrap.ds-mobile-cards .admin-table tbody tr,
  .admin-content.ds-ui-admin .ds-table-wrap.ds-mobile-cards .recent-table tbody tr {
    display: table-row !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  .admin-content.ds-ui-admin .ds-table-inner.ds-mobile-cards .admin-table tbody td,
  .admin-content.ds-ui-admin .ds-table-wrap.ds-mobile-cards .admin-table tbody td,
  .admin-content.ds-ui-admin .ds-table-wrap.ds-mobile-cards .recent-table tbody td {
    display: table-cell !important;
    padding: 7px 10px !important;
    border-bottom: 1px solid var(--line) !important;
    text-align: left !important;
  }

  .admin-content.ds-ui-admin .ds-table-inner.ds-mobile-cards .admin-table tbody td::before,
  .admin-content.ds-ui-admin .ds-table-wrap.ds-mobile-cards .admin-table tbody td::before,
  .admin-content.ds-ui-admin .ds-table-wrap.ds-mobile-cards .recent-table tbody td::before {
    content: none !important;
    display: none !important;
  }

  .admin-content.ds-ui-admin .ds-action-group {
    justify-content: flex-end;
    width: auto;
    margin-top: 0;
  }

  .admin-content.ds-ui-admin .ds-action-group .btn-mini,
  .admin-content.ds-ui-admin .ds-action-group .ds-btn {
    flex: 0 0 auto;
    min-height: 30px;
  }

  .admin-content.ds-ui-admin .ds-admin-summary {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .admin-content.ds-ui-admin .search-box input[type='text'] {
    max-width: none;
    width: 100%;
    flex: 1 1 100%;
  }
}

@media (max-width: 360px) {
  .admin-content.ds-ui-admin .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-content.ds-ui-admin .admin-toolbar > .btn-primary,
  .admin-content.ds-ui-admin .admin-toolbar > .ds-btn--primary {
    width: 100%;
    justify-content: center;
  }

  .admin-content.ds-ui-admin .filter-tabs {
    width: 100%;
  }

  .admin-content.ds-ui-admin .filter-tabs a {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
    text-align: center;
  }

  .admin-content.ds-ui-admin .search-box {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .admin-content.ds-ui-admin .search-box select.tenant-filter,
  .admin-content.ds-ui-admin .search-box input[type='text'],
  .admin-content.ds-ui-admin .search-box button {
    width: 100%;
    max-width: none;
  }

  .admin-content.ds-ui-admin .ds-action-group {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-content.ds-ui-admin .ds-action-group .btn-mini,
  .admin-content.ds-ui-admin .ds-action-group .ds-btn,
  .admin-content.ds-ui-admin td.actions .btn-mini {
    width: 100%;
    min-height: 34px;
  }

  .admin-content.ds-ui-admin .ds-pager,
  .admin-content.ds-ui-admin .pager {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-content.ds-ui-admin .ds-pager .ds-btn,
  .admin-content.ds-ui-admin .pager a {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .admin-content.ds-ui-admin .toggle-row {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-content.ds-ui-admin .toggle-btn {
    width: 100%;
  }

  .admin-content.ds-ui-admin .ds-admin-alert {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-content.ds-ui-admin .ds-admin-alert .ds-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}
