/* ==========================================================================
   Technodream Contracts — Full-Width Portal Styles
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root,
[data-theme="dark"] {
  --p-bg: #0f1117;
  --p-surface: #1a1d27;
  --p-surface2: #22263a;
  --p-border: #2e3352;
  --p-primary: #4f7eff;
  --p-primary-dk: #3a68ee;
  --p-success: #22c55e;
  --p-danger: #ef4444;
  --p-warning: #f59e0b;
  --p-teal: #14b8a6;
  --p-text: #e2e8f0;
  --p-muted: #94a3b8;
  --p-radius: 12px;
  --p-radius-sm: 7px;
  --nav-h: 64px;
}

[data-theme="light"] {
  --p-bg: #f1f5f9;
  --p-surface: #ffffff;
  --p-surface2: #f8fafc;
  --p-border: #cbd5e1;
  --p-primary: #3b82f6;
  --p-primary-dk: #2563eb;
  --p-success: #10b981;
  --p-danger: #ef4444;
  --p-warning: #f59e0b;
  --p-teal: #0d9488;
  --p-text: #0f172a;
  --p-muted: #64748b;
}

html {
  font-size: 15px;
}

body.tdc-portal-body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--p-bg);
  color: var(--p-text);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--p-surface);
}
::-webkit-scrollbar-thumb {
  background: var(--p-border);
  border-radius: 99px;
}

/* ==========================================================================
   NAV
   ========================================================================== */
.tdc-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h);
  background: var(--p-surface);
  border-bottom: 1px solid var(--p-border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 24px;
}

.tdc-nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.tdc-nav-logo {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tdc-portal-logo {
  max-width: 100%;
  height: auto;
  display: block;
}
.tdc-nav-logo .tdc-portal-logo {
  max-height: 38px;
}
.tdc-nav-brand strong {
  font-size: 15px;
  font-weight: 700;
  display: block;
}
.tdc-nav-brand small {
  font-size: 11px;
  color: var(--p-muted);
}

.tdc-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tdc-nav-link {
  padding: 7px 14px;
  border-radius: var(--p-radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--p-muted);
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s;
}
.tdc-nav-link:hover {
  background: var(--p-surface2);
  color: var(--p-text);
}
.tdc-nav-link--logout {
  color: var(--p-danger);
}
.tdc-nav-link--logout:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--p-danger);
}

.tdc-nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--p-muted);
}
.tdc-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--p-primary), #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

/* ==========================================================================
   MAIN
   ========================================================================== */
.tdc-main {
  max-width: 1380px;
  margin: 0 auto;
  padding: 32px 32px 60px;
}

/* ==========================================================================
   STATS ROW
   ========================================================================== */
.tdc-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.tdc-stat-card {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: border-color 0.2s;
}
.tdc-stat-card:hover {
  border-color: var(--p-primary);
}
.tdc-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.tdc-stat-icon--blue {
  background: rgba(79, 126, 255, 0.15);
}
.tdc-stat-icon--green {
  background: rgba(34, 197, 94, 0.15);
}
.tdc-stat-icon--amber {
  background: rgba(245, 158, 11, 0.15);
}
.tdc-stat-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}
.tdc-stat-label {
  font-size: 12px;
  color: var(--p-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ==========================================================================
   MAIN CARD
   ========================================================================== */
.tdc-card {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  overflow: hidden;
}

.tdc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--p-border);
}
.tdc-card-title {
  font-size: 18px;
  font-weight: 700;
}
.tdc-card-sub {
  font-size: 13px;
  color: var(--p-muted);
  margin-top: 2px;
}

/* ==========================================================================
   TOOLBAR
   ========================================================================== */
.tdc-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 10px;
  border-bottom: 1px solid var(--p-border);
  flex-wrap: wrap;
}
.tdc-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}
.tdc-search-wrap input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  background: var(--p-surface2);
  border: 1.5px solid var(--p-border);
  border-radius: var(--p-radius-sm);
  color: var(--p-text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
}
.tdc-search-wrap input::placeholder {
  color: var(--p-muted);
}
.tdc-search-wrap input:focus {
  border-color: var(--p-primary);
  box-shadow: 0 0 0 3px rgba(79, 126, 255, 0.15);
}
.tdc-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--p-muted);
  pointer-events: none;
}
.tdc-toolbar-right {
  display: flex;
  gap: 8px;
}
.tdc-select {
  padding: 10px 14px;
  background: var(--p-surface2);
  border: 1.5px solid var(--p-border);
  border-radius: var(--p-radius-sm);
  color: var(--p-text);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.18s;
}
.tdc-select:focus {
  border-color: var(--p-primary);
}

/* ==========================================================================
   ALERT
   ========================================================================== */
