/* Franchise Portal — stylesheet
   Χωρίς build step, χωρίς CDN. Ένα αρχείο, σερβίρεται ως έχει. */

:root {
  --brand:        #0b3d91;
  --brand-dark:   #082c6b;
  --brand-light:  #e8eefb;
  /* Τα κανάλια χωριστά, για τα rgba() (επικάλυψη φόντου, εφέ «γυαλί»): σε
     rgba() δεν μπαίνει hex μεταβλητή. Το brand_css.php τα ξαναγράφει μαζί με
     το --brand, ώστε να μη μείνουν ποτέ ασύμφωνα. */
  --brand-rgb:    11,61,145;

  --ink:      #1f2933;
  --ink-soft: #52606d;
  --ink-mute: #7b8794;

  --line:     #e4e7eb;
  --line-soft:#f0f2f5;
  --bg:       #f4f5f7;
  --surface:  #ffffff;

  --green: #0a7c42;  --green-bg: #e6f4ec;
  --blue:  #1c6fd4;  --blue-bg:  #e7f0fb;
  --amber: #a35c00;  --amber-bg: #fdf1e0;
  --red:   #b3261e;  --red-bg:   #fce9e8;
  --gray:  #52606d;  --gray-bg:  #eceff2;

  --radius:    8px;
  --radius-sm: 5px;
  --shadow:    0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
  --shadow-md: 0 4px 12px rgba(16,24,40,.10);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.16);

  --topbar-h: 56px;
  --sidebar-w: 232px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.3; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--brand); color: #fff; padding: 10px 16px;
}
.skip-link:focus { left: 8px; top: 8px; }

/* --- Topbar --------------------------------------------------------------- */

.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); z-index: 50;
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: var(--brand); color: #fff;
}

.topbar-brand {
  display: flex; align-items: center; gap: 9px;
  color: #fff; font-weight: 600; font-size: 15px; letter-spacing: .01em;
}
.topbar-brand:hover { text-decoration: none; opacity: .92; }
.topbar-logo { font-size: 19px; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.topbar-store {
  font-size: 12.5px; color: rgba(255,255,255,.88);
  background: rgba(255,255,255,.12); padding: 4px 10px; border-radius: 100px;
  white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis;
}

.topbar-toggle {
  display: none; flex-direction: column; gap: 4px; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  background: none; border: 0; cursor: pointer;
}
.topbar-toggle span { display: block; height: 2px; background: #fff; border-radius: 2px; }

.usermenu { position: relative; }
.usermenu summary {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  padding: 4px; border-radius: var(--radius-sm);
}
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: rgba(255,255,255,.12); }
.usermenu-name { font-size: 13px; }

.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.22); color: #fff;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 600;
  text-transform: uppercase;
}

.usermenu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden;
}
.usermenu-panel a, .usermenu-panel button {
  display: block; width: 100%; text-align: left;
  padding: 10px 14px; font-size: 13.5px; color: var(--ink);
  background: none; border: 0; font-family: inherit; cursor: pointer;
}
.usermenu-panel a:hover, .usermenu-panel button:hover {
  background: var(--line-soft); text-decoration: none;
}
.usermenu-panel button { border-top: 1px solid var(--line); color: var(--red); }

/* --- Shell ---------------------------------------------------------------- */

.shell { display: flex; padding-top: var(--topbar-h); min-height: 100vh; }

.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w);
  overflow-y: auto; padding: 14px 10px 32px;
  background: var(--surface); border-right: 1px solid var(--line);
  z-index: 40;
}

.nav-group { margin-bottom: 18px; }
.nav-title {
  padding: 0 10px 5px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; color: var(--ink-mute);
}

