/* =====================================================================
   ULTRA CRM — Εμφάνιση
   ===================================================================== */

:root {
  --bg:          #f6f7f9;
  --surface:     #ffffff;
  --surface-2:   #fafbfc;
  --border:      #e4e7ec;
  --border-2:    #eef0f3;
  --text:        #101828;
  --text-2:      #475467;
  --text-3:      #98a2b3;
  --primary:     #2563eb;
  --primary-h:   #1d4ed8;
  --primary-bg:  #eff6ff;
  --green:       #059669;
  --green-bg:    #ecfdf5;
  --red:         #dc2626;
  --red-bg:      #fef2f2;
  --amber:       #d97706;
  --amber-bg:    #fffbeb;
  --purple:      #7c3aed;
  --purple-bg:   #f5f3ff;
  --blue:        #2563eb;
  --blue-bg:     #eff6ff;
  --gray:        #64748b;
  --gray-bg:     #f1f5f9;
  --sidebar-bg:  #0f172a;
  --sidebar-tx:  #94a3b8;
  --sidebar-ac:  #ffffff;
  --shadow:      0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg:   0 12px 32px rgba(16,24,40,.12);
  --radius:      12px;
  --radius-sm:   8px;
  --sidebar-w:   246px;
}

[data-theme="dark"] {
  --bg:          #0b0f16;
  --surface:     #141a23;
  --surface-2:   #1a2130;
  --border:      #232c3b;
  --border-2:    #1c2430;
  --text:        #e8ecf2;
  --text-2:      #9aa5b8;
  --text-3:      #6b7688;
  --primary-bg:  #16213a;
  --green-bg:    #0d2620;
  --red-bg:      #2a1416;
  --amber-bg:    #2a1f0d;
  --purple-bg:   #1e1733;
  --blue-bg:     #16213a;
  --gray-bg:     #1a2130;
  --sidebar-bg:  #080c12;
  --shadow:      0 1px 3px rgba(0,0,0,.4);
  --shadow-lg:   0 12px 32px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

/* =====================================================================
   ΔΙΑΤΑΞΗ
   ===================================================================== */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  transition: transform .22s ease;
}

