/* FSZ-GEMI-Search — supplemental styles on top of the shared /apps/assets/app.css.
   Only what doesn't already exist there: the company header block, the
   accordion bubbles, and the "Ιστορικό Αποφάσεων" tabs. The two PDF export
   buttons (#export-summary/#export-full) no longer use a print stylesheet —
   PDF generation is jsPDF-based now (assets/pdf-export.js), no browser print
   engine involved, so there is no @media print block here anymore.
   Everything else (topbar, .card, .entity-list, .error/.ok banners, buttons,
   inputs) is the real shared design system — see app.css. */

.status-pill {
  display: inline-block;
  border-radius: 4px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
}
.status-pill.active { background: var(--ok-bg); color: var(--ok-text); border: 1px solid var(--ok-line); }
.status-pill.inactive { background: var(--error-bg); color: var(--error-text); border: 1px solid var(--error-line); }

/* ---------- Ταυτότητα εταιρείας (αρχική κάρτα της Αναλυτικής Αναφοράς) ----------
   Αντικαθιστά το παλιό .company-header/.header-grid (dl-λίστα πεδίων) με μια
   πιο "έτοιμη" κάρτα: όνομα + κατάσταση πάνω, στρώση βασικών στοιχείων,
   γραμμή επικοινωνίας — βλ. mockup 20/09/2026 (Design artifact). Reuses το
   ήδη υπάρχον .status-pill (app.css/παρακάτω) αμετάβλητο. */
.id-card { background: var(--surface); border: 1px solid var(--line); }
.id-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; padding: 20px 24px 14px; flex-wrap: wrap;
}
.id-name h2 { margin: 0 0 6px; font-size: 19px; font-weight: 700; color: var(--heading); }
.id-name .name-en { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-style: italic; }
.id-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.id-pills .pill { font-size: 12.5px; color: var(--muted); }
.id-pills .pill b { color: var(--text); font-weight: 600; }
.id-top .status-pill { margin-top: 0; white-space: nowrap; }

.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  border-top: 1px solid var(--line-soft);
}
.fact { padding: 12px 24px; border-left: 1px solid var(--line-soft); }
.fact:first-child { border-left: none; }
.fact .flabel { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; margin-bottom: 3px; }
.fact .fval { font-size: 14px; font-weight: 600; color: var(--text); }
.fact.accent .fval { color: var(--orange); font-size: 15.5px; }

.contact-row {
  display: flex; gap: 20px; flex-wrap: wrap;
  padding: 12px 24px; border-top: 1px solid var(--line-soft);
  font-size: 13px; color: var(--muted);
}
.contact-row b { color: var(--text); font-weight: 600; }
.contact-row a { font-weight: 600; }

/* ---------- Επισκόπηση: προεπισκόπηση κάθε ενότητας/bubble ---------- */
.ov-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; padding: 0; height: auto; font-family: inherit; cursor: pointer;
}
.ov-toggle .label { cursor: pointer; }
.ov-caret { color: var(--muted); font-size: 11px; transition: transform .15s ease; }
.ov-toggle[aria-expanded="false"] .ov-caret { transform: rotate(-90deg); }
.ov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .ov-grid { grid-template-columns: 1fr; } }
.ov-card { background: var(--surface); border: 1px solid var(--line); padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.ov-card.wide { grid-column: 1 / -1; }
.ov-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ov-head h3 { margin: 0; font-size: 13.5px; color: var(--heading); }
.ov-more {
  background: none; border: none; padding: 0; height: auto; font-family: inherit;
  font-size: 12.5px; color: var(--orange); font-weight: 600; cursor: pointer; white-space: nowrap;
}
.ov-more:hover { color: var(--orange-hover); text-decoration: underline; }
.ov-body { font-size: 13.5px; color: var(--text); }
.ov-body.muted { color: var(--muted); }
.ov-name-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.ov-name-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.ov-name-list .role { color: var(--muted); text-align: right; }
.ov-stat-row { display: flex; gap: 22px; }
.ov-stat b { display: block; font-size: 19px; color: var(--heading); }
.ov-stat span { font-size: 11.5px; color: var(--muted); }

/* ---------- Bubbles (independent accordion, per bubble) ---------- */

.bubble {
  background: var(--surface);
  border: 1px solid var(--line);
}
.bubble > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--heading);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bubble > summary::-webkit-details-marker { display: none; }
.bubble > summary::after { content: "▾"; color: var(--muted); }
.bubble[open] > summary::after { content: "▴"; }
.bubble .bubble-body { padding: 0 16px 16px; font-size: 14px; overflow-x: auto; }

