:root{color-scheme:dark;font:16px system-ui;background:#0a1425;color:#ecf3ff}*{box-sizing:border-box}body{margin:0;display:grid;grid-template-columns:220px 1fr;min-height:100vh}aside{background:#111f36;padding:24px;border-right:1px solid #30476a}aside strong{font-size:1.25rem}nav{display:grid;gap:8px}main{min-width:0;padding:clamp(16px,4vw,54px);width:100%;max-width:1440px}h1{margin:0 0 18px}h2{font-size:1.1rem}.card{padding:18px;background:#13233d;border:1px solid #30476a;border-radius:12px;margin-bottom:14px}.grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(225px,1fr);gap:14px}.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:12px}.table{overflow:auto}table{text-align:left;border-collapse:collapse;width:100%}th,td{padding:10px;border-bottom:1px solid #30476a}button,input,select,textarea{font:inherit;color:inherit;background:#0c1b31;border:1px solid #4e6c96;border-radius:7px;padding:8px 10px}button{cursor:pointer}button:disabled{opacity:.6}.primary,[aria-current=true]{background:#285dbf;border-color:#619cff}label{display:grid;gap:5px;margin-bottom:12px}textarea{width:100%;min-height:90px;resize:vertical}.message{white-space:pre-wrap;overflow-wrap:anywhere}.note{border-left:3px solid #d6a758;padding-left:12px}#notice{min-height:1.4em;color:#acd1ff}#identity{color:#b9cbe5}.pill{border-radius:99px;padding:4px 9px;background:#213d66}.stats{display:flex;gap:12px;flex-wrap:wrap}@media(max-width:740px){body,.grid{display:block}nav{display:flex;flex-wrap:wrap}aside{padding:16px}}

/* Top navigation and workspace preferences */
body{display:block;min-height:100vh}
.desk-header{display:flex;align-items:center;gap:22px;flex-wrap:wrap;padding:14px clamp(16px,4vw,54px);background:#111f36;border-bottom:1px solid #30476a}
.desk-header strong{font-size:1.18rem;white-space:nowrap}
.desk-header #identity{margin:0 0 0 auto;font-size:.875rem}
.desk-header #identity:empty,.desk-header nav:empty{display:none}
.desk-header nav{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.desk-menu{position:relative}
.desk-menu summary{cursor:pointer;padding:8px 10px;border:1px solid #4e6c96;border-radius:7px;background:#0c1b31}
.desk-menu[open]{z-index:5}
.desk-menu[open] button{position:relative;display:block;margin:5px 0;width:100%;text-align:left}
.desk-menu[open]{background:#13233d;border-radius:7px}
.desk-header nav{align-items:flex-start}
#preferences select{max-width:28rem;width:100%}
[data-density=compact] :is(th,td){padding:5px 8px}
:is([data-theme=light]){color-scheme:light;background:#eff4fb;color:#13233d}
[data-theme=light] :is(.desk-header,.card,.desk-menu[open]){background:#fff;border-color:#ccd8e9}
[data-theme=light] :is(button,input,select,textarea,.desk-menu summary){background:#f5f8fd;border-color:#a6b9d4}
[data-theme=light] :is(.pill){background:#deebff}
[data-theme=light] :is(#identity,#notice){color:#244979}
[data-theme=light] .primary{color:white;background:#285dbf}
@media(prefers-color-scheme:light){
 [data-theme=system]{color-scheme:light;background:#eff4fb;color:#13233d}
 [data-theme=system] :is(.desk-header,.card,.desk-menu[open]){background:#fff;border-color:#ccd8e9}
 [data-theme=system] :is(button,input,select,textarea,.desk-menu summary){background:#f5f8fd;border-color:#a6b9d4}
 [data-theme=system] .pill{background:#deebff}
 [data-theme=system] :is(#identity,#notice){color:#244979}
 [data-theme=system] .primary{color:white;background:#285dbf}
}
@media(max-width:730px){.desk-header{gap:10px}.desk-header nav{flex-basis:100%;order:3}.desk-header #identity{font-size:.78rem}}


/* Unified queue and settings layouts */
.desk-workbench{display:grid;grid-template-columns:minmax(165px,205px) minmax(0,1fr);gap:20px;align-items:start}
.desk-rail{display:grid;gap:7px;padding:12px}
.desk-rail h2{margin:7px 4px 3px;font-size:.85rem;font-weight:650}
.desk-rail button{text-align:left;width:100%}
.desk-rail button[aria-current=page]{background:#285dbf;border-color:#659cff;color:#fff}
.desk-content{min-width:0}
.desk-page-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.desk-page-title h1{margin:0}
.desk-filters{display:grid;grid-template-columns:minmax(180px,1fr) auto auto}
.desk-filters input{min-width:0}
#queue-count{font-size:.85rem;opacity:.82;margin:6px 0 12px}
.desk-ticket-link{text-align:left;max-width:100%;overflow-wrap:anywhere}
.desk-facts{display:grid;grid-template-columns:max-content 1fr;gap:8px 18px}
.desk-facts dd{margin:0}
@media(max-width:730px){.desk-workbench{grid-template-columns:minmax(0,1fr);gap:10px}.desk-rail{display:flex;flex-wrap:wrap;align-items:center}.desk-rail button{width:auto}.desk-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.desk-filters input{grid-column:1/-1}}


.desk-collapse summary{cursor:pointer;padding:8px 10px;border:1px solid currentColor;border-radius:7px}.desk-collapse-items{display:grid;gap:6px;margin-top:7px}.stats .desk-collapse-items{display:flex;flex-wrap:wrap}

#desk-support{margin:24px 0 0;opacity:.8;font-size:.875rem}#desk-support:empty{display:none}#general-settings input{max-width:36rem}

.report-chart{height:110px;display:grid;grid-template-columns:repeat(14,1fr);gap:5px;margin:12px 0}.report-chart>div{display:flex;align-items:end;gap:2px}.report-chart i{background:#5289ee;flex:1}.report-chart i+i{background:#3ac7df}

/* Shared workspace theme */
body {
  --desk-bg: #0d1524;
  --desk-header: #121d30;
  --desk-panel: #172338;
  --desk-field: #101a2c;
  --desk-line: #30415b;
  --desk-text: #f0f4fb;
  --desk-muted: #b0bdd1;
  --desk-accent: #8ec7ff;
  background: var(--desk-bg);
  color: var(--desk-text);
  min-height: 100vh;
  font: 15px/1.55 "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="light"] body, body[data-theme="light"] {
  --desk-bg: #f0f4fa;
  --desk-header: #fff;
  --desk-panel: #fff;
  --desk-field: #f5f8fc;
  --desk-line: #c6d2e2;
  --desk-text: #18263b;
  --desk-muted: #475a74;
  --desk-accent: #174f97;
}
body .desk-header {
  gap: 12px 24px;
  background: var(--desk-header);
  border-color: var(--desk-line);
  padding-block: 16px 12px;
}
.desk-header strong { display: inline-flex; align-items: center; gap: 10px; letter-spacing: -.025em; }
.desk-header strong::before { content: ""; width: 13px; height: 13px; border-radius: 4px; background: #68adff; box-shadow: 0 0 0 4px #68adff24; }
.desk-header #identity { color: var(--desk-muted); }
.desk-header nav { gap: 5px; align-items: center; flex-basis: 100%; }
body #nav > button, body #nav summary { background: transparent; border-color: transparent; border-radius: 8px; font-weight: 600; }
body #nav > button:hover, body #nav summary:hover, body #nav details[open] summary { background: var(--desk-panel); border-color: var(--desk-line); color: var(--desk-accent); }
body #nav .desk-menu[open] { background: var(--desk-panel); }
body main { margin-inline: auto; padding-block: clamp(20px,4vw,46px); }
#notice:empty { display: none; }
#notice:not(:empty) { color: var(--desk-accent); margin: 0 0 16px; }
h1 { font-size: clamp(1.75rem,3vw,2.35rem); letter-spacing: -.04em; line-height: 1.18; margin-bottom: 22px; }
h2 { font-size: 1.1rem; letter-spacing: -.015em; }
body .card { background: var(--desk-panel); border-color: var(--desk-line); border-radius: 14px; padding: 20px; box-shadow: 0 6px 18px #00000012; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

body :is(input,select,textarea,button) { border-color: var(--desk-line); border-radius: 8px; }
body :is(input,select,textarea,button:not(.primary):not([aria-current=true])) { background: var(--desk-field); }
body button:not(:disabled):hover { border-color: var(--desk-accent); }
body :focus-visible { outline: 2px solid var(--desk-accent); outline-offset: 3px; }
body button.primary { background: #2164bd; color: white; border-color: #68a9ff; font-weight: 600; }
body a { color: var(--desk-accent); }
body :is(th,td) { border-color: var(--desk-line); }
body th { color: var(--desk-muted); font-size: .82rem; font-weight: 650; }
.desk-plan-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-bottom: 20px; align-items: start; }
body .desk-plan { min-height: 215px; margin: 0; border-top: 3px solid var(--desk-accent); }
.desk-plan h2 { margin: 0; }
.desk-plan .plan-price { font-size: .88rem; color: var(--desk-muted); margin: 10px 0; }
.desk-plan .plan-price strong { font-size: clamp(1.45rem,2.35vw,2.15rem); color: var(--desk-text); letter-spacing: -.04em; }
.desk-plan .plan-description { color: var(--desk-muted); overflow-wrap: anywhere; }
.desk-plan summary { cursor: pointer; color: var(--desk-accent); font-weight: 600; }
.desk-plan :is(input,textarea) { width: 100%; min-width: 0; }
@media (max-width: 980px) { .desk-plan-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 490px) { .desk-plan-grid { grid-template-columns: 1fr; } body .desk-plan { min-height: 0; } }

/* Ticket workspace and forms */
#workspace { min-width: 0; }
.desk-workbench { gap: 22px; }
body .desk-rail { align-self: start; padding: 16px; }
.desk-rail h2 { color: var(--desk-muted); font-size: .9rem; }
body .desk-collapse summary { border-color: var(--desk-line); font-weight: 600; }
body .desk-rail button[aria-current="page"] { color: var(--desk-accent); border-color: var(--desk-accent); font-weight: 650; }
.desk-page-title { padding: 2px 0 10px; }
.desk-content .table { border: 1px solid var(--desk-line); border-radius: 10px; }
.desk-content thead { background: var(--desk-field); }
.desk-content tr:last-child td { border-bottom: 0; }
.desk-content tbody tr:hover { background: var(--desk-field); }
.desk-content td:first-child { color: var(--desk-muted); font-variant-numeric: tabular-nums; }
body button.desk-ticket-link { background: transparent; border-color: transparent; padding: 3px 5px; color: var(--desk-accent); font-weight: 650; }
#queue-count { color: var(--desk-muted); }
#empty { text-align: center; margin: 14px 0 0; padding: 26px 12px; border: 1px dashed var(--desk-line); border-radius: 10px; color: var(--desk-muted); }
body .pill[data-status] { display: inline-block; font-size: .8rem; font-weight: 650; white-space: nowrap; }
body .pill[data-status="resolved"] { background: #dff5e9; color: #14583b; }
body .pill:is([data-status="open"],[data-status="new"],[data-status="in_progress"]) { background: #e2efff; color: #164784; }
body .pill[data-status="waiting"] { background: #fff0ce; color: #704500; }
#workspace .grid { gap: 20px; }
#workspace .card article { margin: 12px 0; padding: 12px 14px; background: var(--desk-field); border-radius: 9px; }
#workspace .card article p { margin: 5px 0 0; }
#workspace :is(form,label) { min-width: 0; }
#workspace label { gap: 7px; font-weight: 600; }
#workspace :is(input,select,textarea) { max-width: 100%; font-weight: 400; }
#workspace form > button[type="submit"], #workflow > button, #reply > button { margin-top: 4px; }
#preferences, #create { max-width: 46rem; }
@media (max-width: 730px) {
  .desk-workbench, #workspace .grid { gap: 12px; }
  body .desk-rail { padding: 12px; }
  .desk-filters { grid-template-columns: minmax(0,1fr); }
  body .desk-content .card { padding: 14px; }
}

[data-theme="light"] body button.primary, body[data-theme="light"] button.primary { background: #2164bd; border-color: #2164bd; color: #fff; }
