/* ================= design tokens ================= */
:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #f9fafc;
  --text: #16213a;
  --muted: #69758c;
  --border: #e3e8f0;
  --accent: #0f6cbd;
  --accent-2: #115ea3;
  --accent-soft: #e8f1fb;
  --ring: rgba(15, 108, 189, .25);
  --sidebar: #0c1a33;
  --sidebar-2: #13284d;
  --sidebar-text: #b9c6de;
  --ok: #107c41; --ok-soft: #e3f4ea;
  --warn: #a15c00; --warn-soft: #fff3dc;
  --bad: #c42b1c; --bad-soft: #fde7e5;
  --info: #0b6a9e; --info-soft: #e1f2fb;
  --grey-soft: #eef1f6;
  --p1: #d13438; --p2: #e3761b; --p3: #0f6cbd; --p4: #707d93;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --panel: #121b2d; --panel-2: #0f1728; --text: #e6ebf5; --muted: #95a2ba; --border: #22304a;
    --accent: #4f9ee8; --accent-2: #6aaef0; --accent-soft: #15294a; --ring: rgba(79, 158, 232, .3);
    --sidebar: #070d19; --sidebar-2: #0f1b33;
    --ok: #54c784; --ok-soft: #10301f; --warn: #f2b84b; --warn-soft: #362709; --bad: #ff7a6e; --bad-soft: #3a1512;
    --info: #6cc3f2; --info-soft: #0c2a3d; --grey-soft: #1b263b;
    --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 16px 40px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --panel: #121b2d; --panel-2: #0f1728; --text: #e6ebf5; --muted: #95a2ba; --border: #22304a;
  --accent: #4f9ee8; --accent-2: #6aaef0; --accent-soft: #15294a; --ring: rgba(79, 158, 232, .3);
  --sidebar: #070d19; --sidebar-2: #0f1b33;
  --ok: #54c784; --ok-soft: #10301f; --warn: #f2b84b; --warn-soft: #362709; --bad: #ff7a6e; --bad-soft: #3a1512;
  --info: #6cc3f2; --info-soft: #0c2a3d; --grey-soft: #1b263b;
  --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 16px 40px rgba(0,0,0,.5);
  color-scheme: dark;
}

