/* Dashboard hero styles live in dashboard_hero.css (loaded on dashboard page only). */

#purchase-history .purchase-history-lead {
  margin-top: -0.35rem;
  margin-bottom: 0.75rem;
}

#ch-manage-companies .ch-manage-lead {
  margin: 0.25rem 0 0;
  color: #5a6478;
  font-size: 0.92rem;
  line-height: 1.35;
}

#ch-manage-companies .ch-manage-top {
  display: grid;
  grid-template-columns: 28% 11% 15% 13% 12% 21%;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 0.75rem;
}

#ch-manage-companies .ch-manage-intro {
  grid-column: 1 / 6;
  flex: none;
  min-width: 0;
}

#ch-manage-companies .ch-manage-intro h2 {
  margin: 0;
  line-height: 1.15;
}

#ch-manage-companies .ch-agent-pass-banner {
  background: #eef8ee;
  border: 1px solid #b8e0b5;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  color: #1f4d2c;
}

/* =========================
   Dashboard layout
   ========================= */
.dashboard-container {
  max-width: 1620px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

.dashboard-wrapper {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

/* =========================
   Sidebar
   ========================= */
.dashboard-container .nav-buttons {
  width: 260px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0;
}

.nav-group-title {
  font-size: 13px;
  font-weight: 700;
  color: #6b7a99;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 6px;
}

.nav-group + .nav-group {
  border-top: 1px solid #e6edf9;
  padding-top: 16px;
}

.nav-vat-card {
  position: relative;
  margin: 6px 8px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #dce6f5;
  box-shadow: 0 2px 10px rgba(16, 45, 86, 0.08);
  overflow: hidden;
}

.nav-vat-card__accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #5b8fd4 0%, #476db0 100%);
}

.nav-vat-card__inner {
  padding: 12px 12px 12px 16px;
}

.nav-vat-card__header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.nav-vat-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #eef4fc;
  flex: 0 0 auto;
}

.nav-vat-card__icon img {
  display: block;
}

.nav-vat-card__title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #5a6478;
  line-height: 1.2;
}

.nav-vat-card__stat {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.nav-vat-card__count {
  font-size: 1.65rem;
  font-weight: 800;
  color: #0f2a52;
  line-height: 1;
  letter-spacing: -0.02em;
}

.nav-vat-card__unit {
  font-size: 0.82rem;
  font-weight: 600;
  color: #6b7c96;
}

.nav-vat-card__cta {
  display: inline-block;
  margin-top: 0.65rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: #eef4fc;
  color: #476db0;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-vat-card__cta:hover {
  background: #476db0;
  color: #fff;
  text-decoration: none;
}

/* nav button */
.dashboard-container .nav-buttons a.nav-button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 12px 16px;
  border: 1px solid #476DB0;
  border-radius: 8px;
  font-size: 16px;
  color: #333;
  background-color: #fff;
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
  width: 100%;
}

.dashboard-container .nav-buttons a.nav-button img {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.dashboard-container .nav-buttons a.nav-button:hover {
  background-color: #f1f5ff;
}

.dashboard-container .nav-buttons a.nav-button.active {
  background-color: #476DB0;
  border-color: #476DB0;
  color: #fff;
}

.dashboard-container .nav-buttons a.nav-button.active img {
  filter: brightness(0) invert(1);
}

.hidden { display: none !important; }

/* =========================
   Content panel
   ========================= */
.content-section-wrapper {
  flex: 1;
  min-width: 0;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  overflow-x: hidden;
  overflow-y: visible;
}

.content-section { display: none; }
.content-section:not(.hidden) { display: block; }

/* =========================
   Global forms (Account details)
   ========================= */
/* Account-details forms only — exclude Manage Companies search + action forms + password forms */
.content-section form:not(.ch-search):not(.ch-company-action-form):not(.ch-delete-form):not(.no-grid):not(.dashboard-excel-auth-form) {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.content-section form.no-grid:not(.ch-search) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  max-width: 400px;
  margin: 0 auto;
  grid-template-columns: none !important;
}

#ch-manage-companies .ch-company-actions form {
  display: block !important;
  grid-template-columns: none !important;
  gap: 0 !important;
  max-width: none !important;
  width: 100%;
}

