/* Light Helpdesk — ένα αρχείο CSS, χωρίς εξωτερικές βιβλιοθήκες. Θέμα «B · Brand gradient». */
/* Inter (SIL OFL, αρχεία στο /fonts): φιλοξενείται τοπικά λόγω CSP. */
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("/fonts/inter-greek-wght-normal.woff2") format("woff2"); unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("/fonts/inter-greek-ext-wght-normal.woff2") format("woff2"); unicode-range: U+1F00-1FFF; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("/fonts/inter-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
/* Manrope (SIL OFL): έντονη γραμματοσειρά για τίτλους, μενού, κουμπιά και αριθμούς. */
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("/fonts/manrope-greek-wght-normal.woff2") format("woff2"); unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF; }
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("/fonts/manrope-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("/fonts/manrope-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
    --bg: #eef3f7;
    --surface: #ffffff;
    --surface-2: #f8f9fb;
    --border: #e3e9ef;
    --border-strong: #c9ced6;
    --text: #0f1d2b;
    --muted: #5d6b7a;
    --faint: #8b95a3;
    --brand: #00b6dc;          /* CloudReactions cyan */
    --accent: #007c99;         /* σκουρότερο cyan για κείμενο/κουμπιά (αντίθεση AA) */
    --accent-hover: #006a82;
    --accent-soft: #e2f6fb;
    --danger: #b42318;
    --danger-soft: #fdecea;
    --ok: #1a7f4b;
    --ok-soft: #e7f5ee;
    --warn: #9a6400;
    --warn-soft: #fdf3dc;
    --note: #fff8e1;
    --note-border: #f0dc9a;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(10, 40, 60, .07);
    --navy: #06263a;
    --navy-2: #0a3b55;
    --hero: linear-gradient(90deg, #06263a, #0a3b55 55%, #00607a);
    --s-new: #0b6bcb; --s-new-soft: #e6f0fb;
    --s-pend: #a86a00; --s-pend-soft: #fdf3dc;
    --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0c131a;
        --surface: #15202a;
        --surface-2: #111a23;
        --border: #233140;
        --border-strong: #3a4452;
        --text: #e4e8ee;
        --muted: #a3adba;
        --faint: #7d8896;
        --brand: #00b6dc;
        --accent: #29c4e4;
        --accent-hover: #5fd3ec;
        --accent-soft: #12313a;
        --danger: #f07167;
        --danger-soft: #3a1f1f;
        --ok: #4cc38a;
        --ok-soft: #173326;
        --warn: #e0b050;
        --warn-soft: #3a2f16;
        --note: #2e2a1a;
        --note-border: #5a4c22;
        --shadow: 0 8px 24px rgba(0, 0, 0, .25);
        --s-new: #7cb8ff; --s-new-soft: #14263d;
        --s-pend: #e8c070; --s-pend-soft: #2e2612;
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 20px; font-weight: 600; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0 0 .75em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.inline { display: inline; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Top bar ---------- */
.topbar {
    background: var(--surface);
    border-top: 3px solid var(--brand);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 10;
}
.topbar-inner {
    max-width: 1280px; margin: 0 auto;
    display: flex; align-items: center; gap: 24px;
    padding: 0 16px; min-height: 56px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 22px; height: 22px; border-radius: 6px;
    background: var(--accent);
    box-shadow: inset -7px -7px 0 0 rgba(255,255,255,.25);
}
.brand-sub { color: var(--faint); font-weight: 400; font-size: 13px; border-left: 1px solid var(--border); padding-left: 10px; }
.mainnav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.mainnav a {
    color: var(--muted); padding: 6px 10px; border-radius: 6px; font-weight: 500;
}
.mainnav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.mainnav a.active { color: var(--accent); background: var(--accent-soft); }
.userbox { display: flex; align-items: center; gap: 14px; color: var(--muted); }
.lang a { color: var(--faint); font-size: 12px; font-weight: 600; padding: 2px 4px; }
.lang a.on { color: var(--text); }
.username { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkbtn { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font: inherit; }
.linkbtn:hover { text-decoration: underline; }

.container { max-width: 1280px; margin: 0 auto; padding: 24px 16px 48px; }

/* ---------- Common blocks ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-body { padding: 16px; }
.card-head {
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-head h2 { margin: 0; }
.stack > * + * { margin-top: 16px; }

.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.pagehead h1 { margin: 0; }
.pagehead .sub { color: var(--muted); margin-top: 4px; }

.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; }
.flash.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.flash.error { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.flash.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }

/* ---------- Forms ---------- */
label { display: block; font-weight: 500; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field .hint, .hint { color: var(--faint); font-size: 12px; margin-top: 4px; }
input[type=date], input[type=month] { min-height: 38px; }
input[type=text], input[type=email], input[type=search], input[type=date], input[type=month], input[type=number], input[type=url], input[type=tel], input[type=password], select, textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input[type=file] { font: inherit; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1 1 180px; }
.validation, .field-error { color: var(--danger); font-size: 12px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 14px; border-radius: 6px;
    border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--text);
    font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
@media (prefers-color-scheme: dark) { .btn.primary, .btn.primary:hover { color: #0b1a1f; } }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn-ms { background: var(--surface); border-color: var(--border-strong); }
.ms-logo { width: 16px; height: 16px; display: inline-grid; grid-template-columns: 1fr 1fr; gap: 1px; }
.ms-logo i { display: block; }
.ms-logo i:nth-child(1) { background: #f25022; }
.ms-logo i:nth-child(2) { background: #7fba00; }
.ms-logo i:nth-child(3) { background: #00a4ef; }
.ms-logo i:nth-child(4) { background: #ffb900; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters input[type=search] { width: 260px; max-width: 100%; }
.filters select { width: auto; min-width: 140px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { display: block; padding: 12px 16px; color: var(--text); }
.stat:hover { text-decoration: none; border-color: var(--border-strong); }
.stat .n { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 13px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th {
    text-align: left; font-weight: 500; color: var(--muted); font-size: 12px;
    text-transform: uppercase; letter-spacing: .03em;
    padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
table.list td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.list tr:last-child td { border-bottom: none; }
table.list tr.clickable:hover td { background: var(--surface-2); }
table.list .subj { font-weight: 500; color: var(--text); }
table.list .id { color: var(--faint); font-variant-numeric: tabular-nums; }
.empty { padding: 32px; text-align: center; color: var(--muted); }

/* ---------- Pills ---------- */
.pill {
    display: inline-block; padding: 1px 8px; border-radius: 999px;
    font-size: 12px; font-weight: 500; white-space: nowrap;
    background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.pill.s-New { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.s-Open { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.s-Pending { background: var(--surface-2); color: var(--muted); }
.pill.s-Resolved { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.s-Closed { background: transparent; color: var(--faint); }
.prio { font-size: 12px; color: var(--muted); white-space: nowrap; }
.prio::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: var(--border-strong); vertical-align: 1px; }
.prio.p-High::before { background: var(--warn); }
.prio.p-Urgent { color: var(--danger); font-weight: 600; }
.prio.p-Urgent::before { background: var(--danger); }
.prio.p-Low::before { background: transparent; border: 1px solid var(--border-strong); }

/* ---------- Ticket view ---------- */
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.ticket-title { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ticket-title .id { color: var(--faint); font-weight: 400; }

.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.msg-head {
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.msg-head .who { font-weight: 600; }
.msg-head .who .role { font-weight: 400; color: var(--faint); margin-left: 6px; }
.msg-body { padding: 14px; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.msg.agent { border-left: 3px solid var(--accent); }
.msg.customer { border-left: 3px solid var(--border-strong); }
.msg.note { background: var(--note); border-color: var(--note-border); border-left: 3px solid var(--warn); }
.msg.note .msg-head { border-bottom-color: var(--note-border); }
.msg-files { padding: 0 14px 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.file {
    display: inline-flex; gap: 6px; align-items: center;
    padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--surface-2); font-size: 13px; color: var(--text);
}
.file .sz { color: var(--faint); }
.sysmsg { color: var(--faint); font-size: 12px; text-align: center; padding: 2px 0; }
.sysmsg b { color: var(--muted); font-weight: 500; }

.composer { margin-top: 20px; }
.composer .tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.composer .tabs label {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px;
    cursor: pointer; font-weight: 500; margin: 0; background: var(--surface);
}
.composer .tabs input { margin: 0; }
.composer .tabs label:has(input:checked) { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.composer.is-note textarea { background: var(--note); border-color: var(--note-border); }
.composer-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.composer-foot select { width: auto; }

.side .card + .card { margin-top: 16px; }
dl.props { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; }
dl.props dt { color: var(--muted); }
dl.props dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Login ---------- */
.auth-wrap { max-width: 880px; margin: 40px auto 0; }
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.auth-grid .card-body { padding: 24px; }
.auth-intro { margin-bottom: 24px; }
.auth-intro h1 { font-size: 24px; }
.center-card { max-width: 440px; margin: 60px auto 0; }

@media (max-width: 900px) {
    .ticket-layout { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .brand-sub { display: none; }
    .topbar-inner { gap: 10px; padding: 8px 16px; }
    .mainnav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
    table.list .hide-sm { display: none; }
}
.mt { margin-top: 12px; }
.mt-lg { margin-top: 20px; }

/* ---------- Branding ---------- */
.brand-logo { height: 30px; width: auto; display: block; }
.auth-logo { height: 52px; width: auto; display: block; margin-bottom: 20px; }

/* ---------- Push panel ---------- */
.push-panel { margin-bottom: 16px; border-left: 3px solid var(--brand); }
.push-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.push-text { flex: 1 1 320px; }
.push-text h2 { margin-bottom: 4px; }
.push-text p { margin: 0 0 4px; }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }

/* ---------- Mobile ---------- */
body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
}
@media (max-width: 600px) {
    /* 16px: αποτρέπει το αυτόματο zoom του iPhone όταν πατάτε σε πεδίο. */
    input[type=text], input[type=email], input[type=search], input[type=date], input[type=month], input[type=number], input[type=url], input[type=tel], input[type=password], select, textarea { font-size: 16px; }
    .container { padding: 16px 12px 40px; }
    .brand-logo { height: 24px; }
    .username { display: none; }
    .userbox { gap: 10px; margin-left: auto; }
    h1 { font-size: 18px; }
    .btn { min-height: 40px; }
    .btn.sm { min-height: 34px; }
    .pagehead { align-items: stretch; }
    .pagehead > .btn, .pagehead > form, .pagehead > form .btn { width: 100%; }
    .filters input[type=search], .filters select { width: 100%; min-width: 0; }
    .filters > button.btn { width: 100%; }
    .composer-foot { flex-direction: column; align-items: stretch; }
    .composer-foot .actions { flex-direction: column; align-items: stretch; }
    .composer-foot .actions .btn, .composer-foot select { width: 100%; }
    .composer .tabs { flex-wrap: wrap; }
    .msg-head { padding: 8px 12px; }
    .msg-body { padding: 12px; }
    table.list td, table.list th { padding: 10px 8px; }
    .stat { padding: 10px 12px; }
    .stat .n { font-size: 20px; }
    .push-row .actions { width: 100%; }
    .push-row .actions .btn { flex: 1 1 auto; }
    .auth-wrap { margin-top: 8px; }
    .center-card { margin-top: 24px; }
}

/* Εγκατεστημένη εφαρμογή (PWA): χωρίς "κολλημένη" κεφαλίδα που τρώει χώρο στο κινητό. */
@media (display-mode: standalone) and (max-width: 600px) {
    .topbar { position: static; }
}

/* ---------- Ρυθμίσεις: δευτερεύουσες καρτέλες ---------- */
.subtabs {
    display: flex; gap: 4px; margin: -8px 0 20px;
    border-bottom: 1px solid var(--border); overflow-x: auto;
}
.subtabs a {
    padding: 8px 14px; color: var(--muted); font-weight: 500; white-space: nowrap;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.subtabs a:hover { color: var(--text); text-decoration: none; }
.subtabs a.active { color: var(--accent); border-bottom-color: var(--brand); }

/* ---------- Χρόνος εργασίας ---------- */
.time-input { width: 80px !important; }
.time-inline { gap: 6px; }
.time-list { list-style: none; margin: 0; padding: 0; }
.time-list li { position: relative; padding: 10px 40px 10px 16px; border-bottom: 1px solid var(--border); }
.time-main { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.time-del { position: absolute; top: 8px; right: 12px; }
.time-form .row { gap: 8px; }
.time-form .row > .field { flex: 1 1 110px; margin-bottom: 4px; }

/* ---------- CC ---------- */
.cc-box summary { cursor: pointer; list-style: none; }
.cc-box summary::-webkit-details-marker { display: none; }
.cc-box[open] summary { border-bottom: 1px solid var(--border); }

/* ---------- Αναφορές ---------- */
.stats-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stats-6 .stat .n { font-size: 20px; }
.bar-cell { width: 18%; min-width: 80px; vertical-align: middle !important; }
svg.bar { display: block; width: 100%; height: 8px; }
svg.bar .bar-bg { fill: var(--surface-2); }
svg.bar .bar-fg { fill: var(--brand); }
svg.bar .bar-fg.alt { fill: var(--accent); }
.filters input[type=month] { width: auto; }
@media (max-width: 900px) { .stats-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) {
    .stats-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters input[type=month] { width: 100%; font-size: 16px; }
}

/* ---------- Ρόλοι ---------- */
.pill.role-Owner { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.pill.role-Admin { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.role-select { width: auto; min-width: 110px; padding: 4px 8px; }
.roles-legend { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; align-items: baseline; }
.roles-legend dd { margin: 0; color: var(--muted); }
.me-link { font-size: 16px; text-decoration: none !important; opacity: .8; }
.me-link:hover, .me-link.active { opacity: 1; }
a.username { color: var(--muted); }
.show-sm { display: none; }
@media (max-width: 600px) { .show-sm { display: block; } }

/* ---------- Στοίχιση πινάκων ---------- */
/* Οι τίτλοι στηλών ακολουθούν τη στοίχιση των τιμών τους. */
table.list th.right { text-align: right; }
/* Αριθμητικές στήλες στις αναφορές: τίτλος και τιμή στο κέντρο. */
table.list th.num, table.list td.num { text-align: center; }

/* ---------- App Status ---------- */
.status-warnings .flash { margin-bottom: 8px; }
.status-warnings { margin-bottom: 16px; }
.status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.status-grid .big { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
svg.meter { display: block; width: 100%; height: 10px; margin: 8px 0 6px; }
svg.meter .meter-bg { fill: var(--surface-2); }
svg.meter .meter-fg { fill: var(--brand); }
svg.meter .meter-fg.warn { fill: var(--warn); }
svg.meter .meter-fg.bad { fill: var(--danger); }
.pill.lvl-error { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.pill.lvl-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.log-msg { overflow-wrap: anywhere; }
@media (max-width: 1000px) { .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .status-grid { grid-template-columns: 1fr; } }

/* ---------- Καθολική αναζήτηση ---------- */
.topsearch { flex: 0 1 240px; min-width: 120px; }
.topbar-inner { gap: 16px; }
.mainnav a { padding: 6px 9px; white-space: nowrap; }
@media (max-width: 1240px) { .is-agent .brand-sub:not(.tagline) { display: none; } }
.brand-sub.tagline { color: var(--accent); font-weight: 600; font-size: 15px; letter-spacing: .01em; white-space: nowrap; }
/* Μηχανικοί: το σύνθημα κάτω από το logo, για να χωράει το μενού στην ίδια γραμμή. */
.is-agent .brand:has(.tagline) { flex-direction: column; align-items: flex-start; gap: 2px; }
.is-agent .brand-sub.tagline { display: block; border-left: none; padding-left: 0; font-size: 11px; letter-spacing: .03em; line-height: 1.2; }
/* Μεσαίες οθόνες: η αναζήτηση πάει σε δική της γραμμή κάτω από το μενού. */
@media (max-width: 1150px) and (min-width: 601px) {
    .topsearch { order: 4; flex: 1 1 100%; max-width: none; padding-bottom: 8px; }
}
.topsearch input[type=search] {
    width: 100%; padding: 6px 10px 6px 30px; min-height: 34px; border-radius: 8px;
    background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b95a3' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 9px center;
}
.topsearch input[type=search]:focus { background-color: var(--surface); }
.sr-group { margin-bottom: 16px; padding: 0; overflow: hidden; }
.sr-group .card-head { padding: 12px 16px; border-bottom: 1px solid var(--border); margin: 0; }
.sr-group .card-head h2 { margin: 0; font-size: 15px; }
.sr-group .count { color: var(--faint); font-weight: 500; margin-left: 4px; }
.sr-item { display: block; padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
.sr-item:last-of-type { border-bottom: none; }
a.sr-item:hover { background: var(--surface-2); text-decoration: none; }
.sr-item.is-note { border-left: 3px solid var(--warn); }
.sr-title { font-weight: 600; }
.sr-title .id { color: var(--faint); font-weight: 500; margin-right: 4px; }
.sr-title .pill { margin-left: 6px; font-weight: 500; }
.sr-meta { color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.sr-snippet { color: var(--text); font-size: 14px; margin-top: 4px; overflow-wrap: anywhere; }
.sr-more { padding: 10px 16px; border-top: 1px solid var(--border); }
.sr-exact { border-left: 3px solid var(--brand); }
mark { background: #fff1a8; color: inherit; padding: 0 1px; border-radius: 2px; }
@media (prefers-color-scheme: dark) { mark { background: #6b5b00; color: #fff; } }
@media (max-width: 600px) {
    .topsearch { order: 2; flex: 1 1 100%; }
}

/* ---------- Τεκμηρίωση πελατών ---------- */
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.field.grow { flex: 3 1 320px; }
.crumbs { color: var(--muted); }
.iconbtn { background: none; border: none; color: var(--faint); cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 4px; }
.iconbtn:hover { color: var(--danger); background: var(--danger-soft); }
.doc-list { display: flex; flex-direction: column; }
.doc-item { display: block; padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
.doc-item:last-child { border-bottom: none; }
.doc-item:hover { background: var(--surface-2); text-decoration: none; }
.doc-item.active, .doc-item.current { border-left: 3px solid var(--brand); padding-left: 13px; }
.doc-title { font-weight: 600; }
.new-doc .btn.block { display: flex; flex-direction: column; align-items: flex-start; gap: 0; margin-top: 8px; text-align: left; white-space: normal; }
.doc-files { list-style: none; margin: 0; padding: 0; }
.doc-files li { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.doc-files.compact li { padding: 6px 16px; }
.df-main { min-width: 0; flex: 1; }
.df-name { font-weight: 600; overflow-wrap: anywhere; }
.df-ref { display: inline-block; margin-top: 4px; font-size: 11px; color: var(--muted); background: var(--surface-2); padding: 1px 6px; border-radius: 4px; overflow-wrap: anywhere; user-select: all; }
.rev-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.md-editor { font-family: ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace; font-size: 13px; line-height: 1.55; min-height: 420px; tab-size: 2; }
.md-help pre { margin: 0 0 10px; font-size: 12px; line-height: 1.6; white-space: pre-wrap; background: var(--surface-2); padding: 10px 12px; border-radius: 6px; }

/* Περιεχόμενο σελίδας (Markdown) */
.md { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md h2, .md h3, .md h4, .md h5 { text-transform: none; letter-spacing: normal; color: var(--text); }
.md h2 { font-size: 20px; margin: 1.4em 0 .5em; }
.md h3 { font-size: 17px; margin: 1.4em 0 .5em; padding-bottom: 4px; border-bottom: 1px solid var(--border); color: var(--accent); }
.md h4 { font-size: 15px; margin: 1.1em 0 .4em; }
.md h5 { font-size: 14px; margin: 1em 0 .3em; color: var(--muted); }
.md p { margin: 0 0 .8em; }
.md ul, .md ol { margin: 0 0 .8em; padding-left: 1.4em; }
.md li { margin: .15em 0; }
.md li.task { list-style: none; margin-left: -1.2em; }
.md li.task .tick { color: var(--accent); font-size: 15px; }
.md li.task.done { color: var(--muted); }
.md code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .88em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.md pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; overflow-x: auto; margin: 0 0 1em; }
.md pre code { background: none; padding: 0; font-size: 13px; white-space: pre; }
.md blockquote { margin: 0 0 1em; padding: 8px 14px; border-left: 3px solid var(--brand); background: var(--accent-soft); border-radius: 0 6px 6px 0; }
.md blockquote > :last-child { margin-bottom: 0; }
.md hr { border: none; border-top: 1px solid var(--border); margin: 1.5em 0; }
.md-table { overflow-x: auto; margin: 0 0 1em; }
.md table { border-collapse: collapse; width: 100%; font-size: 14px; }
.md th, .md td { overflow-wrap: normal; }
@media (max-width: 700px) { .md th, .md td { white-space: nowrap; } }
.md th, .md td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--surface-2); font-weight: 600; }
.md tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.md .a-center { text-align: center; }
.md .a-right { text-align: right; }
.md img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 6px; display: block; margin: .4em 0 1em; }
.md a.md-img { display: inline-block; }

/* Εκτύπωση / αποθήκευση ως PDF */
@media print {
    .topbar, .no-print, .flash, .doc-layout > .side .card-body form { display: none !important; }
    body { background: #fff; }
    .container { max-width: none; padding: 0; }
    .card { border: none; box-shadow: none; }
    .ticket-layout.doc-layout { display: block; }
    .doc-layout > .side { margin-top: 16px; }
    .md a { color: inherit; text-decoration: underline; }
    .md pre, .md table, .md img { break-inside: avoid; }
    .df-ref { display: none; }
}

/* ---------- Φόντο (Helpdesk__Background) ---------- */
body[class*="bg-"]:not(.bg-none)::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background-position: center; background-size: cover; background-repeat: no-repeat;
}
body.bg-network::before { background-image: url("/img/bg/network.svg"); }
body.bg-waves::before { background-image: url("/img/bg/waves.svg"); }
body.bg-circuit::before { background-image: url("/img/bg/circuit.svg"); }
body.bg-dots::before { background-image: url("/img/bg/dots.svg"); }
@media (prefers-color-scheme: dark) { body[class*="bg-"]::before { opacity: .55; } }
@media print { body::before { display: none !important; } }

/* ---------- Επεξεργαστής τεκμηρίωσης σε μορφή φόρμας ---------- */
.ve-modebar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.ve-modebar label { margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.seg-btn { background: var(--surface); border: none; padding: 6px 12px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--border-strong); }
.seg-btn.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ve { border: 1px solid var(--border); border-radius: 8px; padding: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.ve-block { min-width: 0; }
.ve input.ve-heading { width: 100%; border: none; box-shadow: none; min-height: 0; border-bottom: 2px solid var(--brand); background: transparent; font: inherit; font-weight: 600; color: var(--accent); padding: 6px 2px 4px; border-radius: 0; }
.ve input.ve-h1, .ve input.ve-h2 { font-size: 18px; }
.ve input.ve-h3, .ve input.ve-h4 { font-size: 15px; }
.ve input.ve-heading:focus { outline: none; border-bottom-color: var(--accent); background: var(--surface); }
.ve-text { width: 100%; min-height: 40px; resize: vertical; font: inherit; font-size: 14px; line-height: 1.5; overflow: hidden; }
.ve-scroll { overflow-x: auto; }
.ve-table { border-collapse: collapse; width: 100%; background: var(--surface); }
.ve-table th, .ve-table td { border: 1px solid var(--border); padding: 0; }
.ve-table th { background: var(--surface-2); }
.ve-table .ve-act { width: 34px; border: none; background: transparent; text-align: center; }
.ve input.ve-cell { width: 100%; min-width: 110px; border: none; box-shadow: none; border-radius: 0; background: transparent; padding: 7px 9px; font: inherit; font-size: 14px; color: var(--text); min-height: 0; }
.ve input.ve-cell.ve-head { font-weight: 600; color: var(--muted); font-size: 13px; }
.ve input.ve-cell:focus { outline: 2px solid var(--brand); outline-offset: -2px; background: var(--accent-soft); }
.ve-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.ve-addbar { margin-top: 2px; }
.btn.danger-text { color: var(--danger); }
[hidden] { display: none !important; }

/* ---------- Συμβόλαιο πελάτη ---------- */
.pill.contract-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.contract-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.contract-bad { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.pill.contract-none { background: transparent; color: var(--warn); border-color: var(--warn); }
.contract-box { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; }
.contract-fields { margin-top: 10px; }
.contract-alert { display: inline-flex; gap: 6px; align-items: center; margin: 4px 10px 0 0; color: inherit; }
.mt-xs { margin-top: 4px; }

.narrow-card { max-width: 640px; }
details.deleted-agents > summary { cursor: pointer; list-style: none; }
details.deleted-agents > summary::-webkit-details-marker { display: none; }
details.deleted-agents > summary h2::before { content: "▸ "; color: var(--faint); }
details.deleted-agents[open] > summary h2::before { content: "▾ "; }
a.iconbtn { text-decoration: none; display: inline-block; }
.folder-link { margin-left: 8px; text-decoration: none; font-size: 14px; }

/* ---------- Αξιολόγηση ---------- */
.rate-card { max-width: 520px; }
.rate-faces { display: flex; gap: 10px; margin: 16px 0 4px; }
.rate-face { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 12px; padding: 14px 6px; cursor: pointer; background: var(--surface); }
.rate-face input { position: absolute; opacity: 0; pointer-events: none; }
.rate-face .emo { font-size: 34px; line-height: 1; }
.rate-face .lbl { font-size: 13px; color: var(--muted); }
.rate-face.on { border-color: var(--brand); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-soft); }
.rate-face:focus-within { outline: 2px solid var(--brand); }
.rate-card form.is-sending { opacity: .6; pointer-events: none; }
.csat-big { font-size: 28px; font-weight: 700; }
.csat-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-2); }
.csat-box { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
.csat-emo { font-size: 24px; line-height: 1; }
.csat-summary { display: flex; gap: 28px; flex-wrap: wrap; align-items: flex-end; }
.csat-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; border-top: 1px solid var(--border); }
@media (max-width: 800px) { .csat-tables { grid-template-columns: 1fr; } }
.csat-comments { list-style: none; margin: 0; padding: 0; }
.csat-comments li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.csat-comments li:last-child { border-bottom: none; }

/* ---------- Λίστα αιτημάτων: φίλτρα & κινητό ---------- */
.filter-search { display: contents; }
.filter-more { display: contents; }
.filter-toggle { display: none; position: relative; }
.filter-toggle .badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 11px; line-height: 18px; font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.search-link { display: none; font-size: 16px; text-decoration: none !important; opacity: .8; }
.show-xs { display: none; }

@media (max-width: 600px) {
    /* Κεφαλίδα: χωρίς σύνθημα και χωρίς τη γραμμή αναζήτησης (υπάρχει το 🔍). */
    .is-agent .brand-sub.tagline { display: none; }
    .is-agent .topsearch { display: none; }
    .search-link { display: inline; }

    /* Ειδοποιήσεις: μικρή λωρίδα αντί για κάρτα. */
    .push-panel .push-text p.muted { display: none; }
    .push-panel .push-text h2 { font-size: 14px; margin: 0; }
    .push-panel .card-body { padding: 10px 12px; }
    .push-row { flex-wrap: nowrap; gap: 8px; }
    .push-row .actions { width: auto; flex-wrap: nowrap; }
    .push-row .actions .btn { flex: 0 0 auto; min-height: 34px; padding: 6px 12px; font-size: 13px; }

    /* Μετρητές: μία γραμμή με 4 μικρά κουτιά. */
    .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
    .stats .stat { padding: 8px 6px; text-align: center; }
    .stats .stat .n { font-size: 18px; line-height: 1.1; }
    .stats .stat .l { font-size: 11px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    /* Τίτλος + μικρό κουμπί «+ Νέο» στην ίδια γραμμή. */
    .pagehead.list-head { flex-direction: row; align-items: center; justify-content: space-between; margin-bottom: 10px; }
    .pagehead.list-head .btn { width: auto; min-height: 36px; padding: 6px 14px; }
    .hide-xs { display: none; }
    .show-xs { display: inline; }

    /* Φίλτρα: αναζήτηση + ⚙ σε μία γραμμή, τα υπόλοιπα ανοίγουν με το ⚙. */
    .filters[data-filters] { display: block; }
    .filter-search { display: flex; gap: 8px; }
    .filter-search input[type=search] { flex: 1; }
    .filter-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; flex: 0 0 44px; }
    .filters.has-active .filter-toggle { border-color: var(--brand); color: var(--accent); }
    .filter-more { display: none; }
    .filters.open .filter-more { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
    .filter-submit { display: none; }

    /* Λίστα: κάρτες αντί για στήλες. */
    table.list.tickets thead { display: none; }
    table.list.tickets td.id { display: none; }
    table.list.tickets tr { display: flex; align-items: flex-start; gap: 8px; }
    table.list.tickets td { border: none; }
    table.list.tickets tr { border-bottom: 1px solid var(--border); }
    table.list.tickets td:nth-child(2) { flex: 1; min-width: 0; padding-right: 0; }
    table.list.tickets td:nth-child(3) { flex: 0 0 auto; padding-left: 0; }
    table.list.tickets .subj { display: block; font-size: 15px; line-height: 1.35; }
    .t-meta { margin-top: 2px; }
}

/* Διαγραφή αιτήματος: κλειστό από προεπιλογή, ώστε να μην πατηθεί κατά λάθος. */
.danger-zone > summary { cursor: pointer; padding: 12px 16px; color: var(--danger); font-weight: 600; font-size: 14px; list-style: none; }
.danger-zone > summary::-webkit-details-marker { display: none; }
.danger-zone[open] > summary { border-bottom: 1px solid var(--border); }

/* =====================================================================
   Θέμα B · Brand gradient: navy/cyan κεφαλίδα, κάρτες με σκιά, κάτω μπάρα στο κινητό.
   (Οι κανόνες εδώ υπερισχύουν των παραπάνω.)
   ===================================================================== */
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "cv11", "ss01"; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.015em; }
h2 { letter-spacing: -.005em; }

/* ---- Κεφαλίδα ---- */
.topbar { background: var(--hero); border: none; color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.06) inset; }
.topbar-inner { min-height: 62px; }
.brand-logo { filter: brightness(0) invert(1); }
.brand, .brand-name { color: #fff; }
.brand-sub { color: rgba(255,255,255,.6); border-left-color: rgba(255,255,255,.2); }
.brand-sub.tagline, .is-agent .brand-sub.tagline { color: #7fe3f5; }
.mainnav a { color: rgba(255,255,255,.74); border-radius: 10px; }
.mainnav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.mainnav a.active { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
.userbox, .userbox a, a.username, .linkbtn { color: rgba(255,255,255,.8); }
.userbox .linkbtn:hover, .userbox a:hover { color: #fff; }
.lang a { color: rgba(255,255,255,.5); }
.lang a.on { color: #fff; }
.topsearch input[type=search] {
    background-color: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); color: #fff; border-radius: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cfe9f1' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
}
.topsearch input[type=search]::placeholder { color: rgba(255,255,255,.6); }
.topsearch input[type=search]:focus { background-color: rgba(255,255,255,.2); outline: 2px solid rgba(127,227,245,.5); border-color: transparent; }

/* ---- Ζώνη καλωσορίσματος (dashboard / portal) ---- */
.hero-band {
    background: radial-gradient(900px 260px at 88% -30%, rgba(0,182,220,.5), transparent 70%), var(--hero);
    color: #fff;
}
.hero-inner { max-width: 1280px; margin: 0 auto; padding: 22px 16px 88px; display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.hero-text { flex: 1 1 auto; min-width: 0; }
.hero-text h1 { font-size: 30px; margin: 0; color: #fff; letter-spacing: -.02em; }
.hero-text p { margin: 6px 0 0; color: rgba(255,255,255,.75); font-size: 15px; }
.hero-tagline { color: #7fe3f5; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.hero-btn { order: 3; }
.has-hero .container { position: relative; margin-top: -66px; padding-top: 0; }
.has-hero .topbar .brand-sub.tagline { display: none; }

/* ---- Κάρτες, κουμπιά, πεδία ---- */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
@media (prefers-color-scheme: light) { .card { border-color: transparent; } }
.card-head { padding: 14px 18px; }
.card-body { padding: 18px; }
.msg { border-radius: 14px; box-shadow: var(--shadow); }
@media (prefers-color-scheme: light) { .msg { border-color: transparent; } .msg.note { border-color: var(--note-border); } }
.btn { border-radius: 10px; padding: 9px 16px; font-weight: 600; }
.btn.sm { border-radius: 8px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #04232b; box-shadow: 0 6px 16px rgba(0,182,220,.25); }
.btn.primary:hover { background: #00a3c6; border-color: #00a3c6; }
input[type=text], input[type=email], input[type=search], input[type=date], input[type=month], input[type=number], input[type=url], input[type=tel], input[type=password], select, textarea { border-radius: 10px; border-color: var(--border-strong); padding: 9px 12px; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent-soft); border-color: var(--brand); }
.flash { border-radius: 12px; }
.subtabs a.active { border-bottom-width: 3px; }

/* ---- Μετρητές ---- */
.stats { gap: 16px; margin-bottom: 20px; }
.stat { padding: 18px 20px 16px; position: relative; overflow: hidden; }
.stat .l { font-size: 13px; color: var(--muted); }
.stat .n { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-top: 4px; }
.stat::after { content: ""; display: block; height: 4px; border-radius: 4px; margin-top: 12px; background: var(--border); }
.stat.st-New::after { background: var(--s-new); }
.stat.st-Open::after { background: var(--brand); }
.stat.st-Pending::after { background: #e0a020; }
.stat.st-Mine::after { background: var(--ok); }
a.stat:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(10,40,60,.11); }
a.stat { transition: transform .15s, box-shadow .15s; }

/* ---- Καταστάσεις ---- */
.pill { padding: 3px 10px; font-weight: 600; border: none; }
.pill[class*="s-"]::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; }
.pill.s-New { background: var(--s-new-soft); color: var(--s-new); }
.pill.s-Open { background: var(--accent-soft); color: var(--accent); }
.pill.s-Pending { background: var(--s-pend-soft); color: var(--s-pend); }
.pill.s-Resolved { background: var(--ok-soft); color: var(--ok); }
.pill.s-Closed { background: var(--surface-2); color: var(--faint); }

/* ---- Λίστες ---- */
.table-wrap.card { padding: 6px; }
table.list th { background: transparent; border-bottom-color: var(--border); font-size: 11px; letter-spacing: .06em; padding: 12px 14px; }
table.list td { padding: 13px 14px; vertical-align: middle; border-bottom-color: var(--border); }
table.list tr.clickable td:first-child { border-radius: 10px 0 0 10px; }
table.list tr.clickable td:last-child { border-radius: 0 10px 10px 0; }
table.list tr.clickable:hover td { background: color-mix(in srgb, var(--brand) 6%, transparent); }
table.list .subj { font-weight: 600; }
table.list .id { font-weight: 600; }

/* ---- Κάτω μπάρα (μόνο κινητό) ---- */
.tabbar { display: none; }
@media (max-width: 600px) {
    .has-tabbar { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
    .has-tabbar .mainnav, .has-tabbar .search-link, .has-tabbar .topsearch { display: none !important; }
    .is-customer.has-tabbar .userbox form.inline { display: none; }
    .topbar-inner { min-height: 54px; }
    .tabbar {
        display: flex; position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
        background: var(--navy); border-radius: 22px; padding: 8px 4px; justify-content: space-around; align-items: center;
        box-shadow: 0 12px 30px rgba(6,38,58,.4);
    }
    .tabbar a, .tabbar button {
        flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0;
        color: rgba(255,255,255,.62); font: inherit; font-size: 11px; font-weight: 500; background: none; border: none; padding: 4px 2px; cursor: pointer;
        text-decoration: none !important;
    }
    .tabbar form { flex: 1 1 0; display: flex; }
    .tabbar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
    .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .tabbar a.on, .tabbar a.active { color: #7fe3f5; }
    .tabbar .tab-plus { flex: 0 0 auto; }
    .tabbar .tab-plus b {
        width: 52px; height: 52px; border-radius: 17px; margin-top: -28px; display: grid; place-items: center;
        background: var(--brand); color: #04232b; font-size: 30px; font-weight: 500; line-height: 1;
        box-shadow: 0 8px 20px rgba(0,182,220,.45), 0 0 0 4px var(--bg);
    }
    /* Το «+ Νέο» υπάρχει στη μπάρα. */
    .has-tabbar .pagehead.list-head .btn.primary, .has-tabbar .hero-btn { display: none; }

    .hero-inner { padding: 16px 16px 74px; }
    .hero-text h1 { font-size: 23px; }
    .hero-text p { font-size: 14px; }
    .hero-tagline { display: none; }
    .has-hero .container { margin-top: -58px; }
    h1 { font-size: 20px; }
    .stats { gap: 8px; }
    .stats .stat { padding: 10px 6px 8px; border-radius: 14px; }
    .stats .stat .n { font-size: 22px; margin-top: 0; }
    .stat::after { height: 3px; margin: 8px 6px 0; }
    .table-wrap.card { padding: 2px 4px; }
    table.list.tickets tr { border-bottom-color: var(--border); }
}
/* PWA στο κινητό: η κεφαλίδα δεν «κολλάει». */
@media (display-mode: standalone) and (max-width: 600px) { .topbar { padding-top: env(safe-area-inset-top); } }
@media print { .tabbar, .hero-band { display: none !important; } .has-hero .container { margin-top: 0; } .topbar { background: none; } }

/* ---- Έντονη τυπογραφία: Manrope για τίτλους/μενού/κουμπιά/αριθμούς, Inter λίγο πιο βαριά στο κείμενο ---- */
:root { --font-display: "Manrope", "Inter", "Segoe UI", system-ui, sans-serif; }
body { font-weight: 450; }
h1, h2, h3, .hero-text h1, .stat .n, .ticket-title, .brand-name, .auth-card h1 { font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em; }
h2, h3 { font-weight: 750; letter-spacing: -.01em; }
.mainnav a, .btn, .subtabs a, .tabbar span, .hero-tagline, .pill, .stat .l, table.list th { font-family: var(--font-display); }
.mainnav a { font-weight: 650; }
.mainnav a.active { font-weight: 800; }
.btn { font-weight: 750; letter-spacing: .005em; }
.stat .l { font-weight: 700; font-size: 13px; }
table.list th { font-weight: 800; }
table.list .subj, .msg .who, label { font-weight: 650; }
.pill { font-weight: 750; }
.hero-tagline { font-weight: 800; letter-spacing: .03em; }
.tabbar span { font-weight: 700; }

/* Ένδειξη αυτόματης ανανέωσης («🔔 1 νέο αίτημα») */
.live-toast {
    position: fixed; z-index: 40; left: 50%; top: 76px; transform: translateX(-50%);
    background: var(--navy); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 14px;
    padding: 10px 18px; border-radius: 999px; box-shadow: 0 12px 30px rgba(6,38,58,.35);
    animation: live-in .25s ease-out; transition: opacity .5s, transform .5s;
}
.live-toast.gone { opacity: 0; transform: translateX(-50%) translateY(-8px); }
@keyframes live-in { from { opacity: 0; transform: translateX(-50%) translateY(-8px); } }
.refresh-btn .ri { display: inline-block; font-size: 17px; line-height: 1; transition: transform .2s; }
.refresh-btn.is-loading .ri { animation: spin .8s linear infinite; }
.refresh-btn:disabled { opacity: .8; cursor: progress; }
@keyframes spin { to { transform: rotate(360deg); } }
.pagehead.list-head > .actions { flex-wrap: nowrap; gap: 8px; }
.mt-sm { margin-top: 6px; }
.msi-cmd { display: block; margin-top: 6px; padding: 6px 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; font-family: ui-monospace, Consolas, monospace; word-break: break-all; user-select: all; }

/* Κλιμάκωση (escalate) */
.pill.esc { background: #fdecea; color: #b42318; }
@media (prefers-color-scheme: dark) { .pill.esc { background: #3a1713; color: #ff8a80; } }
.escalate-card > summary { cursor: pointer; padding: 12px 16px; color: var(--accent); font-weight: 700; font-family: var(--font-display); font-size: 14px; list-style: none; }
.escalate-card > summary::-webkit-details-marker { display: none; }
.escalate-card[open] > summary { border-bottom: 1px solid var(--border); }
.mb { margin-bottom: 10px; }

/* ---- Υπηρεσίες (v14) ---- */
.stats.stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 900px) { .stats.stats-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .stats.stats-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat.st-NoSvc::after { background: #c2410c; }

.svc {
    display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
    white-space: nowrap; line-height: 1.5; vertical-align: middle;
    background: var(--svc-bg, #eef1f5); color: var(--svc-fg, #475467);
}
.svc-blue   { --svc-bg: #e6f0fb; --svc-fg: #0b5cad; }
.svc-violet { --svc-bg: #efe9fd; --svc-fg: #5b34b4; }
.svc-teal   { --svc-bg: #e0f5f1; --svc-fg: #0f6e5f; }
.svc-cyan   { --svc-bg: #e2f6fb; --svc-fg: #006a82; }
.svc-red    { --svc-bg: #fdecea; --svc-fg: #a5281b; }
.svc-amber  { --svc-bg: #fdf3dc; --svc-fg: #8a5a00; }
.svc-green  { --svc-bg: #e7f5ee; --svc-fg: #19703f; }
.svc-pink   { --svc-bg: #fce8f3; --svc-fg: #a4246b; }
.svc-slate  { --svc-bg: #eef1f5; --svc-fg: #475467; }
@media (prefers-color-scheme: dark) {
    .svc-blue   { --svc-bg: #12294a; --svc-fg: #8cc0ff; }
    .svc-violet { --svc-bg: #2a1f4a; --svc-fg: #c3abff; }
    .svc-teal   { --svc-bg: #0f3330; --svc-fg: #7fdcc8; }
    .svc-cyan   { --svc-bg: #12313a; --svc-fg: #7fd9ee; }
    .svc-red    { --svc-bg: #3a1f1f; --svc-fg: #ff9a90; }
    .svc-amber  { --svc-bg: #3a2c10; --svc-fg: #f3c264; }
    .svc-green  { --svc-bg: #14321f; --svc-fg: #7fd6a2; }
    .svc-pink   { --svc-bg: #3a1a2c; --svc-fg: #f59ccc; }
    .svc-slate  { --svc-bg: #222d38; --svc-fg: #b6c0cc; }
}
.sub .svc { margin-left: 4px; }
.svc-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 4px; }
.svc-checks { display: flex; flex-direction: column; gap: 6px; }
.svc-check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 400; }
.svc-check input { width: auto; margin: 0; }

/* Γρήγορη επιλογή στη λίστα */
.svc-pick { position: relative; display: inline-block; }
.svc-pick > summary { list-style: none; cursor: pointer; }
.svc-pick > summary::-webkit-details-marker { display: none; }
.svc-add {
    display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; color: var(--muted);
    border: 1px dashed var(--border-strong); line-height: 1.5;
}
.svc-add:hover { color: var(--accent); border-color: var(--accent); }
.svc-pick[open] > .svc-add { color: var(--accent); border-color: var(--accent); border-style: solid; }
/* Ανοίγει μέσα στη γραμμή (όχι absolute), ώστε να μην κόβεται από το .table-wrap που κάνει scroll. */
.svc-pick[open] { display: block; flex-basis: 100%; }
.svc-pop {
    margin-top: 6px; max-width: 280px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px;
    box-shadow: 0 14px 34px rgba(10, 40, 60, .16); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
}
.mt-xs { margin-top: 4px; }
.warn-pill { background: #fdf0e6; color: #c2410c; }
@media (prefers-color-scheme: dark) { .warn-pill { background: #3a2414; color: #f6a56b; } }
.flash-attn { outline: 3px solid #f59e0b; outline-offset: 2px; transition: outline-color 1.5s; }
.num-input { width: 80px; text-align: right; }
.svc-table td input[type=text] { min-width: 120px; }
.svc-table td select { width: auto; margin-right: 6px; }

/* ---- Υπογραφή συμπτυγμένη (1.50, μόνο μηχανικοί) ---- */
.msg-sig { margin: -6px 14px 10px; }
.msg-sig > summary { cursor: pointer; display: inline-block; font-size: 12px; color: var(--muted); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); list-style: none; }
.msg-sig > summary::-webkit-details-marker { display: none; }
.msg-sig > summary:hover { color: var(--accent); border-color: var(--accent); }
.msg-sig[open] > summary { margin-bottom: 4px; }
.msg-body.sig { padding: 8px 0 4px; color: var(--muted); font-size: 13px; }

/* ---- Εικόνες μηνυμάτων (1.52) ---- */
.msg-thumbs { padding: 0 14px 10px; display: flex; flex-wrap: wrap; gap: 10px; }
.thumb { display: block; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-2); line-height: 0; }
.thumb img { display: block; max-width: 260px; max-height: 180px; width: auto; height: auto; object-fit: contain; }
.thumb:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(10, 40, 60, .12); }
@media (max-width: 600px) { .thumb img { max-width: 100%; } }
.msg-recover { margin: -4px 14px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.msg-recover.subtle { margin-top: -8px; }
.msg-recover .linkbtn { color: var(--muted); text-decoration: underline dotted; }
.msg-recover .linkbtn:hover { color: var(--accent); }


/* ---- 1.57 · Ενεργή κάρτα στο dashboard (το φίλτρο που είναι επιλεγμένο) ---- */
.stat.st-New { --stat-c: var(--s-new); }
.stat.st-Open { --stat-c: var(--brand); }
.stat.st-Pending { --stat-c: #e0a020; }
.stat.st-Mine { --stat-c: var(--ok); }
.stat.st-NoSvc { --stat-c: #c2410c; }
.stats .stat.active {
    border: 2px solid var(--stat-c);
    background: color-mix(in srgb, var(--stat-c) 12%, var(--surface));
    box-shadow: 0 16px 38px color-mix(in srgb, var(--stat-c) 30%, transparent);
    transform: translateY(-3px);
}
.stats .stat.active .l { color: var(--stat-c); }
.stats .stat.active::after { height: 6px; }
/* Οι υπόλοιπες κάρτες σβήνουν λίγο όταν υπάρχει επιλεγμένη, ώστε να ξεχωρίζει. */
.stats:has(.stat.active) .stat:not(.active) { opacity: .6; }
.stats:has(.stat.active) .stat:not(.active):hover { opacity: 1; }

/* ---- 1.60 · Προβολή εικόνας ---- */
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(6, 12, 20, .92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
.lightbox.hidden { display: none; }
.lightbox-bar { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; gap: 8px; align-items: center; }
.lightbox-name { flex: 1; color: #fff; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox img { max-width: 100%; max-height: calc(100% - 70px); margin-top: 50px; object-fit: contain; border-radius: 8px; background: #fff; }
body.no-scroll { overflow: hidden; }
