:root {
  --bg: #f3efe6;
  --ink: #1c2430;
  --muted: #5d6b7c;
  --line: #d7d0c3;
  --panel: #fffdf8;
  --accent: #0f6b5c;
  --accent-ink: #ffffff;
  --danger: #8b2e2e;
  --ok: #1f5f3a;
  --warn: #7a5a12;
  --shadow: 0 12px 28px rgba(28, 36, 48, 0.08);
  --radius: 14px;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --touch: 48px;
  --page-pad: clamp(12px, 3.5vw, 24px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 107, 92, 0.12), transparent 40%),
    linear-gradient(180deg, #efe8da 0%, var(--bg) 45%, #e8e2d6 100%);
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: var(--safe-b);
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--page-pad) + var(--safe-t)) var(--page-pad) calc(28px + var(--safe-b));
}

.page-wide .page,
.page-dash .page {
  max-width: none;
  width: 100%;
}

.page-dash .main {
  width: 100%;
  min-height: 0;
}

.page-dash .dash {
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  align-content: start;
  justify-content: start;
}

.page-wide .panel,
.page-wide .panel.panel-wide {
  max-width: none;
  width: 100%;
  margin: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(16px, 3vw, 24px);
}

.brand {
  min-width: 0;
  flex: 1;
}

.brand-mark {
  display: block;
  font-size: clamp(1.15rem, 4vw, 1.4rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.15;
}

.brand-sub {
  display: block;
  color: var(--muted);
  font-size: clamp(0.8rem, 2.8vw, 0.9rem);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav {
  flex-shrink: 0;
}

.nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  padding: 0 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  border-radius: 10px;
}

.nav a.muted { color: var(--muted); font-weight: 500; }

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}

.message {
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  font-size: 0.95rem;
  line-height: 1.4;
  word-break: break-word;
}

.message-success { border-color: #b7d8c4; color: var(--ok); }
.message-error { border-color: #e0b6b6; color: var(--danger); }
.message-warning, .message-info { border-color: #e4d5a8; color: var(--warn); }

.hero, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(18px, 4vw, 28px);
}

.hero h1, .panel h1 {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 5vw, 1.75rem);
  line-height: 1.2;
}

.hero p, .hint, .meta {
  color: var(--muted);
  line-height: 1.5;
}

.meta {
  font-size: 0.85rem;
  word-break: break-all;
}

.login-form {
  margin: 8px auto 0;
  max-width: 22rem;
  width: 100%;
  text-align: center;
}

.login-form .fields {
  text-align: center;
}

.login-form label span {
  text-align: center;
}

.login-form .btn {
  position: relative;
  width: 100%;
  margin-top: 4px;
}

.login-form .btn .btn-spinner {
  display: none;
  width: 1.1rem;
  height: 1.1rem;
  margin-left: 0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -0.15em;
}

.login-form .btn.is-loading .btn-spinner {
  display: inline-block;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(28, 36, 48, 0.35);
  backdrop-filter: blur(2px);
}

.login-overlay[hidden] {
  display: none !important;
}

.login-overlay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 12rem;
  padding: 22px 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-weight: 600;
}

.login-overlay-card p {
  margin: 0;
  color: var(--muted);
}

.issued-dialog-card {
  min-width: min(22rem, calc(100vw - 2.5rem));
  max-width: 22rem;
  text-align: center;
  gap: 10px;
}

.issued-dialog-title {
  color: var(--ink) !important;
  font-size: 1.05rem;
}

