/*
 * Parkareto24 SMS — interface styles.
 * Business tool: light theme, neutral colours, no animation.
 */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #dfe3e8;
  --border-strong: #c9cfd6;
  --text: #1b1f24;
  --muted: #667085;
  --accent: #1f6feb;
  --accent-dark: #1a5fd0;
  --ok: #1a7f37;
  --ok-bg: #e8f5ec;
  --warn: #9a6700;
  --warn-bg: #fff4d6;
  --error: #cf222e;
  --error-bg: #fdeced;
  --info-bg: #eaf1fd;
  --radius: 6px;
  --wrap: 1080px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- top bar ---------- */

/* The bar carries the customer's colour; text on it is chosen by Theme.php
   from the background's brightness, so a pale brand colour still reads. */
.topbar {
  background: var(--header-bg, var(--surface));
  border-bottom: 1px solid var(--header-border, var(--border));
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 60px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 15px;
  color: var(--header-text, var(--text));
  text-decoration: none;
  white-space: nowrap;
}

/* Height-bound so any uploaded logo lands on the same baseline as the text
   it replaces, whatever its proportions. Wide wordmarks are common — this one
   is nearly 7:1 — so the width allowance is generous, and a very wide logo is
   scaled down by max-width rather than cropped. */
.brand__logo {
  display: block;
  height: 32px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
}

@media (max-width: 640px) {
  .brand__logo { height: 26px; max-width: 150px; }
}

.nav {
  display: flex;
  gap: 4px;
  flex: 1 1 auto;
  overflow-x: auto;
}

.nav a {
  padding: 7px 12px;
  border-radius: var(--radius);
  color: var(--header-muted, var(--muted));
  text-decoration: none;
  white-space: nowrap;
}

.nav a:hover {
  background: var(--header-hover, var(--bg));
  color: var(--header-text, var(--text));
}

.nav a[aria-current="page"] {
  background: var(--header-active, var(--info-bg));
  color: var(--header-text, var(--accent-dark));
  font-weight: 600;
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--header-muted, var(--muted));
  font-size: 14px;
}

.topbar__name { white-space: nowrap; }

.link-muted { color: var(--muted); text-decoration: none; }
.link-muted:hover { color: var(--text); text-decoration: underline; }

/* Inside the coloured bar the muted links follow the bar, not the page. */
.topbar .link-muted { color: var(--header-muted, var(--muted)); }
.topbar .link-muted:hover { color: var(--header-text, var(--text)); }

/* ---------- banners ---------- */

.banner {
  padding: 9px 0;
  font-size: 14px;
  border-bottom: 1px solid transparent;
}

.banner--warn {
  background: var(--warn-bg);
  border-bottom-color: #f0dca0;
  color: var(--warn);
}

/* Louder than the test-mode notice: this one costs the business money. */
.banner--error {
  background: var(--error-bg);
  border-bottom-color: #f5c2c7;
  color: var(--error);
  font-weight: 500;
}

/* ---------- main ---------- */

.main { padding: 28px 20px 48px; }

.page-title {
  margin: 0 0 20px;
  font-size: 22px;
  font-weight: 600;
}

.section-title {
  margin: 26px 0 12px;
  font-size: 15px;
  font-weight: 600;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

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

.pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---------- forms ---------- */

.field { margin-bottom: 16px; }

.label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
}

.input {
  width: 100%;
  padding: 9px 11px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}

.input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

.hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  font: inherit;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.btn:hover { background: var(--bg); }

/* Label colour follows the accent, so a pale brand colour keeps dark text
   instead of turning the button unreadable. */
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text, #fff);
}

.btn--primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: var(--accent-text, #fff);
}

.btn--block { display: block; width: 100%; }

/* ---------- alerts ---------- */

.alert {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
}

