/* ===== CRM — style ===== */
:root {
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-2: #f9f8f5;
  --line: #e4e1d9;
  --text: #1d1c1a;
  --muted: #706c64;
  --accent: #2f5d50;
  --accent-ink: #ffffff;
  --accent-soft: #e3ece8;
  --side: #1f2a26;
  --side-text: #c9d3cf;
  --side-on: #ffffff;
  --pos: #23744a;
  --neg: #b23a2e;
  --warn: #a8670b;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(30, 28, 24, .05), 0 2px 8px rgba(30, 28, 24, .04);

  --t-green-bg: #e2f1e7; --t-green: #1f6b41;
  --t-amber-bg: #fbefd8; --t-amber: #8a5409;
  --t-red-bg: #fbe3df;   --t-red: #a3301f;
  --t-blue-bg: #e2ebf7;  --t-blue: #2a5390;
  --t-violet-bg: #ece6f7; --t-violet: #5b3d93;
  --t-grey-bg: #ecebe7;  --t-grey: #5d5a54;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151716;
    --surface: #1d201f;
    --surface-2: #232726;
    --line: #313634;
    --text: #e9ebe9;
    --muted: #98a09c;
    --accent: #7fc2ab;
    --accent-ink: #10201a;
    --accent-soft: #23362f;
    --side: #101211;
    --side-text: #9aa6a1;
    --side-on: #ffffff;
    --pos: #6fcf97;
    --neg: #f08a7c;
    --warn: #e6b45c;
    --shadow: none;

    --t-green-bg: #1f3a2b; --t-green: #8fdcae;
    --t-amber-bg: #3d3018; --t-amber: #f0c472;
    --t-red-bg: #45231e;   --t-red: #f5a196;
    --t-blue-bg: #1f2c42;  --t-blue: #9dbcf0;
    --t-violet-bg: #2f2645; --t-violet: #c3aef0;
    --t-grey-bg: #2a2e2c;  --t-grey: #b3b9b6;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; font-weight: 650; }
h2 { font-size: 1.02rem; font-weight: 620; }
h3 { font-size: .85rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .4rem; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
[hidden] { display: none !important; }

.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

/* ----- Shell ----- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  background: var(--side); color: var(--side-text);
  display: flex; flex-direction: column; gap: 1.2rem;
  padding: 1.1rem .8rem; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--side-on); font-weight: 650; font-size: 1.05rem; padding: .2rem .5rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .95rem;
}
.brand.big { color: var(--text); font-size: 1.25rem; margin-bottom: 1.2rem; padding: 0; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .side-foot a {
  display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 8px;
  color: var(--side-text); font-weight: 500;
}
.nav a:hover, .side-foot a:hover { background: rgba(255, 255, 255, .06); color: var(--side-on); text-decoration: none; }
.nav a.on { background: rgba(255, 255, 255, .1); color: var(--side-on); }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: .8rem; display: flex; flex-direction: column; gap: 2px; }
.linkbtn { background: none; border: 0; color: var(--side-text); padding: .45rem .7rem; font: inherit; cursor: pointer; text-align: left; width: 100%; border-radius: 8px; }
.linkbtn:hover { color: var(--side-on); background: rgba(255, 255, 255, .06); }

.main { padding: 1.6rem 2rem 3rem; min-width: 0; max-width: 1320px; width: 100%; }
.mobile-bar { display: none; }
.scrim { display: none; }

/* ----- Page head ----- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.crumb { display: inline-block; font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }
.count { font-size: .8rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 1px 8px; border-radius: 99px; vertical-align: middle; margin-left: .25rem; }

/* ----- Buttons ----- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem; justify-content: center;
  padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 550; font-size: .92rem;
  cursor: pointer; white-space: nowrap; line-height: 1.3;
}
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--neg); background: transparent; }
.btn.danger:hover { border-color: var(--neg); }
.btn.small { padding: .3rem .65rem; font-size: .85rem; }
.btn.block { width: 100%; margin-top: .4rem; }

/* ----- Cards ----- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .7rem; }
.card-head a:not(.btn) { font-size: .85rem; }

/* ----- KPIs ----- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: .8rem; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: .9rem 1.1rem; display: flex; flex-direction: column; gap: .15rem; color: var(--text);
}
.kpi:hover { text-decoration: none; border-color: var(--accent); }
.kpi-label { font-size: .8rem; color: var(--muted); font-weight: 550; }
.kpi-val { font-size: 1.6rem; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-val.warn { color: var(--warn); }
.kpi-sub { font-size: .8rem; color: var(--muted); }
.kpi-sub.bad { color: var(--neg); font-weight: 600; }

.money-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: .8rem; }
.money-card { color: var(--text); margin: 0; display: block; }
.money-card:hover { text-decoration: none; border-color: var(--accent); }
.money-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: .4rem; }
.money-grid small, .sumbar small { display: block; font-size: .75rem; color: var(--muted); }
.money-grid b, .sumbar b { font-size: 1.1rem; font-variant-numeric: tabular-nums; font-weight: 650; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; align-items: start; }
.grid2 .card { min-width: 0; }

.sumbar { display: flex; flex-wrap: wrap; gap: .6rem 2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1.2rem; margin-bottom: 1rem; }
.sumbar.inner { background: var(--surface-2); margin: .8rem 0 0; border-radius: 8px; }

/* ----- Filters ----- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .75rem; }
.filters .grow { flex: 1 1 220px; }
.filters select, .filters input[type=date] { width: auto; max-width: 220px; }
label.inline { display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; color: var(--muted); white-space: nowrap; }

/* ----- Inputs ----- */
input[type=text], input[type=search], input[type=email], input[type=tel], input[type=date], input[type=password], input:not([type]), select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; font-size: .93rem;
}
textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; margin: .5rem 0 1rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }

.form h2 { margin: .4rem 0 .8rem; }
.form-grid, form .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.2rem; margin-bottom: 1rem; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: .85rem; font-weight: 600; }
.field.check { justify-content: flex-end; }
.field.check label { display: flex; gap: .5rem; align-items: center; font-weight: 500; padding: .55rem 0; }
.req { color: var(--neg); font-weight: 600; }
.hint { color: var(--muted); font-size: .8rem; }
.err { color: var(--neg); font-size: .8rem; font-weight: 550; }
.has-err input, .has-err select, .has-err textarea { border-color: var(--neg); }
.affix { position: relative; }
.affix input { padding-right: 2rem; }
.affix span { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; padding-top: .4rem; border-top: 1px solid var(--line); margin-top: .4rem; padding-top: 1rem; }
.narrow { max-width: 480px; }

/* ----- Tables ----- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th {
  text-align: left; font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  padding: .55rem .7rem; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2);
}
.tbl th a { color: inherit; }
.tbl td { padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl .col-money { text-align: right; }
.card:not(.flush) .tbl th { background: transparent; }
.card:not(.flush) .tbl th:first-child, .card:not(.flush) .tbl td:first-child { padding-left: 0; }
.card:not(.flush) .tbl th:last-child, .card:not(.flush) .tbl td:last-child { padding-right: 0; }
.rowlink { font-weight: 600; color: var(--text); }
.tbl .empty { text-align: center; color: var(--muted); padding: 1.4rem; }
.is-done .rowlink { text-decoration: line-through; color: var(--muted); }
.w-check { width: 34px; }
.w-check form { margin: 0; }
.tick {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--muted); background: transparent; cursor: pointer; padding: 0;
  display: grid; place-items: center;
}
.tick:hover { border-color: var(--accent); }
.tick.on { background: var(--accent); border-color: var(--accent); }
.tick.on::after { content: ""; width: 5px; height: 9px; border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }

.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.badge.green { background: var(--t-green-bg); color: var(--t-green); }
.badge.amber { background: var(--t-amber-bg); color: var(--t-amber); }
.badge.red { background: var(--t-red-bg); color: var(--t-red); }
.badge.blue { background: var(--t-blue-bg); color: var(--t-blue); }
.badge.violet { background: var(--t-violet-bg); color: var(--t-violet); }
.badge.grey { background: var(--t-grey-bg); color: var(--t-grey); }

/* ----- Details ----- */
.details { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem 1.5rem; margin: 0; }
.details dt { font-size: .78rem; color: var(--muted); font-weight: 600; margin-bottom: .15rem; }
.details dd { margin: 0; overflow-wrap: anywhere; }
.notes { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.prose { white-space: normal; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: .8rem; margin: 1rem 0 0; }

/* ----- Misc ----- */
.flash { padding: .65rem .9rem; border-radius: 8px; margin-bottom: 1rem; font-size: .92rem; font-weight: 500; }
.flash.ok { background: var(--t-green-bg); color: var(--t-green); }
.flash.err { background: var(--t-red-bg); color: var(--t-red); }
.pager { display: flex; gap: .3rem; flex-wrap: wrap; }
.pager a { padding: .3rem .7rem; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.pager a.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state h1 { margin-bottom: 1rem; font-size: 1.2rem; }

/* ----- Login / install ----- */
body.bare { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.bare-main { width: 100%; display: grid; place-items: center; }
.login { width: 100%; max-width: 380px; padding: 1.8rem; }
.login.wide { max-width: 640px; }
.login .field { margin-bottom: .9rem; }
.login .form-grid .field { margin-bottom: 0; }
.login h2 { margin: 1.2rem 0 .4rem; }
.login p { margin: .3rem 0 1rem; font-size: .9rem; }

/* ----- Responsive ----- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 30;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .nav-open .side { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 20; }
  .main { padding: 0 16px 2.5rem; }
  .mobile-bar {
    display: flex; align-items: center; gap: .6rem; margin: 0 -16px 1rem; padding: .6rem 16px;
    background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; font-weight: 650;
  }
  .menu-btn { background: none; border: 0; color: var(--text); padding: .3rem; cursor: pointer; display: grid; }
  .menu-btn .ico { width: 22px; height: 22px; }
  h1 { font-size: 1.3rem; }
  .money-row { grid-template-columns: 1fr; }
  .form-grid, form .form-grid { grid-template-columns: 1fr; }
  .quick .btn { padding: .45rem .7rem; }

  /* Πίνακες ως κάρτες στο κινητό */
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { position: relative; padding: .7rem 0; border-bottom: 1px solid var(--line); }
  .card.flush .tbl tr { padding: .7rem 1rem; }
  .tbl tbody tr:last-child { border-bottom: 0; }
  .tbl td { border: 0; padding: .1rem 0 !important; display: flex; justify-content: flex-end; align-items: center; gap: .4rem; text-align: right; }
  .tbl td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; text-align: left; margin-right: auto; padding-right: .8rem; }
  .tbl td.col-text:nth-child(1)::before, .tbl td.w-check::before { content: none; }
  .tbl tr:has(.w-check) { padding-left: 2.2rem; }
  .card.flush .tbl tr:has(.w-check) { padding-left: 3.2rem; }
  .tbl td.w-check { position: absolute; left: 0; top: .75rem; width: auto; }
  .card.flush .tbl td.w-check { left: 1rem; }
  .tbl tbody tr:hover td { background: transparent; }
  .tbl .empty { justify-content: center; }
  .tbl .empty::before { content: none; }
  .tbl td:has(.rowlink) { font-size: 1rem; justify-content: flex-start; text-align: left; }
  .tbl td:has(.rowlink)::before { content: none; }
  .filters select, .filters input[type=date] { max-width: none; flex: 1 1 140px; }
}

/* ----- Φόρμα με τύπους (Hosting & Domains) ----- */
.section-title { margin: .4rem 0 .2rem; }
.small { font-size: .85rem; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .7rem 0 1rem; }
.chip {
  display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .95rem; border: 1px solid var(--line);
  border-radius: 99px; background: var(--surface); cursor: pointer; font-weight: 550; font-size: .92rem; user-select: none;
}
.chip:hover { border-color: var(--muted); }
.chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); padding: .7rem 1rem .2rem; margin: 0 0 1rem; min-width: 0; }
.panel legend { padding: 0 .4rem; }
.form-grid.cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel .form-grid { margin-bottom: .6rem; }
.danger-zone { margin-top: 1rem; }
@media (max-width: 1100px) { .form-grid.cols3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) { .form-grid.cols3 { grid-template-columns: 1fr; } }