.tdc-alert {
  margin: 0 28px;
  padding: 12px 18px;
  border-radius: var(--p-radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.6;
  margin-top: 16px;
}
.tdc-alert--success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ade80;
}
.tdc-alert--error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}
.tdc-alert--info {
  background: rgba(79, 126, 255, 0.12);
  border: 1px solid rgba(79, 126, 255, 0.3);
  color: #93c5fd;
}

/* ==========================================================================
   TABLE
   ========================================================================== */
.tdc-table-wrap {
  overflow-x: auto;
}
.tdc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.tdc-table thead th {
  background: var(--p-surface2);
  color: var(--p-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 11px 18px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--p-border);
}
.tdc-table tbody tr {
  border-bottom: 1px solid var(--p-border);
  transition: background 0.12s;
}
.tdc-table tbody tr:last-child {
  border-bottom: none;
}
.tdc-table tbody tr:hover {
  background: rgba(79, 126, 255, 0.05);
}
.tdc-table tbody td {
  padding: 14px 18px;
  vertical-align: middle;
}
.tdc-table td .row-name {
  font-weight: 600;
  color: var(--p-text);
}
.tdc-table td .row-id {
  color: var(--p-muted);
  font-size: 12px;
}
.tdc-table td .row-contract-type {
  font-size: 11px;
  color: var(--p-primary);
  font-weight: 500;
  letter-spacing: 0.2px;
}
.tdc-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  line-height: 1.2;
}
.tdc-badge--active {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}
.tdc-badge--expired {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}
.tdc-badge--resigned-ne {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}
.tdc-badge--resigned-cl {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}
.tdc-empty {
  text-align: center;
  color: var(--p-muted);
  padding: 48px 0 !important;
  font-style: italic;
}

/* ==========================================================================
   SKELETON LOADER
   ========================================================================== */
@keyframes tdc-skeleton-pulse {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.6;
  }
}
.tdc-skeleton {
  display: inline-block;
  height: 16px;
  width: 100%;
  background: var(--p-surface2);
  border-radius: 4px;
  animation: tdc-skeleton-pulse 1.5s ease-in-out infinite;
}
.tdc-skeleton.sh {
  width: 40%;
}
.tdc-skeleton.md {
  width: 70%;
}
.tdc-skeleton.lg {
  width: 90%;
}
.tdc-skeleton.badge {
  width: 80px;
  height: 22px;
  border-radius: 6px;
}
.tdc-skeleton.btn {
  width: 60px;
  height: 28px;
  border-radius: 6px;
}

/* ==========================================================================
   ACTIONS
   ========================================================================== */
.tdc-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.tdc-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--p-radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition:
    opacity 0.15s,
    transform 0.12s,
    box-shadow 0.15s;
  white-space: nowrap;
}
.tdc-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}
.tdc-btn:active {
  transform: translateY(0);
}
.tdc-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.tdc-btn--primary {
  background: var(--p-primary);
  color: #fff;
}
.tdc-btn--primary:hover {
  background: var(--p-primary-dk);
  opacity: 1;
}
.tdc-btn--ghost {
  background: transparent;
  color: var(--p-muted);
  border: 1.5px solid var(--p-border);
}
.tdc-btn--ghost:hover {
  background: var(--p-surface2);
  color: var(--p-text);
  opacity: 1;
}
.tdc-btn--sm {
  padding: 6px 13px;
  font-size: 12px;
  border-radius: 5px;
}
.tdc-btn--view {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}
.tdc-btn--dl {
  background: rgba(20, 184, 166, 0.15);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.25);
}
.tdc-btn--del {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Spinner inside button */
.tdc-btn-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tdc-spin 0.65s linear infinite;
}
@keyframes tdc-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */
.tdc-pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-top: 1px solid var(--p-border);
  flex-wrap: wrap;
  gap: 12px;
}
#tdc-pagination {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.tdc-pg-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  background: var(--p-surface2);
  border: 1.5px solid var(--p-border);
  border-radius: var(--p-radius-sm);
  color: var(--p-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tdc-pg-btn:hover:not([disabled]) {
  background: var(--p-primary);
  border-color: var(--p-primary);
  color: #fff;
}
.tdc-pg-btn.active {
  background: var(--p-primary);
  border-color: var(--p-primary);
  color: #fff;
}
.tdc-pg-btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}
.tdc-page-info {
  font-size: 12.5px;
  color: var(--p-muted);
}

/* ==========================================================================
   MODAL
   ========================================================================== */
.tdc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: tdc-fadeIn 0.18s ease;
}
@keyframes tdc-fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.tdc-modal {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  animation: tdc-slideUp 0.22s ease;
}
@keyframes tdc-slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.tdc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--p-border);
  flex-shrink: 0;
}
.tdc-modal-header h2 {
  font-size: 17px;
  font-weight: 700;
}
.tdc-modal-close {
  background: none;
  border: none;
  color: var(--p-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  border-radius: 5px;
  transition:
    color 0.15s,
    background 0.15s;
}
.tdc-modal-close:hover {
  color: var(--p-text);
  background: var(--p-surface2);
}

.tdc-modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 4px 0 8px;
}
.tdc-modal-body .tdc-alert {
  margin: 16px 28px 0;
}

