:root {
  /* χρώματα PcNetLab (pcnetlab.gr) */
  --orange: #ff5d1e; --orange-d: #e2480c; --orange-l: #fff1eb;
  --navy: #2b2b2b; --blue: #d4480f; --blue-l: #fff1eb; --ink: #1c2430; --muted: #6b7684;
  --line: #e3e7ec; --bg: #f4f6f9; --card: #fff; --ok: #1f8a4c; --warn: #c27c0e; --bad: #c0392b;
  --r: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: .1rem 0 .3rem; }
h2 { font-size: 1.1rem; margin: 0 0 .7rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; } .pad { padding: 1.5rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; }
.nowrap { white-space: nowrap; } .inline { display: inline; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .55rem 1rem; padding-top: max(.55rem, env(safe-area-inset-top));
  background: #fff; color: var(--ink); border-bottom: 3px solid var(--orange); box-shadow: 0 1px 6px rgba(0,0,0,.06); }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); font-weight: 700; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand small { display: block; font-weight: 600; font-size: .68rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.wordmark { font-size: 1.35rem; font-weight: 800; letter-spacing: -.5px; line-height: 1; color: var(--orange); }
.wordmark b { color: #4a4a4a; font-weight: 800; }
.brand img.brandlogo { height: 48px; width: auto; display: block; }
.auth-brand img.brandlogo { height: 64px; }
.logo { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--orange); }
.logo svg { width: 24px; height: 24px; }
.logo.big { width: 64px; height: 64px; border-radius: 16px; } .logo.big svg { width: 42px; height: 42px; }
.topsearch { flex: 1; max-width: 420px; }
.topsearch input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .75rem; background: #f5f6f8; color: var(--ink); font: inherit; }
.topsearch input:focus { outline: 2px solid #ffc3a8; border-color: var(--orange); background: #fff; }
.topnav { margin-left: auto; display: flex; align-items: center; gap: .2rem; }
.topnav a, .linkbtn { color: #333; padding: .4rem .6rem; border-radius: 6px; font-size: .92rem; font-weight: 600; }
.topnav a:hover { color: var(--orange); text-decoration: none; }
.topnav a.on { color: var(--orange); background: var(--orange-l); }
.linkbtn { background: none; border: 0; cursor: pointer; font: inherit; }

.tabbar { display: none; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 1rem; }

/* cards & layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 460px; margin: 1rem auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; } .grid2 > .card { margin-bottom: 0; } .grid2 { margin-bottom: 1rem; }
.grid-ticket { display: grid; grid-template-columns: 1fr 300px; gap: 1rem; align-items: start; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin: .3rem 0 1rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.sechead { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; flex-wrap: wrap; margin-bottom: .6rem; }
.sechead h2 { margin: 0; }
.crumb { font-size: .85rem; color: var(--muted); }
.count { font-size: .9rem; color: var(--muted); font-weight: 500; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; min-height: 38px; }
.btn:hover { background: #f1f4f8; text-decoration: none; }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 600; } .btn.primary:hover { background: var(--orange-d); border-color: var(--orange-d); }
.btn.danger { color: var(--bad); border-color: #f0c7c2; } .btn.danger:hover { background: #fdf0ee; }
.btn.small { padding: .3rem .65rem; font-size: .86rem; min-height: 32px; }
.btn.block { width: 100%; }
.iconbtn { background: none; border: 0; cursor: pointer; font-size: 1rem; padding: .25rem .35rem; border-radius: 6px; }
.iconbtn:hover { background: #f1f4f8; }

/* forms */
.form label { display: block; font-size: .85rem; font-weight: 600; color: #3a4554; margin-bottom: .75rem; }
.form input:not([type=checkbox]):not([type=radio]):not([type=file]), .form select, .form textarea, .filterbar input, .row-log input {
  display: block; width: 100%; margin-top: .25rem; padding: .55rem .65rem; border: 1px solid #cfd6de; border-radius: 8px; font: inherit; font-weight: 400; background: #fff; color: var(--ink); }
.form input[type=file] { display: block; margin-top: .3rem; font-weight: 400; }
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid #ffc3a8; border-color: var(--orange); }
.form label.check { display: flex; gap: .5rem; align-items: center; font-weight: 500; }
.form.compact label { margin-bottom: .5rem; }
.row2, .row3, .row4 { display: grid; gap: 0 .8rem; } .row2 { grid-template-columns: 1fr 1fr; } .row3 { grid-template-columns: repeat(3, 1fr); } .row4 { grid-template-columns: repeat(4, 1fr); }
.inputrow { display: flex; gap: .4rem; align-items: center; } .inputrow input { margin-top: .25rem !important; } .inputrow .btn { margin-top: .25rem; }
.row-log { display: grid; grid-template-columns: 150px 1fr auto; gap: .5rem; align-items: center; margin-bottom: .6rem; } .row-log input { margin: 0; }
.filterbar { display: flex; gap: .5rem; margin-bottom: 1rem; } .filterbar input { margin: 0; }
.choice { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.pill input { display: none; } .pill span { display: inline-block; padding: .45rem .8rem; border: 1px solid #cfd6de; border-radius: 99px; font-weight: 500; cursor: pointer; }
.pill input:checked + span { background: var(--orange); color: #fff; border-color: var(--orange); }

/* flash */
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 500; }
.flash.ok { background: #e6f5ec; color: #14653a; border: 1px solid #bfe3cd; }
.flash.error { background: #fdecea; color: #8e2b20; border: 1px solid #f3c4be; }

/* stats & chips */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: 1rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: .9rem 1rem; color: var(--ink); box-shadow: var(--shadow); }
.stat:hover { text-decoration: none; border-color: #ffb08f; }
.stat { border-top: 3px solid var(--orange); }
.stat b { display: block; font-size: 1.7rem; line-height: 1.1; } .stat span { color: var(--muted); font-size: .85rem; }
.stat.alert { border-color: #f2b8b0; background: #fff6f5; } .stat.alert b { color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.chip { padding: .35rem .75rem; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-size: .86rem; }
.chip:hover { text-decoration: none; border-color: #ffb08f; } .chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip b { margin-left: .25rem; }

/* badges */
.badge { display: inline-block; padding: .12rem .5rem; border-radius: 99px; font-size: .75rem; font-weight: 600; background: #eef1f5; color: #445; white-space: nowrap; }
.st-new { background: #fde8e6; color: #a5281b; } .st-open { background: #e8eef6; color: #2c4a6e; } .st-in_progress { background: #fff2d9; color: #8a5a00; }
.st-waiting { background: #efe8fb; color: #5b3b9a; } .st-closed { background: #e6f5ec; color: #14653a; }
.pr-low { background: #f0f2f5; color: #667; } .pr-normal { display: none; } .pr-high { background: #fff2d9; color: #8a5a00; } .pr-urgent { background: #c0392b; color: #fff; }
.ty-pbx { --t: #7b4bc4; } .ty-network { --t: #0b75c9; } .ty-cctv { --t: #0e8f6f; } .ty-alarm { --t: #c0392b; } .ty-access { --t: #c27c0e; } .ty-it { --t: #3d5a80; } .ty-other { --t: #6b7684; }
.badge[class*=ty-] { background: color-mix(in srgb, var(--t) 13%, #fff); color: var(--t); }
.chip[class*=ty-] { border-left: 4px solid var(--t); }
.is-active { background: #e6f5ec; color: #14653a; } .is-maintenance { background: #fff2d9; color: #8a5a00; } .is-inactive { background: #eee; color: #777; }
.badge.internal { background: #fff2d9; color: #8a5a00; }

/* lists & tables */
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-top: 1px solid var(--line); } .list li:first-child { border-top: 0; }
.list li > a, .list li > div { display: flex; justify-content: space-between; gap: .8rem; align-items: center; padding: .6rem .1rem; color: var(--ink); }
.list.big li > a { padding: .8rem 1rem; }
.list li > a:hover { background: #f8fafc; text-decoration: none; }
.list small { display: block; color: var(--muted); font-size: .8rem; }
.list .right { text-align: right; flex-shrink: 0; }
.list li.unread b::before { content: "●"; color: var(--bad); margin-right: .35rem; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: .6rem .8rem; background: #f8fafc; border-bottom: 1px solid var(--line); }
.table td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[onclick] { cursor: pointer; } .table tbody tr[onclick]:hover { background: #f8fafc; }
.table .num { text-align: right; }
.card .tablewrap { overflow-x: auto; margin: 0 -1.1rem; } .card .tablewrap .table th:first-child, .card .tablewrap .table td:first-child { padding-left: 1.1rem; }
.card.flush .tablewrap { margin: 0; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .88rem; } .kv dd { margin: 0; }
.notes { white-space: pre-wrap; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: .7rem .8rem; margin-top: .8rem; font-size: .93rem; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem; }
.tile { display: flex; flex-direction: column; gap: .25rem; padding: .8rem .9rem; border: 1px solid var(--line); border-left: 4px solid var(--t); border-radius: 8px; color: var(--ink); background: #fff; }
.tile:hover { text-decoration: none; box-shadow: var(--shadow); } .tile .badge { align-self: flex-start; } .tile small { color: var(--muted); }

.jump { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.jump a { padding: .3rem .7rem; background: #fff; border: 1px solid var(--line); border-radius: 99px; font-size: .85rem; }

details > summary { list-style: none; cursor: pointer; } details > summary::-webkit-details-marker { display: none; }
details.add { margin-top: .8rem; } details.add[open] > summary { margin-bottom: .8rem; }
.rowedit { display: inline-block; position: relative; } .rowedit > summary { padding: .25rem .35rem; border-radius: 6px; } .rowedit > summary:hover { background: #f1f4f8; }
.rowedit .pop { position: absolute; right: 0; z-index: 10; width: min(640px, 92vw); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .9rem; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.dropdown { position: relative; } .dropdown .menu { position: absolute; right: 0; z-index: 10; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.15); min-width: 240px; padding: .3rem; }
.dropdown .menu a { display: block; padding: .5rem .7rem; border-radius: 6px; color: var(--ink); } .dropdown .menu a:hover { background: #f1f4f8; text-decoration: none; }

.creds { list-style: none; margin: 0; padding: 0; }
.creds li { display: flex; justify-content: space-between; gap: .8rem; padding: .7rem 0; border-top: 1px solid var(--line); } .creds li:first-child { border-top: 0; }
.cred-line { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .25rem 0; }
.cred-line .mono { background: #f3f5f8; padding: .2rem .5rem; border-radius: 6px; }
[data-copy] { cursor: copy; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; margin-bottom: .8rem; }
.gitem { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; position: relative; }
.gitem img, .gitem .fileicon { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #f3f5f8; }
.gitem .fileicon { display: grid; place-items: center; font-weight: 800; color: var(--muted); font-size: 1.2rem; }
.gmeta { padding: .35rem .5rem; font-size: .8rem; } .gmeta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .gmeta small { color: var(--muted); }
.gitem form { position: absolute; top: 4px; right: 4px; } .gitem .iconbtn { background: rgba(255,255,255,.9); }
.upload { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 95px 1fr auto; gap: .6rem; padding: .5rem 0; border-top: 1px solid var(--line); align-items: start; }
.timeline .date { font-weight: 600; font-size: .86rem; color: var(--orange-d); }

.thread { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 1rem; }
.msg { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .75rem .9rem; max-width: 92%; box-shadow: var(--shadow); }
.msg.client { align-self: flex-start; } .msg.staff { align-self: flex-end; background: var(--orange-l); border-color: #ffd2bf; }
.msg.internal { background: #fff8e8; border-color: #f1dca8; border-style: dashed; }
.msghead { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .3rem; } .msghead small { color: var(--muted); margin-left: auto; }
.msgbody { white-space: pre-wrap; overflow-wrap: anywhere; }
.att { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin-top: .5rem; font-size: .88rem; }

.auth { min-height: 85vh; display: grid; place-items: center; }
.auth-brand { text-align: center; margin-bottom: 1rem; } .auth-brand h1 { margin-top: .6rem; }
.danger-zone { margin: 2rem 0 1rem; text-align: right; }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .grid2, .grid-ticket { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .row3, .row4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: .75rem; }
  body.role-admin .wrap, body.role-tech .wrap { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .topsearch { display: none; }
  .topbar { gap: .5rem; padding-left: .75rem; padding-right: .75rem; }
  .role-admin .topnav a:not([href="/account"]), .role-tech .topnav a:not([href="/account"]) { display: none; }
  .topnav a, .linkbtn { padding: .35rem .45rem; font-size: .85rem; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 10px rgba(0,0,0,.05); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; padding: .4rem 0 .35rem; font-size: .7rem; color: var(--muted); }
  .tabbar a span { font-size: 1.25rem; line-height: 1.3; } .tabbar a.on { color: var(--orange); font-weight: 700; box-shadow: inset 0 3px 0 var(--orange); } .tabbar a:hover { text-decoration: none; }
  .row2, .row3, .row4 { grid-template-columns: 1fr; }
  .row-log { grid-template-columns: 1fr; }
  .hide-m { display: none; }
  .pagehead { align-items: flex-start; } .pagehead .actions { width: 100%; } .pagehead .actions .btn { flex: 1; }
  .msg { max-width: 100%; }
  .card { padding: .9rem; } .card .tablewrap { margin: 0 -.9rem; }
  .rowedit .pop { position: fixed; left: 4vw; right: 4vw; top: 15vh; width: auto; max-height: 75vh; overflow: auto; }
  .timeline li { grid-template-columns: 80px 1fr auto; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

/* διορθώσεις */
.form label.pill { display: inline-block; margin: 0; font-weight: 500; }
.topnav a, .linkbtn { white-space: nowrap; }
@media (max-width: 640px) {
  .brand small { display: none; }
  .wordmark { font-size: 1.15rem; } .brand img.brandlogo { height: 40px; }
  .uname { display: none; }
  .role-client .topnav a[href="/portal"] { display: none; }
  .tablewrap .table td, .tablewrap .table th { white-space: nowrap; }
}

.auth-brand .wordmark.big { font-size: 2rem; margin: .7rem 0 .2rem; }
.auth-brand .logo.big { margin: 0 auto; }
.auth .card { border-top: 4px solid var(--orange); }
.brandsub { border-left: 2px solid var(--line); padding-left: .6rem; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.auth-brand img.brandlogo { height: auto; width: min(300px, 80%); margin: .4rem auto .2rem; }
@media (max-width: 640px) { .brandsub { display: none; } }

/* επιλογή υπηρεσίας (portal) */
fieldset.services { border: 0; padding: 0; margin: 0 0 1rem; }
fieldset.services legend { font-size: .95rem; font-weight: 700; color: var(--ink); margin-bottom: .6rem; padding: 0; }
.svcgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; }
.form label.svc { margin: 0; font-weight: 400; cursor: pointer; }
.svc input { position: absolute; opacity: 0; pointer-events: none; }
.svcbox { display: flex; flex-direction: column; gap: .15rem; height: 100%; padding: .75rem .8rem; border: 2px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .12s, background .12s; }
.svcbox b { font-size: .93rem; color: var(--ink); } .svcbox small { font-size: .78rem; color: var(--muted); line-height: 1.3; }
.svcicon { font-size: 1.5rem; line-height: 1.2; }
.svc:hover .svcbox { border-color: #ffb08f; }
.svc input:checked + .svcbox { border-color: var(--orange); background: var(--orange-l); box-shadow: 0 0 0 3px rgba(255,93,30,.15); }
.svc input:focus-visible + .svcbox { outline: 2px solid var(--orange); }
.badge.svcb { background: var(--orange-l); color: var(--orange-d); }
@media (max-width: 640px) { .svcgrid { grid-template-columns: 1fr 1fr; gap: .5rem; } .svcbox { padding: .6rem; } .svcbox small { display: none; } }
@media (min-width: 861px) { .svcgrid { grid-template-columns: repeat(4, 1fr); } }

/* εγγραφή */
.card.register { max-width: 640px; width: 100%; margin: 1rem auto; }
.auth .card.register h3 { font-size: .95rem; margin: 1.1rem 0 .5rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.auth .card.register h3 small { font-weight: 400; font-size: .8rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form label.check span { font-weight: 400; }
.form label.check { align-items: flex-start; } .form label.check input { margin-top: .2rem; }
.divider { display: flex; align-items: center; gap: .6rem; margin: 1.2rem 0 .8rem; color: var(--muted); font-size: .85rem; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.badge.pending { background: #fff2d9; color: #8a5a00; }
.notice { background: #fff8e8; border: 1px solid #f1dca8; border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1rem; display: flex; gap: .8rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ΑΑΔΕ */
.afm-status { margin: -.4rem 0 .8rem; font-weight: 500; }
.afm-status.ok { color: var(--ok); } .afm-status.bad { color: var(--bad); }
.form input.filled { background: #eefaf2 !important; transition: background .3s; }