.nav-link {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; margin-bottom: 1px; border-radius: var(--radius-sm);
  color: var(--ink-soft); font-size: 13.5px; font-weight: 500;
}
.nav-link:hover { background: var(--line-soft); color: var(--ink); text-decoration: none; }
.nav-link.active { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.nav-icon { font-size: 15px; width: 18px; text-align: center; flex: none; }

.nav-backdrop {
  display: none; position: fixed; inset: var(--topbar-h) 0 0 0;
  background: rgba(16,24,40,.45); z-index: 39;
}

.main {
  flex: 1; min-width: 0;
  margin-left: var(--sidebar-w);
  padding: 22px 26px 60px;
}

/* --- Page header ---------------------------------------------------------- */

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.page-head-text { min-width: 0; }
.page-sub { margin: 3px 0 0; color: var(--ink-mute); font-size: 13px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.breadcrumb {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  margin-bottom: 8px; font-size: 12.5px; color: var(--ink-mute);
}
.breadcrumb a { color: var(--ink-mute); }
.breadcrumb a:hover { color: var(--brand); }

/* --- Cards ---------------------------------------------------------------- */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.card-body { padding: 16px; }
.card-body-flush { padding: 0; }
.card-foot {
  padding: 12px 16px; border-top: 1px solid var(--line);
  background: var(--line-soft); border-radius: 0 0 var(--radius) var(--radius);
}

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

/* Κάρτες επιλογής έτοιμου σχεδίου προσφοράς. */
.preset-option { border: 1px solid var(--border, #d7dce2); border-radius: 10px; padding: 12px 14px; }
.preset-option.is-active { border-color: var(--primary, #0b3d91); box-shadow: inset 0 0 0 1px var(--primary, #0b3d91); }

.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* --- Stats ---------------------------------------------------------------- */

.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow);
}
.stat-label {
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-mute); margin-bottom: 5px;
}
.stat-value { font-size: 24px; font-weight: 700; line-height: 1.15; color: var(--ink); }
.stat-value.sm { font-size: 19px; }
.stat-meta { margin-top: 4px; font-size: 12px; color: var(--ink-mute); }
.stat-accent-green { border-left: 3px solid var(--green); }
.stat-accent-blue  { border-left: 3px solid var(--blue); }
.stat-accent-amber { border-left: 3px solid var(--amber); }
.stat-accent-red   { border-left: 3px solid var(--red); }

/* --- Tables --------------------------------------------------------------- */

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

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; padding: 10px 14px; white-space: nowrap;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-mute); background: var(--line-soft);
  border-bottom: 1px solid var(--line);
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:hover { background: #fafbfc; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .shrink { width: 1%; white-space: nowrap; }

.cell-strong { font-weight: 600; color: var(--ink); }
.cell-sub { display: block; font-size: 12px; color: var(--ink-mute); margin-top: 1px; }
.cell-mono { font-family: var(--mono); font-size: 12.5px; }

.empty { padding: 44px 20px; text-align: center; color: var(--ink-mute); }
.empty-icon { font-size: 34px; opacity: .5; margin-bottom: 8px; }
.empty-title { font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }

/* --- Badges --------------------------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 100px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-blue  { background: var(--blue-bg);  color: var(--blue); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red   { background: var(--red-bg);   color: var(--red); }
.badge-gray  { background: var(--gray-bg);  color: var(--gray); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

/* Πλακίδιο σταδίου στην «Εξέλιξη» παραγγελιών: αριθμός + ετικέτα, ως σύνδεσμος
   στη φιλτραρισμένη λίστα. Τα άδεια στάδια μένουν ορατά αλλά ξεθωριασμένα —
   το «κανένα σε συλλογή» είναι πληροφορία, ενώ ένα στάδιο που εξαφανίζεται
   αφήνει τον χρήστη να νομίζει ότι δεν υπάρχει καθόλου. */
.stage-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 8px; border-radius: 100px;
  border: 1px solid var(--line);
  font-size: 13px; color: var(--ink); text-decoration: none;
  transition: border-color .15s, background .15s;
}
.stage-chip:hover { border-color: var(--brand); background: var(--line-soft); }
.stage-chip.is-empty { opacity: .5; }

/* Αποτέλεσμα ζωντανού ελέγχου (σειριακός): πράσινο όταν βρέθηκε, κεχριμπαρένιο
   όταν δεν βρέθηκε. Ποτέ κόκκινο — «δεν βρέθηκε» δεν είναι σφάλμα του χρήστη. */
.field-hint.is-ok   { color: var(--green); }
.field-hint.is-warn { color: var(--amber); }

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13.5px; font-weight: 600; line-height: 1.2;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }

.btn-default { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-default:hover:not(:disabled) { background: var(--line-soft); border-color: #cdd4db; }

.btn-ghost { background: none; color: var(--ink-soft); }
.btn-ghost:hover:not(:disabled) { background: var(--line-soft); color: var(--ink); }

.btn-success { background: var(--green); color: #fff; }
.btn-success:hover:not(:disabled) { filter: brightness(.92); }

.btn-danger { background: var(--surface); color: var(--red); border-color: #f0c4c1; }
.btn-danger:hover:not(:disabled) { background: var(--red-bg); }

.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }

.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* --- Forms ---------------------------------------------------------------- */

.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.field-label .req { color: var(--red); margin-left: 2px; }
.field-hint { font-size: 12px; color: var(--ink-mute); }
.field-error { font-size: 12px; color: var(--red); font-weight: 500; }

.input, .select, .textarea {
  width: 100%; padding: 8px 11px;
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--surface); border: 1px solid #cdd4db; border-radius: var(--radius-sm);
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11,61,145,.12);
}
.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--line-soft); color: var(--ink-mute); cursor: not-allowed;
}
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--red); }
.textarea { resize: vertical; min-height: 76px; }
.input.num { text-align: right; font-variant-numeric: tabular-nums; }

