:root {
  --primary-blue: #031751;
  --primary-orange: #fb8c00;
  --soft-blue: #f4f7fc;
  --border-color: #d9e0ef;
  --text-muted: #64748b;
}

body {
  min-height: 100vh;
  background: var(--soft-blue);
  color: #102033;
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: 0 24px 70px rgba(3, 23, 81, 0.16);
}

.login-info-panel {
  background: var(--primary-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  padding: 56px;
}

.info-content h1 {
  font-size: 42px;
  line-height: 1.08;
  margin: 24px 0 18px;
  font-weight: 800;
}

.system-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #ffe1b8;
}

.system-badge span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-orange);
}

.system-description {
  color: #d7def5;
  font-size: 17px;
  line-height: 1.65;
  margin-bottom: 32px;
}

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

.info-list div {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #edf2ff;
}

.info-list i {
  color: var(--primary-orange);
  font-size: 20px;
}

.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px;
}

.login-card {
  width: min(390px, 100%);
}

.login-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}

.login-heading h2 {
  color: var(--primary-blue);
  font-weight: 800;
  margin: 0;
}

.login-heading p {
  color: var(--text-muted);
  margin: 2px 0 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-orange);
  color: #ffffff;
  font-weight: 800;
}

.form-label {
  color: var(--primary-blue);
  font-weight: 700;
}

.form-control,
.input-group-text {
  border-color: var(--border-color);
  min-height: 46px;
}

.form-control:focus {
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 0.2rem rgba(251, 140, 0, 0.16);
}

.btn-primary-orange {
  background: var(--primary-orange);
  border-color: var(--primary-orange);
  color: #ffffff;
  font-weight: 700;
}

.btn-primary-orange:hover,
.btn-primary-orange:focus {
  background: #e27e00;
  border-color: #e27e00;
  color: #ffffff;
}

.setup-alert {
  border-color: rgba(251, 140, 0, 0.3);
  background: rgba(251, 140, 0, 0.1);
  color: var(--primary-blue);
}

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.app-sidebar {
  background: var(--primary-blue);
  color: #ffffff;
  min-height: 100vh;
  padding: 22px 18px;
}

.offcanvas .app-sidebar {
  min-height: 100%;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px 28px;
}

.brand-title {
  font-weight: 800;
}

.brand-subtitle {
  color: #b8c2df;
  font-size: 13px;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: #dfe6ff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 700;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: var(--primary-orange);
  color: #ffffff;
}

.sidebar-link i {
  font-size: 18px;
}

.app-main {
  min-width: 0;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
}

.page-title {
  font-size: 22px;
  margin: 0;
  color: var(--primary-blue);
  font-weight: 800;
}

.page-subtitle,
.user-email,
.content-header p,
.metric-label {
  color: var(--text-muted);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-name {
  color: var(--primary-blue);
  font-weight: 800;
}

.content-section {
  padding: 28px;
}

.content-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.content-header h2 {
  color: var(--primary-blue);
  font-weight: 800;
  margin-bottom: 4px;
}

.metric-card {
  min-height: 150px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
}

.metric-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 140, 0, 0.12);
  color: var(--primary-orange);
  margin-bottom: 18px;
}

.metric-value {
  color: var(--primary-blue);
  font-size: 32px;
  font-weight: 800;
}

.partner-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-bottom: 0;
}

.partner-filter {
  width: min(240px, 100%);
}

.inventory-toolbar {
  flex-wrap: wrap;
}

.inventory-filter {
  width: min(210px, 100%);
}

.searchable-select {
  position: relative;
}

.searchable-select > .form-select {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.searchable-select-menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  z-index: 1050;
  width: max(100%, 320px);
  max-width: calc(100vw - 32px);
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(3, 23, 81, 0.12);
}