.content-section form label {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.content-section form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
  color: #333;
  background-color: #f7f7f7;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.content-section form input[readonly] {
  background-color: #e9ecef;
  cursor: not-allowed;
}

.content-section form input:focus {
  border-color: #476DB0;
  background-color: #fff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(71, 109, 176, 0.15);
}

.full-width { grid-column: span 2; }

.button-group {
  display: flex;
  gap: 0.75rem;
  grid-column: span 2;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.header-with-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
}

.edit-button,
.save-button,
.cancel-button {
  padding: 8px 14px;
  font-size: 14px;
  border: 1px solid #476DB0;
  background-color: #476DB0;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
}

.edit-button:hover,
.save-button:hover,
.cancel-button:hover {
  background-color: #365a8c;
}

/* =========================
   Tables
   ========================= */
.submissions-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.25rem;
  font-family: 'Roboto', sans-serif;
}

.submissions-table th,
.submissions-table td {
  padding: 12px;
  text-align: left;
  font-size: 16px;
  border-right: 1px solid #ddd;
  vertical-align: middle;
}

.submissions-table th {
  background-color: #f5f5f5;
  font-size: 18px;
  font-weight: 500;
  border-bottom: 2px solid #ddd;
}

.submissions-table th:last-child,
.submissions-table td:last-child { border-right: none; }

.submissions-table tr:nth-child(even) { background-color: #f9f9f9; }
.submissions-table td { border-bottom: 1px solid #ddd; }

.download-link {
  color: #476DB0;
  text-decoration: none;
  font-weight: 600;
}

.download-link:hover { text-decoration: underline; }

.grey-row { background-color: #f9f9f9; }

/* =========================
   Password sections
   ========================= */
.input-group-password {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
}

.input-group-password label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 0.5rem;
}

.input-group-password input {
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
  color: #333;
  background-color: #f7f7f7;
}

.input-group-password input:focus {
  border-color: #476DB0;
  background-color: #fff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(71, 109, 176, 0.15);
}

.change-password-btn {
  padding: 10px 14px;
  background-color: #476DB0;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.change-password-btn:hover { background-color: #365a8c; }

/* Request Excel VAT Password — centred vertical stack */
#resend-auth-key:not(.hidden) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

#resend-auth-key .dashboard-excel-auth-panel {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
}

#resend-auth-key .dashboard-excel-auth-panel h2 {
  margin: 0 0 1.25rem;
}

#resend-auth-key .dashboard-excel-auth-form {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  grid-template-columns: none !important;
}

#resend-auth-key .dashboard-excel-auth-form .input-group-password {
  margin-bottom: 0;
  text-align: left;
}

#resend-auth-key .dashboard-excel-auth-form .input-group-password input {
  width: 100%;
  box-sizing: border-box;
}

#resend-auth-key .dashboard-excel-auth-form .change-password-btn {
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
  padding: 10px 16px;
  font-size: 15px;
}

#resend-auth-key .dashboard-excel-auth-note {
  margin-top: 1rem;
  text-align: center;
  line-height: 1.45;
}

/* Change Password — centred vertical stack */
#change-password:not(.hidden) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

#change-password .dashboard-change-password-panel {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

#change-password .dashboard-change-password-panel h2 {
  text-align: center;
  margin: 0 0 1.25rem;
}

#change-password form.no-grid {
  max-width: 400px;
}

#change-password form.no-grid .input-group-password {
  margin-bottom: 0;
}

#change-password form.no-grid .change-password-btn {
  width: 100%;
  max-width: 240px;
  margin: 0.25rem auto 0;
}

.two-factor-title { margin-bottom: 1.25rem; }

/* =========================
   Companies House - table + modal
   ========================= */
.ch-card {
  background: #fff;
  border: 1px solid #dfe6f6;
  border-radius: 12px;
  padding: 16px;
}

.ch-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ch-search { width: 280px; }
.ch-table-wrap { overflow-x: auto; }

.ch-input {
  width: 100%;
  border: 1px solid #cfd8ee;
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
  background: #fff;
}

