/* ==========================================================================
   TPCloud Request Portal - Design System
   Enterprise cloud styling. Server-rendered, no external dependencies.
   ========================================================================== */

:root {
  /* Brand palette */
  --tp-primary: #0B5FFF;
  --tp-primary-600: #0A52DA;
  --tp-primary-700: #083FA8;
  --tp-primary-50: #E8F0FF;
  --tp-primary-100: #D6E4FF;
  --tp-cyan: #00AEEF;
  --tp-cyan-50: #E5F7FE;
  --tp-success: #059669;
  --tp-success-50: #ECFDF5;
  --tp-warning: #EA580C;
  --tp-warning-50: #FFF7ED;
  --tp-danger: #DC2626;
  --tp-danger-50: #FEF2F2;
  --tp-purple: #7C3AED;
  --tp-purple-50: #F5F1FE;
  --tp-indigo: #4338CA;
  --tp-teal: #0F766E;

  /* Neutral palette */
  --tp-bg: #F4F7FB;
  --tp-bg-alt: #EEF2F7;
  --tp-surface: #FFFFFF;
  --tp-surface-soft: #F8FAFC;
  --tp-border: #E2E8F0;
  --tp-border-strong: #CBD5E1;
  --tp-text: #0F172A;
  --tp-text-soft: #1F2937;
  --tp-text-muted: #64748B;
  --tp-text-faint: #94A3B8;

  /* Shadows */
  --tp-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --tp-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --tp-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
  --tp-shadow-lg: 0 12px 32px rgba(11, 95, 255, 0.10), 0 4px 12px rgba(15, 23, 42, 0.05);

  /* Radius */
  --tp-radius-sm: 8px;
  --tp-radius: 12px;
  --tp-radius-lg: 16px;
  --tp-radius-xl: 20px;

  /* Layout */
  --tp-topbar-h: 64px;
  --tp-container-max: 1340px;
  --tp-container-pad: 28px;

  /* Typography */
  --tp-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
             "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --tp-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
             "Liberation Mono", "Courier New", monospace;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--tp-font);
  background: var(--tp-bg);
  color: var(--tp-text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--tp-primary);
  text-decoration: none;
}

a:hover {
  color: var(--tp-primary-700);
  text-decoration: underline;
}

code {
  font-family: var(--tp-mono);
  font-size: 12.5px;
  background: var(--tp-bg-alt);
  color: var(--tp-text);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--tp-border);
}

hr {
  border: 0;
  border-top: 1px solid var(--tp-border);
  margin: 20px 0;
}

/* ---------- Topbar / Navigation ---------- */
.tp-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--tp-topbar-h);
  background: linear-gradient(120deg, #052E70 0%, #0B5FFF 60%, #00AEEF 130%);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 var(--tp-container-pad);
  box-shadow: 0 4px 16px rgba(8, 63, 168, 0.18);
}

.tp-topbar-inner {
  width: 100%;
  max-width: var(--tp-container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.tp-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.tp-brand:hover {
  color: #fff;
  text-decoration: none;
}

.tp-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  backdrop-filter: blur(6px);
}

.tp-brand-mark svg {
  width: 22px;
  height: 22px;
}

.tp-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.tp-brand-text strong {
  font-weight: 700;
  font-size: 15px;
}

.tp-brand-text span {
  font-size: 11px;
  opacity: 0.78;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.tp-nav {
  margin-left: 18px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.tp-nav a {
  color: rgba(255, 255, 255, 0.88);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.tp-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.tp-nav a.is-active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.tp-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.tp-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.14);
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.tp-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #fff;
  color: var(--tp-primary-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.tp-user-logout {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
}

.tp-user-logout:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  text-decoration: none;
}

.tp-nav-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 0;
  border-radius: 8px;
  width: 38px;
  height: 38px;
  font-size: 18px;
  cursor: pointer;
  margin-left: auto;
}

/* ---------- Container & page header ---------- */
.tp-container {
  max-width: var(--tp-container-max);
  margin: 0 auto;
  padding: 28px var(--tp-container-pad) 48px;
}

.tp-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 22px;
}

.tp-page-header-main {
  min-width: 0;
  flex: 1 1 320px;
}

.tp-page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--tp-primary-700);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.tp-page-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  color: var(--tp-text);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.tp-page-subtitle {
  margin: 0;
  color: var(--tp-text-muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 880px;
}

.tp-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tp-page-meta {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--tp-text-muted);
  font-size: 12.5px;
  background: var(--tp-surface);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--tp-border);
}

/* ---------- Buttons ---------- */
.tp-btn,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--tp-primary);
  color: #fff;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.2;
  min-height: 38px;
  transition: background 0.15s ease, border-color 0.15s ease,
              transform 0.05s ease, box-shadow 0.15s ease;
  text-decoration: none;
  box-shadow: var(--tp-shadow-xs);
  white-space: nowrap;
}

.tp-btn:hover,
.btn:hover {
  background: var(--tp-primary-600);
  color: #fff;
  text-decoration: none;
  box-shadow: var(--tp-shadow-sm);
}

.tp-btn:active,
.btn:active {
  transform: translateY(1px);
}

.tp-btn:disabled,
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.tp-btn-secondary,
.btn-secondary {
  background: #fff;
  color: var(--tp-primary-700);
  border-color: var(--tp-border-strong);
  box-shadow: var(--tp-shadow-xs);
}

.tp-btn-secondary:hover,
.btn-secondary:hover {
  background: var(--tp-primary-50);
  color: var(--tp-primary-700);
  border-color: var(--tp-primary);
}

.tp-btn-ghost {
  background: transparent;
  color: var(--tp-primary-700);
  border-color: transparent;
  box-shadow: none;
}

.tp-btn-ghost:hover {
  background: var(--tp-primary-50);
}

.tp-btn-success {
  background: var(--tp-success);
}

.tp-btn-success:hover {
  background: #047857;
}

.tp-btn-danger {
  background: var(--tp-danger);
}

.tp-btn-danger:hover {
  background: #B91C1C;
}

.tp-btn-sm {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 8px;
}

.tp-btn-lg {
  min-height: 46px;
  padding: 12px 22px;
  font-size: 15px;
  border-radius: 12px;
}

.tp-btn-block {
  width: 100%;
}

.tp-btn-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Cards / Sections ---------- */
.tp-card,
.card {
  background: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-lg);
  box-shadow: var(--tp-shadow-sm);
  padding: 22px 22px;
}

.tp-card-tight {
  padding: 16px 18px;
}

.tp-card-flush {
  padding: 0;
  overflow: hidden;
}

.tp-card-accent-primary {
  border-left: 4px solid var(--tp-primary);
}

.tp-card-accent-cyan {
  border-left: 4px solid var(--tp-cyan);
}

.tp-card-accent-success {
  border-left: 4px solid var(--tp-success);
}

.tp-card-accent-warning {
  border-left: 4px solid var(--tp-warning);
}

.tp-card-accent-purple {
  border-left: 4px solid var(--tp-purple);
}

.tp-card-accent-indigo {
  border-left: 4px solid var(--tp-indigo);
}

.tp-card-soft {
  background: var(--tp-surface-soft);
}

.tp-card-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.tp-card-header > .tp-card-header-title {
  flex: 1 1 320px;
  min-width: 0;
}

.tp-section-title,
.section-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--tp-text);
  letter-spacing: -0.005em;
}

.tp-section-subtitle {
  color: var(--tp-text-muted);
  font-size: 13px;
  margin: 0 0 12px;
  line-height: 1.55;
}

.tp-section-divider {
  margin: 18px 0;
  border-top: 1px dashed var(--tp-border);
}

.tp-stack > * + * {
  margin-top: 18px;
}

.tp-stack-sm > * + * {
  margin-top: 12px;
}

.tp-stack-lg > * + * {
  margin-top: 28px;
}

/* ---------- Grid system ---------- */
.tp-grid {
  display: grid;
  gap: 18px;
}

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

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

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

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

.tp-grid-sidebar {
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr);
}

/* Legacy aliases preserved */
.grid {
  display: grid;
  gap: 18px;
}

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

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

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

.detail-grid {
  display: grid;
  gap: 14px 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

/* ---------- KPI / metric cards ---------- */
.tp-kpi {
  position: relative;
  background: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-lg);
  padding: 18px 18px 20px;
  box-shadow: var(--tp-shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tp-kpi::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--tp-primary);
  opacity: 0.85;
}

.tp-kpi-label {
  color: var(--tp-text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tp-kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--tp-text);
  letter-spacing: -0.015em;
  line-height: 1.05;
}

.tp-kpi-hint {
  color: var(--tp-text-muted);
  font-size: 12px;
}

.tp-kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--tp-primary-50);
  color: var(--tp-primary-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.tp-kpi-primary::after  { background: var(--tp-primary); }
.tp-kpi-cyan::after     { background: var(--tp-cyan); }
.tp-kpi-purple::after   { background: var(--tp-purple); }
.tp-kpi-warning::after  { background: var(--tp-warning); }
.tp-kpi-success::after  { background: var(--tp-success); }
.tp-kpi-danger::after   { background: var(--tp-danger); }

/* Legacy metric aliases */
.metric-card { position: relative; overflow: hidden; }
.metric-label { color: var(--tp-text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; margin-bottom: 6px; }
.metric-value { font-size: 28px; font-weight: 800; color: var(--tp-text); letter-spacing: -0.015em; }
.metric-card::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--tp-primary); }
.metric-card.metric-submitted::after { background: var(--tp-primary); }
.metric-card.metric-received::after  { background: var(--tp-cyan); }
.metric-card.metric-progress::after  { background: var(--tp-purple); }
.metric-card.metric-responded::after { background: var(--tp-success); }
.metric-card.metric-completed::after { background: var(--tp-success); }
.metric-card.metric-attention::after { background: var(--tp-warning); }

.status-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.status-pill {
  background: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  padding: 14px;
  box-shadow: var(--tp-shadow-xs);
}

.status-pill-label {
  color: var(--tp-text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.status-pill-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--tp-text);
  letter-spacing: -0.01em;
}