/* table-layout:fixed αναγκάζει τις στήλες να χωράνε στο 100% του bubble-body
   αντί να το ξεπερνάνε όταν κάποιο κελί (π.χ. μεγάλη περιγραφή ΚΑΔ ή τίτλος
   απόφασης) είναι πλατύτερο από τη διαθέσιμη στήλη — αυτό ήταν η αιτία που
   το περιεχόμενο "ξέφευγε" έξω από το πλαίσιο του bubble (12/09/2026).
   Το overflow-x στο .bubble-body (πάνω) μένει σαν δίχτυ ασφαλείας. */
.bubble table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13.5px; margin-top: 6px; }
.bubble th, .bubble td {
  text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top;
  overflow-wrap: break-word; word-wrap: break-word; word-break: break-word;
}
.bubble th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px; }
.bubble table + table { margin-top: 16px; }

/* Μικροί συνοπτικοί πίνακες (π.χ. ανάλυση εισφορών) — ΔΕΝ τεντώνονται σε
   όλο το πλάτος του bubble σαν τους κανονικούς πίνακες εγγραφών, αλλιώς η
   πρώτη στήλη (χωρίς δηλωμένο πλάτος) απορροφά όλο το ελεύθερο πλάτος και
   αφήνει τεράστιο κενό πριν από τη 2η στήλη. table-layout:auto εδώ ώστε οι
   στήλες να παίρνουν όσο πλάτος χρειάζεται το περιεχόμενό τους. */
.bubble table.compact-table { width: auto; table-layout: auto; min-width: auto; }
/* min-width: auto εδώ ακυρώνει το min-width:860px του γενικού `table` κανόνα
   στο κοινό app.css (πλάτος σχεδιασμένο για τους μεγάλους πίνακες εγγραφών) —
   χωρίς αυτό, ο browser αναγκαζόταν να μοιράσει 860px ανάμεσα στις στήλες
   παρά το table-layout:auto, γι' αυτό εμφανιζόταν τεράστιο κενό στους μικρούς
   συνοπτικούς πίνακες (ανάλυση εισφορών, ΚΑΔ/Δραστηριότητες) (19/09/2026). */

/* Ποσά (π.χ. Σύνολο εισφορών) δεξιά στοιχισμένα· γραμμή συνόλου έντονη +
   υπογραμμισμένη — on-screen μόνο. Το PDF export (jsPDF, βλ. assets/
   pdf-export.js) δεν διαβάζει αυτό το CSS· η ισοδύναμη στοίχιση/έντονη
   γραμμή εκεί γίνεται με columnStyles/didParseCell στο autoTable. */
.bubble td.amt, .bubble th.amt { text-align: right; }
.bubble .total-row td { font-weight: 700; text-decoration: underline; border-top: 2px solid var(--line); }

.objective-text { white-space: pre-wrap; margin: 6px 0 0; }

.kad-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--orange-soft); border: 1px solid var(--orange-border); color: var(--navy);
  font-size: 12.5px; font-weight: 600; padding: 4px 10px;
}

.kad-main-flag {
  display: inline-block;
  font-size: 10.5px;
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
  background: var(--orange-soft);
  color: var(--heading);
  border: 1px solid var(--orange-border);
}