.ch-input:focus {
  border-color: #476DB0;
  box-shadow: 0 0 0 3px rgba(71, 109, 176, 0.15);
}

.ch-add-btn {
  border: 1px solid #476DB0;
  background: #fff;
  color: #476DB0;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.ch-add-btn:hover { background: #f1f5ff; }

.ch-btn {
  border: 1px solid #476DB0;
  background: #fff;
  color: #476DB0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.ch-btn-primary { background: #476DB0; color: #fff; }
.ch-btn-primary:hover { background: #365A96; }

/* modal */
.ch-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 9998;
}

.ch-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 9999;
  padding: 16px;
}

.ch-modal-inner {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #dfe6f6;
  padding: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}

.ch-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ch-modal-close {
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: #1f2b4d;
}

.ch-input-row-vertical {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

/* preview */
.ch-preview {
  margin-top: 14px;
  border: 1px solid #e6edf9;
  border-radius: 10px;
  padding: 12px;
  background: #f7f9ff;
}

.ch-preview-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  padding: 6px 0;
}

.ch-preview-k {
  color: #6b7a99;
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ch-preview-v { color: #1f2b4d; }

/* lock scroll when modal open */
body.ch-modal-open { overflow: hidden; }

/* =========================
   Responsive
   ========================= */
@media (min-width: 1200px) {
  .content-section form:not(.ch-search):not(.ch-company-action-form):not(.ch-delete-form):not(.no-grid):not(.dashboard-excel-auth-form) {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .full-width { grid-column: span 3; }
  .button-group { grid-column: span 3; }
}

@media (max-width: 1100px) {
  .dashboard-wrapper { flex-direction: column; }
  .dashboard-container .nav-buttons { width: 100%; min-width: 0; }
  .ch-search { width: 100%; }
  #ch-manage-companies .ch-card-head-toolbar form.ch-search{
    width: auto !important;
  }
}


/* ================================
   Manage Companies: layout + table
   ================================ */

/* Remove the INNER border (keep the main content-section-wrapper border) */
#ch-manage-companies .ch-card{
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  background: transparent !important;
}

/* Full width of content area — table stays within panel (no horizontal scroll) */
#ch-manage-companies .ch-table-wrap{
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow-x: visible;
  overflow-y: visible;
}

/* Header row matches table width */
#ch-manage-companies .ch-card-head{
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 0 0.65rem 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

/* Manage Companies: toolbar sits in the Actions column grid track */
#ch-manage-companies .ch-card-head-toolbar{
  grid-column: 6;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: auto;
  max-width: 100%;
  margin-left: 0;
  padding-right: 14px;
  flex: 0 0 auto;
  box-sizing: border-box;
}

#ch-manage-companies .ch-manage-toolbar-control{
  display: block;
  width: 176px;
  max-width: 100%;
  height: 38px;
  margin: 0;
  padding: 0 12px;
  box-sizing: border-box;
  border: 1px solid #cfd8ee;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.25;
  font-family: inherit;
}

#ch-manage-companies button.ch-manage-toolbar-control{
  padding: 0 14px;
  background: #fff;
  color: #476DB0;
  border-color: #476DB0;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

#ch-manage-companies button.ch-manage-toolbar-control:hover{
  background: #f1f5ff;
}

#ch-manage-companies a.ch-manage-toolbar-control--primary{
  display: flex;
  align-items: center;
  justify-content: center;
  background: #476DB0;
  color: #fff;
  border-color: #476DB0;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}

#ch-manage-companies a.ch-manage-toolbar-control--primary:hover,
#ch-manage-companies a.ch-manage-toolbar-control--primary:focus-visible{
  background: #365a8c;
  border-color: #365a8c;
  color: #fff;
}

#ch-manage-companies .ch-card-head-toolbar form.ch-search{
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
  grid-template-columns: none !important;
}

#ch-manage-companies .ch-card-head-toolbar .ch-input.ch-manage-toolbar-control{
  display: block;
  width: 176px !important;
  max-width: 100% !important;
  height: 38px;
  margin: 0;
  padding: 10px 12px;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #cfd8ee;
}