.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.check input { margin-top: 2px; width: 15px; height: 15px; accent-color: var(--brand); flex: none; }
.check-text { font-size: 13.5px; }
.check-hint { display: block; font-size: 12px; color: var(--ink-mute); margin-top: 1px; }

.form-actions {
  display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap;
  padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--line);
}

.filters {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
  padding: 13px 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px;
}
.filters .field { flex: 1 1 150px; }
.filters .field-grow { flex: 2 1 220px; }

/* --- Alerts --------------------------------------------------------------- */

.alert {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius); margin-bottom: 14px;
  font-size: 13.5px; border: 1px solid transparent;
}
.alert-success { background: var(--green-bg); color: var(--green); border-color: #b8e2ca; }
.alert-error   { background: var(--red-bg);   color: var(--red);   border-color: #f3c9c6; }
.alert-warning { background: var(--amber-bg); color: var(--amber); border-color: #f6dcb4; }
.alert-info    { background: var(--blue-bg);  color: var(--blue);  border-color: #c3dcf7; }
.alert-close {
  background: none; border: 0; cursor: pointer; color: inherit;
  font-size: 18px; line-height: 1; opacity: .6; padding: 0 2px;
}
.alert-close:hover { opacity: 1; }

/* --- Lead protection panel -------------------------------------------------
   Το πιο σημαντικό στοιχείο του UI: πρέπει να σταματάει το μάτι. */

.lead-alert {
  border: 1px solid #f0c98a; border-left: 4px solid var(--amber);
  border-radius: var(--radius); background: #fffaf2;
  padding: 15px 17px; margin-bottom: 16px;
}
.lead-alert.is-own {
  border-color: #b8e2ca; border-left-color: var(--green); background: #f4fbf7;
}
.lead-alert.is-hidden { display: none; }

.lead-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.lead-icon { font-size: 19px; }
.lead-title { font-size: 14.5px; font-weight: 700; color: var(--amber); }
.lead-alert.is-own .lead-title { color: var(--green); }

.lead-body { font-size: 13.5px; color: var(--ink-soft); }

.lead-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px 18px; margin: 11px 0;
  padding: 11px 0; border-top: 1px solid rgba(163,92,0,.16); border-bottom: 1px solid rgba(163,92,0,.16);
}
.lead-fact-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-mute); margin-bottom: 2px;
}
.lead-fact-value { font-size: 13.5px; font-weight: 600; color: var(--ink); }

.lead-fee {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  background: rgba(163,92,0,.10); font-size: 13.5px; font-weight: 600; color: var(--amber);
}

.lead-note { margin-top: 9px; font-size: 12.5px; color: var(--ink-mute); }

/* --- Timeline ------------------------------------------------------------- */

.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ''; position: absolute; left: 5px; top: 5px; bottom: 5px;
  width: 2px; background: var(--line);
}
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ''; position: absolute; left: -21px; top: 5px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line-soft);
}
.timeline-item.is-green::before  { border-color: var(--green); }
.timeline-item.is-blue::before   { border-color: var(--blue); }
.timeline-item.is-amber::before  { border-color: var(--amber); }
.timeline-item.is-red::before    { border-color: var(--red); }
.timeline-time { font-size: 11.5px; color: var(--ink-mute); }
.timeline-title { font-size: 13.5px; font-weight: 600; }
.timeline-text { font-size: 12.5px; color: var(--ink-soft); }

