/* =====================================================================
   Diatrofon B2B — φύλλο στυλ
   Σκόπιμα «πυκνό» και λειτουργικό: οι επαγγελματίες παραγγέλνουν γρήγορα,
   δεν περιηγούνται για διασκέδαση.
   ===================================================================== */

:root {
  --green: #1f5c3d;
  --green-dark: #17422c;
  --green-light: #e8f3ed;
  --amber: #b8860b;
  --red: #b3261e;
  --ink: #1a1a1a;
  --muted: #6b7280;
  --line: #e3e6e3;
  --bg: #f7f8f7;
  --white: #fff;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

* { box-sizing: border-box; }

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

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

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ------------------------------------------------------------ header */
.topbar {
  background: var(--green-dark);
  color: #cfe3d8;
  font-size: 13px;
  padding: 6px 0;
}
.topbar a { color: #fff; }
.topbar .wrap { display: flex; gap: 16px; align-items: center; justify-content: space-between; }

header.main { background: var(--white); border-bottom: 1px solid var(--line); }
header.main .wrap {
  display: flex; align-items: center; gap: 20px; padding-top: 12px; padding-bottom: 12px;
}
.logo { font-size: 22px; font-weight: 700; color: var(--green); white-space: nowrap; }
.logo small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

.searchbar { flex: 1; display: flex; }
.searchbar input {
  flex: 1; padding: 10px 14px; border: 1px solid var(--line); border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius); font-size: 15px;
}
.searchbar button {
  padding: 10px 18px; border: 0; background: var(--green); color: #fff;
  border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; font-size: 15px;
}

.headlinks { display: flex; gap: 14px; align-items: center; white-space: nowrap; }
.cartbtn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--green-light); color: var(--green-dark);
  padding: 8px 14px; border-radius: var(--radius); font-weight: 600;
}
.cartbtn .badge {
  background: var(--green); color: #fff; border-radius: 999px;
  padding: 0 7px; font-size: 12px; min-width: 20px; text-align: center;
}

nav.cats { background: var(--white); border-bottom: 1px solid var(--line); }
nav.cats .wrap { display: flex; gap: 18px; overflow-x: auto; padding-top: 8px; padding-bottom: 8px; font-size: 14px; }
nav.cats a { color: var(--ink); white-space: nowrap; }

/* -------------------------------------------------------------- main */
main { padding: 24px 0 60px; }
h1 { font-size: 26px; margin: 0 0 16px; }
h2 { font-size: 19px; margin: 28px 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }

.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.layout { display: grid; grid-template-columns: 250px 1fr; gap: 24px; align-items: start; }

/* ------------------------------------------------------------ alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; }
.alert.success { background: #eaf6ee; border-color: #bcdcc8; color: #14532d; }
.alert.error { background: #fdecea; border-color: #f5c6c2; color: #7f1d1d; }
.alert.info { background: #eef4fb; border-color: #c7d9ef; color: #1e3a5f; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

.notice-strip {
  background: var(--amber); color: #fff; text-align: center; padding: 8px 16px; font-size: 14px;
}

/* ---------------------------------------------------------- προϊόντα */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; }
.product {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden; position: relative;
}
.product .thumb {
  aspect-ratio: 1; background: #fafafa; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.product .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.product .body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; gap: 6px; }
.product .name { font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.product .sku { font-size: 11px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
.product .price { font-size: 19px; font-weight: 700; color: var(--green-dark); margin-top: auto; }
.product .price small { font-size: 11px; font-weight: 500; color: var(--muted); display: block; }
.product .locked { font-size: 13px; color: var(--muted); margin-top: auto; }

.badge-oos {
  position: absolute; top: 8px; left: 8px; background: var(--red); color: #fff;
  font-size: 11px; padding: 3px 8px; border-radius: 4px; font-weight: 600;
}
.badge-pack {
  position: absolute; top: 8px; right: 8px; background: var(--amber); color: #fff;
  font-size: 11px; padding: 3px 8px; border-radius: 4px;
}
.product.oos .thumb img { opacity: .45; }

/* ------------------------------------------------------------ φόρμες */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: #374151; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel],
select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 15px; font-family: inherit; background: var(--white);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green-light); border-color: var(--green); }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 18px; }
legend { font-weight: 700; padding: 0 8px; font-size: 14px; }