.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px;
  background: rgba(255,255,255,.09);
  display: grid; place-items: center; font-size: 18px; flex-shrink: 0;
}
.brand-text { min-width: 0; }
.brand-text strong {
  display: block; color: #fff; font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-text span { display: block; color: #64748b; font-size: 11px; letter-spacing: .06em; }

.nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav::-webkit-scrollbar { width: 5px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }

.nav-group {
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: #475569;
  padding: 14px 10px 6px;
}
.nav-group:first-child { padding-top: 4px; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8.5px 10px; border-radius: 8px;
  color: var(--sidebar-tx); font-size: 13.5px; font-weight: 500;
  text-decoration: none; transition: background .13s, color .13s;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #cbd5e1; text-decoration: none; }
.nav-item.active { background: rgba(37,99,235,.18); color: var(--sidebar-ac); }
.nav-item.active::before {
  content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; background: var(--primary); border-radius: 0 3px 3px 0;
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-icon svg { width: 100%; height: 100%; display: block; }
.nav-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-badge {
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
  background: var(--primary); color: #fff;
}
.nav-badge-red    { background: #dc2626; }
.nav-badge-amber  { background: #d97706; }
.nav-badge-purple { background: #7c3aed; }

.sidebar-foot { padding: 12px 10px 14px; border-top: 1px solid rgba(255,255,255,.07); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff; font-size: 12px; font-weight: 700;
  display: grid; place-items: center; flex-shrink: 0;
}
.user-info { min-width: 0; flex: 1; }
.user-info strong {
  display: block; color: #e2e8f0; font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-info span { display: block; color: #64748b; font-size: 11px; }

.foot-actions { display: flex; gap: 6px; }
.foot-actions .icon-btn {
  flex: 1; background: rgba(255,255,255,.05); color: #94a3b8;
  border: 0; border-radius: 7px; padding: 7px; cursor: pointer;
  display: grid; place-items: center;
}
.foot-actions .icon-btn:hover { background: rgba(255,255,255,.1); color: #e2e8f0; }
.foot-actions .icon-btn svg { width: 16px; height: 16px; }

/* --- Κύριο --- */
.main {
  flex: 1; min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
}

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.page-title { flex: 1; min-width: 0; }
.page-title h1 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.015em; }
.page-title p  { margin: 1px 0 0; font-size: 12.5px; color: var(--text-3); }

.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.quick-search { position: relative; }
.quick-search svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--text-3); pointer-events: none;
}
.quick-search input {
  width: 230px; padding: 8px 10px 8px 32px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); color: var(--text);
  font-size: 13px; font-family: inherit;
}
.quick-search input:focus {
  outline: none; border-color: var(--primary); width: 300px;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.search-results {
  position: absolute; top: calc(100% + 6px); right: 0; width: 340px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-lg);
  max-height: 380px; overflow-y: auto; display: none; z-index: 50;
}
.search-results.show { display: block; }
.search-results a {
  display: block; padding: 10px 13px; border-bottom: 1px solid var(--border-2);
  color: var(--text); text-decoration: none;
}
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover { background: var(--surface-2); text-decoration: none; }
.search-results .sr-name { font-weight: 600; font-size: 13.5px; }
.search-results .sr-meta { font-size: 12px; color: var(--text-3); }
.search-results .sr-empty { padding: 16px; text-align: center; color: var(--text-3); font-size: 13px; }

.content { padding: 22px 24px 60px; flex: 1;
  /* 28/8/2026: όριο πλάτους για μεγάλες οθόνες — το μάτι διαβάζει κάθετα */
  max-width: 1440px; width: 100%; margin-inline: auto; }

/* =====================================================================
   ΜΗΝΥΜΑΤΑ
   ===================================================================== */
.flash {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 16px 24px 0; padding: 11px 15px;
  border-radius: 10px; font-size: 13.5px; font-weight: 500;
  animation: slideDown .25s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } }
.flash-success { background: var(--green-bg);  color: var(--green);  border: 1px solid rgba(5,150,105,.22); }
.flash-error   { background: var(--red-bg);    color: var(--red);    border: 1px solid rgba(220,38,38,.22); }
.flash-info    { background: var(--blue-bg);   color: var(--blue);   border: 1px solid rgba(37,99,235,.22); }
.flash-warning { background: var(--amber-bg);  color: var(--amber);  border: 1px solid rgba(217,119,6,.22); }
.flash button  { background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; opacity: .55; }
.flash button:hover { opacity: 1; }

/* =====================================================================
   ΚΑΡΤΕΣ
   ===================================================================== */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 18px; overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border-2);
}
.card-head h2, .card-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.card-head .sub { font-size: 12px; color: var(--text-3); font-weight: 400; margin-top: 1px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border-2); background: var(--surface-2); }