/* ---------- Tables ---------- */
.tp-table-wrap {
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  overflow: auto;
  background: var(--tp-surface);
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.tp-table-wrap-sticky {
  max-height: 70vh;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--tp-surface);
  font-size: 13.5px;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 11px 14px;
  border-bottom: 1px solid var(--tp-border);
}

thead th {
  background: linear-gradient(180deg, #F1F6FE 0%, #E8F0FB 100%);
  color: var(--tp-text);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--tp-border-strong);
}

tbody tr:hover {
  background: var(--tp-primary-50);
}

tbody tr:last-child td {
  border-bottom: none;
}

td a {
  font-weight: 600;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

td.center,
th.center {
  text-align: center;
}

tfoot td,
tr.total-row td {
  background: var(--tp-surface-soft);
  font-weight: 700;
  color: var(--tp-text);
  border-top: 1px solid var(--tp-border-strong);
}

table.is-compact th,
table.is-compact td {
  padding: 8px 10px;
  font-size: 13px;
}

table.is-zebra tbody tr:nth-child(even) {
  background: #FBFDFF;
}

table.is-zebra tbody tr:nth-child(even):hover {
  background: var(--tp-primary-50);
}

/* Highlight rows for grand totals (BOQ tables) */
tr.is-emphasis td {
  background: #F3F7FF;
  color: var(--tp-text);
  font-weight: 600;
}

tr.is-total td {
  background: linear-gradient(180deg, #EAF2FF 0%, #DCEAFE 100%);
  font-weight: 800;
  color: var(--tp-primary-700);
  border-top: 2px solid var(--tp-primary);
}

tr.is-grand-total td {
  background: linear-gradient(180deg, var(--tp-primary-700), var(--tp-primary));
  color: #fff;
  font-weight: 800;
}

tr.is-grand-total td a {
  color: #fff;
}

/* Compact key/value table used inside cards */
.card table {
  background: transparent;
}

.card .tp-table-wrap > table {
  background: var(--tp-surface);
}

/* ---------- Forms ---------- */
label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tp-text-soft);
  margin-bottom: 6px;
  letter-spacing: 0.1px;
}