/* --- Definition list ------------------------------------------------------ */

.dl { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 9px 16px; font-size: 13.5px; }
.dl dt { color: var(--ink-mute); }
.dl dd { margin: 0; color: var(--ink); font-weight: 500; word-break: break-word; }

/* --- Items editor (quote lines) ------------------------------------------- */

.items-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.items-table th {
  padding: 8px 8px; text-align: left; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--ink-mute);
  background: var(--line-soft); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.items-table td { padding: 5px 5px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.items-table .input, .items-table .select { padding: 6px 8px; font-size: 13px; }
.items-table .col-qty   { width: 88px; }
.items-table .col-unit  { width: 74px; }
.items-table .col-price { width: 108px; }
.items-table .col-disc  { width: 78px; }
.items-table .col-tax   { width: 78px; }
.items-table .col-total { width: 108px; text-align: right; }
.items-table .col-del   { width: 38px; }

.line-total { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.row-delete {
  background: none; border: 0; cursor: pointer; color: var(--ink-mute);
  font-size: 17px; line-height: 1; padding: 4px 6px; border-radius: var(--radius-sm);
}
.row-delete:hover { background: var(--red-bg); color: var(--red); }

.totals { margin-left: auto; width: min(320px, 100%); }
.totals-row {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 6px 0; font-size: 13.5px;
}
.totals-row.is-grand {
  border-top: 2px solid var(--line); margin-top: 5px; padding-top: 10px;
  font-size: 16px; font-weight: 700;
}
.totals-label { color: var(--ink-soft); }
.totals-value { font-variant-numeric: tabular-nums; font-weight: 600; }

/* --- Pagination ----------------------------------------------------------- */

.pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--ink-mute);
}
.pagination-links { display: flex; gap: 4px; }
.pagination-links a, .pagination-links span {
  min-width: 32px; height: 32px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-soft); font-weight: 500;
}
.pagination-links a:hover { background: var(--line-soft); text-decoration: none; }
.pagination-links .is-current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination-links .is-disabled { opacity: .45; pointer-events: none; }

/* --- Auth ----------------------------------------------------------------- */

.body-centered {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  /* Ακολουθεί το «Χρώμα εφαρμογής». Το τρίτο στοπ μένει σταθερό σκούρο ώστε
     το ντεγκραντέ να έχει βάθος ακόμη και με πολύ ανοιχτό χρώμα. */
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 45%, #1f2933 100%);
}
/* Το --login-oy το ορίζει inline το blank.php (ρύθμιση, ακέραιος px).
   Θετικό = κατεβαίνει, αρνητικό = ανεβαίνει. */
.auth-wrap { width: 100%; max-width: 400px; transform: translateY(var(--login-oy, 0)); }

/* Θέση πλαισίου εισόδου πάνω στο φόντο (ρυθμιζόμενη). Το body-centered κεντράρει
   με grid· εδώ μετακινούμε οριζόντια όταν ζητηθεί αριστερά/δεξιά. */
.body-centered.pos-left  { justify-items: start; padding-left: clamp(24px, 8vw, 120px); }
.body-centered.pos-right { justify-items: end;   padding-right: clamp(24px, 8vw, 120px); }

.auth-card {
  background: var(--surface); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 32px;
}

/* Εφέ πλαισίου εισόδου (ρύθμιση login_card_effect· η κλάση μπαίνει στο <body>).
   Το «shadow» είναι η προεπιλογή και ζει ήδη στο .auth-card παραπάνω. */
.fx-plain .auth-card {
  box-shadow: none; border: 1px solid var(--line);
}
.fx-float .auth-card {
  box-shadow: 0 24px 60px rgba(0,0,0,.34), 0 4px 12px rgba(0,0,0,.16);
}
.fx-outline .auth-card {
  box-shadow: 0 0 0 1px rgba(var(--brand-rgb), .18), var(--shadow-md);
  border-top: 3px solid var(--brand);
}
/* «Γυαλί»: διαφάνεια πάνω στο φόντο. Το -webkit- χρειάζεται ακόμη στο Safari.
   Χωρίς backdrop-filter (παλιοί browsers) μένει μια ημιδιαφανής κάρτα — πιο
   αχνή, αλλά πλήρως αναγνώσιμη. */
