/* phase1.css — Phase 1 screens: ΗΡΙΔΑΝΟΣ registry, readiness, supplier
 * requests, bulk import, ops system. Token-only colours, so dark mode follows
 * dark.css's token flip; the few solid fills are pinned under body.dark-mode at
 * the bottom. Loaded after pages.css, before dark.css (mobile.css stays last). */

/* ═══════════════════════ Tabs ═══════════════════════ */
.ct-tabs {
  display: flex;
  gap: 2px;
  margin: 0 0 var(--space-4);
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  scrollbar-width: thin;
}
.ct-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.ct-tab:hover {
  background: var(--surface-2);
  color: var(--text);
}
.ct-tab[aria-selected="true"] {
  background: var(--primary-soft);
  color: var(--primary);
}
.ct-tab-count {
  min-width: 18px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--confirmed-tint);
  color: var(--confirmed);
  font-size: var(--text-xs);
  text-align: center;
}
.ct-tab-count--ok {
  background: var(--clear-tint);
  color: var(--clear);
}

/* ═══════════════════════ Panels & form grids ═══════════════════════ */
.ct-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}
.ct-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-4);
}
.ct-panel-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--text);
}
.ct-panel-sub {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.ct-field-code {
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  vertical-align: 1px;
}
.ct-grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3) var(--space-4);
}
.ct-grid-form--wide {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.ct-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.ct-field--full {
  grid-column: 1 / -1;
}
.ct-field > label,
.ct-field > .ct-field-label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
}
.ct-field input,
.ct-field select,
.ct-field textarea {
  width: 100%;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--text-base);
}
.ct-field textarea {
  min-height: 84px;
  resize: vertical;
}
.ct-field input:focus,
.ct-field select:focus,
.ct-field textarea:focus {
  border-color: var(--focus);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent);
}
.ct-field-hint {
  margin: 0;
  color: var(--text-subtle);
  font-size: var(--text-xs);
}
.ct-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-4);
}
.ct-fieldset {
  margin: var(--space-4) 0 0;
  padding: var(--space-4) 0 0;
  border: 0;
  border-top: 1px solid var(--border);
  min-width: 0;
}
.ct-fieldset > legend {
  padding: 0;
  margin-bottom: var(--space-3);
  font-size: var(--text-base);
  font-weight: 800;
  color: var(--text);
}
.ct-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 6px var(--space-4);
}
.ct-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--text);
  cursor: pointer;
}
.ct-check input {
  margin-top: 2px;
  accent-color: var(--primary);
  flex: 0 0 auto;
}

/* ═══════════════════════ Banners ═══════════════════════ */
.ct-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--indeterminate-edge);
  border-radius: var(--radius);
  background: var(--indeterminate-tint);
  color: var(--text);
}
.ct-banner--warn {
  border-color: var(--potential-edge);
  background: var(--potential-tint);
}
.ct-banner--danger {
  border-color: var(--confirmed-edge);
  background: var(--confirmed-tint);
}
.ct-banner--ok {
  border-color: var(--clear-edge);
  background: var(--clear-tint);
}
.ct-banner-body {
  flex: 1 1 auto;
  min-width: 0;
}
.ct-banner-title {
  margin: 0 0 4px;
  font-weight: 800;
}
.ct-banner-text {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.ct-banner-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.ct-change-list {
  margin: var(--space-2) 0 0;
  padding-left: 18px;
  font-size: var(--text-sm);
}

/* ═══════════════════════ Readiness ═══════════════════════ */
.ct-next-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  margin-bottom: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--primary);
  box-shadow: var(--shadow-sm);
}
.ct-next-action--done {
  border-color: var(--clear-edge);
  background: var(--clear-tint);
}
.ct-next-eyebrow {
  margin: 0 0 4px;
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.ct-next-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--text);
}
.ct-next-text {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.ct-rl-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-4);
}
.ct-rl-group {
  margin: 0;
}
.ct-rl-group h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--text);
}
.ct-rl-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ct-rl-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: var(--text-sm);
}
.ct-rl-item a {
  color: inherit;
  text-decoration: none;
}
.ct-rl-item a:hover .ct-rl-text {
  text-decoration: underline;
}
.ct-rl-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--confirmed);
}
.ct-rl-item--warning .ct-rl-dot {
  background: var(--potential);
}
.ct-rl-text {
  position: relative; /* contains the .ct-visually-hidden severity text */
  color: var(--text);
}
.ct-rl-empty {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ═══════════════════════ Row cards (workers, substances, measures) ═══════════════════════ */
.ct-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.ct-row-card {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.ct-row-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
}
.ct-row-card-title {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 800;
  color: var(--text);
  overflow-wrap: anywhere;
}
.ct-row-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.ct-row-card-body {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--border);
}
.ct-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
}
.ct-pill--cmr {
  background: var(--confirmed-tint);
  color: var(--confirmed);
}
.ct-pill--ok {
  background: var(--clear-tint);
  color: var(--clear);
}
.ct-pill--warn {
  background: var(--potential-tint);
  color: var(--potential);
}
.ct-pill--lock {
  background: var(--primary-soft);
  color: var(--primary);
}
.ct-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ct-mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

