/* Μητρώο Μελών — stylesheet χωρίς build step */
:root {
    --brand: #1f5f8b;
    --brand-ink: color-mix(in srgb, var(--brand) 78%, black);
    --brand-soft: color-mix(in srgb, var(--brand) 10%, white);
    --brand-line: color-mix(in srgb, var(--brand) 24%, white);
    --bg: #f5f4f0;
    --surface: #ffffff;
    --surface-2: #faf9f6;
    --ink: #1d232b;
    --ink-2: #4a5360;
    --ink-3: #7a828d;
    --line: #e4e1da;
    --line-2: #efede8;
    --ok: #2f7d4f;
    --ok-soft: #e6f3eb;
    --warn: #a86512;
    --warn-soft: #fbf0df;
    --bad: #b23a3a;
    --bad-soft: #f9e6e4;
    --side: #18202a;
    --side-2: #222c38;
    --side-ink: #c5cdd7;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(20, 24, 30, .04), 0 2px 8px rgba(20, 24, 30, .04);
    --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--ink); background: var(--bg); }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; font-weight: 650; }
h2 { font-size: 1.05rem; font-weight: 620; }
h3 { font-size: .95rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--ink-3); }
.num, td.num, .tabnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }
.icon { width: 18px; height: 18px; flex: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 248px; flex: none; background: var(--side); color: var(--side-ink);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40;
}
.brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1.1rem 1rem; color: #fff; text-decoration: none !important; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 1.05rem; color: #fff; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: #8995a3; font-size: .75rem; }
.nav { padding: .75rem .6rem; overflow-y: auto; flex: 1; }
.nav-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #6f7b89; padding: 1rem .65rem .35rem; }
.nav-link { display: flex; align-items: center; gap: .7rem; padding: .5rem .65rem; border-radius: 8px; color: var(--side-ink); font-weight: 500; text-decoration: none !important; }
.nav-link:hover { background: var(--side-2); color: #fff; }
.nav-link.active { background: color-mix(in srgb, var(--brand) 55%, var(--side)); color: #fff; }
.nav-link .icon { opacity: .85; }
.sidebar-foot { display: flex; align-items: center; gap: .5rem; padding: .8rem .8rem; border-top: 1px solid rgba(255,255,255,.06); }
.me { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 0; color: #fff; text-decoration: none !important; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--side-2); display: grid; place-items: center; font-weight: 600; flex: none; }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-text strong { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { font-size: .72rem; color: #8995a3; }
.sidebar .icon-btn { color: var(--side-ink); }
.sidebar .icon-btn:hover { background: var(--side-2); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .75rem; padding: .65rem 1.75rem; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-search { flex: 1; max-width: 620px; position: relative; display: flex; align-items: center; }
.top-search .icon { position: absolute; left: .75rem; color: var(--ink-3); }
.top-search input { width: 100%; padding: .55rem .9rem .55rem 2.4rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font: inherit; }
.top-search input:focus { outline: 2px solid var(--brand-line); border-color: var(--brand); }
.menu-toggle { display: none; }
.content { padding: 1.5rem 1.75rem 3rem; max-width: 1400px; width: 100%; }
.backdrop { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-3); margin-top: .2rem; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: .3rem; color: var(--ink-3); font-size: .85rem; margin-bottom: .35rem; }

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1.15rem; border-bottom: 1px solid var(--line-2); }
.card-head h2 { display: flex; align-items: center; gap: .5rem; }
.card-head h2 .icon { color: var(--brand); }
.card-body { padding: 1.15rem; }
.card-foot { padding: .75rem 1.15rem; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card + .card, .stack > * + * { margin-top: 1.25rem; }
.grid > .card + .card, .grid > * + * { margin-top: 0; }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-full { grid-column: 1 / -1; }
.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }

.stat { padding: 1rem 1.15rem; }
.stat-label { color: var(--ink-3); font-size: .8rem; font-weight: 500; }
.stat-value { font-size: 1.75rem; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin-top: .15rem; }
.stat-note { font-size: .8rem; color: var(--ink-3); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .52rem .95rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 550; cursor: pointer; text-decoration: none !important; white-space: nowrap; line-height: 1.2; }
.btn:hover { background: var(--surface-2); border-color: #d3cfc6; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: #ecc4c0; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: .38rem .7rem; font-size: .85rem; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--line-2); }
.inline { display: inline; }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-brand { background: var(--brand-soft); color: var(--brand-ink); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

.alert { display: flex; gap: .65rem; align-items: flex-start; padding: .8rem 1rem; border-radius: 9px; margin-bottom: 1.1rem; border: 1px solid; }
.alert ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.alert-success { background: var(--ok-soft); border-color: #c4e2cf; color: #1f5a37; }
.alert-error { background: var(--bad-soft); border-color: #ecc4c0; color: #852a2a; }
.alert-info { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
.alert-warn { background: var(--warn-soft); border-color: #efd6ad; color: #7c4a0c; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .62rem .9rem; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.table th a { color: inherit; }
.table tbody tr:hover { background: #fbfaf7; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; }
.table .row-link { color: var(--ink); font-weight: 600; }
.table .actions-cell { text-align: right; white-space: nowrap; }
.table tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--line); }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--ink-3); }
.empty .icon { width: 34px; height: 34px; opacity: .5; margin-bottom: .4rem; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem 1.1rem; }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; } .col-2 { grid-column: span 2; }
.field label, .label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-bottom: .3rem; }
.field .hint { font-size: .78rem; color: var(--ink-3); margin-top: .25rem; }
.field .err { font-size: .8rem; color: var(--bad); margin-top: .25rem; }
.req::after { content: " *"; color: var(--bad); }
.input, select.input, textarea.input {
    width: 100%; padding: .52rem .7rem; border: 1px solid #d9d5cc; border-radius: 8px; background: #fff;
    font: inherit; color: var(--ink); line-height: 1.35;
}
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { outline: 2px solid var(--brand-line); border-color: var(--brand); }
.input.is-invalid { border-color: var(--bad); }
.input-group { display: flex; gap: .5rem; }
.check { display: inline-flex; align-items: center; gap: .5rem; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.form-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 650; grid-column: span 12; padding-top: .5rem; border-top: 1px dashed var(--line); margin-top: .25rem; }
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.form-actions { display: flex; gap: .6rem; justify-content: flex-end; padding-top: .5rem; }

.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; padding: .9rem 1.15rem; border-bottom: 1px solid var(--line-2); }
.filters .field { min-width: 150px; }
.filters .field.grow { flex: 1; min-width: 220px; }
.filters label { font-size: .74rem; }

/* ---------- details ---------- */
.dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: .55rem 1rem; margin: 0; }
.dl dt { color: var(--ink-3); font-size: .84rem; }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.profile-head { display: flex; gap: 1.1rem; align-items: center; }
.profile-avatar { width: 64px; height: 64px; border-radius: 16px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-size: 1.5rem; font-weight: 700; flex: none; }
.amm { font-family: var(--mono); font-weight: 600; color: var(--brand-ink); background: var(--brand-soft); padding: .1rem .45rem; border-radius: 6px; font-size: .85rem; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--line-2); }
.list-plain li:last-child { border-bottom: 0; }