/* --- Πλέγμα --- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-2 { grid-template-columns: 1fr 2fr; }

/* --- Στατιστικά --- */
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.stat-label { font-size: 12px; color: var(--text-3); font-weight: 500; margin-bottom: 6px; }
.stat-value { font-size: 25px; font-weight: 680; letter-spacing: -.03em; line-height: 1.1; }
.stat-sub   { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.stat-value.green  { color: var(--green); }
.stat-value.red    { color: var(--red); }
.stat-value.amber  { color: var(--amber); }
.stat-value.purple { color: var(--purple); }
.stat.clickable { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.stat.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* =====================================================================
   ΠΙΝΑΚΕΣ
   ===================================================================== */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; padding: 10px 14px;
  font-size: 11.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-3); background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td.center, table.data th.center { text-align: center; }
table.data .row-link { cursor: pointer; }
table.data .primary-cell { font-weight: 600; }
table.data .muted { color: var(--text-3); font-size: 12.5px; }

.empty-state { padding: 46px 20px; text-align: center; color: var(--text-3); }
.empty-state .ic { font-size: 38px; margin-bottom: 10px; opacity: .5; }
.empty-state h3 { margin: 0 0 5px; font-size: 15px; color: var(--text-2); font-weight: 600; }
.empty-state p { margin: 0 0 16px; font-size: 13px; }

/* =====================================================================
   ΕΤΙΚΕΤΕΣ
   ===================================================================== */
.badge {
  display: inline-block; padding: 2.5px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 650; white-space: nowrap; line-height: 1.5;
}
.badge-blue   { background: var(--blue-bg);   color: var(--blue); }
.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.badge-amber  { background: var(--amber-bg);  color: var(--amber); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-gray   { background: var(--gray-bg);   color: var(--gray); }

/* Βούλες προειδοποίησης δίπλα στο όνομα (όπως στο παλιό CRM αποθήκης) */
.name-wrap { display: flex; align-items: center; gap: 7px; }
.flag-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.flag-overdue  { background: var(--red); }
.flag-expiring { background: var(--amber); }

/* ── Επισκόπηση Αποθήκευσης (αντιγραφή παλιάς «Αρχικής») ─────────── */
.ov-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.ov-mid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}
.ov-chart {
  display: flex; align-items: flex-end; gap: 6px;
  height: 220px; padding-top: 8px;
}
.ov-col { flex: 1; display: flex; flex-direction: column; height: 100%; min-width: 0; }
.ov-bar-wrap { flex: 1; display: flex; align-items: flex-end; }
.ov-bar {
  width: 100%; border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #8b5cf6, #7c3aed);
  min-height: 3px; transition: opacity .15s;
}
.ov-col:hover .ov-bar { opacity: .8; }
.ov-lbl {
  font-size: 10.5px; color: var(--text-3, #718096);
  text-align: center; margin-top: 6px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.ov-rank {
  display: inline-flex; width: 22px; height: 22px; border-radius: 50%;
  align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  background: var(--gray-bg); color: var(--gray);
}
.ov-rank.first { background: var(--red-bg); color: var(--red); }
.ov-wh {
  border: 1px solid var(--border); border-radius: 10px; padding: 14px;
}
.ov-wh-nums {
  display: flex; gap: 18px; margin: 10px 0;
}
.ov-wh-debt { font-size: 12.5px; margin-top: 4px; }
@media (max-width: 900px) {
  .ov-mid { grid-template-columns: 1fr; }
  .ov-chart { height: 150px; }
  .ov-lbl { font-size: 9px; }
}

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
}

/* =====================================================================
   ΚΟΥΜΠΙΑ
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8.5px 15px; border: 1px solid transparent; border-radius: 8px;
  font-size: 13.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .13s, border-color .13s, transform .08s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.985); }
.btn svg { width: 15px; height: 15px; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); }
.btn-ghost { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { filter: brightness(.93); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { filter: brightness(.93); }
.btn-amber { background: var(--amber); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-lg { padding: 11px 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.icon-btn {
  background: none; border: 1px solid transparent; border-radius: 8px;
  padding: 7px; cursor: pointer; color: var(--text-2);
  display: grid; place-items: center;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* =====================================================================
   ΦΟΡΜΕΣ
   ===================================================================== */
.form-grid { display: grid; gap: 15px; }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.field.span-2 { grid-column: span 2; }
.field.span-3 { grid-column: span 3; }
.field.span-all { grid-column: 1 / -1; }

.field label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text-2); margin-bottom: 5px;
}
.field label .req { color: var(--red); }
.field .help { font-size: 11.5px; color: var(--text-3); margin-top: 4px; line-height: 1.45; }