/* ================= base ================= */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 14px; font-weight: 650; }
h3 { font-size: 14px; margin: 0 0 8px; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; background: var(--grey-soft); padding: 1px 5px; border-radius: 4px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--bad); min-height: 18px; font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; word-break: break-word; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ================= login ================= */
.login { min-height: 100%; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-brand { background: radial-gradient(circle at 20% 10%, #1d4f91 0, transparent 55%), linear-gradient(160deg, #0c1a33, #0f3a6e 60%, #0f6cbd); color: #fff; padding: 56px 64px; display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.login-brand h1 { font-size: 38px; line-height: 1.15; font-weight: 700; }
.login-brand ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; color: #d6e4f7; font-size: 15px; }
.login-brand li { display: flex; gap: 10px; align-items: center; }
.login-brand li svg { color: #7fd1ff; }
.login-foot { margin-top: auto; color: #9fb6d8; font-size: 13px; }
.login-panel { display: grid; place-items: center; padding: 32px 16px; }
.login-card { width: 100%; max-width: 380px; display: grid; gap: 14px; }
.login-card h2 { font-size: 24px; margin: 0; }
.login-card > p { margin: -8px 0 6px; }
.login-form { display: grid; gap: 12px; }
.btn-ms { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 11px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); color: var(--text); font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; box-shadow: var(--shadow); }
.btn-ms:hover { border-color: var(--accent); }
.btn-ms svg { width: 20px; height: 20px; stroke: none; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { padding: 32px 24px; gap: 14px; }
  .login-brand h1 { font-size: 26px; }
  .login-brand ul, .login-foot { display: none; }
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand.big { font-size: 20px; }
.logo { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #2b88d8, #0f6cbd); color: #fff; box-shadow: 0 2px 6px rgba(15,108,189,.4); }
.logo svg { width: 18px; height: 18px; stroke-width: 2.5; }

/* ================= layout ================= */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100%; }
.sidebar { background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2)); color: var(--sidebar-text); padding: 18px 12px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; z-index: 30; }
.sidebar .brand { color: #fff; padding: 2px 8px 6px; }
#nav { display: grid; gap: 2px; }
#nav a { display: flex; align-items: center; gap: 12px; color: var(--sidebar-text); padding: 9px 12px; border-radius: 8px; font-weight: 500; text-decoration: none; position: relative; }
#nav a svg { opacity: .85; }
#nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
#nav a.active { background: rgba(79,158,232,.18); color: #fff; }
#nav a.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #4f9ee8; }
.nav-count { margin-left: auto; background: rgba(255,255,255,.14); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.sidebar-foot { margin-top: auto; padding: 0 10px; color: #6f7f9c; }
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 28px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.spacer { flex: 1; }
.search { position: relative; flex: 1; max-width: 420px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.search input { padding-left: 34px; background: var(--panel); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.only-mobile { display: none; }
.user-menu { position: relative; }
.avatar-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 6px; border-radius: 10px; cursor: pointer; color: var(--text); font: inherit; text-align: left; }
.avatar-btn:hover { background: var(--grey-soft); }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #2b88d8, #0f6cbd); color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.who { display: grid; line-height: 1.2; }
.who small { color: var(--muted); font-size: 11px; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 220px; padding: 6px; z-index: 40; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 6px; cursor: pointer; font: inherit; color: var(--text); }
.menu button:hover { background: var(--grey-soft); }
.view { padding: 24px 28px 40px; min-width: 0; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.scrim { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .2s ease; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(5,10,20,.45); z-index: 25; }
  .only-mobile { display: inline-grid; }
  .topbar { padding: 10px 16px; }
  .who { display: none; }
  .view { padding: 16px; }
}

/* ================= components ================= */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
@media (max-width: 1180px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }

.stat { position: relative; overflow: hidden; }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-size: 30px; font-weight: 700; line-height: 1.15; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.stat-icon { position: absolute; right: 16px; top: 16px; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.stat-icon.ok { background: var(--ok-soft); color: var(--ok); }
.stat-icon.warn { background: var(--warn-soft); color: var(--warn); }
.stat-icon.bad { background: var(--bad-soft); color: var(--bad); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: var(--panel); color: var(--text); padding: 8px 14px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 600; line-height: 1.2; transition: background .12s, border-color .12s; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.block { width: 100%; padding: 10px; }
.btn svg { width: 16px; height: 16px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
.link:hover { text-decoration: underline; }

label { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
textarea { min-height: 90px; resize: vertical; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); box-shadow: none; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); font-size: 13px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-top: 1px solid var(--border); padding-top: 14px; margin-top: 4px; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters > * { width: auto; min-width: 150px; }
.filters input[type=search] { flex: 1; min-width: 220px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid var(--border); background: var(--panel); color: var(--muted); padding: 4px 12px; border-radius: 999px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; background: var(--panel-2); }
thead th:first-child { border-top-left-radius: 8px; }
thead th:last-child { border-top-right-radius: 8px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; transition: background .1s; }
tbody tr.clickable:hover { background: var(--accent-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.prio-P1 td:first-child { box-shadow: inset 3px 0 0 var(--p1); }
tr.prio-P2 td:first-child { box-shadow: inset 3px 0 0 var(--p2); }
tr.prio-P3 td:first-child { box-shadow: inset 3px 0 0 var(--p3); }
tr.prio-P4 td:first-child { box-shadow: inset 3px 0 0 var(--p4); }
.ticket-title { font-weight: 600; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--grey-soft); color: var(--muted); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.prio { display: inline-block; min-width: 28px; text-align: center; padding: 2px 6px; border-radius: 6px; color: #fff; font-weight: 700; font-size: 11px; letter-spacing: .02em; }
.prio.P1 { background: var(--p1); } .prio.P2 { background: var(--p2); } .prio.P3 { background: var(--p3); } .prio.P4 { background: var(--p4); }

.meter { height: 10px; background: var(--grey-soft); border-radius: 999px; overflow: hidden; margin: 12px 0 6px; }
.meter > span { display: block; height: 100%; background: linear-gradient(90deg, #2b88d8, var(--accent)); border-radius: 999px; transition: width .4s ease; }
.meter.warn > span { background: linear-gradient(90deg, #f7b955, #e3761b); }
.meter.bad > span { background: linear-gradient(90deg, #f1707b, #c42b1c); }

.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 170px) 1fr 64px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .track { height: 8px; background: var(--grey-soft); border-radius: 999px; overflow: hidden; }
.bar-row .track span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar-row .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chart svg { width: 100%; height: auto; display: block; stroke: none; }
.chart text { fill: var(--muted); font-size: 11px; }
.donut { display: flex; align-items: center; gap: 18px; }
.donut svg { width: 110px; height: 110px; transform: rotate(-90deg); stroke-linecap: butt; }
.donut .legend { display: grid; gap: 6px; font-size: 13px; }
.donut .legend span { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.alert { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; border: 1px solid transparent; }
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert.bad { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.alert.info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }

.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty svg { width: 34px; height: 34px; opacity: .5; display: block; margin: 0 auto 8px; }

.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 1050px) { .ticket-layout { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 10px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; }
.timeline { display: grid; gap: 12px; }
.comment { display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
.comment .bubble { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--panel-2); min-width: 0; }
.comment.internal .bubble { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.comment .head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: -4px 0 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 8px 12px; cursor: pointer; font: inherit; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.sla-box { display: grid; gap: 14px; }
.sla-item { display: grid; gap: 6px; }
.sla-item .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sla-progress { height: 6px; background: var(--grey-soft); border-radius: 999px; overflow: hidden; }
.sla-progress span { display: block; height: 100%; border-radius: 999px; background: var(--info); }
.sla-progress.ok span { background: var(--ok); }
.sla-progress.warn span { background: #e3a21a; }
.sla-progress.bad span { background: var(--bad); }

.modal { position: fixed; inset: 0; background: rgba(5, 10, 20, .55); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .12s ease; }
.modal-card { background: var(--panel); border-radius: 14px; padding: 24px; width: 100%; max-width: 660px; max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lg); animation: pop .15s ease; }
.modal-card h2 { font-size: 18px; margin-bottom: 18px; }
.modal-card .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.toast { position: fixed; bottom: 20px; right: 20px; background: #16213a; color: #fff; padding: 11px 16px; border-radius: 10px; z-index: 60; box-shadow: var(--shadow-lg); max-width: calc(100vw - 40px); font-weight: 500; animation: pop .15s ease; }
.toast.bad { background: var(--bad); }

.report-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; border-bottom: 3px solid var(--accent); padding-bottom: 14px; margin-bottom: 20px; }
.print-only { display: none; }

/* ---- timer ---- */
.timer-pill { display: flex; align-items: center; gap: 8px; background: #c42b1c; color: #fff !important; padding: 9px 12px; border-radius: 8px; font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: none !important; white-space: pre; }
.timer-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.btn.running { background: #c42b1c; border-color: #c42b1c; color: #fff; font-variant-numeric: tabular-nums; }

/* ---- attachments ---- */
.attachments { display: grid; gap: 8px; }
.attachment { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; }
.attachment img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--grey-soft); cursor: zoom-in; }
.attachment .file-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 8px; background: var(--grey-soft); color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.attachment .info { flex: 1; min-width: 0; }
.attachment .info .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dropzone { border: 2px dashed var(--border); border-radius: 10px; padding: 16px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; margin-top: 10px; transition: all .12s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.lightbox img { max-width: 100%; max-height: 80vh; display: block; margin: 0 auto 12px; border-radius: 8px; }

/* ---- sortable tables ---- */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--accent); }
th.sorted-asc::after { content: ' ▲'; font-size: 9px; }
th.sorted-desc::after { content: ' ▼'; font-size: 9px; }

.info-list { display: grid; grid-template-columns: 170px 1fr; gap: 8px 12px; font-size: 13px; margin: 0 0 12px; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; word-break: break-all; }
tr[data-prio] input[name=name] { min-width: 110px; }
tr[data-prio] input[type=number] { min-width: 80px; max-width: 120px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.status-dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.steps { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; }

/* ================= print ================= */
@media print {
  :root { --bg: #fff; --panel: #fff; --panel-2: #f6f6f6; --text: #000; --muted: #555; --border: #ccc; }
  body { background: #fff; color: #000; font-size: 12px; }
  .sidebar, .topbar, .no-print, .page-head .actions, .toast, .timer-pill { display: none !important; }
  .app { display: block; }
  .view { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  .print-only { display: block; }
  .grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  a { color: inherit; }
}
.ticket-title { min-width: 240px; }
.ticket-title .muted { font-weight: 400; }
#ticket-list td { white-space: nowrap; }
#ticket-list td.ticket-title { white-space: normal; }
