/* ==========================================================================
   ADMIN DASHBOARD
   ========================================================================== */

.admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 22px;
}

.admin-workspace {
  grid-template-columns: 240px minmax(0, 1fr);
}

.admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.admin-heading h2 {
  margin: 0;
  font-size: 30px;
}

.admin-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  min-width: 0;
}

.view-toggle {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.view-toggle button,
.icon-btn {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--blue);
  background: #ffffff;
  font-size: 18px;
  font-weight: 800;
}

.view-toggle button.active {
  color: #ffffff;
  background: #405ca8;
}

.admin-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(100%, 280px);
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 14px;
  background: #ffffff;
  color: var(--blue);
}

.admin-search input {
  min-height: auto;
  border: 0;
  padding: 0;
}

.admin-search input:focus {
  outline: 0;
}

.compact-select {
  display: grid;
  min-width: 110px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 12px;
  background: #ffffff;
}

.compact-select.wide {
  min-width: 250px;
}

.compact-select span {
  color: #97a1b3;
  font-size: 11px;
  font-weight: 800;
}

.compact-select select {
  min-height: 27px;
  border: 0;
  padding: 0;
}

.toolbar-spacer {
  flex: 1;
}

.admin-client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  min-width: 0;
}

.admin-client-card {
  position: relative;
  display: grid;
  min-height: 230px;
  align-content: center;
  justify-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.client-status-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.client-status-badge.active {
  color: #1f5e4b;
  background: #dff1e8;
}

.client-status-badge.inactive {
  color: #8d2f2f;
  background: #f7dddd;
}

.client-delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  opacity: 0.78;
}

.client-delete-btn:hover {
  opacity: 1;
}

.admin-client-card:hover,
.admin-client-card.selected {
  border-color: #b8c5e9;
  box-shadow: 0 14px 35px rgba(55, 75, 125, 0.12);
  transform: translateY(-1px);
}

.admin-client-card::after {
  content: "Άνοιγμα φακέλου";
  position: absolute;
  top: 14px;
  right: 14px;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--primary-dark);
  background: #e7f1ed;
  font-size: 12px;
  font-weight: 900;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.admin-client-card:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.client-avatar-lg {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border-radius: 50%;
  color: #405ca8;
  background: #ecf1fb;
  font-size: 20px;
  font-weight: 800;
}

.admin-client-card h3 {
  margin: 4px 0 0;
  font-size: 21px;
}

.phone-pill {
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  color: #405ca8;
  background: #f1f4fb;
  font-size: 13px;
  font-weight: 700;
}

.client-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  gap: 10px;
  margin-top: 24px;
}

.client-card-stats strong,
.client-card-stats span {
  display: block;
}

.client-card-stats strong {
  font-size: 24px;
}

.client-card-stats span {
  margin-top: 6px;
  color: #98a1b1;
  font-size: 13px;
}

.selected-client {
  display: grid;
  gap: 18px;
}

.admin-client-placeholder {
  display: grid;
  min-height: 180px;
  place-items: center;
  gap: 6px;
  border: 1px dashed #b9c9d5;
  border-radius: 8px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  text-align: center;
}

.admin-client-placeholder strong {
  color: var(--ink);
  font-size: 22px;
}

.admin-client-detail {
  display: grid;
  gap: 18px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(123, 142, 158, 0.22);
  border-radius: 8px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
}

.client-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  border-bottom: 1px solid #e5edf2;
  padding-bottom: 12px;
}

.admin-detail-tabs button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  color: #536173;
  background: transparent;
  font-weight: 800;
}

.admin-detail-tabs button.active,
.admin-detail-tabs button:hover {
  color: var(--primary-dark);
  background: #e7f1ed;
}

.admin-form-section {
  margin-top: 12px;
  border-top: 1px solid #e5edf2;
  padding-top: 18px;
}

.admin-form-section h3 {
  margin: 0;
}

.micronutrient-details {
  align-self: stretch;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  padding: 0;
  background: #fbfcfa;
  overflow: hidden;
}

.micronutrient-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 0 16px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
  list-style: none;
}