.alert--error { background: var(--error-bg); border-color: #f5c2c7; color: var(--error); }
.alert--ok    { background: var(--ok-bg);    border-color: #b7e0c4; color: var(--ok); }
.alert--info  { background: var(--info-bg);  border-color: #c2d8f8; color: var(--accent-dark); }

/* ---------- lists ---------- */

.steps { margin: 0 0 16px; padding-left: 20px; }
.steps li { margin-bottom: 6px; }

.checks { list-style: none; margin: 0 0 20px; padding: 0; font-size: 14px; }

.checks__item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.checks__item:last-child { border-bottom: 0; }
.checks__mark { font-weight: 700; width: 1em; }
.checks__mark.is-ok  { color: var(--ok); }
.checks__mark.is-bad { color: var(--error); }
.checks__label { flex: 1 1 auto; }
.checks__detail { color: var(--muted); }

/* ---------- auth / setup ---------- */

.body--auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}

.auth { width: 100%; max-width: 380px; }
.auth__card { padding: 24px; }

/* The setup screen carries more content than the login box. */
.auth:has(.auth__card--wide) { max-width: 560px; }

.auth__title {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}

.auth__footer {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- appearance settings ---------- */

.input--color {
  width: 72px;
  height: 40px;
  padding: 4px;
  cursor: pointer;
}

.logo-preview {
  margin: 0 0 8px;
  padding: 10px 12px;
  background: var(--header-bg, var(--bg));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Shown against the bar colour, because that is where it will live. */
.logo-preview img { display: block; height: 26px; width: auto; max-width: 100%; }

.check { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ---------- empty states ---------- */

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}

.empty__mark {
  display: block;
  margin: 0 auto 10px;
  width: 40px;
  height: 40px;
  opacity: 0.35;
}

.empty__text { margin: 0; }

/* ---------- footer ---------- */

.footer {
  padding: 16px 0 28px;
  font-size: 13px;
  color: var(--muted);
}

/* ================================================================
   Send screen
   ================================================================ */

.send__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  gap: 20px;
  align-items: start;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.segmented__option { display: block; }
.segmented__option input { position: absolute; opacity: 0; pointer-events: none; }

.segmented__option span {
  display: block;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  border-right: 1px solid var(--border);
}

.segmented__option:last-child span { border-right: 0; }
.segmented__option input:checked + span { background: var(--accent); color: #fff; }
.segmented__option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }

.label__note {
  font-weight: 400;
  color: var(--muted);
  font-size: 13px;
}

.btn--lg { padding: 13px 18px; font-size: 16px; }

.btn--danger { color: var(--error); border-color: #f0b6bb; }
.btn--danger:hover:not(:disabled) { background: var(--error-bg); }

.btn:disabled { opacity: 0.55; cursor: default; }

.preview { position: sticky; top: 20px; }

.preview__bubble {
  min-height: 76px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.preview__meta {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.preview__meta.is-warn { color: var(--warn); font-weight: 500; }
.preview__meta.is-error { color: var(--error); font-weight: 500; }

.alert--warn { background: var(--warn-bg); border-color: #f0dca0; color: var(--warn); }

.confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.confirm__text { margin: 0; flex: 1 1 220px; }

/* ================================================================
   Tables, filters, badges
   ================================================================ */

.card--flush { padding: 0; overflow: hidden; }

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

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

.table thead th {
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  background: var(--bg);
  white-space: nowrap;
}

.table tbody tr:last-child td { border-bottom: 0; }
.table__nowrap { white-space: nowrap; }
.table__num { text-align: end; }
.table__strong { font-weight: 500; }
.table__text { min-width: 220px; overflow-wrap: anywhere; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge.is-ok      { background: var(--ok-bg);    border-color: #b7e0c4; color: var(--ok); }
.badge.is-error   { background: var(--error-bg); border-color: #f5c2c7; color: var(--error); }
.badge.is-warn    { background: var(--warn-bg);  border-color: #f0dca0; color: var(--warn); }
.badge.is-neutral { background: var(--bg);       border-color: var(--border); color: var(--muted); }

.filters { margin-bottom: 20px; }

.filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.filters__row .field { margin-bottom: 0; min-width: 150px; }
.filters__grow { flex: 1 1 220px; }

.filters__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 16px 0 6px;
}

.pager__item {
  display: block;
  min-width: 34px;
  padding: 6px 8px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
}

.pager__item:hover { background: var(--bg); color: var(--text); }
.pager__item.is-current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager__summary { font-size: 13px; margin-top: 0; }

/* ================================================================
   Detail, forms, helpers
   ================================================================ */

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  gap: 20px;
  align-items: start;
}

.props {
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr;
  gap: 8px 16px;
  margin: 18px 0 0;
  font-size: 14px;
}

.props dt { color: var(--muted); }
.props dd { margin: 0; overflow-wrap: anywhere; }
.props--tight { font-size: 13px; }

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

.stack { display: grid; gap: 8px; }
.stack-h { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.card + .card { margin-top: 16px; }

.input--area {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 17px; height: 17px; }

.inline { display: inline; }

/* ---------- row selection ---------- */

.table__pick {
  width: 1%;
  padding-right: 0;
  vertical-align: middle;
}

.table__pick input {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
}

.bulk {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

/* Two adjacent action forms would otherwise render as one run-on phrase:
   "Ορισμός ως προεπιλογή Διαγραφή". */
.table__actions {
  display: flex;
  gap: 16px;
  align-items: baseline;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}

.link-button:hover { color: var(--text); text-decoration: underline; }
.link-button--danger:hover { color: var(--error); }

.section-title--flush { margin-top: 0; }

.help p { margin: 0 0 10px; }
.help code {
  display: inline-block;
  padding: 1px 6px;
  margin: 2px 2px 2px 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.is-error { color: var(--error); }

/* ================================================================
   Mobile
   ================================================================ */

@media (max-width: 900px) {
  .send__grid,
  .detail { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; }

  /* Once the columns stack, the preview goes first: on a phone the operator
     must see the text and the SMS count without scrolling past the form. */
  .send__grid .preview { order: -1; }
}

@media (max-width: 640px) {
  .topbar__inner { gap: 12px; padding-top: 8px; padding-bottom: 8px; }
  .brand { order: 1; }
  .topbar__user { order: 2; margin-left: auto; }
  .nav { order: 3; width: 100%; flex: 1 0 100%; }
  .main { padding-top: 20px; }
  .card { padding: 16px; }

  /* Four Greek menu labels are wider than a phone screen at the desktop
     padding, and the last one would be cut off mid-word. */
  .nav a { padding-left: 6px; padding-right: 6px; }

  .grid-two { grid-template-columns: minmax(0, 1fr); }
  .filters__row .field { min-width: 0; flex: 1 1 100%; }
  .table th, .table td { padding: 9px 12px; }
  .segmented__option span { padding: 11px 22px; }

  /* Comfortable tap targets on a phone at the reception desk. */
  .input, .btn { padding-top: 12px; padding-bottom: 12px; }
}