.tdc-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 28px;
  border-top: 1px solid var(--p-border);
  flex-shrink: 0;
}

/* ==========================================================================
   FORM
   ========================================================================== */
.tdc-form-section {
  padding: 20px 28px 0;
}
.tdc-form-section:last-child {
  padding-bottom: 16px;
}
.tdc-form-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--p-primary);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--p-border);
}
.tdc-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.tdc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tdc-field--full {
  grid-column: 1 / -1;
}
.tdc-field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--p-text);
}
.tdc-field label .req {
  color: var(--p-danger);
  margin-left: 2px;
}

.tdc-field input,
.tdc-field select,
.tdc-field textarea {
  padding: 10px 14px;
  background: var(--p-surface2);
  border: 1.5px solid var(--p-border);
  border-radius: var(--p-radius-sm);
  color: var(--p-text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
  width: 100%;
}
.tdc-field input::placeholder,
.tdc-field textarea::placeholder {
  color: var(--p-muted);
  opacity: 0.7;
}
.tdc-field input:focus,
.tdc-field select:focus,
.tdc-field textarea:focus {
  border-color: var(--p-primary);
  box-shadow: 0 0 0 3px rgba(79, 126, 255, 0.15);
  background: var(--p-surface2);
}
.tdc-field select option {
  background: var(--p-surface2);
}

.tdc-field input.tdc-err,
.tdc-field select.tdc-err,
.tdc-field textarea.tdc-err {
  border-color: var(--p-danger);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .tdc-stats-row {
    grid-template-columns: 1fr 1fr;
  }
  .tdc-stats-row .tdc-stat-card:last-child {
    grid-column: 1 / -1;
  }
}
@media (max-width: 640px) {
  .tdc-main {
    padding: 16px 16px 40px;
  }
  .tdc-nav {
    padding: 0 16px;
    gap: 12px;
  }
  .tdc-nav-links {
    display: none;
  }
  .tdc-nav-brand {
    gap: 8px;
  }
  .tdc-brand-subtitle {
    display: none;
  }
  .tdc-hide-mobile {
    display: none;
  }
  .tdc-btn-rates {
    padding: 6px;
  }
  .tdc-nav-user-wrap {
    gap: 8px;
  }
  .tdc-user-profile {
    padding-left: 0;
    border-left: none;
  }
  .tdc-user-profile span {
    display: none;
  }

  .tdc-stats-row {
    grid-template-columns: 1fr;
  }
  .tdc-stats-row .tdc-stat-card:last-child {
    grid-column: auto;
  }
  .tdc-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .tdc-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .tdc-toolbar-right {
    flex-direction: column;
  }
  .tdc-select {
    width: 100%;
  }
  .tdc-form-grid {
    grid-template-columns: 1fr;
  }
  .tdc-field--full {
    grid-column: 1;
  }
  .tdc-modal {
    max-height: 100vh;
    border-radius: 0;
  }
  .tdc-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
}

/* ==========================================================================
   LOGIN PAGE
   ========================================================================== */
body.tdc-portal-body.tdc-login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
}
.tdc-login-wrap {
  width: 100%;
  max-width: 420px;
}
.tdc-login-header {
  text-align: center;
  margin-bottom: 30px;
}
.tdc-login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.tdc-login-logo .tdc-portal-logo {
  max-width: 220px;
}
.tdc-login-title {
  color: var(--p-text);
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
}
.tdc-login-sub {
  color: var(--p-muted);
  font-size: 14px;
  margin: 0;
}
.tdc-login-card {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}
[data-theme="light"] .tdc-login-card {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
}
.tdc-login-card .tdc-field label {
  font-size: 13px;
}
.tdc-login-card .tdc-btn {
  width: 100%;
  justify-content: center;
  margin-top: 10px;
  padding: 12px;
  font-size: 15px;
}
.tdc-login-footer {
  text-align: center;
  margin-top: 24px;
}
.tdc-login-footer a {
  color: var(--p-muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s;
}
.tdc-login-footer a:hover {
  color: var(--p-text);
}

/* ==========================================================================
   THEME TOGGLE
   ========================================================================== */
.tdc-theme-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--p-surface);
  border: 1.5px solid var(--p-border);
  color: var(--p-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.2s,
    background 0.2s;
  font-size: 20px;
}
.tdc-theme-toggle:hover {
  transform: scale(1.08);
}
[data-theme="light"] .tdc-theme-toggle {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   STATUS PILL (modal header dropdown)
   ========================================================================== */
.tdc-status-pill {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 15px 28px 15px 10px;
  border-radius: 99px;
  border: none;
  cursor: pointer;
  outline: none;
  background-color: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  /* chevron arrow */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%234ade80'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition:
    background-color 0.2s,
    color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
/* Colour variants driven by JS data-status attribute */
.tdc-status-pill[data-status="active"] {
  background-color: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%234ade80'/%3E%3C/svg%3E");
}
.tdc-status-pill[data-status="resigned-ne"] {
  background-color: rgba(239, 68, 68, 0.18);
  color: #f87171;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23f87171'/%3E%3C/svg%3E");
}
.tdc-status-pill[data-status="resigned-cl"] {
  background-color: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23fbbf24'/%3E%3C/svg%3E");
}
.tdc-status-pill[data-status="expired"] {
  background-color: rgba(239, 68, 68, 0.18);
  color: #f87171;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23f87171'/%3E%3C/svg%3E");
}
.tdc-status-pill option {
  background: var(--p-surface);
  color: var(--p-text);
  font-weight: 600;
}

/* ==========================================================================
   AUTOFILL OVERRIDE
   ========================================================================== */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--p-text);
  -webkit-box-shadow: 0 0 0px 1000px var(--p-surface2) inset;
  transition: background-color 5000s ease-in-out 0s;
}

