/* ===== PROJECT AND COUNTRY SETUP STYLES ===== */

/* ---------- LAYOUT ---------- */
.main-layout {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 1.25rem;
  row-gap: 1.25rem;
  align-items: start;
  padding: 0 0.5rem;
}

.project-panel { 
  grid-column: 1 / 5;
}

.right-panel {
  grid-column: 5 / 13;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* ---------- MOBILE ---------- */
@media (max-width: 992px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .project-panel,
  .right-panel {
    grid-column: 1;
  }
}

.project-details-container { flex: 1 1 auto; max-width: 75rem; }

.country-panel,
.cfl-panel {
  width: 100%;
  margin: 0;
}

/* ---------- TABLE STYLES ---------- */
.project-table,
.country-table,
.cfl-table { width: 100%; border-collapse: collapse; table-layout: fixed;}
.project-table td,
.country-table td,
.cfl-table td { padding: 6px 8px; vertical-align: middle; }
.project-table .label,
.country-table .label,
.cfl-table .label { width: 50%; font-size: 0.9rem; color: #444; }

.country-table th:first-child,
.country-table td:first-child { width: 20%; }
.country-table th:nth-child(n+2):not(:last-child),
.country-table td:nth-child(n+2):not(:last-child) {
  width: calc((75% - 10%) / 5);
}

.country-table th {
  font-size: 0.75rem;
  white-space: normal;
  word-break: break-word;
  padding: 4px 6px;
}

.country-table th:nth-last-child(2),
.country-table td:nth-last-child(2) {
  width: 7%;
}

.country-table th:last-child,
.country-table td:last-child {
  width: 6%;
  text-align: left;
  padding-left: 4px;
  vertical-align: middle;
}



.cfl-table th:first-child,
.cfl-table td:first-child { width: 25%; }
.cfl-table th:nth-child(2),
.cfl-table td:nth-child(2) { width: 20%; }
.cfl-table th:nth-child(3),
.cfl-table td:nth-child(3) { width: 20%; }
.cfl-table th:nth-child(4),
.cfl-table td:nth-child(4) { width: 20%; }
.cfl-table th:last-child,
.cfl-table td:last-child { width: 15%; text-align: center; }

/* ===== CFL ASSIGNMENT HISTORY STYLES ===== */

.country-table input[type="checkbox"],
.cfl-table input[type="checkbox"] {
  cursor: pointer;
  width: 15px;
  height: 15px;
  margin: 0;
}

.cfl-table .error {
  border-color: #dc3545 !important;
}

.cfl-table .error:focus {
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

.cfl-error-message td {
  background-color: #fff5f5;
  border-left: 3px solid #dc3545;
}

/* ===== COUNTRY SITE TARGETS STYLES ===== */

.country-table .error {
  border-color: #dc3545 !important;
}

.country-table .error:focus {
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

.country-error-message td {
  background-color: #fff5f5;
  border-left: 3px solid #dc3545;
}

.country-table .dropdown-reason {
  display: none;
}

.country-table .dropdown-reason.visible {
  display: block;
}

.country-table .qv-override-checkbox {
  text-align: center;
}

.country-table .qv-override-checkbox input[type="checkbox"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.country-table select.autocomplete-enabled {
  position: relative;
}

.country-table input[type="number"] {
  text-align: right;
}

.country-table input[type="number"]:invalid {
  border-color: #dc3545;
}

.country-table input[type="number"]:disabled {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

.country-table select:disabled {
  background-color: #f5f5f5;
  cursor: not-allowed;
  opacity: 0.6;
}

.country-table th.optional-header {
  color: inherit;
  opacity: 1;
}

.country-table th.mandatory-header {
  color: inherit;
  opacity: 1;
}
/* ===== INPUT AND SELECT FOCUS STYLES ===== */
input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: #861557;
  outline: 3px solid #A4507E;
}
/* Select2 focus styles */
.select2-container--focus .select2-selection,
.select2-container--open .select2-selection {
  border-color: #861557 !important;
  outline: 3px solid #A4507E;
}

/* Selectize focus styles */
.selectize-input.focus,
.selectize-input.dropdown-active {
  border-color: #861557 !important;
  outline: 3px solid #A4507E;
}
.select2-search__field:focus {
  border-color: #861557 !important;
  outline: 3px solid #A4507E;
}

input[type="text"],
input[type="number"],
select {
  box-sizing: border-box;
  height: 35px;
  padding: 0 10px;
  border: 1px solid #8c8c8c;
  border-radius: 5px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 16px;
  color: #464646;
}

.panel_project_details .table-scroll {
  max-height: none;
  overflow: auto;
  border-radius: 6px;

  scrollbar-width: thin;
  scrollbar-color: #bdbdbd transparent;
}

.panel_project_details {
  background-color: #fff;
  border-radius: 5px !important;
  padding: 1rem !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0px 0px 4px 0px #00000020 !important;
}
