/* ============================================================================
   lines-mobile.css (S610) — Γραμμές παραστατικού σε κινητό (Πωλήσεις / Αγορές)
   Κάρτες γραμμών + παράθυρο επεξεργασίας γραμμής (InvoiceLinesMobileSection /
   PurchaseLinesMobileSection). Σε desktop / tablet ο πίνακας μένει ακριβώς ως έχει:
   οι κάρτες (.inv-lines-mobile) και το κουμπί κινητού (.inv-lines-mobile-btn) είναι κρυφά.
   Σε κινητό (≤ 767.98px — το ίδιο breakpoint με τις ρυθμίσεις κινητού της φόρμας
   στο responsive.css) κρύβεται ο πίνακας (.inv-lines-desktop) και φαίνονται οι κάρτες.
   ============================================================================ */

.inv-lines-mobile { display: none; }

/* S613: σε κινητό ΕΝΑ κουμπί «Νέα Γραμμή» — το μεγάλο πράσινο (.mline-add-btn) κάτω από τις κάρτες.
   Το κουμπί της επικεφαλίδας (.inv-lines-desktop) κρύβεται μαζί με τον πίνακα. */
@media (max-width: 767.98px) {
    .inv-lines-desktop { display: none !important; }
    .inv-lines-mobile { display: block; }
}