.fx-glass .auth-card {
  background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.55);
  box-shadow: 0 16px 44px rgba(0,0,0,.28);
}
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-logo { font-size: 38px; }
.auth-title { margin-top: 8px; font-size: 19px; font-weight: 700; }
.auth-sub { margin-top: 3px; font-size: 13px; color: var(--ink-mute); }

/* Προαιρετικό μήνυμα κάτω από τη φόρμα (π.χ. οδηγίες/τηλέφωνο). */
.auth-note {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border, #e4e7eb);
  font-size: 12.5px; line-height: 1.55; color: var(--ink-mute); text-align: center;
  white-space: pre-line;
}
.auth-fields { display: flex; flex-direction: column; gap: 14px; }
.auth-foot { margin-top: 18px; text-align: center; font-size: 12.5px; }

/* --- Tickets / messages ---------------------------------------------------- */

.message {
  padding: 13px 15px; border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 11px; background: var(--surface);
}
.message.is-mine { background: var(--brand-light); border-color: #cddcf5; }
.message.is-internal { background: #fffaf2; border-color: #f0c98a; border-style: dashed; }
.message-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 6px; font-size: 12.5px;
}
.message-author { font-weight: 600; }
.message-time { color: var(--ink-mute); }
.message-body { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }

/* --- Template editor ------------------------------------------------------- */

.code-editor {
  display: block;
  width: 100%;
  min-height: 560px;
  padding: 14px 16px;
  border: 0;
  border-radius: 0;
  resize: vertical;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: #e4e7eb;
  background: #1f2933;
  /* Το tab μέσα σε textarea αλλάζει πεδίο· τα 2 κενά κρατούν τη στοίχιση
     αναγνώσιμη χωρίς να χρειάζεται tab. */
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}
.code-editor:focus { outline: 2px solid var(--brand); outline-offset: -2px; }

/* --- Tabs του editor ------------------------------------------------------- */

.tabs { display: flex; gap: 2px; }

.tab {
  padding: 7px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: none;
  color: var(--ink-mute);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.tab:hover:not(:disabled) { background: var(--line-soft); color: var(--ink); }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }
.tab:disabled { opacity: .4; cursor: not-allowed; }

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* Tabs στη σελίδα Ρυθμίσεων: χωρίζουν τα μεγάλα blocks (Email, OpenCart, …)
   σε καρτέλες. Δουλεύουν με data-stab μέσω JS — και σε καρτέλες που ζουν σε
   ξεχωριστές φόρμες (test/branding). */
.settings-tabs {
  margin: 0 0 18px;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

/* Μικρογραφία προϊόντος (λίστα & καρτέλα). Οι εικόνες φορτώνουν από το OpenCart
   site — object-fit ώστε να μη «σπάνε» οι αναλογίες. */
.product-thumb {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: #fff;
  display: block;
}
.product-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  opacity: .5;
}
.product-thumb-lg { width: 120px; height: 120px; }

/* Γραμμή προσφοράς/παραγγελίας: εικόνα αριστερά, επιλογέας, απόθεμα δεξιά.
   Το απόθεμα είναι βοήθημα του editor — δεν τυπώνεται. */
.line-product { display: flex; align-items: center; gap: 8px; }
.line-product .select { flex: 1 1 auto; min-width: 120px; }

/* Επιλογέας με αναζήτηση: το πεδίο κάθετα πάνω από τη λίστα,
   ώστε να μην στενεύει το όνομα του προϊόντος σε στενές οθόνες. */
.line-product .combo { flex: 1 1 auto; min-width: 120px; }
.product-thumb-sm {
  width: 34px; height: 34px; object-fit: contain; flex: 0 0 auto;
  border: 1px solid var(--line-soft); border-radius: 6px; background: #fff;
}
.line-stock { flex: 0 0 auto; font-size: 12px; color: var(--ink-mute); white-space: nowrap; }
.line-stock.in  { color: #1a7f37; }
.line-stock.out { color: #b42318; }

/* Μπάρα ομαδικής ενέργειας (π.χ. αποδεκτές προσφορές → παραγγελία) */
.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 10px 14px;
  background: var(--bg-accent, #eef2ff);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}
.bulk-bar[hidden] { display: none; }

/* Οδηγίες χρήσης */
.guide { max-width: 760px; color: var(--ink); font-size: 14px; line-height: 1.65; }
.guide h2 {
  font-size: 15px; font-weight: 700; margin: 22px 0 8px;
  padding-top: 14px; border-top: 1px solid var(--line-soft); color: var(--brand);
}
.guide h2:first-of-type { border-top: 0; padding-top: 0; }
.guide ul { margin: 0 0 6px; padding-left: 20px; }
.guide li { margin: 4px 0; }
.guide .guide-lead { font-size: 15px; color: var(--ink-mute); margin: 0 0 8px; }
.guide .guide-note,
.guide .guide-foot {
  margin-top: 14px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--brand-light); font-size: 13.5px;
}
.guide code { background: var(--line-soft); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

.tpl-frame {
  display: block;
  width: 100%;
  height: 620px;
  border: 0;
  background: #f0f1f3;
}

.visual-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--line-soft);
  min-height: 46px;
}

.token-list { display: flex; flex-wrap: wrap; gap: 4px; }

/* Χρησιμοποιείται ήδη στο σχεδιαστικό — απαντά στο «ποια πεδία έχω βάλει;»
   χωρίς να ψάχνει ο χρήστης μέσα στο HTML. */
.token-used {
  background: var(--green-bg);
  border-color: #b8e2ca;
  color: var(--green);
}

.token {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--line-soft);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11.5px;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.token:hover { background: var(--brand-light); border-color: #cddcf5; color: var(--brand); }
.token:active { transform: translateY(1px); }

/* --- Branding previews ----------------------------------------------------- */

.branding-preview {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  /* Το checkerboard δείχνει τη διαφάνεια — ένα PNG με λευκό φόντο δεν
     ξεχωρίζει αλλιώς από ένα με πραγματικό alpha κανάλι. */
  background-image:
    linear-gradient(45deg, #eceff2 25%, transparent 25%),
    linear-gradient(-45deg, #eceff2 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eceff2 75%),
    linear-gradient(-45deg, transparent 75%, #eceff2 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
}
.branding-preview-logo { max-height: 72px; padding: 6px; }
.branding-preview-login_background { width: 100%; height: 130px; object-fit: cover; }

/* --- Login page background ------------------------------------------------- */

/* Όταν έχει ανέβει εικόνα, μπαίνει πάνω από το ντεγκραντέ. Το ::before σκουραίνει
   ώστε η λευκή κάρτα να διαβάζεται πάνω σε οποιαδήποτε φωτογραφία. */
.body-centered.has-bg { position: relative; background: #1f2933; }
.body-centered.has-bg .login-bg {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.body-centered.has-bg::before {
  content: ''; position: fixed; inset: 0; z-index: 1;
  /* Το --login-ov (0–1) το ορίζει inline το blank.php. Το κάτω άκρο σκουραίνει
     λίγο περισσότερο ώστε να διαβάζεται το πλαίσιο, αλλά με φραγμό 0.92: στο
     100% θέλουμε πυκνό χρώμα, όχι μαύρο. */
  background: linear-gradient(160deg,
              rgba(var(--brand-rgb), calc(var(--login-ov, .55) * 0.85)),
              rgba(24,32,42,          min(calc(var(--login-ov, .55) * 1.15), .92)));
}
.body-centered.has-bg .auth-wrap { position: relative; z-index: 2; }

.auth-logo-img { max-height: 56px; max-width: 220px; }
.topbar-logo-img { height: 26px; max-width: 150px; object-fit: contain; display: block; }

/* --- Utilities ------------------------------------------------------------ */

.muted { color: var(--ink-mute); }
.small { font-size: 12.5px; }
.mono  { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.text-amber { color: var(--amber); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.stack   { display: flex; flex-direction: column; gap: 12px; }
.stack-sm{ display: flex; flex-direction: column; gap: 6px; }
.row     { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-tight { display: flex; align-items: center; gap: 6px; }
.spread  { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.mt-0 { margin-top: 0; }    .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 6px; }  .mb-1 { margin-bottom: 6px; }
.mt-2 { margin-top: 12px; } .mb-2 { margin-bottom: 12px; }
.mt-3 { margin-top: 18px; } .mb-3 { margin-bottom: 18px; }

.divider { height: 1px; background: var(--line); border: 0; margin: 16px 0; }

/* --- Errors --------------------------------------------------------------- */

.error-page { text-align: center; padding: 70px 20px; }
.error-code { font-size: 64px; font-weight: 800; color: var(--brand); line-height: 1; }
.error-message { margin: 12px 0 22px; font-size: 15px; color: var(--ink-soft); }

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .topbar-toggle { display: flex; }
  .topbar-store, .usermenu-name { display: none; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: translateX(0); }
  .nav-backdrop.is-open { display: block; }

  .main { margin-left: 0; padding: 16px 14px 48px; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }

  .page-head { flex-direction: column; align-items: stretch; }
  .page-actions .btn { flex: 1; }

  .totals { width: 100%; }
  .form-actions .btn { flex: 1; }
}

@media print {
  .topbar, .sidebar, .page-actions, .no-print { display: none !important; }
  .main { margin: 0; padding: 0; }
  body { background: #fff; }
}

/* Λίστα επιλογής με τικ (κατηγορίες/ομάδες/κατασκευαστές του ERP).
   Κυλιόμενη: οι κατασκευαστές ξεπερνούν τους 100 και θα έσπρωχναν τη φόρμα. */
.check-list {
  max-height: 220px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 10px; background: var(--surface);
}
.check-list .check { margin: 0 0 4px; }
.check-list .check:last-child { margin-bottom: 0; }
.check-list.is-invalid { border-color: var(--red); }

/* Φωτογραφία στην καρτέλα ανταλλακτικού. Σταθερό πλάτος ώστε η διάταξη να μην
   αναπηδά όσο φορτώνει, και object-fit για να μην παραμορφώνονται οι εικόνες
   του ERP, που έχουν ανομοιόμορφες αναλογίες. */
.part-photo {
  width: 220px; height: 220px; object-fit: contain;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 6px; flex: none;
}
@media (max-width: 640px) { .part-photo { width: 140px; height: 140px; } }

/* Μεγέθυνση φωτογραφίας ανταλλακτικού. */
.part-photo-btn {
  padding: 0; border: 0; background: none; cursor: zoom-in; line-height: 0;
  border-radius: var(--radius);
}
.part-photo-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.zoom-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 18, 22, .82); padding: 24px; cursor: zoom-out;
}
.zoom-overlay[hidden] { display: none; }
.zoom-image {
  max-width: min(1100px, 96vw); max-height: 92vh;
  object-fit: contain; border-radius: var(--radius);
  background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.zoom-close {
  position: absolute; top: 12px; right: 16px;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.9); color: #111; font-size: 26px; line-height: 1;
  cursor: pointer;
}

/* Ομάδα κουμπιών στην κεφαλίδα κάρτας. Χωρίς αυτό, το space-between του
   .card-head στέλνει το κάθε κουμπί σε άλλη άκρη. */
.card-head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 640px) {
  .card-head-actions { width: 100%; }
  .card-head-actions .btn { flex: 1; }
}

/* ── Επιλογέας που γράφεται ──────────────────────────────────────────────
   ΕΝΑ πεδίο: το native <select> κρύβεται (κρατά μόνο το name για την υποβολή)
   και στη θέση του κάθεται πεδίο κειμένου με λίστα που φιλτράρει. */
.combo { position: relative; width: 100%; }
.combo-native { display: none !important; }

/* Το βελάκι ζωγραφίζεται με background, όπως στα κανονικά select του θέματος,
   ώστε το πεδίο να μη μοιάζει «άλλο είδος» μέσα στην ίδια φόρμα. */
.combo-input { width: 100%; padding-right: 28px;
               background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                                 linear-gradient(135deg, currentColor 50%, transparent 50%);
               background-position: calc(100% - 14px) calc(50% + 1px), calc(100% - 9px) calc(50% + 1px);
               background-size: 5px 5px, 5px 5px;
               background-repeat: no-repeat; }

.combo-list { position: absolute; z-index: 70; top: calc(100% + 2px); left: 0; right: 0;
              max-height: 320px; overflow-y: auto; background: var(--card, #fff);
              border: 1px solid var(--line, #d5d9e0); border-radius: 8px;
              box-shadow: 0 10px 28px rgba(0, 0, 0, .14); }
/* Σε δικό της επίπεδο: fixed ως προς την οθόνη, ώστε κανένα
   κουτί με κύλιση να μην την κόβει. Τη θέση τη δίνει το JS. */
.combo-list.combo-layer { position: fixed; right: auto; z-index: 200; }

.combo-item { padding: 7px 10px; cursor: pointer; font-size: 14px; }
.combo-item:hover, .combo-item.is-active { background: rgba(var(--brand-rgb, 11, 61, 145), .10); }
.combo-item.is-current { font-weight: 600; }
.combo-empty { padding: 10px; text-align: center; color: var(--ink-mute, #6b7280); font-size: 12px; }

/* ── Καμπανάκι ειδοποιήσεων ─────────────────────────────────────────── */
.bell { position: relative; }
.bell > summary { list-style: none; cursor: pointer; display: flex; align-items: center;
                  gap: 2px; padding: 6px 8px; border-radius: 8px; }
.bell > summary::-webkit-details-marker { display: none; }
.bell > summary:hover { background: rgba(255, 255, 255, .12); }
.bell-icon { font-size: 17px; line-height: 1; }
.bell-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
              background: #b42318; color: #fff; font-size: 11px; font-weight: 700;
              display: inline-flex; align-items: center; justify-content: center;
              margin-left: -6px; margin-top: -10px; }
.bell-count.is-zero { display: none; }

.bell-panel { position: absolute; right: 0; top: calc(100% + 6px); width: 340px;
              max-width: calc(100vw - 24px); background: var(--card, #fff);
              color: var(--ink, #1a1a1a); border: 1px solid var(--line, #e3e6ea);
              border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .16);
              z-index: 60; overflow: hidden; }
.bell-head { display: flex; align-items: center; justify-content: space-between;
             padding: 10px 12px; border-bottom: 1px solid var(--line, #e3e6ea); }
.bell-list { max-height: 60vh; overflow-y: auto; }
.bell-empty { padding: 18px 12px; text-align: center; color: var(--ink-mute, #6b7280);
              font-size: 13px; }
.bell-item { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line, #eef0f3);
             color: inherit; text-decoration: none; }
.bell-item:hover { background: rgba(0, 0, 0, .03); }
.bell-item.is-unread { border-left: 3px solid var(--brand, #0b3d91); }
.bell-item-title { font-weight: 600; font-size: 13px; }
.bell-item-body { font-size: 12px; color: var(--ink-mute, #6b7280); margin-top: 2px; }
.bell-item-when { font-size: 11px; color: var(--ink-mute, #6b7280); margin-top: 4px; }
.bell-more { display: block; padding: 10px 12px; text-align: center; font-size: 13px;
             border-top: 1px solid var(--line, #e3e6ea); }

/* ── Σελίδα ειδοποιήσεων ────────────────────────────────────────────── */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif { padding: 12px 14px; border-bottom: 1px solid var(--line, #eef0f3); }
.notif:last-child { border-bottom: 0; }
.notif.is-unread { border-left: 3px solid var(--brand, #0b3d91); background: rgba(var(--brand-rgb, 11, 61, 145), .03); }
.notif a { color: inherit; text-decoration: none; display: block; }
.notif-title { font-weight: 600; }
.notif-body { color: var(--ink-mute, #6b7280); font-size: 13px; margin-top: 2px; }
.notif-when { color: var(--ink-mute, #6b7280); font-size: 12px; margin-top: 4px; }

/* Νέο μήνυμα που ήρθε ζωντανά: σύντομο σημάδι, χωρίς να τραβά το βλέμμα. */
.message.is-new { animation: fp-fade-in .4s ease-out; }
@keyframes fp-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Ανταλλακτικά κάρτας service στο αίτημα ─────────────────────────── */
.rma-add { position: relative; }
.rma-hit { display: flex; align-items: center; gap: 8px; padding: 6px 0;
           border-bottom: 1px solid var(--line, #eef0f3); font-size: 13px; }
.rma-hit span { flex: 1 1 auto; }
.rma-qty { width: 64px; flex: 0 0 auto; text-align: right; }
.btn-sm { padding: 4px 10px; font-size: 13px; }

/* ── Φωτογραφία ανακοίνωσης ─────────────────────────────────────────── */
.ann-image { max-width: 100%; border-radius: 10px; margin-bottom: 14px; display: block; }
.ann-image-preview { max-width: 320px; max-height: 200px; border-radius: 8px;
                     margin-top: 8px; display: block; }
