/* DSX Digital customer portal — matches the dsxdigital.com design system. */

@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/portal/static/hanken-latin-ext.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: 'Hanken Grotesk'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/portal/static/hanken-latin.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; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500 600; font-display: swap;
  src: url("/portal/static/jetbrains-latin.woff2") format('woff2'); }

:root {
  --ink: #0e1326; --text: #1d2333; --body: #4a5167; --muted: #666d81; --faint: #7c8296;
  --line: #e8eaf3; --line-2: #dfe2ee; --bg: #f6f7fb; --card: #ffffff; --tint: #e9f1fb;
  --accent: #2f6fb0; --accent-deep: #15375c; --navy: #0c1022;
  --ok: #15803d; --ok-bg: #e8f6ee; --warn: #a15c07; --warn-bg: #fdf3e2; --bad: #b42318; --bad-bg: #fdecea;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--text);
  background: var(--bg); font-size: 15px; line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased; }
::selection { background: #cfe0f3; color: #0f2a47; }
a { color: var(--accent); }
h1, h2, h3 { color: var(--ink); letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(24px, 3vw, 30px); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
code, .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; }

/* ── header ─────────────────────────────────────────────────────────────── */
.p-header { position: sticky; top: 0; z-index: 50; background: rgba(12,16,34,0.96); border-bottom: 1px solid rgba(255,255,255,0.10); }
.p-header-in { max-width: 1280px; margin: 0 auto; height: 68px; padding: 0 clamp(16px, 4vw, 40px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.p-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.p-brand img { height: 34px; width: auto; display: block; }
.p-brand-tag { font-size: 11.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: #9fc2e6;
  border: 1px solid rgba(159,194,230,0.35); border-radius: 6px; padding: 3px 8px; }
.p-who { display: flex; align-items: center; gap: 14px; }
.p-who-name { display: flex; flex-direction: column; align-items: flex-end; text-decoration: none; line-height: 1.25; }
.p-who-name span { color: #fff; font-weight: 600; font-size: 14px; }
.p-who-name small { color: #8b90a3; font-size: 12px; }
.p-who form { margin: 0; }
.p-logout { font: inherit; font-size: 13.5px; font-weight: 600; color: #c2c7d6; background: transparent;
  border: 1px solid rgba(255,255,255,0.18); border-radius: 8px; height: 34px; padding: 0 12px; cursor: pointer; }
.p-logout:hover { color: #fff; border-color: rgba(255,255,255,0.4); }
.p-back { color: #c2c7d6; text-decoration: none; font-size: 14px; }
.p-back:hover { color: #fff; }
.p-nav { max-width: 1280px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); display: flex; gap: 4px; overflow-x: auto; }
.p-nav a { color: #c2c7d6; text-decoration: none; font-size: 14.5px; font-weight: 500; padding: 10px 12px 12px;
  border-bottom: 2px solid transparent; white-space: nowrap; }
.p-nav a:hover { color: #fff; }
.p-nav a.on { color: #fff; border-bottom-color: #5a97cb; }

/* ── layout ─────────────────────────────────────────────────────────────── */
.p-main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 64px; }
.p-narrow { max-width: 760px; }
.p-footer { background: var(--navy); color: #8b90a3; font-size: 13.5px; }
.p-footer-in { max-width: 1280px; margin: 0 auto; padding: 22px clamp(16px, 4vw, 40px);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.p-footer a { color: #c2c7d6; text-decoration: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid-side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 960px) { .grid-2, .grid-side { grid-template-columns: minmax(0, 1fr); } }
.stack > * + * { margin-top: 20px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(20,24,54,.04); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px;
  border-bottom: 1px solid var(--line); }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { padding: 34px 22px; text-align: center; color: var(--muted); }

/* ── stats ──────────────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; text-decoration: none; display: block; }
a.stat:hover { border-color: #d4e4f5; box-shadow: 0 8px 22px rgba(20,24,54,.07); }
.stat-label { font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); }
.stat-value { font-size: 30px; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; margin-top: 4px; }

/* ── tables ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--faint); padding: 11px 16px; border-bottom: 1px solid var(--line); background: #fafbfe; white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid #eef0f7; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
td a.row-link { color: var(--ink); font-weight: 600; text-decoration: none; }
td a.row-link:hover { color: var(--accent); }
.nowrap { white-space: nowrap; }
.ref { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12.5px; color: var(--muted); }

/* ── badges ─────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12.5px;
  font-weight: 600; white-space: nowrap; background: #eef0f7; color: #45485a; }
.st-open { background: var(--tint); color: var(--accent-deep); }
.st-in_progress { background: #ede9fe; color: #5b21b6; }
.st-waiting_customer { background: var(--warn-bg); color: var(--warn); }
.st-resolved { background: var(--ok-bg); color: var(--ok); }
.st-closed { background: #eef0f7; color: #5b6276; }
.pr-low { background: #f1f2f8; color: #666d81; }
.pr-normal { background: #eef0f7; color: #45485a; }
.pr-high { background: var(--warn-bg); color: var(--warn); }
.pr-urgent { background: var(--bad-bg); color: var(--bad); }
.ss-live { background: var(--ok-bg); color: var(--ok); }
.ss-maintenance { background: var(--warn-bg); color: var(--warn); }
.ss-in_development { background: var(--tint); color: var(--accent-deep); }
.ss-offline { background: #eef0f7; color: #5b6276; }
.badge-new { background: var(--accent); color: #fff; height: 20px; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; margin-left: 8px; }
.badge-off { background: var(--bad-bg); color: var(--bad); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 7px; }

/* ── forms ──────────────────────────────────────────────────────────────── */
form { margin: 0; }
.field { margin-bottom: 16px; }
.fields-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 16px; }
@media (max-width: 620px) { .fields-2 { grid-template-columns: minmax(0, 1fr); } }
label, .label { font-size: 13px; font-weight: 600; color: #3d4458; margin-bottom: 7px; display: block; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.input { width: 100%; height: 46px; border: 1px solid var(--line-2); border-radius: 9px; padding: 0 14px; font-size: 15px;
  font-family: inherit; color: var(--text); background: #fff; outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,111,176,.14); }
textarea.input { height: auto; min-height: 130px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 38px;
  background-image: url("/portal/static/chevron.svg");
  background-repeat: no-repeat; background-position: right 13px center; }
input[type=file].input { height: auto; padding: 10px 12px; font-size: 14px; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; font-size: 14.5px; color: var(--text); }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 44px; padding: 0 18px;
  border-radius: 9px; background: var(--accent); color: #fff; font: inherit; font-size: 15px; font-weight: 600;
  text-decoration: none; border: 1px solid var(--accent); cursor: pointer; box-shadow: 0 6px 16px rgba(47,111,176,.22); white-space: nowrap; }
.btn:hover { background: #2a63a0; }
.btn-ghost { background: #fff; color: var(--text); border-color: #e1e4ef; box-shadow: none; }
.btn-ghost:hover { background: #fafbfe; border-color: #cfd4e3; }
.btn-danger { background: #fff; color: var(--bad); border-color: #f2c4bf; box-shadow: none; }
.btn-danger:hover { background: var(--bad-bg); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; }

.flash { border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; font-size: 14.5px; border: 1px solid; }
.flash-ok { background: var(--ok-bg); color: #14532d; border-color: #bfe5cc; }
.flash-error { background: var(--bad-bg); color: #7a1a12; border-color: #f2c4bf; }
.flash-info { background: var(--tint); color: var(--accent-deep); border-color: #cfe0f3; }
.secret { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 16px; background: #0e1326; color: #fff;
  padding: 12px 14px; border-radius: 9px; user-select: all; word-break: break-all; margin-top: 8px; }

/* ── login ──────────────────────────────────────────────────────────────── */
.login { max-width: 420px; margin: clamp(20px, 6vh, 70px) auto 0; }
.login .card-pad { padding: 30px; }
.login h1 { font-size: 26px; }
.login p.lead { color: var(--muted); margin: 8px 0 24px; }

/* ── ticket thread ──────────────────────────────────────────────────────── */
.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; max-width: 88%; }
.msg-mine { align-self: flex-end; background: #f4f8fd; border-color: #d4e4f5; }
.msg-theirs { align-self: flex-start; }
.msg-note { align-self: stretch; max-width: none; background: #fffbeb; border-color: #f5e1a4; border-style: dashed; }
.msg-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.msg-author { font-weight: 700; color: var(--ink); font-size: 14px; }
.msg-author small { font-weight: 500; color: var(--muted); margin-left: 6px; }
.msg-time { font-size: 12.5px; color: var(--faint); }
.p-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.event { align-self: center; font-size: 13px; color: var(--muted); background: #eef0f7; border-radius: 999px; padding: 5px 14px; text-align: center; }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.file { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fafbfe; border-radius: 9px;
  padding: 7px 11px; font-size: 13.5px; color: var(--text); text-decoration: none; max-width: 100%; }
.file:hover { border-color: #cfe0f3; background: #fff; }
.file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.file small { color: var(--muted); }

dl.meta { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 16px; font-size: 14px; }
dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.filters a { text-decoration: none; font-size: 13.5px; font-weight: 600; color: var(--body); border: 1px solid var(--line);
  background: #fff; border-radius: 999px; padding: 6px 13px; }
.filters a.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; padding: 18px 22px 22px; }
.site { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #fafbfe; }
.site h3 { margin-bottom: 4px; overflow-wrap: anywhere; }
.site a { font-size: 13.5px; overflow-wrap: anywhere; }
.site .row { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

details.disclose { border-top: 1px solid var(--line); }
details.disclose > summary { padding: 14px 22px; font-weight: 600; color: var(--accent); cursor: pointer; }
details.disclose > div { padding: 0 22px 20px; }

@media (max-width: 620px) {
  .p-who-name { display: none; }
  .p-brand img { height: 26px; }
  .p-brand-tag { display: none; }
  .p-header-in { height: 60px; }
  .msg { max-width: 100%; }
  td, th { padding: 10px 12px; }
}
.pd-guard { background: #e9f1fb; color: #15375c; }
.pd-insight { background: #e6f4f1; color: #0f5f52; }
.pd-iq { background: #f1ecfb; color: #4c2a85; }
.checks { display: flex; gap: 18px; flex-wrap: wrap; }

/* ── phones: tables become cards ────────────────────────────────────────── */
@media (max-width: 760px) {
  .p-main { padding-top: 22px; }
  .page-head { margin-bottom: 16px; }
  .page-head .btn { width: 100%; }
  .card-pad { padding: 18px; }
  .card-head { padding: 16px 18px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat-label { font-size: 11.5px; }
  .stat-value { font-size: 26px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 0 16px 2px; }
  .filters a { white-space: nowrap; }
  .filters .input { min-width: 0; flex: 1; }

  table.t-list thead, table.s-list thead { display: none; }
  table.t-list, table.t-list tbody, table.s-list, table.s-list tbody { display: block; }
  table.t-list tr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 6px; padding: 14px 18px; border-bottom: 1px solid #eef0f7; }
  table.t-list tr:last-child { border-bottom: none; }
  table.t-list td { display: block; padding: 0; border: none; }
  table.t-list .c-ref { order: 1; flex: 1; }
  table.t-list .c-updated { order: 2; }
  table.t-list .c-subject { order: 3; width: 100%; }
  table.t-list .c-subject .row-link { font-size: 15.5px; }
  table.t-list .c-company { order: 4; width: 100%; font-size: 13.5px; color: var(--muted); }
  table.t-list .c-badge { order: 5; }

  table.s-list tr { display: block; padding: 14px 18px; border-bottom: 1px solid #eef0f7; }
  table.s-list tr:last-child { border-bottom: none; }
  table.s-list td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border: none; text-align: right; overflow-wrap: anywhere; }
  table.s-list td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; flex: none; }
  table.s-list td.s-head { display: block; text-align: left; padding-bottom: 6px; font-size: 15.5px; }
  table.s-list td.s-head::before, table.s-list td.s-actions::before { content: none; }
  table.s-list td.s-actions { justify-content: flex-start; flex-wrap: wrap; gap: 8px; padding-top: 10px; white-space: normal; }

  .msg { padding: 14px 15px; }
  .event { border-radius: 12px; font-size: 12.5px; }
  .site-grid { padding: 14px 18px 18px; }
  details.disclose > summary { padding: 14px 18px; }
  details.disclose > div { padding: 0 18px 18px; }
  .p-nav a { padding: 9px 10px 11px; font-size: 14px; }
}
