/* PRODUCTS SCANNER: «Σημάδια του Δέματος».
   Χαρτί ετικέτας, μαύρο μελάνι, καφέ χαρτονιού μόνο στην κεφαλίδα,
   πράσινο και κόκκινο μόνο για κατάσταση. Χωρίς σκιές, χωρίς στρογγυλέματα. */

@font-face {
  font-family: "Sofia Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 1 1000;
  src: url(fonts/sofia-sans-greek-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: "Sofia Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 1 1000;
  src: url(fonts/sofia-sans-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Sofia Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 1 1000;
  src: url(fonts/sofia-sans-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Sofia Sans Extra Condensed";
  font-style: normal;
  font-display: swap;
  font-weight: 1 1000;
  src: url(fonts/sofia-sans-extra-condensed-greek-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: "Sofia Sans Extra Condensed";
  font-style: normal;
  font-display: swap;
  font-weight: 1 1000;
  src: url(fonts/sofia-sans-extra-condensed-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Sofia Sans Extra Condensed";
  font-style: normal;
  font-display: swap;
  font-weight: 1 1000;
  src: url(fonts/sofia-sans-extra-condensed-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Χρώματα */
  --paper: #f7f4ec; /* χαρτί ετικέτας: το φόντο */
  --label: #ffffff; /* η ίδια η ετικέτα: επιφάνειες που διαβάζεις */
  --ink: #17140f; /* μελάνι: κείμενο, γραμμές, το κύριο κουμπί */
  --ink-hover: #3a342a; /* το κύριο κουμπί κάτω από τον δείκτη */
  --ink-press: #000000; /* το κύριο κουμπί τη στιγμή που πατιέται */
  --ink-soft: #5a5245; /* δεύτερο κείμενο: barcodes, εξηγήσεις */
  --kraft: #b98a56; /* χαρτόνι: μόνο η λωρίδα της κεφαλίδας */
  --blank: #ede7d8; /* θέση φωτογραφίας χωρίς φωτογραφία, hover */
  --ok: #1e8a4b; /* ταιριάζει */
  --side: #d42a1e; /* στην άκρη, λάθος */

  /* Γράμματα */
  --text: "Sofia Sans", system-ui, sans-serif;
  --stencil: "Sofia Sans Extra Condensed", "Sofia Sans", system-ui, sans-serif;

  /* Γραμμές */
  --rule: 4px; /* περίγραμμα ενοτήτων, κουμπιών, πεδίων */
  --rule-thin: 2px; /* περίγραμμα κελιών και ετικετών */

  /* Μεγέθη */
  --header-h: 72px;
  --control-h: 84px;
  --gutter: 40px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 22px;
  line-height: 1.3;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: var(--header-h) 1fr;
}

::selection {
  background: var(--kraft);
  color: var(--ink);
}

:focus-visible {
  outline: var(--rule) solid var(--ink);
  outline-offset: 4px;
}

/* Κεφαλίδα: η λωρίδα χαρτονιού, με τον τίτλο σε στένσιλ. */
.strip {
  background: var(--kraft);
  border-bottom: var(--rule) solid var(--ink);
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 var(--gutter);
  min-width: 0;
}

.stencil {
  font-family: var(--stencil);
  font-weight: 900;
  font-size: 44px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.strip .tag {
  background: var(--paper);
  border: var(--rule-thin) solid var(--ink);
  padding: 6px 14px;
  font-weight: 800;
  font-size: 22px;
  line-height: 1.2;
  white-space: nowrap;
}

.page {
  padding: 40px var(--gutter) 56px;
  min-width: 0;
}

/* Ετικέτα: λευκή επιφάνεια με παχύ περίγραμμα, κολλημένη πάνω στο χαρτί. */
.sticker {
  background: var(--label);
  border: var(--rule) solid var(--ink);
  padding: 36px 40px 40px;
}

.title {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.1;
  text-wrap: balance;
}

.lede {
  font-size: 26px;
  line-height: 1.35;
  color: var(--ink-soft);
  margin-top: 14px;
  max-width: 34em;
  text-wrap: pretty;
}

/* Κουμπιά και πεδία, στην κλίμακα της Καταμέτρησης. */
.button {
  font: 800 34px/1 var(--text);
  height: var(--control-h);
  padding: 0 44px;
  border: var(--rule) solid var(--ink);
  border-radius: 0;
  background: var(--label);
  color: var(--ink);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color 150ms ease-out;
}
.button:hover {
  background: var(--blank);
}
.button:active {
  background: var(--kraft);
}
.button.primary {
  background: var(--ink);
  color: var(--paper);
}
.button.primary:hover {
  background: var(--ink-hover);
}
.button.primary:active {
  background: var(--ink-press);
}
.field:disabled,
.button:disabled,
.button.primary:disabled {
  background: var(--blank);
  color: var(--ink-soft);
  border-color: var(--ink-soft);
  cursor: not-allowed;
}

.field-label {
  display: block;
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 12px;
}

.field {
  display: block;
  width: 100%;
  height: var(--control-h);
  padding: 0 24px;
  border: var(--rule) solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  caret-color: var(--ink);
  font: 600 40px/1 var(--text);
  letter-spacing: 0.08em;
  -webkit-appearance: none;
  appearance: none;
}
/* Το πεδίο με focus δεν παίρνει δεύτερο δαχτυλίδι: το ίδιο του το περίγραμμα διπλασιάζεται. */
.field:focus-visible {
  background: var(--label);
  outline: var(--rule) solid var(--ink);
  outline-offset: calc(-2 * var(--rule));
}
/* Το autofill του browser δεν βάφει το πεδίο με δικό του χρώμα. */
.field:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  transition: background-color 600000s 0s;
}
.field[aria-invalid="true"] {
  border-color: var(--side);
}
.field[aria-invalid="true"]:focus-visible {
  outline-color: var(--side);
}

/* Μήνυμα κατάστασης: χρώμα ΚΑΙ λέξεις, ποτέ μόνο χρώμα. */
.notice {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 20px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--side);
}
.notice svg {
  flex: none;
  width: 34px;
  height: 34px;
  margin-top: -2px;
}
.notice small {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}

/* Είσοδος */
.login {
  display: grid;
  align-content: start;
  justify-items: center;
  padding-top: clamp(32px, 9vh, 120px);
}
.login .sticker {
  width: 100%;
  max-width: 600px;
}
.login form {
  margin-top: 28px;
}
.login .button {
  width: 100%;
  margin-top: 24px;
}

/* Σύνδεσμοι: μελάνι, με γραμμή που δεν κολλάει στα γράμματα. */
a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}
a:hover {
  text-decoration-thickness: 4px;
}
.mark-out {
  width: 0.8em;
  height: 0.8em;
  margin-left: 0.3em;
  vertical-align: -0.05em;
  flex: none;
}

/* Κουμπί που είναι σύνδεσμος (tracking, delivery note): ίδιο σχήμα με το κουμπί. */
.button.link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* Αποστολές */
.apostoles .empty {
  max-width: 900px;
}

/* Η γραμμή του συγχρονισμού: κατάσταση αριστερά, «Ανανέωση» δεξιά. */
.sync-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}
.sync-state {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
  max-width: 40em;
}
.sync-state small {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink-soft);
}
.sync-state.notice {
  margin-top: 0;
}
.sync-state.notice small {
  color: var(--ink);
}
.sync-bar form {
  flex: none;
}

/* Μια ομάδα (Παραδόθηκε, Καθ' οδόν, Αναμένεται): τίτλος σε στένσιλ πάνω σε γραμμή 4px. */
.group + .group {
  margin-top: 56px;
}
.group-title {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: var(--rule) solid var(--ink);
  font-family: var(--stencil);
  font-weight: 900;
  font-size: 40px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.group-title .count {
  font-family: var(--text);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}
.group-empty {
  margin-top: 16px;
  color: var(--ink-soft);
}
/* Πωλητές που δεν επιβεβαίωσαν τίποτα ακόμα: μια γραμμή κειμένου, όχι κάρτα. */
.unconfirmed {
  margin-top: 16px;
  font-weight: 600;
  max-width: 60em;
}
.unconfirmed-item {
  white-space: nowrap;
}
.unconfirmed strong {
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* Κάθε Αποστολή είναι μια ετικέτα αποστολής: κωδικός πωλητή σαν το «From», και κάτω η
   λωρίδα του WAYBILL. Όλη η ετικέτα ανοίγει την Αποστολή· το tracking ανοίγει τη μεταφορική. */
.labels {
  list-style: none;
  padding: 0;
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.label-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--label);
  border: var(--rule-thin) solid var(--ink);
  transition: background-color 150ms ease-out;
}
.label-card:hover {
  background: var(--blank);
}
.label-card:focus-within {
  outline: var(--rule) solid var(--ink);
  outline-offset: 4px;
}
.label-card .seller {
  padding: 20px 20px 0;
  font-family: var(--stencil);
  font-weight: 900;
  font-size: 44px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.label-card .seller:focus-visible {
  outline: none;
}
.label-card .seller::after {
  content: "";
  position: absolute;
  inset: 0;
}
.label-card .from {
  padding: 8px 20px 0;
  font-weight: 600;
}
.label-card .amount {
  padding: 12px 20px 0;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.label-card .meta span {
  display: block;
}
.label-card .meta {
  padding: 4px 20px 20px;
  font-size: 20px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.label-card .waybill {
  margin-top: auto;
  padding: 12px 20px;
  border-top: var(--rule-thin) solid var(--ink);
  min-height: 56px;
  display: flex;
  align-items: center;
}
.label-card .tracking {
  position: relative; /* πάνω από τον σύνδεσμο που καλύπτει την ετικέτα */
  z-index: 1;
  display: inline-flex;
  align-items: center;
  font-family: var(--stencil);
  font-weight: 800;
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}
.note {
  color: var(--ink-soft);
  font-weight: 600;
}

/* Μία Αποστολή: τι περιμένουμε από τον πωλητή. */
.back {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-left: -12px;
  flex: none;
}
.back svg {
  width: 28px;
  height: 28px;
}
.strip .back:hover {
  background: var(--paper);
}
/* Στην κεφαλίδα μιας Αποστολής ο κωδικός πωλητή δεν κόβεται ποτέ· στενεύουν οι ετικέτες. */
.apostoli .strip .stencil {
  flex: none;
}
.apostoli .strip .tag {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shipment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.summary .amount {
  display: block;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.summary .from {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  color: var(--ink-soft);
}
.head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.head-actions .tracking {
  font-family: var(--stencil);
  font-weight: 800;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}
.shelf-title {
  margin-top: 48px;
  padding-bottom: 12px;
  border-bottom: var(--rule) solid var(--ink);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.shelf {
  list-style: none;
  padding: 0;
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.cell {
  display: grid;
  /* φωτογραφία · όνομα (και GTIN όταν λείπει το όνομα) · μετρητής πάντα στο κάτω μέρος */
  grid-template-rows: 150px auto 1fr;
  background: var(--label);
  border: var(--rule-thin) solid var(--ink);
}
.cell-photo {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: contain;
  padding: 8px;
  background: var(--label);
  border-bottom: var(--rule-thin) solid var(--ink);
}
.cell-photo.empty {
  background: var(--blank);
}
.cell-text {
  display: block;
}
.cell-name,
.cell-gtin {
  display: block;
}
.cell-name {
  padding: 12px 16px 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.cell-gtin {
  padding: 4px 16px 0;
  font-size: 20px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.cell-count {
  align-self: end;
  padding: 8px 16px 12px;
  font-family: var(--stencil);
  font-weight: 900;
  font-size: 50px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cell-count small {
  font-family: var(--text);
  font-size: 20px;
  font-weight: 800;
}

@media (max-width: 720px) {
  :root {
    --header-h: 60px;
    --control-h: 72px;
    --gutter: 16px;
  }
  html {
    font-size: 20px;
  }
  .stencil {
    font-size: 34px;
  }
  .strip {
    gap: 16px;
  }
  .strip .tag {
    font-size: 18px;
    padding: 4px 10px;
  }
  .page {
    padding: 24px var(--gutter) 40px;
  }
  .sticker {
    padding: 24px 20px 28px;
  }
  .title {
    font-size: 30px;
  }
  .lede {
    font-size: 22px;
  }
  .button {
    font-size: 30px;
  }
  .field {
    font-size: 32px;
  }
  .login {
    padding-top: 24px;
  }
  .sync-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 32px;
  }
  .sync-state {
    font-size: 22px;
  }
  .sync-bar .button {
    width: 100%;
  }
  .group + .group {
    margin-top: 40px;
  }
  .group-title {
    font-size: 34px;
  }
  .labels {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .label-card .seller {
    font-size: 38px;
  }
  .summary .amount {
    font-size: 30px;
  }
  .summary .from {
    font-size: 22px;
  }
  .head-actions,
  .head-actions .button {
    width: 100%;
  }
  .head-actions .button {
    justify-content: center;
  }
  .shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .cell-count {
    font-size: 40px;
  }
  .cell-name,
  .cell-gtin,
  .cell-count {
    padding-left: 12px;
    padding-right: 12px;
  }
  .cell-gtin {
    overflow-wrap: anywhere;
  }
  .apostoli .strip .tag-word {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