.searchable-select-list {
  max-height: 260px;
  margin: 6px 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.searchable-select-option {
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.searchable-select-option.active {
  background: var(--soft-blue);
}

.searchable-select-option.selected {
  color: #ffffff;
  background: #6c757d;
}

.searchable-select-empty {
  padding: 8px 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.data-panel {
  padding: 8px 18px 18px;
  background: #ffffff;
  border: 1px solid var(--border-color);
}

.data-panel .table {
  margin-bottom: 12px;
}

.data-panel thead th {
  color: var(--primary-blue);
  font-size: 13px;
  text-transform: uppercase;
  vertical-align: middle;
}

.client-id {
  color: #334155;
  background: #f1f5f9;
  padding: 4px 7px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-active {
  color: #166534;
  background: #dcfce7;
}

.status-inactive {
  color: #475569;
  background: #e2e8f0;
}

.inventory-status-available {
  color: #166534;
  background: #dcfce7;
}

.inventory-status-sold {
  color: #1e40af;
  background: #dbeafe;
}

.inventory-status-expired {
  color: #991b1b;
  background: #fee2e2;
}

.payment-paid {
  color: #166534;
  background: #dcfce7;
}

.payment-unpaid {
  color: #92400e;
  background: #fef3c7;
}

.order-status {
  color: #334155;
  background: #e2e8f0;
}
.order-status-pending {
  color: #92400e;
  background: #fef3c7;
}

.order-status-success {
  color: #166534;
  background: #dcfce7;
}

.order-status-failure {
  color: #991b1b;
  background: #fee2e2;
}

.order-detail-section h6 {
  color: var(--primary-blue);
  font-weight: 800;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border-color);
}

.order-detail-grid {
  display: grid;
  grid-template-columns: minmax(140px, 0.35fr) 1fr;
  gap: 10px 18px;
  margin: 16px 0 0;
}

.order-detail-grid dt {
  color: var(--text-muted);
  font-size: 13px;
}

.order-detail-grid dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-secret {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.email-summary-card {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--border-color);
}

.email-summary-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 19px;
}

.summary-total {
  color: #1e40af;
  background: #dbeafe;
}

.summary-pending,
.email-status-pending {
  color: #92400e;
  background: #fef3c7;
}

.summary-sent,
.email-status-sent {
  color: #166534;
  background: #dcfce7;
}

.summary-failed,
.email-status-failed {
  color: #991b1b;
  background: #fee2e2;
}

.email-summary-label {
  color: var(--text-muted);
  font-size: 13px;
}

.email-summary-value {
  color: var(--primary-blue);
  font-size: 24px;
  font-weight: 800;
}

.email-meta-grid {
  display: grid;
  grid-template-columns: minmax(140px, 0.25fr) 1fr;
  gap: 9px 18px;
  margin: 0;
}

.email-meta-grid dt {
  color: var(--text-muted);
  font-size: 13px;
}

.email-meta-grid dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.email-content-panel {
  min-height: 430px;
  border: 1px solid var(--border-color);
  border-top: 0;
  background: #ffffff;
}

.email-preview-frame {
  width: 100%;
  min-height: 430px;
  border: 0;
  background: #ffffff;
}

.email-text-content {
  min-height: 430px;
  margin: 0;
  padding: 18px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}

.dt-container .dt-search input,
.dt-container .dt-length select {
  border-color: var(--border-color);
}

@media (max-width: 991.98px) {
  .login-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .login-info-panel,
  .login-form-panel {
    padding: 36px 24px;
  }

  .info-content h1 {
    font-size: 32px;
  }

  .app-layout {
    display: block;
  }

  .app-layout > .app-sidebar {
    display: none;
  }

  .topbar,
  .content-section {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 575.98px) {
  .login-page {
    padding: 12px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-user {
    flex-direction: column;
    align-items: flex-end;
  }

  .content-header,
  .partner-toolbar {
    align-items: stretch !important;
    flex-direction: column;
  }

  .partner-filter {
    width: 100%;
  }

  .inventory-filter {
    width: 100%;
  }

  .order-detail-grid {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .order-detail-grid dd {
    margin-bottom: 9px;
  }

  .email-meta-grid {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .email-meta-grid dd {
    margin-bottom: 9px;
  }
}

/* Pridcut CSS */
.inventory-status-reserved {
  color: #92400e;
  background: #fef3c7;
}

.inventory-status-error {
  color: #ffffff;
  background: #b91c1c;
}

.stock-error {
  color: #991b1b;
  background: #fee2e2;
}

.stock-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 8px;
  margin-right: 4px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.stock-available {
  color: #166534;
  background: #dcfce7;
}

.stock-available:hover {
  color: #14532d;
  background: #bbf7d0;
}

.stock-available.stock-low {
  color: #92400e;
  background: #fef3c7;
}

.stock-reserved {
  color: #92400e;
  background: #fff7ed;
}

.stock-sold {
  color: #1e40af;
  background: #dbeafe;
}

.product-name-cell {
  min-width: 200px;
}

.product-stock-cell {
  min-width: 170px;
}

.product-stock-cell .stock-chip {
  margin-bottom: 4px;
}

.product-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border: 1px solid var(--border-color, #dce2ef);
  border-radius: 8px;
  background: #f8fafc;
}

.product-image-field {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.product-image-preview {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 112px;
  overflow: hidden;
  border: 1px dashed #c8d2e6;
  border-radius: 8px;
  background: #f8fafc;
  text-align: center;
}

.product-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 575.98px) {
  .product-image-field {
    flex-direction: column;
  }
}

.product-link {
  vertical-align: middle;
}

.product-unassigned code {
  color: #334155;
  background: #f1f5f9;
  padding: 1px 5px;
}

/* Orders: riwayat ganti nomor */
.number-change-table th {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}

.number-change-table td {
  font-size: 13px;
}

.change-number-summary {
  margin-bottom: 0;
}

/* Orders: order yang nomornya diganti */
.order-status-replaced {
  color: #475569;
  background: #e2e8f0;
}

.order-replace-note {
  margin-top: 2px;
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
}

#emailDetailActivationCode {
  color: #334155;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}