/* Legacy header helpers (unused after ch-manage-top) */
#ch-manage-companies .ch-header{
  width: 100%;
  max-width: 100%;
  margin: 0 0 0.75rem 0;
  display: block;
}

#ch-manage-companies .ch-header h2{
  margin: 0;
  line-height: 1.15;
}

#ch-manage-companies .ch-header-actions{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

#ch-manage-companies .ch-header-actions form{
  margin: 0;
}

#ch-manage-companies .ch-header .ch-add-btn{
  min-width: 132px;
  height: 42px;
  padding: 0 14px;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

#ch-manage-companies .ch-header .ch-add-btn--secondary{
  border-color: #7da2de;
  color: #3f6fbf;
  background: #fff;
}

#ch-manage-companies .ch-header .ch-add-btn--secondary:hover{
  background: #f3f7ff;
}

#ch-manage-companies .ch-card-head h3{
  margin: 0;
  line-height: 1.2;
}


/* Fluid table: fits the content panel; column headers keep existing typography rules */
#ch-manage-companies table.submissions-table{
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-top: 0;
  border-collapse: separate;
  border-spacing: 0 10px;
  table-layout: fixed;
}

/* Table header — consistent left alignment; sort glyph vertically centred */
#ch-manage-companies table.submissions-table thead th{
  background: #f7f9ff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #dfe6f6;
  padding: 12px 28px 12px 14px;
  hyphens: none;
  word-break: normal;
  overflow-wrap: break-word;
}

/* Two-line headers: each line is a nowrap block so narrow cols cannot split words */
#ch-manage-companies table.submissions-table thead th.ch-th-stacked{
  line-height: 1.35;
  overflow-wrap: normal;
}

#ch-manage-companies table.submissions-table thead th.ch-th-stacked .ch-th-line{
  display: block;
  white-space: nowrap;
}

#ch-manage-companies table.submissions-table thead th.ch-th-stacked .ch-th-line--spacer{
  visibility: hidden;
}

/* Table cells */
#ch-manage-companies table.submissions-table td{
  font-size: 16px;
  border-bottom: none;
  background: #fbfcff;
}

/* Remove vertical borders to modernize look */
#ch-manage-companies table.submissions-table th,
#ch-manage-companies table.submissions-table td{
  border-right: none !important;
}

#ch-manage-companies table.submissions-table tbody td{
  padding: 12px 14px;
}

/* Card-like row grouping for clearer per-company separation */
#ch-manage-companies table.submissions-table tbody tr{
  overflow: visible;
}

#ch-manage-companies table.submissions-table tbody tr td{
  border-top: 1px solid #e7edf9;
  border-bottom: 1px solid #e7edf9;
}

#ch-manage-companies table.submissions-table tbody tr td:first-child{
  border-left: 1px solid #e7edf9;
  border-radius: 10px 0 0 10px;
}

#ch-manage-companies table.submissions-table tbody tr td:last-child{
  border-right: 1px solid #e7edf9;
  border-radius: 0 10px 10px 0;
  overflow: visible;
}

#ch-manage-companies table.submissions-table th.ch-sortable{
  position: relative;
  padding-right: 28px;
}

#ch-manage-companies table.submissions-table .ch-sort-controls{
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

#ch-manage-companies table.submissions-table .ch-sort-arrow{
  border: 0;
  background: transparent;
  color: #5c6478;
  opacity: 0.6;
  font-size: 9px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

#ch-manage-companies table.submissions-table .ch-sort-arrow:hover,
#ch-manage-companies table.submissions-table .ch-sort-arrow:focus{
  opacity: 1;
  color: #1d4ed8;
  outline: none;
}

#ch-manage-companies table.submissions-table .ch-sort-arrow.is-active{
  opacity: 1;
  color: #1d4ed8;
}

.dashboard-pagination{
  margin-top: 1rem;
}