/* ═══════════════════════ Key–value ═══════════════════════ */
.ct-kv {
  display: grid;
  grid-template-columns: minmax(130px, max-content) 1fr;
  gap: 6px var(--space-4);
  margin: 0;
  font-size: var(--text-sm);
}
.ct-kv dt {
  color: var(--text-muted);
  font-weight: 700;
}
.ct-kv dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* ═══════════════════════ Timeline (request events) ═══════════════════════ */
.ct-timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 18px;
  border-left: 1px solid var(--border); /* neutral 1px rail; the dots carry the events */
}
.ct-timeline li {
  position: relative;
  padding: 0 0 var(--space-3) var(--space-3);
  font-size: var(--text-sm);
}
.ct-timeline li::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
}
.ct-timeline-kind {
  font-weight: 800;
  color: var(--text);
}
.ct-timeline-meta {
  color: var(--text-subtle);
  font-size: var(--text-xs);
}
.ct-timeline-detail {
  margin-top: 2px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

/* ═══════════════════════ Progress ═══════════════════════ */
.ct-progress {
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  overflow: hidden;
}
.ct-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.4s ease;
}
.ct-progress-fill--done {
  background: var(--clear);
}
.ct-progress-fill--failed {
  background: var(--confirmed);
}
.ct-progress-label {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0 0 6px;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ═══════════════════════ Two drop zones side by side ═══════════════════════ */
.ct-drop-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
}
.ct-drop-slot h3 {
  margin: 0 0 6px;
  font-size: var(--text-base);
  font-weight: 800;
  color: var(--text);
}
.ct-drop-chosen {
  margin: 8px 0 0;
  font-size: var(--text-sm);
  color: var(--clear);
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* ═══════════════════════ System checks ═══════════════════════ */
.ct-checks {
  display: grid;
  /* 210px: two 170px columns on a phone clipped "Χρονοπρογραμματιστής";
     a phone now gets one column, a tablet three. */
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.ct-check-card {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.ct-check-card--bad {
  border-color: var(--confirmed-edge);
  background: var(--confirmed-tint);
}
.ct-check-name {
  position: relative; /* contains the .ct-visually-hidden state text */
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  font-weight: 800;
  color: var(--text);
  /* Last resort only: a flex row's text keeps its min-content width, so
     break-word never fired here; anywhere does. */
  overflow-wrap: anywhere;
}
.ct-check-name::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clear);
}
.ct-check-card--bad .ct-check-name::before {
  background: var(--confirmed);
}
.ct-check-state {
  margin: 4px 0 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.ct-mail-body {
  margin: 0;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 50vh;
  overflow: auto;
}

/* ═══════════════════════ Supplier portal (Phase 1) ═══════════════════════ */
.ct-portal-hero {
  margin-bottom: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.ct-portal-hero h1 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xl);
  color: var(--text);
}
.ct-portal-reqno {
  display: inline-block;
  margin-bottom: var(--space-2);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
}
.ct-portal-step {
  margin-bottom: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.ct-portal-step-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.ct-portal-step-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: var(--text-sm);
}
.ct-portal-step-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--text);
}
.ct-attestation {
  padding: var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.ct-attestation-text {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text);
}
.ct-components-field .ct-table input[type="text"],
.ct-components-field .ct-table input:not([type]) {
  width: 100%;
  min-width: 110px;
}
.ct-components-field .ct-table td:has(input[type="checkbox"]) {
  text-align: center;
}

/* ═══════════════════════ Responsive ═══════════════════════ */
@media (max-width: 720px) {
  .ct-panel,
  .ct-portal-step,
  .ct-portal-hero,
  .ct-next-action {
    padding: var(--space-4);
  }
  .ct-kv {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .ct-kv dd {
    margin-bottom: 6px;
  }
  .ct-banner {
    flex-direction: column;
  }
  .ct-next-action .ct-btn-primary,
  .ct-form-actions .ct-btn-primary {
    width: 100%;
  }
  .ct-grid-form,
  .ct-grid-form--wide {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════ Dark-mode pins ═══════════════════════ */
body.dark-mode .ct-portal-step-num {
  background: #1f3c54;
}
body.dark-mode .ct-tab[aria-selected="true"] {
  color: var(--text);
  background: rgba(125, 151, 168, 0.22);
}

/* Screen-reader-only text (severity of a readiness item, etc.). */
.ct-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ct-rl-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}

/* ═══════════════════════ Supplier request page ═══════════════════════ */
.ct-request-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}
.ct-request-main,
.ct-request-side {
  min-width: 0;
}
@media (min-width: 1100px) {
  .ct-request-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  }
  .ct-request-side {
    position: sticky;
    top: var(--space-4);
  }
}
.ct-error-text {
  margin: 0;
  color: var(--confirmed);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

/* ═══════════════════════ Campaign create form (phones) ═══════════════════════ */
/* .ct-form wraps by default; in this column form a wrapping flex line takes the
   widest child's min-content (the long questionnaire / product selects), so
   every field ran off the card at 390px. One line, shrinkable fields. */
.ct-engage-form {
  flex-wrap: nowrap;
}
.ct-engage-form-row .ct-question,
.ct-engage-recipients {
  min-width: 0;
}
.ct-engage-form select,
.ct-engage-form input:not([type="checkbox"]):not([type="radio"]) {
  min-width: 0;
  max-width: 100%;
}
.ct-campaign-recipient select {
  width: 100%;
  max-width: 32rem;
}
@media (min-width: 601px) {
  .ct-engage-form > .ct-btn-primary {
    align-self: flex-start;
  }
}
/* CAS numbers ("71-43-2") must not break at their hyphens */
.ct-request-detail .ct-table .ct-mono {
  white-space: nowrap;
}