.btn {
  display: inline-block; padding: 10px 20px; border-radius: var(--radius); border: 1px solid transparent;
  background: var(--green); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
  text-align: center; font-family: inherit;
}
.btn:hover { background: var(--green-dark); text-decoration: none; }
.btn.ghost { background: var(--white); color: var(--green); border-color: var(--green); }
.btn.grey { background: #eceeec; color: #374151; }
.btn.danger { background: var(--red); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.qty { display: flex; gap: 6px; align-items: center; }
.qty input { width: 84px; text-align: center; }

/* ------------------------------------------------------------ πίνακες */
table.data { width: 100%; border-collapse: collapse; background: var(--white); font-size: 14px; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.data th { background: #f3f5f3; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #4b5563; }
table.data td.right, table.data th.right { text-align: right; }
table.data tr:hover td { background: #fbfcfb; }

/* -------------------------------------------------------- πλαϊνό μενού */
.sidebar { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; position: sticky; top: 12px; }
.sidebar h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a { display: block; padding: 5px 6px; border-radius: 4px; color: var(--ink); font-size: 14px; }
.sidebar li a:hover { background: var(--green-light); text-decoration: none; }
.sidebar li a.active { background: var(--green); color: #fff; font-weight: 600; }
.sidebar ul ul { margin-left: 10px; border-left: 1px solid var(--line); padding-left: 6px; }
.sidebar .count { color: var(--muted); font-size: 12px; }

/* ----------------------------------------------------------- σύνολα */
.totals { font-size: 15px; }
.totals .row { display: flex; justify-content: space-between; padding: 6px 0; }
.totals .row.big { font-size: 20px; font-weight: 700; border-top: 2px solid var(--line); margin-top: 8px; padding-top: 12px; }
.totals .row .muted { color: var(--muted); font-size: 13px; }

.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.chip.new { background: #e0ecff; color: #1e40af; }
.chip.confirmed { background: #e8f3ed; color: #14532d; }
.chip.packing { background: #fff3d6; color: #7c4a03; }
.chip.shipped { background: #ddeeff; color: #075985; }
.chip.delivered { background: #e6f6e6; color: #14532d; }
.chip.cancelled { background: #f3f4f6; color: #6b7280; }
.chip.pending { background: #fff3d6; color: #7c4a03; }
.chip.approved { background: #e8f3ed; color: #14532d; }
.chip.rejected { background: #fdecea; color: #7f1d1d; }
.chip.suspended { background: #f3f4f6; color: #6b7280; }

.pager { display: flex; gap: 6px; justify-content: center; margin: 24px 0; flex-wrap: wrap; }
.pager a, .pager span {
  padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); color: var(--ink); font-size: 14px;
}
.pager .current { background: var(--green); color: #fff; border-color: var(--green); }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, monospace; }
.right { text-align: right; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* -------------------------------------------------------------- footer */
footer {
  background: var(--green-dark); color: #cfe3d8; padding: 32px 0; margin-top: 40px; font-size: 14px;
}
footer a { color: #fff; }
footer .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* -------------------------------------------------------------- admin */
.admin-nav { background: #1f2937; }
.admin-nav .wrap { display: flex; gap: 4px; overflow-x: auto; padding: 0; }
.admin-nav a { color: #d1d5db; padding: 12px 14px; font-size: 14px; white-space: nowrap; }
.admin-nav a:hover, .admin-nav a.active { background: #111827; color: #fff; text-decoration: none; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .n { font-size: 30px; font-weight: 700; color: var(--green-dark); line-height: 1.1; }
.stat .l { font-size: 13px; color: var(--muted); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .cols-3, .cols-2 { grid-template-columns: 1fr; }
  header.main .wrap { flex-wrap: wrap; }
  .searchbar { order: 3; width: 100%; }
  footer .cols { grid-template-columns: 1fr; }
}

@media print {
  header, nav, footer, .noprint { display: none !important; }
  body { background: #fff; }
}