.micronutrient-details summary::-webkit-details-marker {
  display: none;
}

.micronutrient-details summary::after {
  content: "+";
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #e7f1ed;
  color: var(--primary-dark);
  font-size: 20px;
  line-height: 1;
}

.micronutrient-details[open] summary::after {
  content: "-";
}

.micronutrient-details summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.micronutrient-details > p {
  margin: 0;
  border-top: 1px solid #e5edf2;
  padding: 14px 16px 0;
  color: var(--muted);
}

.micronutrient-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.compact-admin-form {
  align-items: end;
  margin-bottom: 22px;
}

.admin-table {
  margin-top: 18px;
  max-width: 100%;
}

.upload-form {
  margin: 12px 0 22px;
}

.biochemical-manual-form {
  display: grid;
  gap: 18px;
  margin-bottom: 24px;
}

.biochemical-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 18px;
  align-items: end;
  border: 1px solid rgba(123, 142, 158, 0.18);
  border-radius: 8px;
  padding: 18px;
  background: linear-gradient(135deg, #f8fbfa, #eef5f3);
}

.biochemical-intro h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.biochemical-intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.biochemical-groups,
.biochemical-history {
  display: grid;
  gap: 14px;
}

.biochemical-group,
.biochemical-history-card {
  border: 1px solid rgba(123, 142, 158, 0.2);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.biochemical-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  background: #f7fafb;
}

.biochemical-group summary strong {
  color: var(--ink);
  font-size: 18px;
}

.biochemical-group summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.biochemical-group > p {
  margin: 0;
  padding: 0 18px 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.biochemical-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  padding: 0 18px 18px;
}

.biochemical-test-card {
  display: grid;
  gap: 8px;
  border: 1px solid #dfe7ec;
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.biochemical-test-card.status-ok {
  border-color: rgba(39, 116, 93, 0.28);
  background: #eff8f3;
}

.biochemical-test-card.status-out {
  border-color: rgba(199, 79, 79, 0.3);
  background: #fff0f0;
}

.biochemical-test-name {
  color: #253443;
  font-weight: 900;
}

.biochemical-value-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 132px);
  gap: 8px;
}

.biochemical-value-row input,
.biochemical-value-row select {
  min-height: 42px;
}

.biochemical-range,
.biochemical-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.biochemical-status {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef3f5;
}

.status-ok .biochemical-status,
.biochemical-result-row.status-ok small {
  color: #1f5e4b;
  background: #dff1e8;
}

.status-out .biochemical-status,
.biochemical-result-row.status-out small {
  color: #8d2f2f;
  background: #f7dddd;
}

.biochemical-history {
  margin: 18px 0 24px;
}

.biochemical-history-card {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.biochemical-history-card .client-detail-header {
  border-bottom: 1px solid #edf1f4;
  padding-bottom: 12px;
}

.biochemical-result-group {
  display: grid;
  gap: 8px;
}

.biochemical-result-group h4 {
  margin: 0;
  color: #17212b;
}

.biochemical-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #edf1f4;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fbfcfd;
}

.biochemical-result-row strong {
  color: var(--ink);
}

.biochemical-result-row small {
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  background: #eef3f5;
  font-weight: 900;
}

.upload-drop {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px dashed #aebfca;
  border-radius: 8px;
  min-height: 126px;
  padding: 20px;
  background: #f7fafb;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.upload-drop:hover,
.upload-drop.selected {
  border-color: rgba(39, 116, 93, 0.55);
  background: #eef8f3;
  box-shadow: inset 0 0 0 1px rgba(39, 116, 93, 0.12);
  transform: translateY(-1px);
}

.upload-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.upload-drop strong {
  color: var(--ink);
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--blue));
  font-size: 30px;
  font-weight: 900;
}

.upload-copy {
  display: grid;
  gap: 5px;
}

.upload-copy small {
  color: var(--muted);
  line-height: 1.45;
}

.upload-copy em {
  margin-top: 4px;
  color: var(--primary-dark);
  font-style: normal;
  font-weight: 900;
}

.upload-drop span,
