.phb-portal,
.phb-portal * {
  box-sizing: border-box;
}

.phb-portal {
  max-width: 1180px;
  margin: 0 auto;
}

.phb-box,
.phb-order-header {
  border: 1px solid #dcdcde;
  border-radius: 12px;
  padding: 18px;
  margin: 18px 0;
  background: #fff;
}

.phb-order-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.phb-form label,
.phb-message-form label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 600;
}

.phb-form input[type="text"],
.phb-form input[type="email"],
.phb-form input[type="url"],
.phb-form input[type="date"],
.phb-form input[type="number"],
.phb-form select,
.phb-form textarea,
.phb-message-form textarea {
  width: 100%;
  border: 1px solid #c3c4c7;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.phb-checkbox {
  display: flex !important;
  gap: 10px;
  align-items: flex-start;
  font-weight: 500 !important;
}

.phb-help {
  font-size: 13px;
  opacity: .75;
}

.phb-button {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: #1d2327;
  color: #fff !important;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.2;
}

.phb-button:hover {
  opacity: .88;
}

.phb-button-small {
  padding: 7px 12px;
  font-size: 13px;
}

.phb-table-wrap {
  overflow-x: auto;
}

.phb-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.phb-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 13px;
  opacity: .72;
}

.phb-table td {
  padding: 12px;
  border-top: 1px solid rgba(0,0,0,.08);
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.phb-table td:first-child {
  border-left: 1px solid rgba(0,0,0,.08);
  border-radius: 10px 0 0 10px;
}

.phb-table td:last-child {
  border-right: 1px solid rgba(0,0,0,.08);
  border-radius: 0 10px 10px 0;
}

.phb-row-done,
.wp-list-table .phb-row-done td,
tr.phb-row-done td {
  background: #dcfce7 !important;
}

.phb-row-progress,
.wp-list-table .phb-row-progress td,
tr.phb-row-progress td {
  background: #fef9c3 !important;
}

.phb-row-waiting,
.wp-list-table .phb-row-waiting td,
tr.phb-row-waiting td {
  background: #f1f5f9 !important;
}

.phb-row-attention,
.wp-list-table .phb-row-attention td,
tr.phb-row-attention td {
  background: #ffedd5 !important;
}

.phb-row-danger,
.wp-list-table .phb-row-danger td,
tr.phb-row-danger td {
  background: #fee2e2 !important;
}

.phb-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #1d2327;
}

.phb-badge-done { background: #86efac; }
.phb-badge-progress { background: #fde047; }
.phb-badge-waiting { background: #cbd5e1; }
.phb-badge-attention { background: #fdba74; }
.phb-badge-danger { background: #fca5a5; }

.phb-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
  font-size: 13px;
}

.phb-legend span {
  padding: 6px 10px;
  border-radius: 999px;
}

.phb-legend-done { background: #dcfce7; }
.phb-legend-progress { background: #fef9c3; }
.phb-legend-waiting { background: #f1f5f9; }
.phb-legend-attention { background: #ffedd5; }

.phb-notice {
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0;
  border: 1px solid transparent;
}

.phb-notice-success,
.phb-ok-box {
  background: #dcfce7;
  border-color: #86efac;
}

.phb-notice-error,
.phb-alert {
  background: #fee2e2;
  border-color: #fca5a5;
}

.phb-summary-grid,
.phb-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}

.phb-summary-grid div {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  background: rgba(255,255,255,.75);
}

.phb-summary-grid span {
  display: block;
  font-size: 12px;
  opacity: .7;
}

.phb-summary-grid strong {
  display: block;
  margin-top: 4px;
}

.phb-grid-span {
  grid-column: 1 / -1;
}

.phb-preline {
  white-space: pre-line;
}

.phb-file-list {
  margin-left: 18px;
}

.phb-timeline {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.phb-message {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.phb-message-internal {
  background: #fff7ed;
  border-color: #fdba74;
}

.phb-message-system {
  background: #f8fafc;
}

.phb-message-meta {
  font-size: 12px;
  opacity: .75;
  margin-bottom: 6px;
}

.phb-small-ok { color: #166534; font-weight: 700; }
.phb-small-waiting { color: #854d0e; font-weight: 700; }
.phb-ok { color: #166534; font-weight: 700; }

@media (max-width: 760px) {
  .phb-summary-grid,
  .phb-admin-grid {
    grid-template-columns: 1fr;
  }
  .phb-order-header {
    display: block;
  }
}

.phb-access-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #dcdcde;
  border-radius: 999px;
  padding: 10px 14px;
  margin: 12px 0 18px;
  background: #f8fafc;
}

.phb-button-muted {
  background: #64748b;
}

.phb-gateway {
  max-width: 520px;
}

.phb-gateway input[type="password"],
.phb-owner-panel input[type="text"],
.phb-owner-panel input[type="url"],
.phb-owner-panel select,
.phb-owner-panel textarea,
.phb-message-form select,
.phb-message-form textarea {
  width: 100%;
  border: 1px solid #c3c4c7;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.phb-gateway label,
.phb-owner-panel label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 600;
}

.phb-grid {
  display: grid;
  gap: 12px 18px;
}

.phb-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.phb-owner-panel {
  border-color: #f59e0b;
  background: #fffbeb;
}

@media (max-width: 760px) {
  .phb-access-bar {
    align-items: flex-start;
    border-radius: 14px;
    flex-direction: column;
  }
  .phb-grid-2 {
    grid-template-columns: 1fr;
  }
}

.phb-edit-panel {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.phb-edit-panel input[type="text"],
.phb-edit-panel input[type="email"],
.phb-edit-panel input[type="date"],
.phb-edit-panel input[type="number"],
.phb-edit-panel select,
.phb-edit-panel textarea {
  width: 100%;
  border: 1px solid #c3c4c7;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.phb-edit-panel label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 600;
}

.phb-details-summary {
  cursor: pointer;
  font-weight: 700;
  padding: 10px 0;
}

.phb-history-entry {
  border-left: 4px solid #94a3b8;
}

.phb-history-owner {
  border-left-color: #f59e0b;
}

.phb-history-client {
  border-left-color: #2563eb;
}

.phb-history-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.phb-history-values > div {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.phb-history-values span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  opacity: .7;
  margin-bottom: 4px;
}

@media (max-width: 760px) {
  .phb-history-values {
    grid-template-columns: 1fr;
  }
}