.dashboard-pagination-inner{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.dashboard-pagination-link{
  color: #476db0;
  font-weight: 600;
  text-decoration: none;
}

.dashboard-pagination-link:hover{
  text-decoration: underline;
}

.dashboard-pagination-link--disabled{
  color: #9aa3b2;
  cursor: default;
}

.dashboard-pagination-status{
  color: #5a6478;
  font-size: 0.92rem;
}

.ch-history-status-label{
  font-weight: 600;
}

.ch-history-status-label--accepted{
  color: #0f766e;
}

.ch-history-status-label--pending{
  color: #b45309;
}

.ch-history-status-label--rejected{
  color: #b91c1c;
}

.ch-history-status-label--other{
  color: #1d4ed8;
}

.ch-history-rejection{
  font-size: 0.9em;
  margin-top: 0.25rem;
}

.ch-history-status-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-top: 0.35rem;
}

.ch-history-action-link{
  color: #476db0;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.92rem;
}

.ch-history-action-link:hover{
  text-decoration: underline;
}

.ch-history-action-link--button{
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.ch-history-reset-form{
  display: inline;
  margin: 0;
}

/* Column share of row (fixed layout); min-width 0 allows shrinking without overflow */
#ch-manage-companies table.submissions-table th:nth-child(1),
#ch-manage-companies table.submissions-table td:nth-child(1){
  width: 28%;
  min-width: 11.5rem;
  white-space: nowrap;
}

#ch-manage-companies table.submissions-table th:nth-child(2),
#ch-manage-companies table.submissions-table td:nth-child(2){
  width: 11%;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
}

#ch-manage-companies table.submissions-table th:nth-child(3),
#ch-manage-companies table.submissions-table td:nth-child(3){
  width: 15%;
  min-width: 0;
  white-space: nowrap;
}

#ch-manage-companies table.submissions-table th:nth-child(4),
#ch-manage-companies table.submissions-table td:nth-child(4){
  width: 13%;
  min-width: 7.5rem;
  white-space: nowrap;
}

#ch-manage-companies table.submissions-table th:nth-child(5),
#ch-manage-companies table.submissions-table td:nth-child(5){
  width: 12%;
  min-width: 0;
}

#ch-manage-companies .ch-deadline-urgency-cell{
  min-width: 0;
}

/* Deadline column: icon + label pill (sortable by days remaining) */
#ch-manage-companies .ch-accounts-urgency-pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  border: 1px solid transparent;
  box-sizing: border-box;
}
#ch-manage-companies .ch-accounts-urgency-pill--green{
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
#ch-manage-companies .ch-accounts-urgency-pill--amber{
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}
#ch-manage-companies .ch-accounts-urgency-pill--red{
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
#ch-manage-companies .ch-accounts-urgency-label{
  white-space: normal;
  text-align: center;
}
#ch-manage-companies .ch-accounts-urgency-empty{
  color: #6b7280;
  font-weight: 600;
}

#ch-manage-companies .ch-accounts-due-clock{
  display: inline-block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
}
#ch-manage-companies .ch-accounts-due-clock--green{
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='12' cy='12' r='9' stroke='%23057649' stroke-width='2'/%3E%3Cpath d='M12 8v5l3 1.5' stroke='%23057649' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
#ch-manage-companies .ch-accounts-due-clock--amber{
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='12' cy='12' r='9' stroke='%23b45309' stroke-width='2'/%3E%3Cpath d='M12 8v5l3 1.5' stroke='%23b45309' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
#ch-manage-companies .ch-accounts-due-clock--red{
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='12' cy='12' r='9' stroke='%23c41212' stroke-width='2'/%3E%3Cpath d='M12 8v5l3 1.5' stroke='%23c41212' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Actions column — fixed-width uniform buttons, centred in cell */
#ch-manage-companies table.submissions-table th.ch-actions-col,
#ch-manage-companies table.submissions-table td.ch-actions-col{
  width: 21%;
  min-width: 11rem;
  white-space: normal;
  vertical-align: middle;
  text-align: left !important;
  box-sizing: border-box;
}

#ch-manage-companies table.submissions-table thead th.ch-actions-col{
  text-align: left !important;
  padding: 12px 28px 12px 14px;
}

#ch-manage-companies table.submissions-table td.ch-actions-col{
  border-left: 1px solid #dbe5f7;
  background: #f7f9ff;
  padding: 14px;
}

#ch-manage-companies .ch-company-actions{
  width: 176px;
  max-width: 100%;
  margin: 0 0 0 auto;
}

