/* Φάκελος Συμβολαίου — κοινή εμφάνιση.
   Το βασικό χρώμα ορίζεται στη μεταβλητή --brand. */

:root {
  --brand: #1d4f5c;
  --brand-strong: #133a44;
  --brand-soft: #e3eef0;
  --page: #f2f4f5;
  --surface: #ffffff;
  --ink: #1b2227;
  --ink-muted: #56626b;
  --line: #d3dade;
  --line-strong: #aab5bb;

  --ok: #1e6b3a;
  --ok-soft: #e2f1e7;
  --warn: #8a5300;
  --warn-soft: #fcf0d9;
  --bad: #a3261f;
  --bad-soft: #fbe6e4;
  --info: #1f4f8f;
  --info-soft: #e4ecf8;
  --neutral-soft: #eceff1;

  --radius-s: 4px;
  --radius-m: 8px;
  --gap: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-num: "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3 {
  line-height: 1.25;
  margin: 0 0 0.5em;
}

h1 { font-size: 1.6rem; font-weight: 650; }
h2 { font-size: 1.25rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 650; }

p { margin: 0 0 0.75em; }

a {
  color: var(--brand);
  text-underline-offset: 2px;
}

:focus-visible {
  outline: 3px solid var(--info);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Κεφαλίδα ---------- */

.app-header {
  background: var(--brand);
  color: #fff;
}

.app-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 1.1rem;
  color: #fff;
  text-decoration: none;
  margin-right: auto;
}

.app-header__brand img {
  max-height: 32px;
  width: auto;
}

.app-header__user {
  font-size: 0.875rem;
  opacity: 0.9;
}

/* ---------- Επιλογή γλώσσας ---------- */

.lang-switch {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-s);
  overflow: hidden;
}

.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  min-width: 44px;
  min-height: 36px;
  padding: 0 10px;
  cursor: pointer;
}

.lang-switch button[aria-pressed="true"] {
  background: #fff;
  color: var(--brand-strong);
}

/* ---------- Διάταξη ---------- */

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 20px;
  margin-bottom: 20px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar h1 {
  margin: 0 auto 0 0;
}

.muted {
  color: var(--ink-muted);
}

.app-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px 32px;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

/* ---------- Κουμπιά ---------- */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-s);
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover { background: var(--brand-strong); border-color: var(--brand-strong); }

.btn--secondary {
  background: var(--surface);
  color: var(--brand);
}

.btn--secondary:hover { background: var(--brand-soft); color: var(--brand-strong); }

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .btn { min-height: 48px; width: 100%; }
  .toolbar .btn { width: auto; }
}

/* ---------- Πίνακες ---------- */

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

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

table.data th,
table.data td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.data th {
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--ink-muted);
  border-bottom: 2px solid var(--line-strong);
  white-space: nowrap;
}

table.data td.num,
table.data th.num {
  text-align: right;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

table.data tr.subtotal td {
  font-weight: 600;
  background: var(--neutral-soft);
}

table.data tr.total td {
  font-weight: 700;
  border-top: 2px solid var(--ink);
  border-bottom: 0;
}

.empty-state {
  padding: 32px 12px;
  text-align: center;
  color: var(--ink-muted);
}

/* ---------- Κατάσταση ---------- */

.status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--neutral-soft);
  color: var(--ink);
}

.status--pending,
.status--returned { background: var(--warn-soft); color: var(--warn); }
.status--submitted,
.status--in_review { background: var(--info-soft); color: var(--info); }
.status--approved { background: var(--ok-soft); color: var(--ok); }
.status--rejected,
.status--expired { background: var(--bad-soft); color: var(--bad); }
.status--not_required { background: var(--neutral-soft); color: var(--ink-muted); }

/* ---------- Λίστα ελέγχου ---------- */

.checklist {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.checklist li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 4px 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.checklist .mark {
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.4;
}

.checklist .ok .mark { color: var(--ok); }
.checklist .fail .mark { color: var(--bad); }

.checklist .detail {
  grid-column: 2;
  font-size: 0.85rem;
  color: var(--ink-muted);
  word-break: break-word;
}

/* ---------- Μηνύματα ---------- */

.notice {
  border-radius: var(--radius-s);
  padding: 10px 14px;
  margin: 12px 0;
  border-left: 4px solid var(--info);
  background: var(--info-soft);
}

.notice--ok { border-color: var(--ok); background: var(--ok-soft); }
.notice--bad { border-color: var(--bad); background: var(--bad-soft); }
.notice--warn { border-color: var(--warn); background: var(--warn-soft); }

.notice:empty { display: none; }

/* ---------- Σελίδα μηνύματος (σύνδεσμος μη έγκυρος, φάκελος κλειστός) ---------- */

.message-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.message-box {
  max-width: 520px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 6px solid var(--brand);
  border-radius: var(--radius-m);
  padding: 28px;
}

.message-box h1 {
  font-size: 1.3rem;
}

.message-box hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}

@media print {
  .app-header,
  .app-footer,
  .no-print {
    display: none !important;
  }

  body { background: #fff; }
  .panel { border: 0; padding: 0; }
}

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

@media (max-width: 640px) {
  table.data th {
    white-space: normal;
  }
}