input,
select,
textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--tp-border-strong);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--tp-text);
  font-family: inherit;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--tp-primary);
  box-shadow: 0 0 0 3px rgba(11, 95, 255, 0.18);
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  margin-right: 6px;
  accent-color: var(--tp-primary);
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--tp-text-muted) 50%),
                    linear-gradient(135deg, var(--tp-text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.field {
  margin-bottom: 14px;
}

.field-name {
  color: var(--tp-text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.field-value {
  font-size: 14px;
  color: var(--tp-text);
  line-height: 1.55;
  word-wrap: break-word;
}

.field-value.is-pre {
  white-space: pre-line;
}

.field .errorlist,
.errorlist {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  color: var(--tp-danger);
  font-size: 12.5px;
}

.field input.has-error,
.field select.has-error,
.field textarea.has-error {
  border-color: var(--tp-danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.tp-help {
  color: var(--tp-text-muted);
  font-size: 12px;
  margin-top: 6px;
}

.tp-required {
  color: var(--tp-danger);
  font-weight: 700;
  margin-left: 2px;
}

/* Filters row */
.filters {
  display: grid;
  gap: 12px;
  grid-template-columns: 1.5fr repeat(4, 1fr) auto auto;
  align-items: end;
}

.filters .tp-btn,
.filters .btn {
  width: 100%;
}

/* Config tables used in service forms */
.config-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  overflow: hidden;
  margin-top: 8px;
}

.config-table th,
.config-table td {
  border-bottom: 1px solid var(--tp-border);
  padding: 10px 12px;
  vertical-align: middle;
}

.config-table thead th {
  background: var(--tp-bg-alt);
  color: var(--tp-text);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--tp-border-strong);
}

.config-table tbody tr:last-child td {
  border-bottom: none;
}

.config-table tbody tr:hover {
  background: var(--tp-primary-50);
}

.config-table input,
.config-table select,
.config-table textarea {
  width: 100%;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.4;
  background: var(--tp-bg-alt);
  color: var(--tp-text-soft);
  border: 1px solid var(--tp-border);
  white-space: nowrap;
  text-transform: none;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.85;
}

.badge.is-plain::before {
  display: none;
}

.badge-status,
.badge-priority {
  background: var(--tp-bg-alt);
  color: var(--tp-text-soft);
  border-color: var(--tp-border);
}

/* Status colors */
.badge-status-submitted     { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.badge-status-received      { background: #ECFEFF; color: #0369A1; border-color: #BAE6FD; }
.badge-status-need_more_info{ background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
.badge-status-assigned      { background: #EEF2FF; color: #4338CA; border-color: #C7D2FE; }
.badge-status-in_progress   { background: #F5F3FF; color: #6D28D9; border-color: #DDD6FE; }
.badge-status-responded     { background: #ECFDF5; color: #047857; border-color: #A7F3D0; }
.badge-status-completed     { background: #DCFCE7; color: #166534; border-color: #86EFAC; }
.badge-status-cancelled     { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }

.badge-priority-low      { background: #F1F5F9; color: #475569; border-color: #CBD5E1; }
.badge-priority-normal   { background: #E0F2FE; color: #0369A1; border-color: #BAE6FD; }
.badge-priority-high     { background: #FFEDD5; color: #9A3412; border-color: #FED7AA; }
.badge-priority-urgent   { background: #FEE2E2; color: #B91C1C; border-color: #FCA5A5; }

.badge-internal { background: #FFF7ED; color: #9A3412; border-color: #FED7AA; }
.badge-public   { background: #ECFDF5; color: #047857; border-color: #A7F3D0; }

.badge-soft-primary { background: var(--tp-primary-50); color: var(--tp-primary-700); border-color: var(--tp-primary-100); }
.badge-soft-cyan    { background: var(--tp-cyan-50); color: #0369A1; border-color: #BAE6FD; }
.badge-soft-success { background: var(--tp-success-50); color: #047857; border-color: #A7F3D0; }
.badge-soft-warning { background: var(--tp-warning-50); color: #9A3412; border-color: #FED7AA; }
.badge-soft-danger  { background: var(--tp-danger-50); color: #B91C1C; border-color: #FECACA; }

/* ---------- Alerts / messages ---------- */
.tp-alert {
  border: 1px solid var(--tp-border);
  background: var(--tp-surface);
  border-left: 4px solid var(--tp-primary);
  border-radius: var(--tp-radius);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--tp-text);
  line-height: 1.55;
}

.tp-alert-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--tp-primary-50);
  color: var(--tp-primary-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 13px;
}

.tp-alert-body {
  flex: 1;
  font-size: 13.5px;
}

.tp-alert-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.tp-alert-success {
  border-left-color: var(--tp-success);
  background: var(--tp-success-50);
}

.tp-alert-success .tp-alert-icon { background: #BBF7D0; color: #047857; }

.tp-alert-warning {
  border-left-color: var(--tp-warning);
  background: var(--tp-warning-50);
}

.tp-alert-warning .tp-alert-icon { background: #FED7AA; color: #9A3412; }

.tp-alert-danger {
  border-left-color: var(--tp-danger);
  background: var(--tp-danger-50);
}

.tp-alert-danger .tp-alert-icon { background: #FECACA; color: #B91C1C; }

.tp-alert-info {
  border-left-color: var(--tp-primary);
  background: var(--tp-primary-50);
}

.tp-alert-info .tp-alert-icon { background: var(--tp-primary-100); color: var(--tp-primary-700); }

.tp-alert ul {
  margin: 6px 0 0 18px;
  padding: 0;
}

/* ---------- Empty state ---------- */
.tp-empty,
.empty {
  text-align: center;
  padding: 36px 24px;
  color: var(--tp-text-muted);
  background: var(--tp-surface-soft);
  border: 1px dashed var(--tp-border-strong);
  border-radius: var(--tp-radius);
}

.tp-empty-title {
  font-weight: 700;
  color: var(--tp-text-soft);
  margin-bottom: 6px;
  font-size: 15px;
}

.tp-empty-hint {
  font-size: 13px;
  max-width: 480px;
  margin: 0 auto;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--tp-border);
}

.pagination-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--tp-border);
  border-radius: 8px;
  background: #fff;
  color: var(--tp-primary-700);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}

.page-link:hover {
  background: var(--tp-primary-50);
  border-color: var(--tp-primary);
  text-decoration: none;
}

.page-link.current {
  background: var(--tp-primary);
  border-color: var(--tp-primary);
  color: #fff;
}

.page-link.disabled {
  color: var(--tp-text-faint);
  background: var(--tp-surface-soft);
  pointer-events: none;
}

.filter-meta {
  color: var(--tp-text-muted);
  font-size: 12.5px;
}

/* ---------- Timeline ---------- */
.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  align-items: start;
}

.timeline-time {
  color: var(--tp-text-muted);
  font-size: 12.5px;
  line-height: 1.45;
  padding-top: 10px;
}

.timeline-card {
  border: 1px solid var(--tp-border);
  border-left: 3px solid var(--tp-primary);
  border-radius: var(--tp-radius);
  background: #fff;
  padding: 12px 14px;
  box-shadow: var(--tp-shadow-xs);
}

.timeline-card.internal {
  background: var(--tp-warning-50);
  border-left-color: var(--tp-warning);
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  color: var(--tp-text-muted);
  font-size: 12.5px;
}

.timeline-author {
  font-weight: 700;
  color: var(--tp-text);
}

.timeline-body {
  white-space: pre-wrap;
  line-height: 1.55;
  color: var(--tp-text);
  font-size: 14px;
}

.response-box {
  background: var(--tp-surface-soft);
  border: 1px solid var(--tp-border);
  border-left: 3px solid var(--tp-cyan);
  border-radius: var(--tp-radius);
  padding: 14px 16px;
  line-height: 1.6;
  white-space: pre-wrap;
  font-size: 14px;
}

/* ---------- Workflow stepper ---------- */
.tp-stepper {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0;
  margin: 4px 0 18px;
}

.tp-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 6px;
}

.tp-step + .tp-step::before {
  content: "";
  position: absolute;
  top: 14px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--tp-border);
}

.tp-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--tp-bg-alt);
  border: 2px solid var(--tp-border-strong);
  color: var(--tp-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.tp-step-label {
  font-size: 12px;
  color: var(--tp-text-muted);
  font-weight: 600;
  max-width: 140px;
}

.tp-step.is-done .tp-step-dot {
  background: var(--tp-success);
  border-color: var(--tp-success);
  color: #fff;
}

.tp-step.is-done + .tp-step::before { background: var(--tp-success); }

.tp-step.is-current .tp-step-dot {
  background: #fff;
  border-color: var(--tp-primary);
  color: var(--tp-primary-700);
  box-shadow: 0 0 0 4px rgba(11, 95, 255, 0.12);
}

.tp-step.is-current .tp-step-label {
  color: var(--tp-primary-700);
}

/* ---------- Info / summary boxes ---------- */
.tp-info-row {
  display: grid;
  gap: 12px 18px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.tp-info-item {
  border: 1px solid var(--tp-border);
  background: var(--tp-surface);
  border-radius: var(--tp-radius);
  padding: 10px 12px;
}

.tp-info-item .field-name {
  margin-bottom: 2px;
}

/* ---------- Sticky table header inside scroll wrap ---------- */
.tp-table-wrap thead th {
  position: sticky;
  top: 0;
}

/* ---------- Code blocks (kept for debug pages) ---------- */
pre {
  background: #0F172A;
  color: #E2E8F0;
  border-radius: var(--tp-radius);
  padding: 14px 16px;
  overflow-x: auto;
  line-height: 1.5;
  font-family: var(--tp-mono);
  font-size: 12.5px;
}

/* ---------- Login layout ---------- */
.tp-login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--tp-bg);
}

.tp-login-hero {
  background: radial-gradient(circle at 20% 20%, rgba(0, 174, 239, 0.35), transparent 55%),
              linear-gradient(135deg, #052E70 0%, #0B5FFF 55%, #0A52DA 100%);
  color: #fff;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.tp-login-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 90% 80%, rgba(0, 174, 239, 0.32), transparent 38%),
    radial-gradient(circle at 80% 12%, rgba(255, 255, 255, 0.08), transparent 28%);
  pointer-events: none;
}

.tp-login-hero > * {
  position: relative;
  z-index: 1;
}

.tp-login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tp-login-brand .tp-brand-mark {
  width: 46px;
  height: 46px;
  background: rgba(255, 255, 255, 0.2);
}

.tp-login-brand .tp-brand-mark svg {
  width: 26px;
  height: 26px;
}

.tp-login-brand-text strong {
  font-size: 18px;
  display: block;
  letter-spacing: 0.2px;
}

.tp-login-brand-text span {
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0.85;
}

.tp-login-headline {
  font-size: 32px;
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 32px 0 16px;
  max-width: 460px;
}

.tp-login-tagline {
  font-size: 15px;
  line-height: 1.6;
  max-width: 480px;
  opacity: 0.92;
}

.tp-login-points {
  display: grid;
  gap: 14px;
  max-width: 480px;
  margin-top: 28px;
}

.tp-login-point {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  opacity: 0.94;
}

.tp-login-point-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  color: #fff;
}

.tp-login-foot {
  font-size: 12px;
  opacity: 0.72;
  letter-spacing: 0.4px;
}

.tp-login-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
}

.tp-login-card {
  width: 100%;
  max-width: 420px;
  background: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-xl);
  box-shadow: var(--tp-shadow-lg);
  padding: 36px;
}

.tp-login-card h1 {
  margin: 0 0 6px;
  font-size: 24px;
  color: var(--tp-text);
}

.tp-login-card .tp-help-text {
  color: var(--tp-text-muted);
  font-size: 13.5px;
  margin: 0 0 20px;
}

.tp-login-foot-link {
  margin-top: 16px;
  text-align: center;
  color: var(--tp-text-muted);
  font-size: 12.5px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .tp-grid-4    { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tp-grid-sidebar { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .tp-login { grid-template-columns: 1fr; }
  .tp-login-hero { padding: 40px 28px; }
  .tp-login-headline { font-size: 26px; }

  .tp-grid-3,
  .tp-grid-2,
  .grid-2,
  .grid-3,
  .detail-grid {
    grid-template-columns: 1fr;
  }

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

  .tp-page-header {
    flex-direction: column;
  }

  .tp-stepper {
    grid-auto-flow: row;
    grid-auto-columns: unset;
  }

  .tp-step + .tp-step::before {
    display: none;
  }
}

@media (max-width: 720px) {
  :root {
    --tp-container-pad: 16px;
  }

  .tp-topbar {
    height: auto;
    min-height: var(--tp-topbar-h);
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .tp-topbar-inner {
    flex-wrap: wrap;
  }

  .tp-nav {
    order: 4;
    width: 100%;
    flex-basis: 100%;
    margin-left: 0;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    margin-top: 6px;
    display: none;
  }

  .tp-nav.is-open {
    display: flex;
  }

  .tp-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .tp-user {
    margin-left: 0;
  }

  .tp-grid-4 { grid-template-columns: 1fr; }
  .status-summary { grid-template-columns: 1fr; }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .timeline-time { padding-top: 0; }

  .tp-page-title { font-size: 22px; }
  .tp-page-actions { width: 100%; }

  .filters { grid-template-columns: 1fr; }

  .tp-login-card { padding: 24px; }
  .tp-login-form { padding: 24px 16px; }
}

@media (max-width: 540px) {
  th, td { padding: 9px 10px; font-size: 12.5px; }
  .tp-card, .card { padding: 16px; }
  .tp-page-actions .tp-btn,
  .tp-page-actions .btn { width: 100%; }
}

/* ---------- Utility helpers ---------- */
.u-flex          { display: flex; }
.u-flex-wrap     { flex-wrap: wrap; }
.u-flex-between  { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.u-flex-end      { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.u-gap-sm        { gap: 8px; }
.u-gap-md        { gap: 12px; }
.u-gap-lg        { gap: 18px; }
.u-mt-0          { margin-top: 0 !important; }
.u-mt-sm         { margin-top: 8px; }
.u-mt-md         { margin-top: 16px; }
.u-mt-lg         { margin-top: 24px; }
.u-mb-0          { margin-bottom: 0 !important; }
.u-mb-sm         { margin-bottom: 8px; }
.u-mb-md         { margin-bottom: 16px; }
.u-mb-lg         { margin-bottom: 24px; }
.u-text-muted    { color: var(--tp-text-muted); }
.u-text-soft     { color: var(--tp-text-soft); }
.u-text-danger   { color: var(--tp-danger); }
.u-text-success  { color: var(--tp-success); }
.u-text-right    { text-align: right; }
.u-text-center   { text-align: center; }
.u-text-nowrap   { white-space: nowrap; }
.u-pre           { white-space: pre-line; }
.u-tabular       { font-variant-numeric: tabular-nums; }
.u-full          { width: 100%; }
.u-truncate      { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.u-hidden        { display: none !important; }
.u-divider       { height: 1px; background: var(--tp-border); margin: 16px 0; }

.tp-tag-cell {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* === TPCloud Phase 16Q: Login 2-1 Tech Background Override === */
.tp-login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(380px, 1fr);
  background: #F4F7FB;
}

.tp-login-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 100vh;
  padding: 56px 52px;
  background:
    linear-gradient(90deg,
      rgba(2, 12, 38, 0.96) 0%,
      rgba(4, 31, 86, 0.90) 36%,
      rgba(8, 68, 168, 0.58) 68%,
      rgba(11, 95, 255, 0.28) 100%
    ),
    url("../img/login-bg.b34e39f3295e.png") center center / cover no-repeat;
}

.tp-login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 76% 36%, rgba(0, 174, 239, 0.30), transparent 32%),
    radial-gradient(circle at 18% 82%, rgba(11, 95, 255, 0.32), transparent 30%),
    linear-gradient(180deg, rgba(2, 8, 23, 0.02), rgba(2, 8, 23, 0.34));
}

.tp-login-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(125, 211, 252, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.18) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.72), transparent);
}

.tp-login-hero > * {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.tp-login-brand {
  margin-bottom: clamp(80px, 13vh, 180px);
}

.tp-login-headline {
  max-width: 680px;
  text-shadow: 0 10px 32px rgba(0, 0, 0, 0.34);
}

.tp-login-tagline {
  max-width: 660px;
  color: rgba(255, 255, 255, 0.86);
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.tp-login-points {
  max-width: 720px;
}

.tp-login-point {
  background: rgba(2, 8, 23, 0.24);
  border: 1px solid rgba(148, 215, 255, 0.18);
  box-shadow: 0 18px 48px rgba(0, 22, 80, 0.16);
  backdrop-filter: blur(8px);
}

.tp-login-point-mark {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.tp-login-foot {
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.tp-login-form {
  min-height: 100vh;
  padding: 40px 34px;
  background:
    radial-gradient(circle at 18% 12%, rgba(11, 95, 255, 0.06), transparent 28%),
    linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%);
}

.tp-login-card {
  width: min(100%, 430px);
  border: 1px solid rgba(203, 213, 225, 0.72);
  box-shadow:
    0 24px 70px rgba(15, 23, 42, 0.10),
    0 4px 16px rgba(15, 23, 42, 0.05);
}

/* Keep login responsive after changing desktop ratio */
@media (max-width: 1100px) {
  .tp-login {
    grid-template-columns: 1fr;
  }

  .tp-login-hero {
    min-height: auto;
    padding: 44px 30px;
  }

  .tp-login-brand {
    margin-bottom: 56px;
  }

  .tp-login-form {
    min-height: auto;
    padding: 36px 20px 48px;
  }

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

@media (max-width: 640px) {
  .tp-login-hero {
    padding: 34px 22px;
    background-position: center center;
  }

  .tp-login-hero::after {
    opacity: 0.20;
  }

  .tp-login-brand {
    margin-bottom: 42px;
  }
}
/* === End TPCloud Phase 16Q Login Override === */

/* === TPCloud Phase 16R: Login Brand + Headline Override === */
.tp-login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(72px, 12vh, 160px);
}

.tp-login-brand-logo {
  display: block;
  height: 56px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.18));
}

.tp-login-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.1;
}

.tp-login-brand-text strong {
  display: none;
}

.tp-login-brand-text span {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.9px;
  text-transform: uppercase;
}

.tp-login-headline {
  max-width: none !important;
  white-space: nowrap;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

@media (max-width: 1500px) {
  .tp-login-headline {
    white-space: normal;
    max-width: 760px !important;
  }
}

@media (max-width: 1100px) {
  .tp-login-brand {
    margin-bottom: 56px;
  }

  .tp-login-brand-logo {
    height: 48px;
    max-width: 220px;
  }

  .tp-login-headline {
    white-space: normal;
    max-width: 100% !important;
    font-size: 26px;
  }
}

@media (max-width: 640px) {
  .tp-login-brand {
    gap: 10px;
    margin-bottom: 40px;
  }

  .tp-login-brand-logo {
    height: 40px;
    max-width: 180px;
  }

  .tp-login-brand-text span {
    font-size: 10px;
    letter-spacing: 1.4px;
  }

  .tp-login-headline {
    font-size: 22px;
  }
}
/* === End TPCloud Phase 16R Login Override === */

/* === TPCloud Phase 16S: Login Clean Hero Highlights === */
.tp-login-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
  max-width: 880px;
}

.tp-login-highlight {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 215, 255, 0.24);
  background: rgba(2, 8, 23, 0.24);
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.35px;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 14px 42px rgba(0, 22, 80, 0.14);
  backdrop-filter: blur(8px);
}

.tp-login-highlight::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 9px;
  border-radius: 999px;
  background: rgba(0, 174, 239, 0.96);
  box-shadow: 0 0 16px rgba(0, 174, 239, 0.86);
}

@media (max-width: 1100px) {
  .tp-login-highlights {
    margin-top: 22px;
  }
}

@media (max-width: 640px) {
  .tp-login-highlights {
    gap: 8px;
  }

  .tp-login-highlight {
    min-height: 32px;
    padding: 8px 12px;
    font-size: 10px;
    letter-spacing: 1px;
  }
}
/* === End TPCloud Phase 16S Login Clean Hero === */

/* === TPCloud Phase 16T: Login Background Opacity Tune === */
.tp-login-hero {
  background:
    linear-gradient(90deg,
      rgba(2, 12, 38, 0.68) 0%,
      rgba(4, 31, 86, 0.54) 34%,
      rgba(8, 68, 168, 0.28) 68%,
      rgba(11, 95, 255, 0.10) 100%
    ),
    url("../img/login-bg.b34e39f3295e.png") center center / cover no-repeat;
}

.tp-login-hero::before {
  background:
    radial-gradient(circle at 76% 36%, rgba(0, 174, 239, 0.22), transparent 32%),
    radial-gradient(circle at 18% 82%, rgba(255, 136, 0, 0.10), transparent 22%),
    radial-gradient(circle at 22% 28%, rgba(11, 95, 255, 0.14), transparent 26%),
    linear-gradient(180deg, rgba(2, 8, 23, 0.01), rgba(2, 8, 23, 0.12));
}

.tp-login-hero::after {
  opacity: 0.20;
}
/* === End TPCloud Phase 16T Login Background Opacity Tune === */

/* === TPCloud Phase 16U: Login Copy Position Tuning === */
.tp-login-hero {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.tp-login-brand {
  margin-bottom: 0;
}

.tp-login-copy {
  margin-top: clamp(14vh, 18vh, 22vh);
  max-width: 760px;
}

.tp-login-copy .tp-login-headline {
  margin-bottom: 18px;
}

.tp-login-highlights {
  margin-top: 20px;
}

.tp-login-foot {
  margin-top: auto;
}

@media (max-width: 1100px) {
  .tp-login-copy {
    margin-top: 64px;
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .tp-login-copy {
    margin-top: 40px;
  }
}
/* === End TPCloud Phase 16U Login Copy Position Tuning === */

/* === TPCloud Phase 16V: Login Card Logo and Spacing === */
.tp-login-card {
  padding: 46px 48px 42px;
}

.tp-login-card-brand {
  display: flex;
  align-items: center;
  margin-bottom: 26px;
}

.tp-login-card-brand img {
  display: block;
  height: 42px;
  width: auto;
  max-width: 210px;
  object-fit: contain;
}

.tp-login-card h1 {
  margin: 0 0 26px;
}

.tp-login-card form {
  margin-top: 0;
}

.tp-login-card .field {
  margin-bottom: 22px;
}

.tp-login-card .field label {
  margin-bottom: 9px;
}

.tp-login-card .tp-btn-block {
  margin-top: 6px;
}

@media (max-width: 640px) {
  .tp-login-card {
    padding: 34px 28px 32px;
  }

  .tp-login-card-brand {
    margin-bottom: 22px;
  }

  .tp-login-card-brand img {
    height: 36px;
    max-width: 180px;
  }

  .tp-login-card h1 {
    margin-bottom: 22px;
  }
}
/* === End TPCloud Phase 16V Login Card Logo and Spacing === */

/* === TPCloud Phase 16W: Login Copy Center and Background Softening === */
.tp-login-hero {
  background:
    linear-gradient(90deg,
      rgba(2, 12, 38, 0.78) 0%,
      rgba(4, 31, 86, 0.68) 34%,
      rgba(8, 68, 168, 0.42) 68%,
      rgba(11, 95, 255, 0.22) 100%
    ),
    url("../img/login-bg.b34e39f3295e.png") center center / cover no-repeat;
}

.tp-login-hero::before {
  background:
    radial-gradient(circle at 76% 36%, rgba(0, 174, 239, 0.18), transparent 32%),
    radial-gradient(circle at 18% 82%, rgba(255, 136, 0, 0.07), transparent 22%),
    radial-gradient(circle at 22% 28%, rgba(11, 95, 255, 0.10), transparent 26%),
    linear-gradient(180deg, rgba(2, 8, 23, 0.03), rgba(2, 8, 23, 0.18));
}

.tp-login-hero::after {
  opacity: 0.14;
}

.tp-login-copy {
  position: absolute;
  top: 50%;
  left: 52px;
  right: 52px;
  margin: 0;
  max-width: 820px;
  transform: translateY(-50%);
}

.tp-login-copy .tp-login-headline {
  margin-bottom: 18px;
}

.tp-login-highlights {
  margin-top: 18px;
}

@media (max-width: 1100px) {
  .tp-login-copy {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    margin-top: 64px;
    max-width: 100%;
    transform: none;
  }
}

@media (max-width: 640px) {
  .tp-login-copy {
    margin-top: 40px;
  }
}
/* === End TPCloud Phase 16W Login Copy Center and Background Softening === */

/* === TPCloud Phase 16X: Login Background 03 === */
.tp-login-hero {
  background:
    linear-gradient(90deg,
      rgba(2, 12, 38, 0.78) 0%,
      rgba(4, 31, 86, 0.68) 34%,
      rgba(8, 68, 168, 0.42) 68%,
      rgba(11, 95, 255, 0.22) 100%
    ),
    url("../img/login-bg-03.e2bd341b4aee.png") center center / cover no-repeat;
}
/* === End TPCloud Phase 16X Login Background 03 === */

/* === TPCloud Phase 16Y: Topbar Logo Brand === */
.tp-topbar-logo-brand {
  gap: 10px;
  min-width: 0;
}

.tp-topbar-logo-shell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 5px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(2, 8, 23, 0.12);
  flex-shrink: 0;
}

.tp-topbar-logo-img {
  display: block;
  height: 24px;
  width: auto;
  max-width: 118px;
  object-fit: contain;
}

.tp-topbar-logo-tagline {
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.8px;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.tp-topbar-logo-brand:hover {
  text-decoration: none;
}

@media (max-width: 760px) {
  .tp-topbar-logo-shell {
    height: 36px;
    padding: 5px 8px;
  }

  .tp-topbar-logo-img {
    height: 22px;
    max-width: 104px;
  }

  .tp-topbar-logo-tagline {
    display: none;
  }
}
/* === End TPCloud Phase 16Y Topbar Logo Brand === */

/* === TPCloud Phase 16Z: Dashboard Request Code Type Badge === */
.tp-request-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  font-weight: 700;
  text-decoration: none;
  color: var(--tp-primary);
}

.tp-request-code:hover {
  text-decoration: none;
}

.tp-request-type-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.65px;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}

.tp-request-code-text {
  color: var(--tp-primary);
  line-height: 1.25;
}

.tp-request-code-estimation .tp-request-type-chip {
  color: #0B5FFF;
  background: #E8F0FF;
  border-color: #BBD0FF;
}

.tp-request-code-poc .tp-request-type-chip {
  color: #7C3AED;
  background: #F5F1FE;
  border-color: #DDD0FE;
}

.tp-request-code-deployment .tp-request-type-chip {
  color: #EA580C;
  background: #FFF7ED;
  border-color: #FED7AA;
}

.tp-request-code:hover .tp-request-code-text {
  color: var(--tp-primary-700);
  text-decoration: underline;
}

@media (max-width: 900px) {
  .tp-request-code {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .tp-request-type-chip {
    min-width: auto;
  }
}
/* === End TPCloud Phase 16Z Dashboard Request Code Type Badge === */

/* === TPCloud Phase 16AA: Dashboard Divider + Request Code Colors === */

/* Hide accidental duplicate divider if any still remains after template cleanup */
.u-divider + .u-divider {
  display: none;
}

/* Request code colors by request type */
.tp-request-code-link {
  font-weight: 800;
  text-decoration: none;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.tp-request-code-link:hover {
  text-decoration: underline;
}

.tp-request-code-link-estimation {
  color: #0B5FFF !important;
}

.tp-request-code-link-poc {
  color: #7C3AED !important;
}

.tp-request-code-link-deployment {
  color: #EA580C !important;
}

.tp-request-code-link-estimation:hover {
  color: #0847c7 !important;
}

.tp-request-code-link-poc:hover {
  color: #6431d8 !important;
}

.tp-request-code-link-deployment:hover {
  color: #c2410c !important;
}

/* Make code column visually tighter and clearer */
.tp-request-code-link {
  display: inline-block;
  line-height: 1.25;
}

/* === End TPCloud Phase 16AA Dashboard Divider + Request Code Colors === */

/* === TPCloud Phase 16AE: Request List Compact Table === */
.tp-request-list-table {
  min-width: 1500px;
  table-layout: fixed;
}

.tp-request-list-table th,
.tp-request-list-table td {
  padding: 12px 14px;
  vertical-align: top;
}

/* Column sizing */
.tp-request-list-table th:nth-child(1),
.tp-request-list-table td:nth-child(1) {
  width: 150px;
}

.tp-request-list-table th:nth-child(2),
.tp-request-list-table td:nth-child(2) {
  width: 360px;
}

.tp-request-list-table th:nth-child(3),
.tp-request-list-table td:nth-child(3) {
  width: 92px;
}

.tp-request-list-table th:nth-child(4),
.tp-request-list-table td:nth-child(4) {
  width: 145px;
}

.tp-request-list-table th:nth-child(5),
.tp-request-list-table td:nth-child(5) {
  width: 72px;
}

.tp-request-list-table th:nth-child(6),
.tp-request-list-table td:nth-child(6) {
  width: 145px;
}

.tp-request-list-table th:nth-child(7),
.tp-request-list-table td:nth-child(7) {
  width: 140px;
}

.tp-request-list-table th:nth-child(8),
.tp-request-list-table td:nth-child(8) {
  width: 108px;
}

.tp-request-list-table th:nth-child(9),
.tp-request-list-table td:nth-child(9) {
  width: 135px;
}

.tp-request-list-table th:nth-child(10),
.tp-request-list-table td:nth-child(10) {
  width: 125px;
}

/* Keep operational columns compact */
.tp-request-list-table td:nth-child(1),
.tp-request-list-table td:nth-child(3),
.tp-request-list-table td:nth-child(4),
.tp-request-list-table td:nth-child(5),
.tp-request-list-table td:nth-child(7),
.tp-request-list-table td:nth-child(8),
.tp-request-list-table td:nth-child(10) {
  white-space: nowrap;
}

/* Request code color by request type */
.tp-request-code-link {
  display: inline-block;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  text-decoration: none;
}

.tp-request-code-link:hover {
  text-decoration: underline;
}

.tp-request-code-link-estimation {
  color: #0B5FFF !important;
}

.tp-request-code-link-poc {
  color: #7C3AED !important;
}

.tp-request-code-link-deployment {
  color: #EA580C !important;
}

/* Reduce visual height for long titles/customers */
.tp-request-title-clamp,
.tp-request-customer-clamp {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.tp-request-title-clamp {
  -webkit-line-clamp: 2;
  line-height: 1.45;
}

.tp-request-customer-clamp {
  -webkit-line-clamp: 2;
  line-height: 1.4;
}

/* Prevent duplicate divider from previous dashboard cleanup */
.u-divider + .u-divider {
  display: none;
}
/* === End TPCloud Phase 16AE Request List Compact Table === */

/* === TPCloud Phase 16AF: Request List Code Title Spacing === */
.tp-request-list-table th:nth-child(1),
.tp-request-list-table td:nth-child(1) {
  width: 185px;
  padding-right: 28px;
}

.tp-request-list-table th:nth-child(2),
.tp-request-list-table td:nth-child(2) {
  width: 430px;
  padding-left: 24px;
}

.tp-request-list-table td:nth-child(1) {
  border-right: 1px solid rgba(203, 213, 225, 0.55);
}

.tp-request-list-table .tp-request-code-link {
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.tp-request-list-table .tp-request-title-clamp {
  padding-left: 0;
}
/* === End TPCloud Phase 16AF Request List Code Title Spacing === */

/* === TPCloud Phase 16AG: Request List Customer and Date Spacing === */
.tp-request-list-table {
  min-width: 1660px;
}

/* Customer column: allow longer real customer names */
.tp-request-list-table th:nth-child(6),
.tp-request-list-table td:nth-child(6) {
  width: 220px;
  min-width: 220px;
  padding-left: 18px;
  padding-right: 22px;
}

/* Let customer wrap nicely up to 2 lines instead of becoming cramped */
.tp-request-list-table .tp-request-customer-clamp {
  -webkit-line-clamp: 2;
  line-height: 1.45;
  word-break: normal;
  overflow-wrap: anywhere;
}

/* Assigned column: give it breathing room before date */
.tp-request-list-table th:nth-child(9),
.tp-request-list-table td:nth-child(9) {
  width: 160px;
  min-width: 160px;
  padding-right: 22px;
}

/* Created date column: avoid sticking to the right edge */
.tp-request-list-table th:nth-child(10),
.tp-request-list-table td:nth-child(10) {
  width: 155px;
  min-width: 155px;
  padding-left: 20px;
  padding-right: 34px;
  white-space: nowrap;
}

/* Add a little inner breathing room at the far right of the scrollable table */
.tp-request-list-table th:last-child,
.tp-request-list-table td:last-child {
  border-right: 18px solid transparent;
}
/* === End TPCloud Phase 16AG Request List Customer and Date Spacing === */

/* === TPCloud Phase 16AH: Request List Reorder Customer Remove Type === */
.tp-request-list-table {
  min-width: 1580px;
  table-layout: fixed;
}

/* 9-column layout:
   1 Code, 2 Title, 3 Customer, 4 Service, 5 BU,
   6 Status, 7 Priority, 8 Assigned, 9 Created
*/
.tp-request-list-table th:nth-child(1),
.tp-request-list-table td:nth-child(1) {
  width: 185px;
  min-width: 185px;
  padding-right: 26px;
  border-right: 1px solid rgba(203, 213, 225, 0.55);
}

.tp-request-list-table th:nth-child(2),
.tp-request-list-table td:nth-child(2) {
  width: 410px;
  min-width: 410px;
  padding-left: 24px;
  padding-right: 24px;
}

.tp-request-list-table th:nth-child(3),
.tp-request-list-table td:nth-child(3) {
  width: 300px;
  min-width: 300px;
  padding-left: 18px;
  padding-right: 26px;
}

.tp-request-list-table th:nth-child(4),
.tp-request-list-table td:nth-child(4) {
  width: 170px;
  min-width: 170px;
}

.tp-request-list-table th:nth-child(5),
.tp-request-list-table td:nth-child(5) {
  width: 78px;
  min-width: 78px;
}

.tp-request-list-table th:nth-child(6),
.tp-request-list-table td:nth-child(6) {
  width: 150px;
  min-width: 150px;
}

.tp-request-list-table th:nth-child(7),
.tp-request-list-table td:nth-child(7) {
  width: 120px;
  min-width: 120px;
}

.tp-request-list-table th:nth-child(8),
.tp-request-list-table td:nth-child(8) {
  width: 170px;
  min-width: 170px;
  padding-right: 24px;
}

.tp-request-list-table th:nth-child(9),
.tp-request-list-table td:nth-child(9) {
  width: 170px;
  min-width: 170px;
  padding-left: 22px;
  padding-right: 38px;
  white-space: nowrap;
}

/* Compact no-wrap operational columns */
.tp-request-list-table td:nth-child(1),
.tp-request-list-table td:nth-child(4),
.tp-request-list-table td:nth-child(5),
.tp-request-list-table td:nth-child(6),
.tp-request-list-table td:nth-child(7),
.tp-request-list-table td:nth-child(9) {
  white-space: nowrap;
}

/* Customer can be longer, max 2 lines */
.tp-request-customer-clamp {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.45;
  word-break: normal;
  overflow-wrap: anywhere;
}

/* Title max 2 lines */
.tp-request-title-clamp {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.45;
}

/* Request code color by type */
.tp-request-code-link {
  display: inline-block;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  text-decoration: none;
}

.tp-request-code-link:hover {
  text-decoration: underline;
}

.tp-request-code-link-estimation {
  color: #0B5FFF !important;
}

.tp-request-code-link-poc {
  color: #7C3AED !important;
}

.tp-request-code-link-deployment {
  color: #EA580C !important;
}

/* Far-right breathing room */
.tp-request-list-table th:last-child,
.tp-request-list-table td:last-child {
  border-right: 20px solid transparent;
}
/* === End TPCloud Phase 16AH Request List Reorder Customer Remove Type === */

/* === TPCloud Phase 16AI: Request List Numbered Pagination === */
.tp-pagination-numbered {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 28px;
  margin-top: 0;
  border-top: 1px solid rgba(203, 213, 225, 0.7);
}

.tp-pagination-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.tp-pagination-links .page-link,
.tp-pagination-links .page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  font-weight: 800;
  line-height: 1;
}

.tp-pagination-links .page-link {
  border: 1px solid rgba(203, 213, 225, 0.95);
  background: #ffffff;
  color: #0B3F99;
  text-decoration: none;
}

.tp-pagination-links .page-link:hover {
  border-color: rgba(11, 95, 255, 0.45);
  background: #F3F7FF;
  text-decoration: none;
}

.tp-pagination-links .page-link.current {
  border-color: #0B5FFF;
  background: #0B5FFF;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(11, 95, 255, 0.22);
}

.tp-pagination-links .page-link.disabled {
  color: #94A3B8;
  background: #F8FAFC;
  cursor: not-allowed;
}

.tp-pagination-links .page-ellipsis {
  color: #64748B;
  min-width: 24px;
  padding: 0 4px;
}

@media (max-width: 760px) {
  .tp-pagination-numbered {
    align-items: flex-start;
    flex-direction: column;
  }

  .tp-pagination-links {
    justify-content: flex-start;
  }
}
/* === End TPCloud Phase 16AI Request List Numbered Pagination === */

/* === TPCloud Phase 16AJ-R2: Request List Per Page Selector === */
.tp-pagination-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.tp-per-page-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.tp-per-page-form label {
  margin: 0;
  color: #64748B;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.tp-per-page-form select {
  height: 38px;
  min-width: 108px;
  padding: 0 34px 0 12px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 10px;
  background-color: #ffffff;
  color: #0F172A;
  font-weight: 700;
  outline: none;
}

.tp-per-page-form select:focus {
  border-color: rgba(11, 95, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(11, 95, 255, 0.12);
}
/* === End TPCloud Phase 16AJ-R2 Request List Per Page Selector === */

/* === TPCloud Phase 16AK: Fix Per Page Select === */
.tp-pagination-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.tp-per-page-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.tp-per-page-form label {
  margin: 0;
  color: #64748B;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.tp-per-page-form select,
#per-page-select {
  display: inline-block !important;
  appearance: auto !important;
  -webkit-appearance: menulist !important;
  height: 40px !important;
  min-width: 132px !important;
  padding: 0 12px !important;
  border: 1px solid rgba(148, 163, 184, 0.9) !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: #0F172A !important;
  font-weight: 800 !important;
  line-height: 40px !important;
  opacity: 1 !important;
  cursor: pointer !important;
}

.tp-per-page-form select option,
#per-page-select option {
  color: #0F172A !important;
  background: #ffffff !important;
}
/* === End TPCloud Phase 16AK Fix Per Page Select === */

/* === TPCloud Phase 16AL: Dashboard Recent Table Remove Type Column === */

/* Recent request table on dashboard now has no Loại column.
   Give Title and Service a little more breathing room. */
.tp-dashboard-recent-table th:nth-child(1),
.tp-dashboard-recent-table td:nth-child(1) {
  width: 170px;
  white-space: nowrap;
}

.tp-dashboard-recent-table th:nth-child(2),
.tp-dashboard-recent-table td:nth-child(2) {
  min-width: 420px;
}

.tp-dashboard-recent-table th:nth-child(3),
.tp-dashboard-recent-table td:nth-child(3) {
  min-width: 160px;
}

.tp-dashboard-recent-table th:nth-child(4),
.tp-dashboard-recent-table td:nth-child(4) {
  width: 80px;
  white-space: nowrap;
}

.tp-dashboard-recent-table th:nth-child(5),
.tp-dashboard-recent-table td:nth-child(5),
.tp-dashboard-recent-table th:nth-child(6),
.tp-dashboard-recent-table td:nth-child(6),
.tp-dashboard-recent-table th:nth-child(7),
.tp-dashboard-recent-table td:nth-child(7) {
  white-space: nowrap;
}

/* If the dashboard table does not already carry this class, keep generic recent table behavior harmless. */
.tp-request-code-link behavior harmless. */
.tp-request-code-link-estimation {
  color: #0B5FFF !important;
}

.tp-request-code-link-poc {
  color: #7C3AED !important;
}

.tp-request-code-link-deployment {
  color: #EA580C !important;
}
/* === End TPCloud Phase 16AL Dashboard Recent Table Remove Type Column === */

/* === TPCloud Phase 16AN: Multi Request Add Button Spacing === */
.tp-multi-add-service-action {
  margin-top: 30px;
  padding-top: 4px;
  display: flex;
  align-items: center;
}

.tp-multi-add-service-action .tp-btn,
.tp-multi-add-service-action button {
  margin-top: 0;
}

/* Give the dynamic service block a little breathing room at the bottom */
.tp-service-block,
.tp-service-section,
.tp-service-category-block,
.tp-multi-service-block {
  margin-bottom: 22px;
}
/* === End TPCloud Phase 16AN Multi Request Add Button Spacing === */

/* === TPCloud Phase 16AO: Special Service Label and Wrapping === */

/* Request list layout after removing Loại column:
   1 Code, 2 Title, 3 Customer, 4 Service, 5 BU, ...
   Let Service wrap so long labels do not collide with BU. */
.tp-request-list-table th:nth-child(4),
.tp-request-list-table td:nth-child(4) {
  width: 190px;
  min-width: 190px;
  padding-right: 26px;
  white-space: normal !important;
}

.tp-request-service-clamp {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.45;
  word-break: normal;
  overflow-wrap: anywhere;
}

/* Keep BU compact and visually separated from Service */
.tp-request-list-table th:nth-child(5),
.tp-request-list-table td:nth-child(5) {
  width: 88px;
  min-width: 88px;
  padding-left: 18px;
  white-space: nowrap;
}

/* Dashboard recent table service column also gets safe wrapping */
.tp-dashboard-recent-table th:nth-child(3),
.tp-dashboard-recent-table td:nth-child(3) {
  white-space: normal !important;
}
/* === End TPCloud Phase 16AO Special Service Label and Wrapping === */

/* === TPCloud Phase 16AP: Request Detail Payload Per Service === */
.tp-service-payload-stack {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.tp-service-payload-card {
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
}

.tp-service-payload-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
  border-bottom: 1px solid rgba(203, 213, 225, 0.85);
}

.tp-service-payload-code {
  color: #0B5FFF;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tp-service-payload-title {
  margin: 6px 0 0;
  color: #0F172A;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
}

.tp-service-payload-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: #64748B;
  font-size: 13px;
  font-weight: 700;
}

.tp-service-payload-table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.tp-service-payload-table {
  border-radius: 0;
}

.tp-empty-compact {
  margin: 18px;
  padding: 24px;
}

@media (max-width: 760px) {
  .tp-service-payload-header {
    flex-direction: column;
  }
}
/* === End TPCloud Phase 16AP Request Detail Payload Per Service === */

/* === TPCloud Phase 16AP-R2: Request Detail Payload Per Service === */
.tp-service-payload-stack {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.tp-service-payload-card {
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
}

.tp-service-payload-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
  border-bottom: 1px solid rgba(203, 213, 225, 0.85);
}

.tp-service-payload-code {
  color: #0B5FFF;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tp-service-payload-title {
  margin: 6px 0 0;
  color: #0F172A;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
}

.tp-service-payload-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: #64748B;
  font-size: 13px;
  font-weight: 700;
}

.tp-service-payload-table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.tp-service-payload-table {
  border-radius: 0;
}

.tp-empty-compact {
  margin: 18px;
  padding: 24px;
}

@media (max-width: 760px) {
  .tp-service-payload-header {
    flex-direction: column;
  }
}
/* === End TPCloud Phase 16AP-R2: Request Detail Payload Per Service === */

/* === TPCloud Phase 16AQ: Deployment Source Estimation Card === */
.tp-linked-estimation-card {
  border-left: 5px solid #0B5FFF;
  background:
    linear-gradient(135deg, rgba(11, 95, 255, 0.08), rgba(14, 165, 233, 0.04)),
    #ffffff;
}

.tp-linked-estimation-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.tp-linked-estimation-eyebrow {
  color: #0B5FFF;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tp-linked-estimation-code {
  margin: 8px 0 0;
  font-size: 26px;
  font-weight: 950;
  letter-spacing: 0.02em;
}

.tp-linked-estimation-code a {
  color: #0F172A;
  text-decoration: none;
}

.tp-linked-estimation-code a:hover {
  color: #0B5FFF;
  text-decoration: underline;
}

.tp-linked-estimation-title {
  margin: 8px 0 0;
  color: #475569;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.5;
}

.tp-linked-estimation-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tp-linked-estimation-action {
  flex: 0 0 auto;
}

@media (max-width: 760px) {
  .tp-linked-estimation-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .tp-linked-estimation-action {
    width: 100%;
  }

  .tp-linked-estimation-action .tp-btn {
    width: 100%;
  }
}
/* === End TPCloud Phase 16AQ Deployment Source Estimation Card === */

/* === TPCloud Phase 16AR: Compact Deployment Source Estimation === */

/* Make the source estimation relationship a compact full-width callout,
   not a heavy card competing with request/business information. */
.tp-linked-estimation-compact {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 22px !important;
  margin-bottom: 8px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-left: 5px solid #0B5FFF;
  border-radius: 18px;
  background:
    radial-gradient(circle at 10% 10%, rgba(11, 95, 255, 0.12), transparent 32%),
    linear-gradient(135deg, rgba(11, 95, 255, 0.075), rgba(14, 165, 233, 0.035)),
    #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.tp-linked-estimation-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0B5FFF, #0EA5E9);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(11, 95, 255, 0.24);
}

.tp-linked-estimation-icon span {
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.1em;
}

.tp-linked-estimation-content {
  min-width: 0;
}

.tp-linked-estimation-eyebrow {
  color: #0B5FFF;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tp-linked-estimation-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 8px;
}

.tp-linked-estimation-code-link {
  color: #0F172A;
  font-size: 24px;
  font-weight: 950;
  letter-spacing: 0.035em;
  text-decoration: none;
  line-height: 1.1;
}

.tp-linked-estimation-code-link:hover {
  color: #0B5FFF;
  text-decoration: underline;
}

.tp-linked-estimation-title {
  margin: 8px 0 0;
  max-width: 920px;
  color: #475569;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-linked-estimation-action {
  flex: 0 0 auto;
}

.tp-linked-estimation-action .tp-btn {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .tp-linked-estimation-compact {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .tp-linked-estimation-action {
    grid-column: 1 / -1;
  }

  .tp-linked-estimation-action .tp-btn {
    width: 100%;
  }

  .tp-linked-estimation-title {
    white-space: normal;
  }
}

@media (max-width: 560px) {
  .tp-linked-estimation-compact {
    grid-template-columns: 1fr;
  }

  .tp-linked-estimation-icon {
    width: 46px;
    height: 46px;
  }
}
/* === End TPCloud Phase 16AR Compact Deployment Source Estimation === */

/* === TPCloud Phase 16AT-R3: Direct Target BOQ Sizing Summary === */
.tp-boq-sizing-summary-r3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.tp-boq-sizing-card-r3 {
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.tp-boq-sizing-title-r3 {
  padding: 13px 16px;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(203, 213, 225, 0.78);
}

.tp-boq-sizing-card-r3.is-resource .tp-boq-sizing-title-r3 {
  color: #0B5FFF;
  background: linear-gradient(135deg, rgba(11, 95, 255, 0.10), rgba(14, 165, 233, 0.04));
}

.tp-boq-sizing-card-r3.is-converted .tp-boq-sizing-title-r3 {
  color: #7C3AED;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.10), rgba(167, 139, 250, 0.04));
}

.tp-boq-sizing-card-r3.is-cost .tp-boq-sizing-title-r3 {
  color: #047857;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(52, 211, 153, 0.04));
}

.tp-boq-sizing-grid-r3 {
  display: grid;
}

.tp-boq-sizing-item-r3 {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, auto);
  gap: 12px;
  padding: 11px 16px;
  border-top: 1px solid rgba(226, 232, 240, 0.95);
}

.tp-boq-sizing-item-r3:first-child {
  border-top: 0;
}

.tp-boq-sizing-key-r3 {
  color: #475569;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}

.tp-boq-sizing-value-r3 {
  color: #0F172A;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
  text-align: right;
  word-break: break-word;
}

.tp-boq-sizing-raw-r3 {
  grid-column: 1 / -1;
  margin-top: 2px;
  border: 1px dashed rgba(148, 163, 184, 0.65);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.82);
}

.tp-boq-sizing-raw-r3 summary {
  padding: 10px 14px;
  color: #64748B;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.tp-boq-sizing-raw-r3 pre {
  margin: 0;
  padding: 0 14px 14px;
  color: #334155;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

@media (max-width: 1180px) {
  .tp-boq-sizing-summary-r3 {
    grid-template-columns: 1fr;
  }

  .tp-boq-sizing-value-r3 {
    text-align: left;
  }
}
/* === End TPCloud Phase 16AT-R3 Direct Target BOQ Sizing Summary === */

/* === TPCloud Phase 16AU: Cloud Processing Summary vs Action Form === */

/* Read-only tracking card */
.tp-cloud-processing-summary-card {
  position: relative;
  border-left: 5px solid #0EA5E9 !important;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.065), rgba(255, 255, 255, 0.96)),
    #ffffff;
}

.tp-cloud-processing-summary-card::before {
  content: "THEO DÕI";
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 10px;
  padding: 5px 10px;
  border: 1px solid rgba(14, 165, 233, 0.28);
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.08);
  color: #0369A1;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.12em;
}

/* Action/update form card */
.tp-cloud-processing-action-card {
  position: relative;
  border-left: 5px solid #0B5FFF !important;
  background:
    linear-gradient(135deg, rgba(11, 95, 255, 0.075), rgba(255, 255, 255, 0.98)),
    #ffffff;
  box-shadow: 0 16px 38px rgba(11, 95, 255, 0.09);
}

.tp-cloud-processing-action-card::before {
  content: "BIỂU MẪU THAO TÁC";
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 10px;
  padding: 5px 10px;
  border: 1px solid rgba(11, 95, 255, 0.28);
  border-radius: 999px;
  background: rgba(11, 95, 255, 0.09);
  color: #0B5FFF;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.12em;
}

.tp-cloud-processing-action-card .tp-section-title,
.tp-cloud-processing-action-card h2 {
  color: #0F172A;
}

.tp-cloud-processing-action-card form {
  margin-top: 8px;
}

.tp-cloud-processing-action-card textarea {
  min-height: 140px;
}

.tp-cloud-processing-action-card button[type="submit"],
.tp-cloud-processing-action-card .tp-btn-primary {
  box-shadow: 0 12px 24px rgba(11, 95, 255, 0.22);
}

/* Make the summary/action separation clearer */
.tp-cloud-processing-summary-card + .u-divider,
.tp-cloud-processing-action-card + .u-divider {
  margin-top: 28px;
  margin-bottom: 28px;
}

@media (max-width: 760px) {
  .tp-cloud-processing-summary-card::before,
  .tp-cloud-processing-action-card::before {
    margin-bottom: 8px;
  }
}
/* === End TPCloud Phase 16AU Cloud Processing Summary vs Action Form === */

/* === TPCloud Phase 16AY: BU Edit Request === */
.tp-bu-edit-form textarea {
  min-height: 96px;
  resize: vertical;
}

.tp-bu-edit-payload-card {
  border-left: 5px solid #0EA5E9;
}

.tp-bu-edit-service-stack {
  display: grid;
  gap: 18px;
}

.tp-bu-edit-service-card {
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.035), rgba(255, 255, 255, 0.98));
}

.tp-bu-edit-service-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.tp-bu-edit-service-code {
  color: #0B5FFF;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tp-bu-edit-service-header h3 {
  margin: 4px 0 0;
  color: #0F172A;
  font-size: 18px;
  font-weight: 900;
}

.tp-bu-edit-payload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.tp-bu-edit-payload-grid .field label {
  word-break: break-word;
}

.tp-bu-edit-payload-grid textarea {
  min-height: 72px;
  font-family: inherit;
}

.tp-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

@media (max-width: 900px) {
  .tp-bu-edit-payload-grid {
    grid-template-columns: 1fr;
  }

  .tp-bu-edit-service-header {
    flex-direction: column;
  }
}
/* === End TPCloud Phase 16AY BU Edit Request === */

/* === TPCloud Phase 16AZ: BU Edit Request Repair === */
.tp-bu-edit-form textarea {
  min-height: 96px;
  resize: vertical;
}

.tp-bu-edit-payload-card {
  border-left: 5px solid #0EA5E9;
}

.tp-bu-edit-service-stack {
  display: grid;
  gap: 18px;
}

.tp-bu-edit-service-card {
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.035), rgba(255, 255, 255, 0.98));
}

.tp-bu-edit-service-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.tp-bu-edit-service-code {
  color: #0B5FFF;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tp-bu-edit-service-header h3 {
  margin: 4px 0 0;
  color: #0F172A;
  font-size: 18px;
  font-weight: 900;
}

.tp-bu-edit-payload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.tp-bu-edit-payload-grid textarea {
  min-height: 72px;
  font-family: inherit;
}

.tp-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

@media (max-width: 900px) {
  .tp-bu-edit-payload-grid {
    grid-template-columns: 1fr;
  }

  .tp-bu-edit-service-header {
    flex-direction: column;
  }
}
/* === End TPCloud Phase 16AZ BU Edit Request Repair === */

/* === TPCloud Phase 16BA: BU Edit Technical Detail Polish === */

.tp-bu-edit-payload-card {
  overflow: visible;
  border-left: 5px solid #0EA5E9 !important;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.045), rgba(255, 255, 255, 0.98)),
    #ffffff;
}

.tp-bu-edit-service-card {
  position: relative;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.055);
}

.tp-bu-edit-service-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #0B5FFF, #0EA5E9);
}

.tp-bu-edit-service-header {
  margin: 0 !important;
  padding: 20px 22px 16px 26px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
  background:
    radial-gradient(circle at 0% 0%, rgba(11, 95, 255, 0.10), transparent 30%),
    linear-gradient(135deg, rgba(11, 95, 255, 0.055), rgba(14, 165, 233, 0.025));
}

.tp-bu-edit-service-code {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 9px;
  border: 1px solid rgba(11, 95, 255, 0.18);
  border-radius: 999px;
  background: rgba(11, 95, 255, 0.07);
  color: #0B5FFF !important;
  font-size: 11px !important;
  font-weight: 950 !important;
  letter-spacing: 0.1em !important;
}

.tp-bu-edit-service-header h3 {
  margin-top: 10px !important;
  font-size: 22px !important;
  font-weight: 950 !important;
  color: #0F172A !important;
}

.tp-bu-edit-service-card > .field {
  padding: 18px 22px 0 26px;
}

.tp-bu-edit-service-card > .field input {
  max-width: 520px;
}

.tp-edit-spec-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 22px 22px 26px;
}

.tp-edit-spec-field {
  position: relative;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(203, 213, 225, 0.86);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.tp-edit-spec-field:hover {
  border-color: rgba(11, 95, 255, 0.34);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.055);
  transform: translateY(-1px);
}

.tp-edit-spec-field.is-wide {
  grid-column: 1 / -1;
}

.tp-edit-spec-resource {
  background:
    linear-gradient(135deg, rgba(11, 95, 255, 0.045), rgba(255, 255, 255, 0.95));
}

.tp-edit-spec-network {
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.045), rgba(255, 255, 255, 0.95));
}

.tp-edit-spec-note {
  background:
    linear-gradient(135deg, rgba(249, 115, 22, 0.045), rgba(255, 255, 255, 0.95));
}

.tp-edit-spec-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.tp-edit-spec-label-row label {
  margin: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.tp-edit-spec-unit {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.10);
  color: #64748B;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tp-edit-spec-field input,
.tp-edit-spec-field textarea {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  background: #ffffff;
  font-size: 14px;
}

.tp-edit-spec-field textarea {
  min-height: 82px;
  resize: vertical;
}

.tp-edit-spec-field:not(.is-wide) textarea {
  min-height: 44px;
}

.tp-bu-edit-service-stack {
  gap: 22px !important;
}

@media (max-width: 1280px) {
  .tp-edit-spec-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .tp-edit-spec-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .tp-edit-spec-grid {
    grid-template-columns: 1fr;
  }

  .tp-bu-edit-service-header {
    padding-right: 18px;
  }
}
/* === End TPCloud Phase 16BA BU Edit Technical Detail Polish === */

/* === TPCloud Phase 16BB: Password Management === */
.tp-password-card {
  max-width: 880px;
  margin: 0 auto;
  border-left: 5px solid #0B5FFF;
}

.tp-password-form {
  display: grid;
  gap: 18px;
  margin-top: 14px;
}

.tp-password-form input[type="password"] {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
}

.tp-password-target-summary {
  margin: 10px 0 22px;
  padding: 16px;
  border: 1px solid rgba(203, 213, 225, 0.86);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.86);
}

.tp-field-hint {
  margin-top: 8px;
  color: #64748B;
  font-size: 13px;
  line-height: 1.5;
}

.tp-field-hint ul {
  margin: 6px 0 0 18px;
  padding: 0;
}

.tp-field-error {
  margin-top: 8px;
  color: #B91C1C;
  font-size: 13px;
  font-weight: 750;
}

.tp-field-error ul {
  margin: 0;
  padding-left: 18px;
}

.tp-btn-danger {
  background: linear-gradient(135deg, #EF4444, #DC2626) !important;
  border-color: #DC2626 !important;
  color: #ffffff !important;
  box-shadow: 0 12px 24px rgba(220, 38, 38, 0.20);
}

.tp-card-accent-warning {
  border-left: 5px solid #F97316 !important;
}
/* === End TPCloud Phase 16BB Password Management === */

/* === TPCloud Phase 16BC: Header password link and login email support === */
.tp-app-header a[href*="change-password"],
.tp-header a[href*="change-password"],
.tp-navbar a[href*="change-password"],
.tp-topbar a[href*="change-password"],
header a[href*="change-password"] {
  color: rgba(255, 255, 255, 0.88) !important;
  font-weight: 700;
  text-decoration: none;
}

.tp-app-header a[href*="change-password"]:hover,
.tp-header a[href*="change-password"]:hover,
.tp-navbar a[href*="change-password"]:hover,
.tp-topbar a[href*="change-password"]:hover,
header a[href*="change-password"]:hover {
  color: #ffffff !important;
  text-decoration: none;
}

.login-card input[name="username"],
.tp-login-card input[name="username"],
form input[name="username"] {
  letter-spacing: 0.01em;
}
/* === End TPCloud Phase 16BC Header password link and login email support === */

/* === TPCloud Phase 16BD: Header Account Actions Consistency === */
.tp-header-action-link,
.tp-app-header .tp-header-action-link,
.tp-header .tp-header-action-link,
.tp-navbar .tp-header-action-link,
.tp-topbar .tp-header-action-link,
header .tp-header-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.86) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-decoration: none !important;
  white-space: nowrap;
  background: transparent;
  border: 1px solid transparent;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.tp-header-action-link:hover,
.tp-app-header .tp-header-action-link:hover,
.tp-header .tp-header-action-link:hover,
.tp-navbar .tp-header-action-link:hover,
.tp-topbar .tp-header-action-link:hover,
header .tp-header-action-link:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.18);
  text-decoration: none !important;
}

/* Override older Change Password CSS if still loaded */
a[href*="change-password"].tp-header-action-link {
  color: rgba(255, 255, 255, 0.86) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

a[href*="logout"].tp-header-action-link {
  color: rgba(255, 255, 255, 0.86) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}
/* === End TPCloud Phase 16BD Header Account Actions Consistency === */

/* === TPCloud Phase 16BG: Wrap Customer Column === */
.tp-has-customer-column {
  table-layout: auto !important;
}

.tp-has-customer-column th.tp-customer-col,
.tp-has-customer-column td.tp-customer-col {
  min-width: 260px;
  max-width: 420px;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  line-height: 1.45;
}

.tp-has-customer-column td.tp-customer-col {
  color: #0F172A;
}

.tp-has-customer-column td.tp-customer-col a,
.tp-has-customer-column td.tp-customer-col span,
.tp-has-customer-column td.tp-customer-col div {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

@media (max-width: 1100px) {
  .tp-has-customer-column th.tp-customer-col,
  .tp-has-customer-column td.tp-customer-col {
    min-width: 220px;
    max-width: 360px;
  }
}
/* === End TPCloud Phase 16BG Wrap Customer Column === */

/* === TPCloud Phase 17A: Styled Error Pages === */
.tp-error-page {
  min-height: 58vh;
  display: grid;
  place-items: center;
  padding: 40px 16px;
}

.tp-error-card {
  width: min(680px, 100%);
  padding: 42px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(11, 95, 255, 0.10), transparent 38%),
    #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.10);
}

.tp-error-code {
  width: fit-content;
  margin-bottom: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(11, 95, 255, 0.10);
  color: #0B5FFF;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0.12em;
}

.tp-error-card h1 {
  margin: 0 0 12px;
  color: #0F172A;
  font-size: 32px;
  font-weight: 950;
}

.tp-error-card p {
  margin: 0;
  color: #64748B;
  font-size: 16px;
  line-height: 1.7;
}
/* === End TPCloud Phase 17A Styled Error Pages === */

/* === TPCloud Phase 17D: Business Form Rules === */
.tp-title-field {
  grid-column: 1 / -1;
}

.tp-title-field input {
  width: 100%;
  min-height: 46px;
}

.tp-field-hint {
  margin-top: 7px;
  color: #64748B;
  font-size: 13px;
  line-height: 1.45;
}

input:required,
select:required,
textarea:required {
  scroll-margin-top: 120px;
}
/* === End TPCloud Phase 17D Business Form Rules === */

/* BEGIN PHASE18A2_SERVICE_ITEM_CHIPS_STYLE */
.tp-request-service-main {
  font-weight: 600;
}

.tp-request-item-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tp-request-item-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(14, 165, 233, 0.28);
  background: rgba(14, 165, 233, 0.08);
  color: #0369a1;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
}

.tp-request-item-chip:hover {
  background: rgba(14, 165, 233, 0.14);
  color: #075985;
  text-decoration: none;
}

.tp-request-item-code-link {
  font-weight: 800;
  color: #0369a1;
  text-decoration: none;
}

.tp-request-item-code-link:hover {
  color: #075985;
  text-decoration: underline;
}

.tp-request-item-row-action {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
}

.tp-request-item-row-action a {
  color: #ea580c;
  text-decoration: none;
}

.tp-request-item-row-action a:hover {
  text-decoration: underline;
}
/* END PHASE18A2_SERVICE_ITEM_CHIPS_STYLE */


/* BEGIN PHASE18A3B_BOQ_SOURCE_BREAKDOWN_STYLE */
.tp-boq-source-breakdown {
  border-left: 4px solid rgba(14, 165, 233, 0.65);
}

.tp-boq-source-table td {
  vertical-align: top;
}

.tp-boq-payload-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tp-boq-payload-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  background: rgba(20, 184, 166, 0.08);
  color: #0f766e;
  font-size: 12px;
  line-height: 1.25;
  word-break: break-word;
}

.tp-boq-source-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(234, 88, 12, 0.22);
  background: rgba(255, 247, 237, 0.72);
  color: #7c2d12;
  font-size: 13px;
  line-height: 1.5;
}