#ch-manage-companies .ch-company-action-form{
  width: 100%;
  max-width: 176px;
}

#ch-manage-companies .ch-company-actions .ch-company-action-btn,
#ch-manage-companies .ch-company-actions .ch-company-action-form .ch-company-action-btn,
#ch-manage-companies .ch-company-actions button.ch-company-action-btn{
  box-sizing: border-box;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 38px !important;
  height: 38px !important;
  margin: 0;
  padding: 0.35rem 0.5rem !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.15;
  white-space: normal;
  text-align: center;
  border-radius: 6px;
  cursor: pointer;
}

#ch-manage-companies .ch-company-actions .ch-delete-form.ch-company-action-form{
  width: 100%;
  max-width: none;
  margin: 0;
}

.ch-company-actions{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 176px;
  max-width: 100%;
  margin: 0 0 0 auto;
  box-sizing: border-box;
}

.ch-company-status-chip{
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

#ch-manage-companies .ch-company-status-chip{
  max-width: 100%;
  white-space: normal;
  text-align: center;
  box-sizing: border-box;
}

.ch-company-actions .ch-delete-form{
  display: block;
  margin: 0;
}

.ch-company-action-form{
  width: 176px;
}

.ch-company-action-btn{
  width: 176px;
  min-height: 38px;
  height: 38px;
  text-align: center;
  white-space: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
  border: 1px solid transparent;
  text-decoration: none;
  box-sizing: border-box;
}

#ch-manage-companies a.ch-company-action-btn,
#ch-manage-companies a.ch-company-action-btn:visited,
#ch-manage-companies a.ch-company-action-btn:hover,
#ch-manage-companies a.ch-company-action-btn:focus,
#ch-manage-companies a.ch-company-action-btn:focus-visible,
#ch-manage-companies a.ch-company-action-btn:active{
  text-decoration: none;
}

.ch-company-action-form .ch-company-action-btn{
  width: 100%;
}

/* Start filing — green outline */
.ch-company-action-btn--file{
  background: #fff;
  border-color: #4CB047;
  color: #4CB047;
}

.ch-company-action-btn--file:visited{
  color: #4CB047;
}

.ch-company-action-btn--file:hover,
.ch-company-action-btn--file:focus-visible{
  background: #4CB047;
  border-color: #4CB047;
  color: #fff;
}

.ch-company-action-btn--file:active{
  background: #419a3d;
  border-color: #419a3d;
  color: #fff;
}

.ch-company-action-btn--file-disabled{
  background: #d1d5db;
  border: 1px solid #d1d5db;
  color: #6b7280;
  cursor: not-allowed;
  pointer-events: none;
  font-size: 0.72rem;
}

/* Continue filing / Resume — brand blue */
.ch-company-action-btn--continue{
  background: #476DB0;
  border-color: #476DB0;
  color: #fff;
}

.ch-company-action-btn--continue:visited{
  color: #fff;
}

.ch-company-action-btn--continue:hover,
.ch-company-action-btn--continue:focus-visible{
  background: #365a8c;
  border-color: #365a8c;
  color: #fff;
}

/* View filing status — neutral grey outline */
.ch-company-action-btn--view{
  background: #fff;
  border-color: #6b7280;
  color: #374151;
}

.ch-company-action-btn--view:visited{
  color: #374151;
}

.ch-company-action-btn--view:hover,
.ch-company-action-btn--view:focus-visible{
  background: #f3f4f6;
  border-color: #4b5563;
  color: #1f2937;
}

/* Fix and resubmit — amber warning */
.ch-company-action-btn--fix{
  background: #fff;
  border-color: #d97706;
  color: #b45309;
}

.ch-company-action-btn--fix:visited{
  color: #b45309;
}

.ch-company-action-btn--fix:hover,
.ch-company-action-btn--fix:focus-visible{
  background: #d97706;
  border-color: #d97706;
  color: #fff;
}