.issued-dialog-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.issued-dialog-actions .btn {
  flex: 1;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid rgba(15, 107, 92, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.field-optional {
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8em;
}

.login-alt {
  margin-top: 22px;
  font-size: 0.9rem;
}

.login-alt a {
  color: var(--accent);
  font-weight: 600;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn:active { filter: brightness(0.95); }
.btn:hover { filter: brightness(1.05); }

.btn .btn-spinner {
  display: none;
  width: 1.1rem;
  height: 1.1rem;
  margin-left: 0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -0.15em;
}

.btn.is-loading .btn-spinner {
  display: inline-block;
}

.dash {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 0;
  align-content: start;
  grid-template-columns: 1fr;
}

.dash-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: none;
  min-height: 0;
  padding: 16px 18px 16px 20px;
  text-decoration: none;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid rgba(15, 107, 92, 0.1);
  border-radius: 16px;
  box-shadow:
    0 4px 8px rgba(28, 36, 48, 0.08),
    0 14px 28px rgba(28, 36, 48, 0.1),
    0 22px 44px rgba(15, 107, 92, 0.14);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.dash-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, #1a8f7c 0%, var(--accent) 100%);
}

.dash-card-secondary {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}

.dash-card-secondary::before {
  background: linear-gradient(180deg, #c4b8a2 0%, #8d8270 100%);
}

.dash-card-secondary .dash-card-kicker {
  color: var(--muted);
}

.dash-card-secondary .dash-card-hint {
  color: var(--muted);
  opacity: 1;
}

.dash-card:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 2px rgba(28, 36, 48, 0.06),
    0 6px 14px rgba(28, 36, 48, 0.07);
}

.dash-card-title {
  font-size: clamp(1.02rem, 3.6vw, 1.18rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ink);
}

.dash-card-hint {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.4;
  font-weight: 500;
}

.dash-card-kicker {
  display: inline-flex;
  align-self: flex-start;
  margin: 0 0 2px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 107, 92, 0.1);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-head { margin-bottom: 16px; }

.search-form .fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.fields-stack {
  grid-template-columns: 1fr !important;
}

label span {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
}

/* 16px+ αποφεύγει auto-zoom στο iOS */
input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: var(--touch);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  font-size: 16px;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

.alert {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  line-height: 1.4;
  word-break: break-word;
}

.alert-error {
  background: #f8ecec;
  color: var(--danger);
  border: 1px solid #e0b6b6;
}

.alert-info {
  background: #eef6f4;
  color: var(--accent);
  border: 1px solid #b7d8c4;
  margin-bottom: 18px;
}

.results-meta {
  margin: 18px 0 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}

.customer-list {
  display: grid;
  gap: 8px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.customer-card {
  display: block;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.customer-card:has(input:checked),
.customer-card.is-selected {
  border-color: var(--accent);
  background: #eef6f4;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.customer-card-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  min-height: var(--touch);
  padding: 12px 14px;
}

.customer-card input[type="radio"] {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.customer-card-body {
  min-width: 0;
}

.customer-card-name {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  word-break: break-word;
}

.customer-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

.customer-card-meta span {
  display: inline;
  font-weight: 500;
}

.doc-list {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.doc-card {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.doc-card.is-new {
  border-color: var(--accent);
  background: #eef6f4;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.doc-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.9rem;
}

.doc-card-top strong {
  color: var(--ink);
  font-size: 1.02rem;
}

.doc-card-name {
  margin-top: 6px;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}

.doc-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.85rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  background: #fff;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 0.92rem;
}

th {
  background: #f7f2e8;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.empty { color: var(--muted); margin-top: 14px; }

.section-title {
  margin: 24px 0 12px;
  font-size: 1.05rem;
}

.radio-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

tr.is-selected { background: #eef6f4; }

.col-print {
  width: 44px;
  text-align: center;
  vertical-align: middle;
}

.btn-print {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--accent);
  border-radius: 10px;
  text-decoration: none;
}

.btn-print:hover {
  background: #eef6f4;
}

input.is-readonly {
  background: #f7f2e8;
  color: var(--muted);
}

.panel-wide {
  max-width: 920px;
}

.product-suggest {
  margin: 8px 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  max-height: 240px;
  overflow: auto;
}

.product-suggest-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font: inherit;
  cursor: pointer;
}

.product-suggest-item:hover {
  background: #eef6f4;
}

.product-suggest-empty {
  padding: 10px 12px;
  color: var(--muted);
}

.lines-wrap {
  overflow-x: auto;
}

.lines-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.lines-table th,
.lines-table td {
  padding: 8px 6px;
  text-align: left;
  vertical-align: middle;
}

.lines-table input {
  min-height: 40px;
  padding: 8px 10px;
}

.btn-mini {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--danger);
}

.invoice-total {
  margin: 12px 0 0;
  font-size: 1.05rem;
}

.pay-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.pay-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch);
  padding: 10px 14px;
  border: 2px solid var(--accent);
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  color: var(--accent);
}

.pay-option:has(input:checked) {
  background: var(--accent);
  color: var(--accent-ink);
}

.pay-option input {
  width: auto;
  min-height: 0;
  accent-color: currentColor;
}

.pay-option.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* —— Receipt ticket (screen + print) —— */
.receipt-ticket {
  --rt-ink: #142018;
  --rt-muted: #5a6a62;
  --rt-line: #c8d2cc;
  --rt-pad: clamp(0.7rem, 2.8vw, 1.35rem);
  --rt-fs: clamp(0.82rem, 2.4vw + 0.35rem, 1.05rem);
  --rt-fs-lg: clamp(1.35rem, 4.5vw + 0.4rem, 2rem);
  --rt-fs-sm: clamp(0.7rem, 1.8vw + 0.3rem, 0.85rem);

  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  padding: var(--rt-pad);
  background: #fff;
  color: var(--rt-ink);
  border: 1px solid var(--rt-line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: var(--rt-fs);
  line-height: 1.35;
}

.rt-head {
  text-align: center;
  margin-bottom: 0.85em;
}

.rt-brand-title {
  font-size: clamp(1.15rem, 3.5vw + 0.4rem, 1.55rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.15;
}

.rt-brand-sub {
  margin-top: 0.2em;
  color: var(--rt-muted);
  font-size: var(--rt-fs-sm);
}

.rt-doctype {
  margin-top: 0.55em;
  font-weight: 700;
  font-size: 0.95em;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.rt-number-block {
  text-align: center;
  margin: 0.9em 0 0.35em;
}

.rt-number-label {
  font-size: var(--rt-fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rt-muted);
}

.rt-number {
  margin-top: 0.15em;
  font-weight: 800;
  font-size: var(--rt-fs-lg);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1.1;
  word-break: break-word;
}

.rt-series { opacity: 0.85; }
.rt-sep { margin: 0 0.12em; opacity: 0.45; font-weight: 600; }

.rt-mk {
  margin-top: 0.25em;
  font-size: var(--rt-fs-sm);
  color: var(--rt-muted);
}

.rt-rule {
  height: 0;
  margin: 0.85em 0;
  border: 0;
  border-top: 1px dashed var(--rt-line);
}

.rt-rows {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55em 1.1em;
  margin: 0;
}

.rt-row {
  display: grid;
  grid-template-columns: minmax(5.5em, 34%) 1fr;
  gap: 0.35em 0.75em;
  align-items: baseline;
}

.rt-row dt {
  margin: 0;
  font-size: var(--rt-fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rt-muted);
}

.rt-row dd {
  margin: 0;
  font-weight: 600;
  word-break: break-word;
  text-align: right;
}

.rt-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75em;
  padding: 0.35em 0 0.15em;
}

.rt-total-label {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.95em;
}

.rt-total-value {
  font-size: var(--rt-fs-lg);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  line-height: 1.1;
  text-align: right;
}

.rt-foot {
  margin-top: 1em;
  text-align: center;
  font-size: var(--rt-fs-sm);
  color: var(--rt-muted);
  letter-spacing: 0.04em;
}

.rt-actions { margin-top: 1.25rem; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

button.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

code {
  background: #efe8da;
  padding: 2px 6px;
  border-radius: 6px;
  word-break: break-all;
}

/* —— Mobile / small tablet —— */
@media (max-width: 720px) {
  .search-form .fields { grid-template-columns: 1fr; }

  .hero .btn,
  .form-actions .btn,
  .actions .btn {
    width: 100%;
  }

  .form-actions,
  .actions {
    flex-direction: column;
  }

  .panel-head .meta {
    display: none;
  }

  .form-actions-sticky {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 18px -clamp(18px, 4vw, 28px) calc(-1 * clamp(18px, 4vw, 28px));
    padding: 12px clamp(18px, 4vw, 28px) calc(12px + var(--safe-b));
    background: linear-gradient(180deg, rgba(255, 253, 248, 0) 0%, var(--panel) 28%);
    border-top: 1px solid var(--line);
  }
}

/* —— Tablet / μικρό laptop —— */
@media (min-width: 721px) and (max-width: 859px) {
  .page { max-width: 820px; }
  .page-wide .page,
  .page-dash .page { max-width: none; width: 100%; }
  .page-dash .dash {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }
}

/* —— Υπολογιστής —— */
@media (min-width: 860px) {
  :root {
    --touch: 44px;
    --page-pad: 32px;
  }

  .page {
    max-width: 1080px;
    padding: 28px 36px 48px;
  }

  .topbar {
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
  }

  .brand-mark {
    font-size: 1.45rem;
    letter-spacing: 0.12em;
  }

  .brand-sub {
    font-size: 0.95rem;
    white-space: normal;
  }

  .nav a {
    min-height: 40px;
    padding: 0 14px;
  }

  .nav a.muted:hover {
    background: rgba(15, 107, 92, 0.08);
    color: var(--accent);
  }

  .messages {
    max-width: 100%;
  }

  .page-dash .main {
    width: 100%;
    min-height: 0;
    display: block;
  }

  .page-dash .dash,
  .dash {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    width: 100%;
    max-width: none;
    min-height: 0;
    align-content: start;
    margin: 0;
  }

  .dash.dash-single,
  .dash.dash-two,
  .dash.dash-three,
  .dash.dash-four,
  .dash.dash-five {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .dash-card {
    min-height: 0;
    padding: 18px 20px 18px 22px;
    justify-content: flex-start;
    gap: 7px;
  }

  .dash-card-kicker {
    margin-bottom: 2px;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    opacity: 1;
  }

  .dash-card-title {
    font-size: 1.16rem;
    text-transform: none;
    letter-spacing: -0.015em;
  }

  .dash-card-hint {
    font-size: 0.86rem;
    max-width: 28em;
  }

  .dash-card-secondary .dash-card-kicker {
    color: var(--muted);
    opacity: 1;
  }

  .hero,
  .panel {
    max-width: 760px;
    margin: 0 auto;
    padding: 28px 32px;
  }

  .panel.panel-wide {
    max-width: 920px;
  }

  .page-wide .page {
    max-width: none;
    width: 100%;
  }

  .page-wide .panel,
  .page-wide .panel.panel-wide {
    max-width: none;
    width: 100%;
    margin: 0;
  }

  .hero h1,
  .panel h1 {
    font-size: 1.7rem;
  }

  .btn:hover {
    filter: brightness(1.06);
  }
}

@media (min-width: 1100px) {
  .page-dash .page {
    max-width: none;
    width: 100%;
  }

  .page-dash .dash,
  .dash.dash-three,
  .dash.dash-four,
  .dash.dash-five {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (min-width: 860px) and (hover: hover) {
  .dash-card:hover {
    transform: translateY(-3px);
    border-color: rgba(15, 107, 92, 0.22);
    box-shadow:
      0 2px 6px rgba(28, 36, 48, 0.06),
      0 16px 36px rgba(15, 107, 92, 0.14);
    filter: none;
  }
}

@media (hover: none) {
  .btn:hover,
  .dash-card:hover {
    filter: none;
    transform: none;
  }
}

/* —— Print: adapts to A4 / B5 / thermal / custom page size —— */
@page {
  size: auto;
  margin: 6mm;
}

@media print {
  html, body {
    background: #fff !important;
    color: #000 !important;
    min-height: 0;
    height: auto;
  }

  .topbar,
  .messages,
  .no-print,
  .form-actions-sticky,
  .rt-actions {
    display: none !important;
  }

  .page {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .main,
  .receipt-panel.panel,
  .panel {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  .receipt-ticket {
    --rt-ink: #000;
    --rt-muted: #333;
    --rt-line: #000;
    --rt-pad: clamp(0.2rem, 1.8vw, 0.9rem);
    --rt-fs: clamp(9pt, 2.6vw, 11pt);
    --rt-fs-lg: clamp(14pt, 5.2vw, 22pt);
    --rt-fs-sm: clamp(7.5pt, 2vw, 9pt);

    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--rt-pad);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
    color: #000;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .rt-doctype,
  .rt-total-value {
    color: #000 !important;
  }

  .rt-rule {
    border-top-color: #000;
    border-top-style: dashed;
  }

  .rt-row {
    grid-template-columns: minmax(4.5em, 32%) 1fr;
    break-inside: avoid;
  }

  .rt-number-block,
  .rt-total,
  .rt-head {
    break-inside: avoid;
  }

  .rt-foot {
    margin-top: 0.75em;
  }
}

/* Θεραμικός / στενή σελίδα (< ~90mm): όλα σε μία στήλη, πιο «απόδειξη» */
@media print and (max-width: 90mm) {
  .receipt-ticket {
    --rt-pad: 1.5mm;
    --rt-fs: 9pt;
    --rt-fs-lg: 16pt;
    --rt-fs-sm: 7.5pt;
  }

  .rt-brand-title {
    font-size: 12pt;
    letter-spacing: 0.06em;
  }

  .rt-row {
    grid-template-columns: 1fr;
    gap: 0.1em;
  }

  .rt-row dd {
    text-align: left;
    font-size: 1.05em;
  }

  .rt-total {
    flex-direction: column;
    align-items: stretch;
    gap: 0.15em;
  }

  .rt-total-value {
    text-align: left;
  }
}

/* B5 / μικρό φύλλο */
@media print and (min-width: 90.01mm) and (max-width: 160mm) {
  .receipt-ticket {
    --rt-pad: 4mm;
  }

  .rt-rows {
    grid-template-columns: 1fr 1fr;
  }

  .rt-row-wide {
    grid-column: 1 / -1;
  }
}

/* A4 / μεγάλο φύλλο: κεντραρισμένο «εισιτήριο», όχι άπλωμα σε όλο το πλάτος */
@media print and (min-width: 160.01mm) {
  .receipt-ticket {
    width: min(100%, 105mm);
    margin: 0 auto;
    --rt-pad: 7mm;
    --rt-fs: 10pt;
    --rt-fs-lg: 18pt;
    --rt-fs-sm: 8pt;
    border: 1px solid #000;
  }

  .rt-rows {
    grid-template-columns: 1fr 1fr;
  }

  .rt-row-wide {
    grid-column: 1 / -1;
  }
}