.tp-boq-source-note code {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 237, 213, 0.9);
  color: #9a3412;
  font-weight: 700;
}
/* END PHASE18A3B_BOQ_SOURCE_BREAKDOWN_STYLE */

/* BEGIN PHASE18B2_BOQ_LIVE_RECALC_STYLE */
.tp-boq-live-recalc-notice {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(239, 246, 255, 0.82);
  color: #1e3a8a;
  font-size: 13px;
  line-height: 1.5;
}

.tp-boq-live-updated {
  animation: tp-boq-live-flash 0.5s ease-out;
}

@keyframes tp-boq-live-flash {
  0% {
    background: rgba(250, 204, 21, 0.42);
  }
  100% {
    background: transparent;
  }
}
/* END PHASE18B2_BOQ_LIVE_RECALC_STYLE */

/* BEGIN PHASE18B4_BOQ_LIVE_COST_PREVIEW_STYLE */
.tp-boq-live-cost-notice {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  background: rgba(236, 253, 245, 0.82);
  color: #065f46;
  font-size: 13px;
  line-height: 1.5;
}
/* END PHASE18B4_BOQ_LIVE_COST_PREVIEW_STYLE */

/* BEGIN PHASE18C3_BOQ_ADDON_COST_CORE_STYLE */
.tp-boq-addon-cost-section {
  border-left: 4px solid rgba(239, 68, 68, 0.62);
}