/* Pay now — teal */
.ch-company-action-btn--pay{
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

.ch-company-action-btn--pay:visited{
  color: #fff;
}

.ch-company-action-btn--pay:hover,
.ch-company-action-btn--pay:focus-visible{
  background: #0d5f59;
  border-color: #0d5f59;
  color: #fff;
}

.ch-company-action-btn--delete{
  background: #d4351c;
  border-color: #d4351c;
  color: #fff;
}

.ch-company-action-btn--delete:hover,
.ch-company-action-btn--delete:focus-visible{
  background: #b12a15;
  border-color: #b12a15;
  color: #fff;
}

.ch-company-action-btn--remove{
  background: #fff;
  border-color: #d4351c;
  color: #d4351c;
}

.ch-company-action-btn--remove:hover,
.ch-company-action-btn--remove:focus-visible{
  background: #d4351c;
  border-color: #d4351c;
  color: #fff;
}

.ch-company-action-btn--auth{
  background: #f4f7fd;
  border-color: #c8d6ef;
  color: #365a96;
}

.ch-company-action-btn--auth:visited{
  color: #365a96;
}

.ch-company-action-btn--auth:hover,
.ch-company-action-btn--auth:focus-visible{
  background: #eef4fc;
  border-color: #476db0;
  color: #0f2a52;
}

#ch-manage-companies .ch-company-action-btn--remove{
  border-width: 1px;
  border-style: solid;
}

/* Responsive: use full width on smaller screens */
@media (max-width: 900px){
  #ch-manage-companies .ch-manage-top{
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  #ch-manage-companies .ch-manage-intro{
    grid-column: auto;
  }

  #ch-manage-companies .ch-card-head-toolbar{
    grid-column: auto;
    grid-row: auto;
    align-items: stretch;
    padding-right: 0;
  }

  #ch-manage-companies .ch-header,
  #ch-manage-companies .ch-table-wrap,
  #ch-manage-companies .ch-card-head{
    width: 100%;
  }

  #ch-manage-companies .ch-card-head{
    align-items: stretch;
  }

  #ch-manage-companies .ch-card-head-toolbar,
  #ch-manage-companies .ch-manage-toolbar-control,
  #ch-manage-companies .ch-card-head-toolbar form.ch-search,
  #ch-manage-companies .ch-card-head-toolbar form.ch-search .ch-input{
    width: 100% !important;
  }
}


/* ===== GOV/CH style modal content ===== */
.ch-modal .ch-gov-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin-top: 6px;
}

.ch-modal .ch-gov-form .ch-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 4px;
}

.ch-hint{
  margin: 0 0 10px;
  color: #6b7a99;
  font-size: 14px;
}

.ch-gov-form .ch-label,
.ch-modal .ch-gov-form .ch-label{
  display: block;
  font-weight: 700;
  color: #1f2b4d;
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.4;
}

.ch-modal .ch-gov-form .ch-hint {
  margin: 0 0 10px;
}

.ch-modal .ch-gov-form .ch-input,
.ch-modal .ch-gov-form .ch-input-gov {
  width: 100%;
  box-sizing: border-box;
}

.ch-input-gov{
  border: 2px solid #1f2b4d;
  border-radius: 6px;
  padding: 12px 12px;
  font-size: 18px;
}

.ch-input-gov:focus{
  border-color: #476DB0;
  box-shadow: 0 0 0 3px rgba(71,109,176,0.2);
}

.ch-actions{
  margin-top: 14px;
}

.ch-btn-wide{
  width: 100%;
  justify-content: center;
}

.ch-actions-secondary{
  margin-top: 10px;
  display: flex;
  justify-content: flex-start;
}

.ch-link-btn{
  background: transparent;
  border: 0;
  color: #476DB0;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}

.ch-link-btn:hover{
  text-decoration: underline;
}

/* Summary list like Companies House */
.ch-summary{
  border-top: 1px solid #e6edf9;
  margin-top: 6px;
}

.ch-summary-row{
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid #e6edf9;
}

.ch-summary-k{
  font-weight: 700;
  color: #1f2b4d;
}

.ch-summary-v{
  color: #1f2b4d;
}

.ch-error{
  margin-top: 10px;
  padding: 14px;
  border-radius: 0;
  background: #fff;
  color: #0b0c0c;
  border: 4px solid #d4351c;
  font-weight: 700;
}