/* Cloud CMS styles — matched με local CMS aesthetic (cream/navy/gold) */
:root {
  --cream: #FCF5EB;
  --navy: #2C2C3A;
  --gold: #D4901E;
  --success: #155724;
  --danger: #b71c1c;
  --border: #e0d9c8;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
       background: var(--cream); color: var(--navy); margin: 0;
       overflow-x: hidden; }

header { background: var(--navy); color: white; padding: 10px 24px;
         display: flex; align-items: center; gap: 14px; }
header .logo { width: 48px; height: 48px; border-radius: 8px; flex-shrink: 0;
               background: var(--cream); padding: 3px;
               display: flex; align-items: center; justify-content: center; }
header .logo img { width: 100%; height: 100%; object-fit: contain; }
header .brand { font-weight: 600; font-size: 18px; color: var(--gold); }
header nav { margin-left: auto; display: flex; gap: 16px; align-items: center; }
header nav a { color: #ccc; text-decoration: none; font-size: 14px; padding: 6px 10px; border-radius: 4px; }
header nav a:hover, header nav a.active { color: white; background: rgba(255,255,255,0.1); }
header nav .linkish { background: none; border: none; color: #ccc; cursor: pointer;
                     font-size: 14px; padding: 6px 10px; border-radius: 4px; }
header nav .linkish:hover { color: white; background: rgba(255,255,255,0.1); }
header .nav-toggle { display: none; margin-left: auto; background: none; border: none;
                      color: white; font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 8px; }
.nav-backdrop { display: none; }

main { max-width: 1100px; margin: 0 auto; padding: 20px; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Sortable column headers (2026-08-20) — μικρά ▲▼ κουμπάκια δίπλα σε <th>, κλικ =
   ταξινόμηση tbody rows client-side. Χρειάζεται στη γειτονική td ένα data-<key>
   attribute που να ταιριάζει με το data-sort-key του button. Χρησιμοποιείται στο
   admin_products.html (Κατηγορία/Υποκατ.) και στο masterImportTable του
   event_products.html (Κατηγορία) — global ώστε να μη ξαναγράφεται το CSS ανά σελίδα. */
.sort-arrows { display: inline-flex; gap: 2px; margin-left: 4px; }
.sort-arrow { border: none; background: none; cursor: pointer; padding: 0 2px; font-size: 10px;
              color: #999; line-height: 1; }
.sort-arrow:hover { color: var(--navy); }
.sort-arrow.active { color: var(--gold); }

/* Χρησιμοποιείται σε event_dashboard.html + event_settings.html — πριν ζούσε scoped
   μόνο μέσα στο <style> του event_settings.html (2026-08-19: μετακινήθηκε εδώ, ώστε
   να δουλεύει και στο dashboard, και να collapse-άρει σε 1 στήλη σε κινητό). */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.card { background: white; border: 0.5px solid var(--border); border-radius: 8px;
        padding: 16px 20px; margin-bottom: 14px; }
.card h2 { margin: 0 0 12px; color: var(--gold); font-size: 18px; }
.card h3 { margin: 8px 0; color: var(--navy); font-size: 14px; }

table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { padding: 8px 6px; text-align: left; border-bottom: 0.5px solid var(--border); font-size: 14px; }
th { background: #faf3e5; color: var(--navy); font-weight: 500; font-size: 12px;
     text-transform: uppercase; letter-spacing: 0.4px; }

input[type=text], input[type=password], input[type=number], select {
  padding: 6px 10px; border: 0.5px solid var(--border); border-radius: 4px;
  font-size: 14px; background: white; font-family: inherit;
}
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: -1px; }

button { padding: 8px 14px; border: 0.5px solid #ccc; border-radius: 4px;
         background: white; cursor: pointer; font-size: 14px; font-family: inherit; }
button:hover { background: #f5f5f5; }
button.primary { background: var(--gold); color: white; border-color: var(--gold); font-weight: 500; }
button.primary:hover { background: #b57a15; }
button.danger { background: #fdecea; color: var(--danger); border-color: #f5c4c1; }
button.danger:hover { background: #f8d7d5; }
button.outline { background: white; }

.row-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-form input, .row-form select { min-width: 100px; }

.muted { color: #888; }
code { background: #f5f5f5; padding: 2px 6px; border-radius: 3px; font-size: 12px; }
a { color: #0066cc; }

details summary { user-select: none; }

.link-stack { display: flex; flex-direction: column; gap: 3px; }

.addon-stack { display: flex; flex-direction: column; gap: 4px; }
.addon-stack .addon { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.addon-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.addon-dot.on { background: var(--success, #2e7d32); }
.addon-dot.off { background: #d9d3c4; }
.addon-stack .addon.off { color: #999; }

/* ── Mobile (κινητό) — hamburger + side menu αντί για nav που σπάει/ξεχειλίζει,
   πίνακες scroll-άρουν εντός `.table-scroll` αντί να σπρώχνουν πλαγίως όλη τη σελίδα ── */
@media (max-width: 700px) {
  header { padding: 10px 16px; }
  header .logo { width: 40px; height: 40px; }
  header .brand { font-size: 15px; }
  header .nav-toggle { display: inline-flex; align-items: center; }

  header nav {
    position: fixed; top: 0; right: -260px; width: 240px; height: 100vh;
    margin-left: 0; background: var(--navy); flex-direction: column; align-items: stretch;
    gap: 2px; padding: 64px 14px 14px; box-shadow: -6px 0 16px rgba(0,0,0,.3);
    transition: right 0.25s ease; z-index: 1000; overflow-y: auto;
  }
  header nav.open { right: 0; }
  header nav a, header nav .linkish { width: 100%; font-size: 15px; padding: 10px 10px; text-align: left; }

  .nav-backdrop.open {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 999;
  }

  main { padding: 14px; }
  .card { padding: 14px; }

  th, td { padding: 6px 8px; }

  .row-form { flex-direction: column; align-items: stretch; }
  .row-form input, .row-form select, .row-form label { width: 100%; min-width: 0; }
  .row-form label { white-space: normal !important; display: flex !important;
                     align-items: center; gap: 6px; }

  /* Inline 2-column grids (edit-forms κτλ) → 1 στήλη σε στενή οθόνη.
     Χρειάζεται !important επειδή ο inline grid-template-columns κερδίζει specificity.
     Το white-space:normal είναι απαραίτητο ρητά εδώ (ΟΧΙ μόνο .row-form) επειδή αυτό
     το div ζει μέσα σε <td> — αν το td είχε nowrap θα το κληρονομούσε και θα φούσκωνε
     ξανά το table. */
  .edit-grid { grid-template-columns: 1fr !important; }
  .edit-grid, .edit-grid * { white-space: normal !important; }

  .grid-2 { grid-template-columns: 1fr; }
}