.tp-boq-addon-cost-table td {
  vertical-align: top;
}

.tp-boq-addon-cost-table input[type="text"],
.tp-boq-addon-cost-table input[type="number"] {
  width: 100%;
  min-width: 120px;
}

.tp-boq-addon-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.18);
  background: rgba(254, 242, 242, 0.8);
  color: #7f1d1d;
  font-size: 13px;
  line-height: 1.5;
}
/* END PHASE18C3_BOQ_ADDON_COST_CORE_STYLE */

/* BEGIN PHASE18C4_VEEAM_OPEX_ROW6_STYLE */
.tp-boq-veeam-license-row {
  background: rgba(239, 246, 255, 0.55);
}

.tp-boq-veeam-license-row input[type="text"],
.tp-boq-veeam-license-row input[type="number"] {
  width: 100%;
  min-width: 120px;
}
/* END PHASE18C4_VEEAM_OPEX_ROW6_STYLE */

/* BEGIN PHASE18C5E_ALIGN_VEEAM_QUANTITY_AS_TABLE_NUMBER */
.tp-boq-veeam-license-row td {
  vertical-align: middle;
}

.tp-boq-veeam-license-row td:nth-child(4) {
  text-align: right;
}

.tp-boq-veeam-license-row input[name="addon_veeam_quantity"] {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 32px;
  display: block;
  margin: 0;
  padding: 0 0 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
  box-shadow: none;
  appearance: textfield;
  -moz-appearance: textfield;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.tp-boq-veeam-license-row input[name="addon_veeam_quantity"]:hover {
  border-color: rgba(37, 99, 235, 0.18);
  background: rgba(248, 251, 255, 0.9);
}

.tp-boq-veeam-license-row input[name="addon_veeam_quantity"]:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.72);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12), 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.tp-boq-veeam-license-row input[name="addon_veeam_quantity"]::-webkit-outer-spin-button,
.tp-boq-veeam-license-row input[name="addon_veeam_quantity"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.tp-boq-veeam-license-row td:nth-child(5),
.tp-boq-veeam-license-row td:nth-child(6) {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
/* END PHASE18C5E_ALIGN_VEEAM_QUANTITY_AS_TABLE_NUMBER */

/* BEGIN PHASE18D2_WORKFLOW_GUIDE_STYLE */
.tp-workflow-guide {
  margin: 12px 0 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  background: rgba(239, 246, 255, 0.72);
}

.tp-workflow-guide-title {
  margin-bottom: 10px;
  color: #0f172a;
  font-weight: 800;
}

.tp-workflow-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tp-workflow-guide-grid > div {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.tp-workflow-guide-grid strong {
  display: block;
  margin-bottom: 4px;
  color: #0f4ab8;
  font-size: 13px;
}

.tp-workflow-guide-grid span {
  display: block;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .tp-workflow-guide-grid {
    grid-template-columns: 1fr;
  }
}
/* END PHASE18D2_WORKFLOW_GUIDE_STYLE */

/* BEGIN PHASE18D3_TIMELINE_READABILITY_STYLE */
.tp-timeline-body-prewrap {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
}

.timeline-card .timeline-meta {
  margin-bottom: 6px;
}

.timeline-card.internal {
  border-left-color: rgba(245, 158, 11, 0.7);
  background: rgba(255, 251, 235, 0.72);
}
/* END PHASE18D3_TIMELINE_READABILITY_STYLE */