/* ---------- modules page ---------- */
.module-card { display: flex; flex-direction: column; padding: 1.1rem 1.15rem; gap: .6rem; }
.module-card.off { background: var(--surface-2); }
.module-card.off .module-icon { background: var(--line-2); color: var(--ink-3); }
.module-top { display: flex; align-items: flex-start; gap: .8rem; }
.module-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); flex: none; }
.module-icon .icon { width: 20px; height: 20px; }
.module-meta { font-size: .78rem; color: var(--ink-3); display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.module-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: .6rem; border-top: 1px solid var(--line-2); }
.switch { position: relative; width: 42px; height: 24px; border-radius: 999px; background: #cfcac0; border: 0; cursor: pointer; transition: background .15s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch.on { background: var(--ok); }
.switch.on::after { transform: translateX(18px); }

/* ---------- bars (reports) ---------- */
.bars { display: flex; flex-direction: column; gap: .5rem; }
.bar-row { display: grid; grid-template-columns: 140px minmax(0, 1fr) 90px; gap: .75rem; align-items: center; font-size: .86rem; }
.bar-track { height: 10px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 999px; }
.bar-row .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.colchart { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 1rem; }
.colchart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.colchart .colbar { width: 100%; max-width: 38px; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.colchart .colbar:hover { background: var(--brand-ink); }
.colchart .lbl { font-size: .7rem; color: var(--ink-3); white-space: nowrap; }

/* ---------- pagination ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1.15rem; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.pager-links { display: flex; gap: .25rem; flex-wrap: wrap; }
.pager-links a, .pager-links span { min-width: 32px; height: 32px; padding: 0 .55rem; display: inline-grid; place-items: center; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: .85rem; text-decoration: none; }
.pager-links .current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager-links .disabled { opacity: .45; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: var(--side); color: #dfe5ec; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::before { content: ""; position: absolute; inset: 0; background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(255,255,255,.035) 31px 32px),
    radial-gradient(600px 400px at 85% 15%, color-mix(in srgb, var(--brand) 55%, transparent), transparent 70%); }
.auth-art > * { position: relative; }
.auth-art h1 { font-size: 2.2rem; color: #fff; max-width: 14ch; margin-top: 1rem; }
.auth-art p { color: #9aa6b4; max-width: 42ch; }
.auth-form { display: grid; place-items: center; padding: 2rem; }
.auth-form .card { width: 100%; max-width: 400px; }

/* ---------- utilities ---------- */
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; } .wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.text-right { text-align: right; } .text-ok { color: var(--ok); } .text-bad { color: var(--bad); } .text-warn { color: var(--warn); }
.fw-6 { font-weight: 600; } .nowrap { white-space: nowrap; } .small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .layout-side { grid-template-columns: minmax(0, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.3); }
    .shell.nav-open .sidebar { transform: none; }
    .shell.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(10, 14, 20, .4); z-index: 35; }
    .menu-toggle { display: inline-grid; }
    .topbar { padding: .6rem 1rem; }
    .content { padding: 1.1rem 1rem 3rem; }
    .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
    .span-2 { grid-column: auto; }
    .col-8, .col-6, .col-4, .col-3, .col-2 { grid-column: span 12; }
    .hide-sm { display: none !important; }
    .auth { grid-template-columns: 1fr; }
    .auth-art { display: none; }
    .dl { grid-template-columns: 120px minmax(0, 1fr); }
    .bar-row { grid-template-columns: 100px minmax(0, 1fr) 70px; }
}
@media (max-width: 520px) {
    .grid-4 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- print ---------- */
@media print {
    .sidebar, .topbar, .page-head .actions, .no-print, .filters, .pager { display: none !important; }
    body { background: #fff; }
    .content { padding: 0; max-width: none; }
    .card { box-shadow: none; border-color: #ccc; }
}
.colchart .cv { font-size: .66rem; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
details summary::-webkit-details-marker { color: var(--ink-3); }

/* ---------- branding ---------- */
.image-setting { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.image-preview { width: 180px; height: 96px; border: 1px solid var(--line); border-radius: 10px; display: grid; place-items: center; padding: .6rem;
    background: repeating-conic-gradient(#f1efea 0 25%, #fff 0 50%) 50% / 16px 16px; }
.image-preview img { max-width: 160px; max-height: 80px; object-fit: contain; display: block; }
.image-preview { overflow: hidden; }
.image-preview.is-empty { background: var(--surface-2); }
.brand-logo { background: #fff; border-radius: 9px; padding: 4px 6px; display: grid; place-items: center; flex: none; height: 40px; max-width: 150px; }
.brand-logo img { max-height: 32px; max-width: 138px; object-fit: contain; display: block; }
.brand.has-logo { flex-direction: column; align-items: flex-start; gap: .6rem; }
.brand.has-logo .brand-logo { height: 56px; max-width: 212px; padding: 6px 12px; }
.brand.has-logo .brand-logo img { max-height: 44px; max-width: 188px; }
.brand.has-logo .brand-text strong { white-space: normal; line-height: 1.25; }
.auth-logo { background: #fff; border-radius: 14px; padding: 12px 16px; display: inline-grid; place-items: center; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.auth-logo img { max-height: 72px; max-width: 260px; object-fit: contain; display: block; }
.auth-art.has-photo { background-size: cover; background-position: center; }
.auth-art.has-photo::before { background: linear-gradient(160deg, rgba(16,22,30,.82), rgba(16,22,30,.55) 55%, color-mix(in srgb, var(--brand) 55%, rgba(16,22,30,.7))); }
.auth-art .lead { white-space: pre-line; }
.auth-mobile-brand { display: none; text-align: center; margin-bottom: 1.25rem; }
.auth-mobile-brand img { max-height: 64px; max-width: 220px; object-fit: contain; }
.auth-mobile-brand strong { display: block; font-size: 1.1rem; margin-top: .4rem; }
.dash-notice { white-space: pre-line; }
@media (max-width: 1100px) { .auth-mobile-brand { display: block; } .auth-form { align-content: center; } }

/* ---------- footer ---------- */
.app-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: .5rem 1.5rem; flex-wrap: wrap;
    padding: 1rem 1.75rem; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .78rem; max-width: 1400px; width: 100%; }
.app-footer a { color: var(--ink-2); font-weight: 600; }
.app-footer a:hover { color: var(--brand-ink); }
.app-version { font-family: var(--mono); background: var(--line-2); color: var(--ink-2); padding: .05rem .4rem; border-radius: 5px; font-size: .72rem; }
.auth-form .app-footer { border-top: 0; padding: 1.25rem 0 0; max-width: 400px; justify-content: center; text-align: center; }
@media (max-width: 860px) { .app-footer { padding: 1rem; justify-content: center; text-align: center; } }
@media print { .app-footer { display: none; } }
