/* EMG Helpdesk — администраторски интерфейс */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8ef;
  --border-strong: #cfd7e3;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;
  --primary: #1d4ed8;
  --primary-2: #1e40af;
  --primary-soft: #e8efff;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #b45309;
  --warn-soft: #fdf3e2;
  --danger: #b91c1c;
  --danger-soft: #fdecec;
  --note: #fff8dc;
  --note-border: #f0d97a;
  --sidebar: #0f172a;
  --sidebar-2: #1e293b;
  --sidebar-text: #cbd5e1;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220; --surface: #111a2b; --surface-2: #0f1727; --border: #1f2b40; --border-strong: #2b3a55;
    --text: #e5ebf5; --text-2: #b4c0d3; --muted: #8494ad; --primary: #5b8cff; --primary-2: #7aa2ff; --primary-soft: #18264a;
    --ok: #4ade80; --ok-soft: #10291c; --warn: #fbbf24; --warn-soft: #2d2410; --danger: #f87171; --danger-soft: #2f1416;
    --note: #2a2514; --note-border: #5c4f1d; --sidebar: #070d18; --sidebar-2: #111a2b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.25; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
.inline { display: inline; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.xsmall { font-size: 11px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.text-danger { color: var(--danger); }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ico { flex: none; vertical-align: -3px; }
pre { white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 11.5px; margin: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }

/* layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 236px; flex: none; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 600; font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; display: grid; place-items: center; font-weight: 700; }
.nav { display: flex; flex-direction: column; padding: 6px 10px; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: var(--sidebar-text); font-size: 13.5px; }
.nav-item:hover { background: var(--sidebar-2); color: #fff; text-decoration: none; }
.nav-item.active { background: #1d4ed8; color: #fff; }
.nav-label { margin: 16px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #64748b; }
.sidebar-foot { margin-top: auto; padding: 14px 20px; font-size: 11px; color: #475569; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.page-title { font-size: 17px; font-weight: 600; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.nav-toggle { display: none; }
.content { padding: 20px 24px 48px; max-width: 1440px; width: 100%; }
.user-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 13px; }
.user-chip:hover { text-decoration: none; border-color: var(--border-strong); }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.bell-count { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.card-head.pad { padding: 14px 18px 0; }
.card.flush > .empty { padding: 28px; }
.empty { color: var(--muted); text-align: center; padding: 14px; margin: 0; }
.stack > .card:last-child { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack > .card { margin-bottom: 0; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.span-3 { grid-column: 1 / -1; }
.note-card { background: var(--surface-2); white-space: normal; }

/* forms */
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 10px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 7px 10px; width: 100%; font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
input[type=color] { padding: 2px; height: 36px; }
textarea { resize: vertical; }
label.check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; color: var(--text); }
label.check input { margin-top: 3px; }
.radio-row { display: flex; gap: 20px; }
.radio-col { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.field-error { color: var(--danger); font-size: 12px; font-weight: 500; }
.w-sm { max-width: 240px; } .w-md { max-width: 420px; }
.form-page { max-width: 980px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin: 6px 0 16px; }
.inline-field { flex-direction: row; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
.inline-field select, .inline-field input { width: auto; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 16px; }
.check-group-title { grid-column: 1 / -1; margin: 10px 0 4px; }
.copy-field { display: flex; gap: 6px; }
.copy-field input { font-family: var(--mono); font-size: 12.5px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius-sm); 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(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-lg { padding: 10px 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-send { background: var(--ok); border-color: var(--ok); }
.btn-send:hover { background: #166534; }

/* alerts, chips, badges */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; border: 1px solid; display: flex; gap: 8px; align-items: flex-start; }
.alert ul { margin: 0; padding-left: 18px; }
.alert-success { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: var(--ok); }
.alert-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.alert-warning { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }
.alert-info { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 25%, transparent); color: var(--primary); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); white-space: nowrap; }
.chip-xs { font-size: 10.5px; padding: 0 6px; }
.chip-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.strike { text-decoration: line-through; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.badge-cat::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--muted)); }
.dot-ok { background: var(--ok); } .dot-off { background: var(--danger); }
.sla { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.sla-ok { color: var(--ok); background: var(--ok-soft); }
.sla-warning { color: var(--warn); background: var(--warn-soft); }
.sla-overdue { color: #fff; background: var(--danger); }
.new-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-right: 6px; vertical-align: 1px; }

/* tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table.compact td, .table.compact th { padding: 6px 10px; }
.card:not(.flush) .table th { background: transparent; }
.table tr.unread .row-title { font-weight: 700; }
.table tr.disabled { opacity: .55; }
.row-title { color: var(--text); font-weight: 500; }
.tickets .prio-cell { box-shadow: inset 3px 0 0 var(--prio); }
.actions { white-space: nowrap; text-align: right; }
.schedule input[type=time] { width: 120px; }

/* toolbar / tabs / filters */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar p { margin: 0; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.toolbar .tabs { margin-bottom: 0; border-bottom: 0; }
.tab { padding: 8px 12px; color: var(--text-2); border-bottom: 2px solid transparent; font-weight: 500; font-size: 13.5px; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 11.5px; text-align: center; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px; }
.filters label { margin: 0; }
.filters select { width: auto; max-width: 200px; }
.filters .grow { flex: 1; min-width: 220px; }
.search-inline { display: flex; gap: 6px; }
.search-inline input { width: 280px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 4px 2px; font-size: 13px; }
.pager-links { display: flex; gap: 4px; }
.pager-links a, .pager-links span { min-width: 30px; padding: 4px 8px; text-align: center; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); }
.pager-links .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.breadcrumbs { margin: 0 0 12px; font-size: 13px; }

/* dashboard */
.stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); }
.stat:hover { border-color: var(--primary); text-decoration: none; }
.stat-ico { grid-row: span 2; width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-danger .stat-ico { background: var(--danger-soft); color: var(--danger); }
.stat-danger .stat-value { color: var(--danger); }
.stat-accent .stat-ico { background: var(--primary); color: #fff; }
.bar-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bar-list a { display: flex; justify-content: space-between; color: var(--text); font-size: 13px; }
.bar-label { display: inline-flex; align-items: center; gap: 8px; }
.bar-value { font-weight: 600; }
.bar { display: block; height: 6px; margin-top: 4px; border-radius: 3px; background: linear-gradient(90deg, var(--c) var(--w), var(--surface-2) var(--w)); }
.simple-list { list-style: none; margin: 0; padding: 0; }
.simple-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); align-items: center; }
.simple-list li:last-child { border-bottom: 0; }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.contact-list li { padding: 8px 10px; background: var(--surface-2); border-radius: 8px; }