/* ==========================================================================
   Utility & Inline-replaced Classes
   ========================================================================== */
.tdc-hidden {
  display: none;
}

/* Nav / Portal Header */
.tdc-brand-subtitle {
  margin-left: 10px;
  opacity: 0.8;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.tdc-nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 20px;
  align-items: center;
}
.tdc-nav-actions {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-left: 20px;
}
.tdc-nav-user-wrap {
  display: flex;
  align-items: center;
  gap: 15px;
}
.tdc-btn-rates {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
}
.tdc-user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 1px solid var(--p-border);
  padding-left: 15px;
}

/* Toolbar */
.tdc-toolbar-filters {
  flex-wrap: wrap;
  gap: 12px;
}
.tdc-search-col {
  flex: 1;
  min-width: 200px;
}
.tdc-filters-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.tdc-flag-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--p-text);
  padding: 0 4px;
}
.tdc-flag-checkbox {
  cursor: pointer;
  width: 16px;
  height: 16px;
}
.tdc-clear-btn {
  padding: 0 12px;
  height: 36px;
}
.tdc-toolbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Rates Modal */
.tdc-rates-modal-body {
  padding: 20px;
  line-height: 1.6;
  color: var(--p-text);
}
.tdc-rates-empty-text {
  color: var(--p-text);
}
.tdc-rates-modal-inner {
  max-width: 1300px !important;
  width: 95% !important;
  margin: auto;
}
.tdc-modal-title {
  margin: 0;
}

.tdc-rates-content {
  overflow-x: auto;
}
.tdc-rates-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 14px;
  background: transparent !important;
  color: var(--p-text) !important;
}
.tdc-rates-content table * {
  color: var(--p-text) !important;
}
.tdc-rates-content th,
.tdc-rates-content td {
  border: 1px solid var(--p-border) !important;
  padding: 10px 14px;
  text-align: left;
  background: transparent !important;
  white-space: normal !important;
  word-break: break-word !important;
}
.tdc-rates-content th {
  background-color: var(--p-surface2) !important;
  font-weight: 600;
}
.tdc-rates-content tr:nth-child(even) td {
  background-color: var(--p-surface2) !important;
}
.tdc-rates-content tr:nth-child(odd) td {
  background-color: var(--p-surface) !important;
}
.tdc-rates-content figure.wp-block-table {
  margin: 0;
}
.tdc-rates-content p {
  margin-bottom: 1em;
}

/* Modal Add Contract */
.tdc-modal-header-flex {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  justify-content: space-between;
}
.tdc-name-grid {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  gap: 14px;
}
.tdc-input-readonly {
  background-color: var(--p-surface);
  opacity: 0.8;
  cursor: not-allowed;
}
.tdc-rate-wrap {
  display: flex;
  align-items: stretch;
}
.tdc-rate-prefix {
  background: var(--p-surface2);
  border: 1.5px solid var(--p-border);
  border-right: none;
  padding: 0 16px;
  border-radius: var(--p-radius-sm) 0 0 var(--p-radius-sm);
  color: var(--p-muted);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
}
.tdc-rate-input {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  flex: 1;
  min-width: 0;
}

/* Login */
.tdc-login-field-spacer {
  margin-bottom: 16px;
}
.tdc-login-field-wrap {
  margin-bottom: 24px;
}
.tdc-login-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: normal;
  cursor: pointer;
}
.tdc-login-checkbox {
  width: fit-content;
}
.tdc-message {
  padding: 12px 18px;
  border-radius: var(--p-radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 20px;
}
.tdc-message--error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}
