/* ==========================================================================
   CNet Helpdesk — restyled to match the cnet.gr site (2026-07)
   Same class names as before; only the look changed.
   ========================================================================== */

:root {
  --navy: #163a66;
  --navy-dark: #0e2747;
  --navy-deeper: #0a1d36;
  --accent: #56aede;
  --accent-light: #9fd1ef;

  --bg: #f3f7fb;
  --panel: #ffffff;
  --ink: #1c2b3a;
  --muted: #5b6b7c;
  --line: #e3ebf2;

  /* legacy aliases kept so any stray reference still resolves */
  --brand: #163a66;
  --brand-dark: #0e2747;

  --ok: #1b6e3d;
  --warn: #8a6410;
  --err: #c0392b;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(14, 39, 71, 0.08);
  --shadow-md: 0 8px 30px rgba(14, 39, 71, 0.12);
  --shadow-lg: 0 18px 50px rgba(14, 39, 71, 0.18);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: none; }

h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; color: var(--navy-dark); margin: 0 0 1rem; }
h2 { font-size: 1.15rem; font-weight: 700; color: var(--navy-dark); margin: 2rem 0 0.75rem; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.muted { color: var(--muted); }

/* ---- top nav ---- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(120deg, var(--navy-deeper) 0%, var(--navy) 100%);
  color: #d7e6f2;
  padding: 0 1.25rem;
  height: 60px;
  box-shadow: var(--shadow-md);
}
.topnav a { color: #cfe0f0; padding: 0.5rem 0.85rem; border-radius: 8px; font-weight: 600; font-size: 0.92rem; }
.topnav a:hover { color: #fff; background: rgba(255, 255, 255, 0.09); }
.topnav .brand { display: flex; align-items: center; gap: 0.5rem; padding-right: 0.75rem; }
.topnav .brand-logo, .topnav .brand-name { padding: 0.4rem 0.3rem; border-radius: 8px; }
.topnav .brand-logo { padding-left: 0; }
.topnav .brand-logo img { display: block; height: 26px; width: auto; }
.topnav .brand-logo:hover { background: none; }
.topnav .brand-name { font-weight: 700; color: var(--accent-light); letter-spacing: 0.02em; }
.topnav .brand-name:hover { background: none; color: #fff; }
.topnav .spacer { flex: 1; }
.topnav .who { color: #9fb8cd; font-weight: 500; }
.topnav .logout { color: #9fb8cd; }
.topnav .langsw { display: inline-flex; align-items: center; gap: 0.15rem; font-size: 0.82rem; }
.topnav .langsw a { color: #9fb8cd; padding: 0.35rem 0.35rem; border-radius: 6px; font-weight: 600; }
.topnav .langsw a:hover { color: #fff; background: rgba(255, 255, 255, 0.09); }
.topnav .langsw .on { color: var(--accent-light); font-weight: 700; padding: 0.35rem 0.35rem; }
.topnav .langsw .sep { color: #45607a; }

/* Language switcher on the auth pages (login / register / verify / forgot). */
.auth-langsw { max-width: 780px; margin: 0.75rem auto -0.25rem; padding: 0 0.5rem; text-align: right; }
.auth-langsw .langsw { font-size: 0.85rem; }
.auth-langsw .langsw a { color: var(--muted); font-weight: 600; padding: 0.2rem 0.35rem; }
.auth-langsw .langsw a:hover { color: var(--navy); }
.auth-langsw .langsw .on { color: var(--navy); font-weight: 700; }
.auth-langsw .langsw .sep { color: var(--line); margin: 0 0.1rem; }

/* ---- flash messages ---- */
.flash {
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  border: 1px solid;
  font-size: 0.95rem;
}
.flash-ok  { background: #e8f8ee; border-color: #b5e5c8; color: var(--ok); }
.flash-err { background: #fdeeee; border-color: #f2c7c7; color: var(--err); }

/* ---- login / setup ---- */
.auth-card {
  max-width: 400px;
  margin: 9vh auto 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.25rem;
  box-shadow: var(--shadow-lg);
}
.auth-card .auth-logo { display: block; height: 40px; width: auto; margin: 0 auto 1rem; }

/* ---- two-column sign-in (staff | customer) ---- */
.auth-split { max-width: 780px; margin: 6vh auto 0; }
.auth-split-head { text-align: center; margin-bottom: 1.4rem; }
.auth-split-head .auth-logo { display: block; height: 40px; width: auto; margin: 0 auto 0.7rem; }
.auth-split-head h1 { font-size: 1.35rem; margin: 0; }
.auth-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
.auth-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}
.auth-panel h2 { font-size: 1.02rem; margin: 0 0 1.1rem; }
.auth-panel--staff { border-top: 3px solid var(--navy); }
.auth-panel--staff h2 { color: var(--navy); }
.auth-panel--customer { background: var(--bg); border-top: 3px solid var(--accent); }
.auth-panel--customer h2 { color: #135a96; }
.auth-panel--customer button { background: var(--accent); color: var(--navy-deeper); }
.auth-panel--customer button:hover { background: var(--accent-light); color: var(--navy-deeper); }
.auth-panel .auth-links { text-align: left; margin: 0.9rem 0 0; }
@media (max-width: 640px) { .auth-cols { grid-template-columns: 1fr; } }
.auth-card h1 { text-align: center; color: var(--navy-dark); font-size: 1.35rem; }
.auth-card .muted { text-align: center; }

/* ---- forms ---- */
label { display: block; margin-bottom: 0.85rem; font-weight: 600; font-size: 0.82rem; color: var(--navy-dark); }
input[type="text"], input[type="password"], input[type="email"], input[type="search"],
select, textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.6rem 0.7rem;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(86, 174, 222, 0.18);
}
button {
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--navy);
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.3rem;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
button:hover { background: var(--navy-dark); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; font-weight: 600; border-radius: 8px; }
.btn-link { align-self: center; font-weight: 600; }
.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.check input { width: auto; margin: 0; }

.ticket-form { max-width: 720px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 1rem; }

/* ---- dashboard cards ---- */
.cards { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; }
.card {
  flex: 1;
  min-width: 112px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  color: var(--muted);
  font-size: 0.8rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover { text-decoration: none; border-color: rgba(86, 174, 222, 0.6); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(86, 174, 222, 0.35); }
.card-n { font-size: 1.7rem; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; }

/* ---- filters ---- */
.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.5rem; align-items: center; }
.filters input[type="search"] { flex: 2; min-width: 220px; margin: 0; width: auto; }
.filters select { flex: 1; min-width: 150px; margin: 0; width: auto; }

/* ---- ticket table ---- */
table.tickets { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.tickets th, .tickets td { text-align: left; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tickets th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--bg); font-weight: 700; }
.tickets tr:last-child td { border-bottom: 0; }
.tickets tbody tr:hover td { background: var(--bg); }
.tickets .num { color: var(--muted); }
.empty { color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); padding: 2.5rem; text-align: center; box-shadow: var(--shadow-sm); }

/* ---- badges ---- */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.st-open        { background: #e3effa; color: #135a96; }
.st-in_progress { background: #fff4d6; color: #8a6410; }
.st-waiting     { background: #f3e8fd; color: #6b3fa0; }
.st-resolved    { background: #e8f8ee; color: var(--ok); }
.st-closed      { background: #e9edf1; color: var(--muted); }
.pr-low    { background: #e9edf1; color: var(--muted); }
.pr-medium { background: #e3effa; color: #135a96; }
.pr-high   { background: #fdebd7; color: #ad5b0d; }
.pr-urgent { background: #fdeeee; color: var(--err); }

/* ---- ticket view ---- */
/* Big floating "back to dashboard" arrow, vertically centred on the left. */
.ticket-back {
  position: fixed;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 2rem;
  line-height: 60px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  z-index: 60;
  transition: background 0.18s ease, transform 0.18s ease;
}
.ticket-back:hover { background: var(--navy-dark); text-decoration: none; color: #fff; transform: translateY(-50%) scale(1.07); }
/* Hide once the content column would reach the arrow, to avoid overlap. */
@media (max-width: 1300px) { .ticket-back { display: none; } }

.ticket-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.35rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.meta-label { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 0.15rem; font-weight: 700; }
.ticket-body {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.35rem;
  margin-bottom: 1rem;
  white-space: normal;
  box-shadow: var(--shadow-sm);
}
.update-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.35rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.update-bar label { margin: 0; flex: 1; min-width: 140px; }
.edit-details { margin-bottom: 1rem; }
.edit-details summary { cursor: pointer; color: var(--navy); font-weight: 600; font-size: 0.9rem; }
.edit-details form { margin-top: 0.75rem; }

/* ---- activity ---- */
.timeline { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1rem; }
.comment { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.85rem 1.1rem; box-shadow: var(--shadow-sm); }
.comment-head { margin-bottom: 0.35rem; }
.event { font-size: 0.85rem; color: var(--muted); padding: 0.1rem 1rem; border-left: 3px solid var(--line); }
.comment-form textarea { margin-bottom: 0.6rem; }

/* ---- deleted folder & replies ---- */
.btn-danger { background: var(--err); }
.btn-danger:hover { background: #96281b; }
.card-deleted .card-n { color: var(--err); }
.ticket-head-actions { display: flex; align-items: center; gap: 0.5rem; }
.ticket-head-actions form { margin: 0; }
.deleted-banner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.deleted-actions { display: flex; gap: 0.5rem; }
.deleted-actions form { margin: 0; }
.comment-reply { border-left: 3px solid var(--accent); }
/* After posting a reply/comment the page jumps here; briefly highlight it. */
#activity { scroll-margin-top: 16px; animation: activity-hl 2.6s ease-out; }
@keyframes activity-hl {
  0%, 15% { box-shadow: 0 0 0 3px var(--accent); }
  100%    { box-shadow: 0 0 0 3px transparent; }
}

/* ---- attachments ---- */
.att-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.7rem; }
.att-chip {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
}
.att-chip:hover { border-color: var(--accent); color: var(--navy); text-decoration: none; }
input[type="file"] { font-weight: 400; margin-top: 0.3rem; display: block; width: 100%; }
.att-list audio { display: block; width: 100%; max-width: 460px; height: 36px; }

/* ---- customers page: top form + filter ---- */
.cust-form { margin-bottom: 1.5rem; }
.cust-form > summary { font-weight: 600; color: var(--navy); }
.cust-form .ticket-form { margin-top: 0.75rem; }
.cust-searchbar { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.cust-searchbar input[type="search"] { flex: 1; max-width: 480px; margin: 0; }
#cust-count { white-space: nowrap; font-size: 0.85rem; }
/* Customers page uses more of the screen so the Company column can be large. */
body:has(#cust-table) .wrap { max-width: 1500px; }
/* Fixed layout with percentage widths; Company doubled (≈29% → 42%, ~2× its px
   width once the container is widened). Numbers/actions sized to their labels. */
#cust-table { table-layout: fixed; }
#cust-table thead th { white-space: nowrap; }
#cust-table td:nth-child(2), #cust-table td:nth-child(3) { overflow-wrap: anywhere; }
#cust-table th:nth-child(1), #cust-table td:nth-child(1) { width: 33%; }
#cust-table th:nth-child(2), #cust-table td:nth-child(2) { width: 19%; }
#cust-table th:nth-child(3), #cust-table td:nth-child(3) { width: 16%; }
#cust-table th:nth-child(4), #cust-table td:nth-child(4) { width: 6%; }
#cust-table th:nth-child(5), #cust-table td:nth-child(5) { width: 7%; }
#cust-table th:nth-child(6), #cust-table td:nth-child(6) { width: 6%; }
#cust-table th:nth-child(7), #cust-table td:nth-child(7) { width: 13%; }
/* Actions column: Edit + Delete on one line when there's room; wrap (stack)
   instead of clipping when the labels are long (Greek Επεξεργασία / Διαγραφή). */
#cust-table td:nth-child(7) { white-space: normal; }
#cust-table .row-actions { flex-wrap: wrap; justify-content: flex-start; gap: 0.35rem; }
#cust-table .row-actions .btn-sm { padding: 0.3rem 0.6rem; }
#cust-table td { padding-top: 0.4rem; padding-bottom: 0.4rem; }

/* ---- users page ---- */
.row-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.row-actions form { display: flex; gap: 0.4rem; align-items: center; margin: 0; }
.inline-pass input { width: 140px; margin: 0; padding: 0.3rem 0.55rem; font-size: 0.8rem; }
.add-user { margin-top: 0.5rem; }

/* ---- portal / auth extras ---- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.6rem 0 1.1rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-links { text-align: center; margin-top: 1rem; font-size: 0.9rem; }
.auth-logo-link { display: block; }
.cf-turnstile { margin: 0.25rem 0 1rem; }
/* "Customer activity" marker on the dashboard ticket list. */
.attn {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--err);
  background: #fdeeee;
  border: 1px solid #f2c7c7;
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  vertical-align: middle;
  white-space: nowrap;
}
/* Green left-rail marks a message that came FROM the customer (portal). */
.comment-customer { border-left: 3px solid var(--ok); }
.inline-scope { margin: 0; }
.inline-scope select { width: auto; margin: 0; padding: 0.3rem 0.5rem; font-size: 0.85rem; }

@media (max-width: 720px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .tickets th:nth-child(4), .tickets td:nth-child(4),
  .tickets th:nth-child(8), .tickets td:nth-child(8) { display: none; }
  .topnav { gap: 0.25rem; overflow-x: auto; padding: 0 0.75rem; }
  .topnav .brand-name { display: none; }
}
