/* TF-11 Tehnicieni: compact team catalog and responsive planning dialogs. */

#technicians.techniciansPage {
  --technician-ink: #173956;
  --technician-muted: #687f97;
  --technician-line: #d8e5ef;
  --technician-soft: #f4f9fb;
  --technician-accent: #087f78;
  --technician-blue: #176dcc;
  display: grid;
  gap: 20px;
  min-width: 0;
  overflow: visible;
}

#technicians .modulePageHeader {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 24px 26px;
  border: 1px solid #d5e6e5;
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 17%, rgba(8, 127, 120, 0.13), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #f4fbfa 100%);
  box-shadow: 0 14px 35px rgba(18, 68, 78, 0.075);
}

#technicians .modulePageHeader::after {
  position: absolute;
  right: -48px;
  bottom: -75px;
  width: 198px;
  height: 198px;
  border: 34px solid rgba(8, 127, 120, 0.07);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

#technicians .modulePageHeader > * {
  position: relative;
  z-index: 1;
}

#technicians .technicianHeaderActions {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 9px;
  align-items: center;
}

#technicians .technicianHeaderActions button {
  min-height: 42px;
  border-radius: 11px;
  white-space: nowrap;
}

#technicians .technicianHeaderActions .modulePrimaryAction {
  box-shadow: 0 9px 20px rgba(8, 127, 120, 0.18);
}

#technicians .technicianStats {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px;
  margin: 0;
}

#technicians .technicianStats article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--technician-line);
  border-radius: 15px;
  background: linear-gradient(145deg, #ffffff, #f9fbfd);
  box-shadow: 0 8px 22px rgba(23, 57, 86, 0.055);
}

#technicians .technicianStats article .statTrend {
  grid-column: 2;
  margin-top: 3px;
  color: var(--technician-muted);
  font-size: 0.68rem;
}

#technicians .technicianStats article small {
  color: var(--technician-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

#technicians .technicianStats article strong {
  display: block;
  margin-top: 3px;
  color: var(--technician-ink);
  font-size: 1.45rem;
  line-height: 1;
}

#technicians .technicianToolbar {
  display: grid !important;
  grid-template-columns: minmax(320px, 1.7fr) minmax(180px, 0.7fr) minmax(180px, 0.7fr) !important;
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--technician-line);
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(23, 57, 86, 0.05);
}

#technicians .technicianToolbar input,
#technicians .technicianToolbar select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border-radius: 10px;
}

#technicians .operationPanel {
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--technician-line);
  border-radius: 17px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(23, 57, 86, 0.065);
}

#technicians .panelTitle {
  min-height: 68px;
  margin: 0;
  padding: 17px 20px;
  border-bottom: 1px solid #e4edf4;
  background: linear-gradient(90deg, #f8fbfd, #ffffff);
}

#technicians .panelSummary {
  padding: 6px 10px;
  border: 1px solid #d2e0ea;
  border-radius: 999px;
  background: #ffffff;
  color: #536f87;
  font-size: 0.75rem;
  font-weight: 700;
}

#technicians .technicianCards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  padding: 14px;
}

#technicians .technicianCard {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 11px;
  min-width: 0;
  min-height: 0;
  height: auto;
  padding: 16px;
  overflow: visible;
  border: 1px solid #dce7ef;
  border-top: 4px solid var(--technician-accent);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(23, 57, 86, 0.05);
}

#technicians .technicianCard h4,
#technicians .technicianCard p,
#technicians .technicianCard span,
#technicians .technicianCard strong {
  overflow-wrap: anywhere;
}

#technicians .technicianCard h4 {
  margin: 0 0 3px;
  color: var(--technician-ink);
  font-size: 1rem;
}

#technicians .technicianCardBody {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  color: #4f6981;
  font-size: 0.78rem;
  line-height: 1.4;
}

#technicians .technicianBadges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#technicians .technicianCard > .moduleSecondaryAction {
  display: inline-flex;
  justify-content: center;
  width: calc(50% - 5px);
  min-height: 40px;
  margin-top: 2px;
  border-radius: 9px;
}

#technicians .technicianCard > .moduleSecondaryAction:last-child {
  justify-self: end;
  margin-top: -53px;
}

#technicians .technicianPagination {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  padding: 4px 14px 16px;
}

#technicians .technicianPagination button {
  width: 42px;
  min-height: 40px;
  border-radius: 9px;
}