input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password],
input[type=date], input[type=time], input[type=search], input[type=url], select, textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text);
  font-size: 14px; font-family: inherit; line-height: 1.4;
  transition: border-color .13s, box-shadow .13s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.11);
}
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--text-3); }
textarea { resize: vertical; min-height: 78px; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center; padding-left: 32px;
}
input.money { text-align: left; font-variant-numeric: tabular-nums; }

.check-row { display: flex; align-items: center; gap: 8px; }
.check-row input[type=checkbox], .check-row input[type=radio] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.check-row label { margin: 0; font-weight: 500; font-size: 13.5px; color: var(--text); cursor: pointer; }

.input-group { display: flex; }
.input-group input { border-radius: 8px 0 0 8px; }
.input-group .addon {
  display: grid; place-items: center; padding: 0 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-right: 0;
  border-radius: 0 8px 8px 0; font-size: 13px; color: var(--text-3); white-space: nowrap;
}

.field-error { color: var(--red); font-size: 12px; margin-top: 4px; }
input.has-error, select.has-error, textarea.has-error { border-color: var(--red); }

fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin: 0 0 16px; }
legend { font-size: 12.5px; font-weight: 650; color: var(--text-2); padding: 0 7px; }

/* =====================================================================
   ΦΙΛΤΡΑ
   ===================================================================== */
.filters {
  display: flex; gap: 9px; flex-wrap: wrap; align-items: flex-end;
  padding: 14px 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 16px; box-shadow: var(--shadow);
}
.filters .field { min-width: 140px; }
.filters .field.grow { flex: 1; min-width: 200px; }
.filters label { font-size: 11.5px; margin-bottom: 4px; }
.filters input, .filters select { padding: 7.5px 11px; font-size: 13px; }
.filters select { padding-left: 30px; }

.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a {
  padding: 9px 15px; font-size: 13.5px; font-weight: 600; color: var(--text-3);
  border-bottom: 2px solid transparent; text-decoration: none; white-space: nowrap;
}
.tabs a:hover { color: var(--text-2); text-decoration: none; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* =====================================================================
   TIMELINE
   ===================================================================== */
.timeline { position: relative; padding-right: 24px; }
.timeline::before {
  content: ''; position: absolute; right: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item::before {
  content: ''; position: absolute; right: -21px; top: 5px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border-2);
  box-shadow: 0 0 0 3px var(--surface);
}
.tl-item.tl-green::before  { border-color: var(--green); }
.tl-item.tl-red::before    { border-color: var(--red); }
.tl-item.tl-blue::before   { border-color: var(--blue); }
.tl-item.tl-amber::before  { border-color: var(--amber); }
.tl-item.tl-purple::before { border-color: var(--purple); }
.tl-title { font-size: 13.5px; font-weight: 600; }
.tl-meta  { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.tl-detail{ font-size: 12.5px; color: var(--text-2); margin-top: 4px; }

/* =====================================================================
   ΛΙΣΤΕΣ ΕΝΕΡΓΕΙΩΝ (κουτί «Σήμερα»)
   ===================================================================== */
.action-list { display: flex; flex-direction: column; }
.action-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--border-2);
  text-decoration: none; color: inherit;
}
.action-item:last-child { border-bottom: 0; }
.action-item:hover { background: var(--surface-2); text-decoration: none; }
.action-mark { width: 4px; align-self: stretch; border-radius: 3px; background: var(--border); flex-shrink: 0; }
.action-item.urgent  .action-mark { background: var(--red); }
.action-item.warning .action-mark { background: var(--amber); }
.action-item.normal  .action-mark { background: var(--blue); }
.action-main { flex: 1; min-width: 0; }
.action-title { font-size: 13.5px; font-weight: 600; }
.action-meta { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.action-side { text-align: left; flex-shrink: 0; font-size: 12.5px; }
.action-amount { font-weight: 650; font-variant-numeric: tabular-nums; }

/* =====================================================================
   ΠΑΡΑΘΥΡΑ (modals)
   ===================================================================== */
.modal-back {
  position: fixed; inset: 0; background: rgba(15,23,42,.55);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-back.show { display: flex; }
.modal {
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column;
  animation: modalIn .18s ease;
}
.modal.wide { max-width: 860px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border-2);
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 650; }
.modal-head button { background: none; border: 0; font-size: 24px; cursor: pointer; color: var(--text-3); line-height: 1; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  display: flex; gap: 9px; justify-content: flex-start;
  padding: 14px 20px; border-top: 1px solid var(--border-2); background: var(--surface-2);
}

/* =====================================================================
   ΒΟΗΘΗΤΙΚΑ
   ===================================================================== */
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.tiny  { font-size: 11.5px; }
.bold  { font-weight: 650; }
.right { text-align: left; }
.center{ text-align: center; }
.nowrap{ white-space: nowrap; }
.mono  { font-variant-numeric: tabular-nums; }
.green { color: var(--green); }
.red   { color: var(--red); }
.amber { color: var(--amber); }
.mt-0{margin-top:0} .mt-1{margin-top:8px} .mt-2{margin-top:16px} .mt-3{margin-top:24px}
.mb-0{margin-bottom:0} .mb-1{margin-bottom:8px} .mb-2{margin-bottom:16px} .mb-3{margin-bottom:24px}
.flex { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: 6px; }
.hidden { display: none !important; }
hr { border: 0; border-top: 1px solid var(--border-2); margin: 18px 0; }

.progress { height: 7px; background: var(--gray-bg); border-radius: 4px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s; }
.progress.green span { background: var(--green); }
.progress.red   span { background: var(--red); }
.progress.amber span { background: var(--amber); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--text-3); font-size: 12.5px; }
.kv dd { margin: 0; font-weight: 500; }