/* text-align: left εδώ γιατί το `<button>` έχει από προεπιλογή στα browsers
   text-align: center — αόρατο όσο το κείμενο χωράει σε μία γραμμή, αλλά
   κεντράρει κάθε γραμμή όταν ο τίτλος μιας απόφασης είναι αρκετά μεγάλος
   ώστε να "σπάσει" σε 2+ γραμμές μέσα στο κελί του πίνακα — γι' αυτό
   κάποιες αποφάσεις (αυτές με κουμπί λήψης PDF) εμφανίζονταν κεντραρισμένες
   ενώ οι υπόλοιπες (απλό κείμενο, χωρίς κουμπί) έμεναν αριστερά. */
.link-like {
  background: none; border: none; padding: 0; height: auto; text-align: left;
  color: var(--orange); text-decoration: underline; font: inherit; cursor: pointer;
}
.link-like:hover { background: none; color: var(--heading); }

/* ---------- «Ιστορικό Αποφάσεων» — καρτέλες ανά θεματική κατηγορία ----------
   Ίδιο μοτίβο .tabs/.tab με το κοινό app.css (βλ. ΚΗΜΔΗΣ app.html, Διαύγεια
   assets/*.js) — εδώ μόνο μέσα σε ένα bubble αντί για ολόκληρη σελίδα, οπότε
   λίγο μικρότερο περιθώριο πάνω/κάτω. */
.bubble .tabs { margin: 0 0 12px; }
.tab-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--hover);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.tab[aria-selected="true"] .tab-count { background: var(--orange-soft); color: var(--orange); }
.decision-panel[hidden] { display: none; }

/* Προειδοποίηση όταν μια ζωντανή κλήση ΚΗΜΔΗΣ απέτυχε και σερβιρίστηκε
   παλιότερο (stale) cache — βλ. kimdisFreshnessLabel() στο app.js. */
.kimdis-partial-warning { display: block; margin-top: 2px; color: var(--orange); }

/* ---------- Advanced (live ΓΕΜΗ) search ---------- */
#advanced-search { border: 1px solid var(--line); padding: 12px 16px; }
#advanced-search > summary { cursor: pointer; font-weight: 600; color: var(--heading); list-style: none; }
#advanced-search > summary::-webkit-details-marker { display: none; }
#advanced-search > summary::before { content: "▸ "; }
#advanced-search[open] > summary::before { content: "▾ "; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
#advanced-search select {
  width: 100%; padding: 6px 10px; border: 1px solid var(--line);
  font-size: 14px; color: var(--text); background: var(--surface); font-family: inherit;
}
#advanced-search select:focus { outline: 2px solid var(--orange); outline-offset: -1px; }

/* ---------- Popover επιλογής παραρτημάτων (#gemi-appendix-popover) ----------
   Ίδιο .gemi-popover* shell με το KIMDIS app (apps/assets/app.css) — εδώ μόνο
   ό,τι είναι ειδικό για τη λίστα checkboxes/quick-actions του GEMI export. */
#gemi-appendix-popover .gemi-popover-card { max-width: 420px; }
#gemi-appendix-popover h3 { margin: 0 24px 4px 0; font-size: 16px; color: var(--heading); }
.appendix-quick-actions { display: flex; align-items: center; gap: 8px; margin: 10px 0 14px; font-size: 13px; }
.appendix-list { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.appendix-list label { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.appendix-list input[type="checkbox"] { margin-top: 2px; }
#appendix-kimdis-note { margin: 10px 0 0; }
.appendix-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- Υπομενού κατηγοριών μέσα σε Παράρτημα Β/Ε (19/09/2026) ---------- */
.appendix-submenu { list-style: none; margin: 4px 0 0 26px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.appendix-submenu label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.appendix-submenu input[type="checkbox"] { margin: 0; }
.appendix-list > li.appendix-disabled .appendix-submenu { opacity: .45; pointer-events: none; }

/* Αρ. ΓΕΜΗ clickable (19/09/2026): δοκιμάστηκε overlay με iframe, αλλά το
   businessportal.gr γυρνάει "500 Internal Server Error" όταν φορτώνεται μέσα
   σε iframe από άλλο domain (δουλεύει μόνο ως top-level navigation) — οπότε
   μείναμε σε απλό link με target="_blank" (βλ. contactFieldHtml στο app.js). */