/* ticket */
.ticket-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.ticket-head-main { min-width: 0; }
.ticket-meta-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.ticket-subject { font-size: 19px; margin: 0 0 4px; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.ticket-side { position: sticky; top: 76px; }
.ticket-side .card { margin-bottom: 12px; padding: 14px 16px; }
.assignee { display: flex; align-items: center; gap: 6px; font-weight: 500; margin: 0 0 10px; }
.details { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; margin: 0; font-size: 13px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; min-width: 0; word-break: break-word; }
.details.cols { grid-template-columns: 170px 1fr; }
.details.env { grid-template-columns: 120px 1fr; font-size: 12px; margin-top: 10px; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary h3::before { content: "▸ "; color: var(--muted); }
details[open] > summary h3::before { content: "▾ "; }
.add-box { margin-top: 14px; }
.add-box[open] summary { margin-bottom: 12px; }

.timeline { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.entry { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); }
.entry-client { border-left: 3px solid #94a3b8; }
.entry-staff.entry-message { border-left: 3px solid var(--ok); background: color-mix(in srgb, var(--ok-soft) 45%, var(--surface)); }
.entry-note { background: var(--note); border-color: var(--note-border); border-left: 3px solid #d4a72c; }
.entry-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.entry-author { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.entry-kind { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; display: inline-flex; align-items: center; gap: 4px; }
.entry-head time { margin-left: auto; }
.entry-body { overflow-wrap: anywhere; }
.rich img { max-width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--border); }
.rich p { margin: 0 0 .6em; }
.rich p:last-child { margin-bottom: 0; }
.rich blockquote { border-left: 3px solid var(--border-strong); margin: 0 0 .6em; padding: 2px 12px; color: var(--text-2); }
.rich table { border-collapse: collapse; } .rich td, .rich th { border: 1px solid var(--border); padding: 4px 8px; }
.files { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.files li { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.delivery { margin-top: 8px; font-size: 12px; }
.delivery .ok { color: var(--ok); } .delivery .fail { color: var(--danger); } .delivery .wait { color: var(--warn); }
.entry-event { display: flex; gap: 10px; align-items: center; padding: 2px 6px 2px 16px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.event-ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--muted); flex: none; }
.event-text { flex: 1; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.reason { font-style: italic; color: var(--text); }

.composer { border-top: 3px solid var(--primary); }
.composer textarea[data-editor] { min-height: 180px; }
.composer.is-public { border-top-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.uploader { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0; }
.uploader .files { width: 100%; margin: 0; }
.uploader .files li { padding: 3px 4px 3px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); }
.uploader .files li button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 4px; }
.uploader label { margin: 0; flex-direction: row; }
.composer-options { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0; }
.reason-input { width: 260px; }
.send-toggle { margin: 0; flex-direction: row; cursor: pointer; }
.send-toggle input { position: absolute; opacity: 0; }
.send-toggle-box { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 8px; border: 2px dashed var(--border-strong); color: var(--text-2); }
.send-toggle input:checked + .send-toggle-box { border: 2px solid var(--ok); background: var(--ok-soft); color: var(--ok); }
.send-toggle input:focus-visible + .send-toggle-box { outline: 2px solid var(--primary); }
.send-warning { display: flex; gap: 8px; align-items: center; padding: 9px 12px; border-radius: 8px; background: var(--ok-soft); color: var(--ok); font-weight: 500; margin: 8px 0; }
.composer-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list a { display: flex; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); color: var(--text); }
.notif-list a:hover { background: var(--surface-2); text-decoration: none; }
.notif-list .unread a { background: var(--primary-soft); font-weight: 600; }
.notif-msg { flex: 1; }
.notif-ico { color: var(--primary); }

.token-box { border: 2px solid var(--ok); }
.token-box h2 { display: flex; gap: 8px; align-items: center; }

/* auth / setup */
.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; padding: 28px; }
.auth-card h1 { font-size: 20px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.lang-switch { display: flex; gap: 10px; justify-content: center; margin-top: 16px; font-size: 13px; }
.lang-switch a.active { font-weight: 700; }
.error-code { font-size: 54px; font-weight: 800; color: var(--muted); }
.setup-card { width: 100%; max-width: 760px; padding: 28px; }
.setup-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.setup-head h1 small { font-size: 13px; color: var(--muted); font-weight: 400; }
.setup-card h2 { margin-top: 18px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.checks { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks .ok { color: var(--ok); } .checks .fail { color: var(--danger); font-weight: 600; }
.setup-next li { margin-bottom: 8px; }
.setup-next code { display: inline-block; margin-top: 4px; padding: 4px 8px; background: var(--surface-2); border-radius: 4px; font-size: 12px; }

/* Jodit в тъмен режим */
@media (prefers-color-scheme: dark) {
  .jodit-container:not(.jodit_inline) { background: var(--surface) !important; border-color: var(--border-strong) !important; }
  .jodit-wysiwyg { color: var(--text); }
}

/* responsive */
@media (max-width: 1200px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1000px) {
  .grid-main, .ticket-layout { grid-template-columns: 1fr; }
  .ticket-side { position: static; }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; left: -260px; z-index: 50; transition: left .2s; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .sidebar.open { left: 0; }
  .nav-toggle { display: inline-grid; }
  .user-chip span { display: none; }
  .content { padding: 14px 12px 40px; }
  .topbar { padding: 10px 12px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .ticket-head { flex-direction: column; }
  .search-inline input { width: 100%; }
  .details.cols { grid-template-columns: 1fr; }
}