/* ---------------- Κάρτες γραμμών ---------------- */
.mline-wrap { margin-bottom: 20px; }
.mline-hint { font-size: 12px; color: #6c757d; margin: 4px 0 8px; }
.mline-hint i { color: #22B2A8; margin-right: 4px; }
.mline-empty { text-align: center; color: #6c757d; padding: 22px 10px; border: 1px dashed #ced4da; border-radius: 8px; font-size: 14px; }
.mline-empty i { font-size: 26px; color: #c3cbd3; margin-bottom: 6px; display: block; }

.mline-card {
    border: 1px solid #dee2e6; border-left: 4px solid #22B2A8; border-radius: 8px;
    background: #fff; padding: 10px 12px; margin-bottom: 8px; cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04); -webkit-tap-highlight-color: rgba(34,178,168,0.15);
}
.mline-card:active { background: #f2fbfa; }
.mline-card.accessory { border-left-color: #8fd8d2; background: #f7fcfb; }
.mline-card-head { display: flex; align-items: flex-start; gap: 8px; }
.mline-no {
    flex: 0 0 auto; min-width: 22px; height: 22px; border-radius: 11px; background: #e9f7f6; color: #1a8f87;
    font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px;
}
.mline-name { flex: 1 1 auto; font-size: 15px; font-weight: 600; color: #1f2937; line-height: 1.3; word-break: break-word; }
.mline-total { flex: 0 0 auto; font-size: 16px; font-weight: 700; color: #1f2937; white-space: nowrap; }
.mline-card-sub { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 13px; color: #495057; }
.mline-code { color: #6c757d; font-family: Consolas, Menlo, monospace; font-size: 12px; }
.mline-disc { color: #c0392b; }
.mline-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mline-tag { font-size: 11px; color: #495057; background: #f1f3f5; border-radius: 10px; padding: 2px 8px; }
.mline-tag.variant { background: #f5eef8; color: #6f42c1; }
.mline-tag.accessory { background: #e9f7f6; color: #1a8f87; }

.mline-add-btn {
    width: 100%; min-height: 48px; margin-top: 4px; border: none; border-radius: 8px;
    background: #28a745; color: #fff; font-size: 16px; font-weight: 600; cursor: pointer;
}
.mline-add-btn:active { background: #23923d; }

/* ---------------- Παράθυρο γραμμής ---------------- */
.mline-editor { display: flex; flex-direction: column; gap: 12px; }
.mline-label { display: block; font-size: 12px; font-weight: 600; color: #495057; margin-bottom: 4px; }
.mline-input {
    width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid #ced4da; border-radius: 8px;
    font-size: 16px; /* 16px: το iOS δεν κάνει zoom στην εστίαση */
    background: #fff; color: #1f2937; box-sizing: border-box;
}
.mline-input:focus { outline: none; border-color: #22B2A8; box-shadow: 0 0 0 3px rgba(34,178,168,0.18); }
.mline-input.num { text-align: right; font-variant-numeric: tabular-nums; }
.mline-input.num.short { border-color: #e74c3c; background: #fff0f1; }
.mline-input.inline { width: 140px; min-height: 40px; padding: 6px 10px; }
textarea.mline-input { min-height: 64px; resize: vertical; }
select.mline-input { appearance: auto; }
.mline-row { display: block; }
.mline-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Είδος */
.mline-item-box { border: 1px solid #c9ebe8; background: #f2fbfa; border-radius: 8px; padding: 10px 12px; }
.mline-item-main { display: flex; align-items: flex-start; gap: 10px; }
.mline-item-icon { color: #22B2A8; font-size: 18px; margin-top: 2px; }
.mline-item-text { flex: 1 1 auto; min-width: 0; }
.mline-item-name { font-size: 15px; font-weight: 600; color: #1f2937; line-height: 1.3; word-break: break-word; }
.mline-item-code { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: #6c757d; margin-top: 2px; }
.mline-stock { color: #6c757d; }
.mline-stock.ok { color: #17a2b8; }
.mline-stock.ko { color: #e74c3c; }
.mline-variant { margin-top: 8px; font-size: 13px; color: #6f42c1; }
.mline-variant-pick { margin-top: 8px; border: 1px solid #e67e22; border-radius: 8px; padding: 2px; background: #fff8e1; }
.mline-variant-pick.picked { border-color: #9b59b6; background: #f5eef8; }

/* Αναζήτηση είδους — αποτελέσματα ΣΕ ΡΟΗ (όχι dropdown) ώστε να μην κόβονται από το scroll του παραθύρου */
.mline-search { display: flex; flex-direction: column; gap: 6px; }
.mline-results { border: 1px solid #c9ebe8; border-radius: 8px; overflow: hidden; margin-top: 2px; }
.mline-results-head { font-size: 11px; color: #6c757d; background: #f8f9fa; padding: 5px 10px; border-bottom: 1px solid #e9ecef; }
.mline-result { padding: 9px 10px; border-bottom: 1px solid #f1f3f5; cursor: pointer; }
.mline-result:last-child { border-bottom: none; }
.mline-result:active, .mline-result.hl { background: #f0f7ff; }
.mline-result-name { font-size: 14px; font-weight: 600; color: #1f2937; }
.mline-result-name i { color: #22B2A8; margin-right: 4px; font-size: 12px; }
.mline-result-sub { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: #6c757d; margin-top: 2px; }
.mline-result-price { color: #1a8f87; font-weight: 600; }
.mline-results-more { font-size: 11px; color: #6c757d; background: #f8f9fa; padding: 5px 10px; border-top: 1px solid #e9ecef; }

/* Ποσότητα − / + */
.mline-stepper { display: flex; align-items: stretch; gap: 6px; }
.mline-stepper .mline-input { flex: 1 1 auto; text-align: center; font-size: 18px; font-weight: 600; }
.mline-step {
    flex: 0 0 52px; min-height: 44px; border: 1px solid #ced4da; border-radius: 8px; background: #f8f9fa;
    color: #1f2937; font-size: 22px; font-weight: 600; cursor: pointer; line-height: 1;
}
.mline-step:active { background: #e9f7f6; border-color: #22B2A8; }

/* Μονάδα τιμολόγησης (ΜΜ1 / ΜΜ2) */
.mline-seg { display: flex; border: 1px solid #ced4da; border-radius: 8px; overflow: hidden; }
.mline-seg button { flex: 1 1 0; min-height: 40px; border: none; background: #fff; color: #495057; font-size: 14px; cursor: pointer; }
.mline-seg button + button { border-left: 1px solid #ced4da; }
.mline-seg button.on { background: #e9f7f6; color: #1a8f87; font-weight: 600; }

/* Αξίες */
.mline-amounts { border: 1px solid #dee2e6; border-radius: 8px; padding: 8px 12px; background: #fafbfc; }
.mline-amounts-title { font-size: 12px; font-weight: 600; color: #6c757d; margin-bottom: 4px; }
.mline-amt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 14px; color: #495057; border-top: 1px dashed #e9ecef; }
.mline-amt:first-of-type { border-top: none; }
.mline-amt strong { font-variant-numeric: tabular-nums; color: #1f2937; }
.mline-amt.total { font-size: 16px; }
.mline-amt.total strong { color: #1a8f87; font-size: 18px; }

/* Chips (S/N-παρτίδες, ιστορικό, κόστος, αλλαγή είδους) */
.mline-extras { display: flex; flex-wrap: wrap; gap: 8px; }
.mline-chip {
    display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px;
    border: 1px solid #c9ebe8; border-radius: 20px; background: #fff; color: #1a8f87; font-size: 13px; cursor: pointer;
    max-width: 100%; text-align: left;
}
.mline-chip:active { background: #e9f7f6; }
.mline-chip.static { cursor: default; }
.mline-chip.ok { color: #28a745; border-color: #cdeccd; }
.mline-chip.ko { color: #e74c3c; border-color: #f5c6c6; }

/* S617: φακός + μολύβι μέσα στο παράθυρο γραμμής — ίδια λειτουργία με τα εικονίδια του header
   «Κωδικός» του πίνακα (ItemBrowseModal / ItemQuickCreateModal), σε μέγεθος αντίχειρα. */
.mline-item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; }
.mline-iconbtns { display: flex; gap: 6px; }
.mline-label-row { display: flex; align-items: center; gap: 8px; }
.mline-label-row .mline-label { flex: 1 1 auto; margin-bottom: 0; }
.mline-iconbtn {
    display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
    border: 1px solid #c9ebe8; border-radius: 50%; background: #fff; color: #22B2A8; font-size: 14px; cursor: pointer;
}
.mline-iconbtn.edit { color: #e0a800; border-color: #f3e2a9; }
.mline-iconbtn:active { background: #e9f7f6; }

/* Προειδοποιήσεις */
.mline-warn { font-size: 13px; color: #c0392b; background: #fff0f1; border: 1px solid #f5c6c6; border-radius: 8px; padding: 8px 10px; }
.mline-warn.small { font-size: 12px; padding: 5px 8px; margin-top: 6px; }
.mline-warn-icon { color: #e67e22; margin-left: 4px; }

/* Υποσέλιδο παραθύρου — κουμπιά αντίχειρα */
.mline-footer { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.mline-btn {
    flex: 1 1 45%; min-height: 46px; border-radius: 8px; border: 1px solid transparent; font-size: 14px; font-weight: 600;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.mline-btn.primary { background: #22B2A8; color: #fff; }
.mline-btn.primary:active { background: #1a9d94; }
.mline-btn.outline { background: #fff; color: #1a8f87; border-color: #22B2A8; }
.mline-btn.ghost { background: #f8f9fa; color: #495057; border-color: #ced4da; }
.mline-btn.danger { background: #fff; color: #c0392b; border-color: #f5c6c6; }