.only-mobile { display: none; }
.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 39; display: none;
}
.sidebar-backdrop.show { display: block; }

/* =====================================================================
   ΣΕΛΙΔΑ ΕΙΣΟΔΟΥ
   ===================================================================== */
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 55%, #334155 100%);
}
.login-card {
  background: var(--surface); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.32);
  width: 100%; max-width: 400px; padding: 34px 32px 30px;
}
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo .m { font-size: 40px; }
.login-logo h1 { margin: 8px 0 2px; font-size: 20px; font-weight: 650; }
.login-logo p { margin: 0; font-size: 13px; color: var(--text-3); }

/* =====================================================================
   ΕΚΤΥΠΩΣΗ
   ===================================================================== */
@media print {
  .sidebar, .topbar, .flash, .no-print, .btn { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; }
  .card { border: 0; box-shadow: none; margin-bottom: 12px; }
  body { background: #fff; font-size: 12px; }
  @page { margin: 14mm; }
}

/* =====================================================================
   ΚΙΝΗΤΟ
   ===================================================================== */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .only-mobile { display: grid; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .field.span-2, .field.span-3 { grid-column: span 1; }
  .quick-search input { width: 150px; }
  .quick-search input:focus { width: 200px; }
  .content { padding: 16px 14px 50px; }
  .topbar { padding: 12px 14px; }
  .flash { margin: 12px 14px 0; }
  .page-title h1 { font-size: 17px; }
  table.data th, table.data td { padding: 9px 10px; }
  .search-results { width: calc(100vw - 28px); left: 0; right: auto; }
}

@media (max-width: 560px) {
  .quick-search { display: none; }
  .stat-value { font-size: 21px; }
}

/* Οθόνη συνεργείου — μεγάλα κουμπιά για δάχτυλα */
.mobile-view .btn { padding: 13px 20px; font-size: 15px; }
.mobile-view .card { border-radius: 14px; }
.mobile-view input, .mobile-view select, .mobile-view textarea { padding: 12px 14px; font-size: 16px; }