#technicians > .operationDialog {
  width: min(940px, calc(100vw - 48px));
  max-width: 940px;
  max-height: min(840px, calc(100dvh - 40px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #cbdce7;
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(7, 40, 62, 0.28);
}

#technicians > .operationDialog .dialogHeader {
  padding: 19px 22px;
  border-bottom: 1px solid #dce7ee;
  background: linear-gradient(130deg, #f7fcfc, #eaf7f5);
}

#technicianDialog form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  max-height: min(840px, calc(100dvh - 40px));
}

#technicianDialog .technicianForm {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  min-height: 0;
  padding: 22px;
  overflow-y: auto;
}

#technicians > .operationDialog input,
#technicians > .operationDialog select,
#technicians > .operationDialog textarea {
  width: 100%;
  min-width: 0;
}

#technicianDialog .dialogFullField,
#technicianDetailsDialog .dialogFullField {
  grid-column: 1 / -1;
}

#technicians > .operationDialog .dialogFooter {
  padding: 15px 22px;
  border-top: 1px solid #dce7ee;
  background: #f8fbfc;
}

#technicianDetailsDialog {
  display: none;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

#technicianDetailsDialog[open] {
  display: grid;
}

#technicianDetailsDialog .technicianDetailsBody {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
}

#technicianDetailsDialog .technicianDetailsSection {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--technician-line);
  border-radius: 14px;
  background: #ffffff;
}

#technicianDetailsDialog .technicianDetailsSection:last-child {
  grid-column: 1 / -1;
  padding-bottom: 16px;
}

#technicianDetailsDialog .technicianDetailForm {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  padding: 15px;
}

#technicianDetailsDialog .technicianDetailForm button,
#technicianDetailsDialog .technicianDetailsSection > button {
  width: 100%;
  min-height: 42px;
  border-radius: 9px;
}

#technicianDetailsDialog .technicianDetailsSection:last-child > label,
#technicianDetailsDialog .technicianDetailsSection:last-child > button {
  margin: 15px 15px 0;
  width: calc(100% - 30px);
}

#technicianDetailsDialog .technicianMetaList {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 15px 15px;
  list-style: none;
}

@media (max-width: 1180px) {
  #technicians .technicianCards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #technicians .technicianHeaderActions {
    grid-template-columns: repeat(2, auto);
  }

  #technicians .technicianHeaderActions .modulePrimaryAction {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  #technicians.techniciansPage {
    gap: 14px;
  }

  #technicians .modulePageHeader {
    display: grid;
    gap: 16px;
    padding: 19px 17px;
    border-radius: 15px;
  }

  #technicians .technicianHeaderActions,
  #technicians .technicianStats,
  #technicians .technicianToolbar,
  #technicians .technicianCards {
    grid-template-columns: 1fr !important;
  }

  #technicians .technicianHeaderActions button,
  #technicians .technicianHeaderActions .modulePrimaryAction {
    grid-column: auto;
    width: 100%;
  }

  #technicians .technicianStats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px;
  }

  #technicians .technicianStats article {
    min-height: 84px;
    padding: 13px;
  }

  #technicians .technicianToolbar {
    gap: 10px;
    padding: 12px;
  }

  #technicians .panelTitle {
    align-items: flex-start;
    gap: 10px;
    min-height: 60px;
    padding: 14px;
  }

  #technicians .technicianCards {
    padding: 10px;
  }

  #technicians .technicianCardBody {
    grid-template-columns: 1fr;
  }

  #technicians > .operationDialog {
    width: calc(100vw - 16px);
    max-width: none;
    max-height: calc(100dvh - 16px);
    margin: auto;
    border-radius: 15px;
  }

  #technicianDialog form {
    max-height: calc(100dvh - 16px);
  }

  #technicians > .operationDialog .dialogHeader {
    padding: 15px;
  }

  #technicianDialog .technicianForm,
  #technicianDetailsDialog .technicianDetailsBody,
  #technicianDetailsDialog .technicianDetailForm {
    grid-template-columns: 1fr;
  }

  #technicianDialog .technicianForm,
  #technicianDetailsDialog .technicianDetailsBody {
    gap: 13px;
    padding: 15px;
  }

  #technicianDialog .dialogFullField,
  #technicianDetailsDialog .dialogFullField,
  #technicianDetailsDialog .technicianDetailsSection:last-child {
    grid-column: auto;
  }

  #technicians > .operationDialog .dialogFooter {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 12px 15px 15px;
  }

  #technicians > .operationDialog .dialogFooter button {
    width: 100%;
    min-height: 44px;
  }
}

@media (max-width: 420px) {
  #technicians .technicianStats {
    grid-template-columns: 1fr !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #technicians .technicianCard,
  #technicians .modulePrimaryAction {
    transition: none;
  }
}
