/* WeManage.Tech — modern dark PSA theme (same layout, refreshed look) */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0a0c10;
  --bg-grad: radial-gradient(1200px 600px at 70% -10%, #12161f 0%, #0a0c10 60%);
  --panel: #14171e;
  --panel-2: #191d26;
  --panel-head: #171b23;
  --border: #262b35;
  --border-soft: rgba(255,255,255,.06);
  --text: #e6e9ef;
  --text-dim: #939dac;
  --blue: #7fa6f5;
  --blue-strong: #4f83f1;
  --accent: #5b8def;
  --red: #f0565b;
  --green: #46b45b;
  --orange: #eb9542;
  --yellow: #cbaa3c;
  --radius: 9px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 4px 14px rgba(0,0,0,.22);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
}
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { background: var(--bg); background-image: var(--bg-grad); background-attachment: fixed; color: var(--text);
  font: 13.5px/1.5 -apple-system, "Segoe UI", Roboto, system-ui, sans-serif; min-height: 100vh; }
a { color: var(--blue); text-decoration: none; transition: color .12s ease; }
a:hover { color: #a9c4fb; text-decoration: none; }
::selection { background: rgba(79,131,241,.35); }
/* refined scrollbars */
* { scrollbar-width: thin; scrollbar-color: #2c333f transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #2c333f; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #3a4250; background-clip: content-box; }

/* ---- Top bar ---- */
.topbar { display: flex; align-items: center; gap: 16px; background: rgba(17,20,27,.82); backdrop-filter: saturate(140%) blur(10px);
  padding: 10px 20px; position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--border-soft); }
.topbar .brand { font-weight: 700; font-size: 15px; color: #fff; white-space: nowrap; letter-spacing: -.2px; }
.topbar form { flex: 0 1 320px; }
.topbar input[type=search] { width: 100%; background: #0f1319; border: 1px solid var(--border); border-radius: 999px; color: var(--text); padding: 7px 14px; transition: border-color .15s ease, box-shadow .15s ease; }
.topbar input[type=search]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,131,241,.18); outline: none; }
.topbar .spacer { flex: 1; }
.topbar .pill-btn { background: linear-gradient(90deg,#e0484d,#a24bd6); color: #fff; border: none; border-radius: 999px; padding: 7px 15px; font-weight: 600; cursor: pointer; box-shadow: 0 2px 10px rgba(162,75,214,.25); transition: transform .1s ease, box-shadow .15s ease; }
.topbar .pill-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(162,75,214,.4); }
.topbar .user { color: #b9c1cd; white-space: nowrap; }

/* ---- Nav ---- */
.nav { display: flex; align-items: center; background: rgba(20,23,30,.7); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border-soft); padding: 4px 12px; overflow-x: auto; position: sticky; top: 53px; z-index: 40; }
.nav a { display: flex; align-items: center; gap: 6px; color: #aeb6c2; padding: 9px 14px; font-size: 13px; font-weight: 500; white-space: nowrap; border-radius: var(--radius-sm); margin: 2px 1px; transition: color .12s ease, background .12s ease; }
.nav a:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.05); }
.nav a.active { color: #fff; background: rgba(79,131,241,.16); box-shadow: inset 0 0 0 1px rgba(79,131,241,.3); }
.nav .badge { background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; line-height: 17px; font-weight: 700; }

/* ---- Layout ---- */
.content { padding: 22px 26px; max-width: 1520px; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 23px; font-weight: 650; color: #fff; letter-spacing: -.4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; background: #222732; color: #e8ecef; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 13px; font-size: 13px; font-weight: 500; cursor: pointer; transition: background .13s ease, border-color .13s ease, transform .08s ease; }
.btn:hover { background: #2b313d; border-color: #3a4250; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg,#fbfcfd,#e9edf1); color: #14171e; border-color: transparent; font-weight: 600; }
.btn.primary:hover { background: #fff; }
.btn.blue { background: linear-gradient(180deg,#5a8cf3,#4276ec); border-color: transparent; color: #fff; box-shadow: 0 1px 8px rgba(79,131,241,.3); }
.btn.blue:hover { background: linear-gradient(180deg,#6a98f5,#4f83f1); }
.btn.danger { background: rgba(240,86,91,.14); border-color: rgba(240,86,91,.4); color: #ff9a9d; }
.btn.danger:hover { background: rgba(240,86,91,.22); }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 5px; }

/* ---- Stat cards ---- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: linear-gradient(180deg,var(--panel-2),var(--panel)); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 18px 14px; text-align: center; box-shadow: var(--shadow-sm); transition: transform .12s ease, border-color .12s ease; }
.stat-card:hover { transform: translateY(-2px); border-color: rgba(79,131,241,.25); }
.stat-card .label { font-size: 13px; font-weight: 600; color: #cfd6df; margin-bottom: 8px; }
.stat-card .value { font-size: 38px; font-weight: 300; color: var(--blue); letter-spacing: -1px; }
.stat-card .value.dim { color: #6b7280; }
.stat-card .sub { font-size: 10px; letter-spacing: 1px; color: var(--text-dim); text-transform: uppercase; margin-top: 6px; }

/* ---- Tab counters (tickets) ---- */
.tab-row { display: flex; border: 1px solid var(--border-soft); background: var(--panel); border-radius: var(--radius); margin-bottom: 16px; overflow-x: auto; box-shadow: var(--shadow-sm); }
.tab-row a { flex: 1; text-align: center; padding: 13px 16px; color: var(--text-dim); border-bottom: 3px solid transparent; min-width: 110px; transition: color .12s ease, background .12s ease; }
.tab-row a:hover { text-decoration: none; color: #fff; background: rgba(255,255,255,.03); }
.tab-row a.active { border-bottom-color: var(--accent); color: #fff; background: rgba(79,131,241,.08); }
.tab-row .t-label { font-size: 12px; display: block; }
.tab-row .t-value { font-size: 26px; font-weight: 300; display: block; margin-top: 4px; color: inherit; letter-spacing: -.5px; }

/* ---- Panels ---- */
.panel { background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius); margin-bottom: 16px; box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 10px; background: var(--panel-head); padding: 11px 14px; font-weight: 600; font-size: 13px; color: #eef1f5; border-bottom: 1px solid var(--border-soft); }
.panel-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; font-weight: 400; }
.panel-body { padding: 14px; }
.panel-body.tight { padding: 0; }

/* ---- Tables ---- */
table.grid { width: 100%; border-collapse: collapse; }
table.grid th { text-align: left; font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: var(--text-dim); font-weight: 600; padding: 11px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: rgba(255,255,255,.015); }
table.grid td { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: none; }
table.grid tbody tr, table.grid tr { transition: background .1s ease; }
table.grid tr:hover td { background: rgba(79,131,241,.06); }
table.grid td.dim, .dim { color: var(--text-dim); }
table.grid .num { text-align: right; }

/* ---- Pills / badges ---- */
.pill { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 600; color: #fff; white-space: nowrap; letter-spacing: .2px; }
.pill.s-new { background: rgba(201,168,58,.18); color: #e6c65a; box-shadow: inset 0 0 0 1px rgba(201,168,58,.35); }
.pill.s-inprogress { background: rgba(79,131,241,.18); color: #85acf7; box-shadow: inset 0 0 0 1px rgba(79,131,241,.35); }
.pill.s-scheduled { background: rgba(139,113,232,.18); color: #b3a2ee; box-shadow: inset 0 0 0 1px rgba(139,113,232,.35); }
.pill.s-waiting { background: rgba(235,149,66,.18); color: #f0ab63; box-shadow: inset 0 0 0 1px rgba(235,149,66,.35); }
.pill.s-resolved { background: rgba(70,180,91,.18); color: #6fd085; box-shadow: inset 0 0 0 1px rgba(70,180,91,.35); }
.pill.s-open { background: rgba(203,168,58,.18); color: #e0bf4d; box-shadow: inset 0 0 0 1px rgba(203,168,58,.35); }
.pill.s-paid { background: rgba(70,180,91,.18); color: #6fd085; box-shadow: inset 0 0 0 1px rgba(70,180,91,.35); }
.pill.s-overdue { background: rgba(240,86,91,.18); color: #f58489; box-shadow: inset 0 0 0 1px rgba(240,86,91,.35); }
.pill.s-draft { background: rgba(148,163,184,.16); color: #b6c0cf; box-shadow: inset 0 0 0 1px rgba(148,163,184,.3); }
.pill.s-sent { background: rgba(79,131,241,.18); color: #85acf7; box-shadow: inset 0 0 0 1px rgba(79,131,241,.35); }
.pill.s-approved { background: rgba(70,180,91,.18); color: #6fd085; box-shadow: inset 0 0 0 1px rgba(70,180,91,.35); }
.pill.s-declined { background: rgba(240,86,91,.18); color: #f58489; box-shadow: inset 0 0 0 1px rgba(240,86,91,.35); }
.pill.s-won { background: rgba(70,180,91,.18); color: #6fd085; box-shadow: inset 0 0 0 1px rgba(70,180,91,.35); }
.pill.s-lost { background: rgba(148,163,184,.16); color: #b6c0cf; box-shadow: inset 0 0 0 1px rgba(148,163,184,.3); }
.pill.s-contacted { background: rgba(79,131,241,.18); color: #85acf7; box-shadow: inset 0 0 0 1px rgba(79,131,241,.35); }
.pill.s-fresh { background: rgba(79,131,241,.18); color: #85acf7; box-shadow: inset 0 0 0 1px rgba(79,131,241,.35); }
.pill.s-resolvedandinvoiced { background: rgba(70,180,91,.18); color: #6fd085; box-shadow: inset 0 0 0 1px rgba(70,180,91,.35); }
.pill.s-needsordered, .pill.s-needsonsite { background: rgba(139,113,232,.18); color: #b3a2ee; box-shadow: inset 0 0 0 1px rgba(139,113,232,.35); }
.pill.s-customerreply { background: rgba(79,131,241,.18); color: #85acf7; box-shadow: inset 0 0 0 1px rgba(79,131,241,.35); }
.pill.gray { background: rgba(148,163,184,.16); color: #b6c0cf; box-shadow: inset 0 0 0 1px rgba(148,163,184,.28); }
.prio-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.prio-0 { background: #f0565b; box-shadow: 0 0 6px rgba(240,86,91,.6); } .prio-1 { background: #eb9542; } .prio-2 { background: #4f83f1; } .prio-3 { background: #6b7280; }
.online-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.online-dot.on { background: #46b45b; box-shadow: 0 0 6px rgba(70,180,91,.6); } .online-dot.off { background: #565b63; }
.status-tag { display: inline-block; background: rgba(70,180,91,.9); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .5px; border-radius: 999px; padding: 4px 12px; }
.status-tag.off { background: #565b63; }

/* ---- Forms ---- */
label.f { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim); margin: 12px 0 5px; font-weight: 600; }
input[type=text], input[type=email], input[type=date], input[type=number], input[type=search], input[type=password], input[type=time], input[type=color], select, textarea {
  background: #0f1319; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); padding: 8px 11px; font: inherit; width: 100%; transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,131,241,.16); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-narrow { max-width: 720px; }
.inline-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.inline-form > div { flex: 1; min-width: 120px; }

/* ---- Ticket detail ---- */
.split { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 10px; font-size: 13px; }
.kv .k { color: var(--text-dim); }
.comment { border: 1px solid var(--border); border-radius: 4px; margin-bottom: 10px; }
.comment .c-head { display: flex; gap: 10px; padding: 8px 12px; background: var(--panel-head); font-size: 12px; color: var(--text-dim); }
.comment .c-head .who { color: #e8ecef; font-weight: 600; }
.comment .c-body { padding: 10px 12px; white-space: pre-wrap; }
.comment.private { border-color: #6e5c1e; }
.comment.private .c-head { background: #2a2410; }
.comment.system { opacity: .75; }

/* ---- Charts ---- */
.chart-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 16px; }
.bar-item { margin-bottom: 8px; }
.bar-item .b-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px; }
.bar-item .b-track { background: #23262c; border-radius: 3px; height: 8px; }
.bar-item .b-fill { background: var(--orange); height: 8px; border-radius: 3px; }
.bar-item .b-fill.blue { background: var(--blue-strong); }
.bar-item .b-fill.green { background: var(--green); }

/* ---- Misc ---- */
.muted-note { color: var(--text-dim); font-style: italic; text-align: center; padding: 18px; }
.search-bar { display: flex; gap: 8px; margin-bottom: 14px; max-width: 480px; }
.mono { font-family: Consolas, monospace; }
.fav { color: #d8b62a; }
.footer { text-align: center; color: #4b5563; padding: 20px; font-size: 12px; }
.tabs2 { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs2 a { padding: 8px 14px; color: var(--text-dim); border-radius: 4px 4px 0 0; white-space: nowrap; }
.tabs2 a.active { background: var(--panel); color: #fff; border: 1px solid var(--border); border-bottom-color: var(--panel); }
code.script-body, textarea.code { font-family: Consolas, monospace; font-size: 12.5px; background: #121417; }

/* ---- Pager & timer ---- */
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 12px; }
.timer-clock { font-size: 30px; font-weight: 300; font-family: Consolas, monospace; color: #fff; letter-spacing: 2px; }
.timer-clock.idle { color: #565b63; }
.timer-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.badge-billable { background: #2e7d3a; color: #fff; border-radius: 3px; font-size: 10px; padding: 1px 6px; font-weight: 700; }
.badge-billable.off { background: #4b5563; }
.badge-billable.invoiced { background: #2d6da3; }

/* custom Syncro statuses */
.pill { background: #4b5563; }
.pill.s-resolvedandinvoiced { background: #2e7d3a; }
.pill.s-needsordered, .pill.s-needsonsite { background: #5b4a9e; }
.pill.s-customerreply { background: #2d6da3; }

/* ---- Calendar ---- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.cal-dow { background: var(--panel-head); padding: 8px; text-align: center; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); }
.cal-cell { background: var(--panel); min-height: 96px; padding: 6px; }
.cal-cell.empty { background: #121417; }
.cal-cell.today { background: #1a2230; box-shadow: inset 0 0 0 1px var(--blue-strong); }
.cal-daynum { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.cal-appt { display: block; background: #2d4a6b; color: #dce9f5; border-radius: 3px; padding: 2px 5px; font-size: 11px; margin-bottom: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-appt:hover { background: var(--blue-strong); text-decoration: none; }

/* ---- Ticket views sidebar ---- */
.tickets-layout { display: grid; grid-template-columns: 210px 1fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .tickets-layout { grid-template-columns: 1fr; } }
.views-side { background: var(--panel); border: 1px solid var(--border); border-radius: 4px; }
.views-side .vs-head { display: flex; align-items: center; padding: 10px 12px; font-weight: 600; border-bottom: 1px solid var(--border); }
.views-side .vs-sub { padding: 8px 12px 2px; font-size: 10px; letter-spacing: 1px; color: var(--text-dim); text-transform: uppercase; }
.views-side a.vs-item { display: flex; justify-content: space-between; gap: 8px; padding: 6px 12px; color: #c9ced4; font-size: 12.5px; }
.views-side a.vs-item:hover { background: #1d2025; text-decoration: none; }
.views-side a.vs-item.active { background: #1b2330; color: #fff; }
.views-side .vs-count { color: var(--text-dim); }
.views-side .vs-del { color: var(--text-dim); background: none; border: none; cursor: pointer; padding: 0 4px; }
.views-side .vs-del:hover { color: var(--red); }

/* ---- Live search suggestions ---- */
.search-wrap { position: relative; }
.suggest-box { display: none; position: absolute; top: 100%; left: 0; right: 0; margin-top: 3px; background: #1d2025; border: 1px solid #3a3d42; border-radius: 4px; z-index: 200; max-height: 420px; overflow-y: auto; box-shadow: 0 6px 20px rgba(0,0,0,.5); min-width: 320px; }
.suggest-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid #26292e; color: var(--text); }
.suggest-item:hover, .suggest-item.active { background: #2a3340; text-decoration: none; }
.suggest-type { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: #fff; background: #3a4250; border-radius: 3px; padding: 1px 6px; flex: 0 0 auto; }
.suggest-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-sub { color: var(--text-dim); font-size: 11px; flex: 0 0 auto; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Bulk action bar ---- */
.bulk-bar { display: none; position: sticky; top: 0; z-index: 30; align-items: center; gap: 10px; background: #1b2330; border: 1px solid var(--blue-strong); border-radius: 4px; padding: 8px 12px; margin-bottom: 10px; flex-wrap: wrap; }
.bulk-bar .bulk-count-wrap { font-weight: 600; color: #fff; }
.bulk-bar select { width: auto; }
th.bulk-col, td.bulk-col { width: 28px; text-align: center; }

/* ---- Collapsible sidebar sections ---- */
.vs-sub[data-collapse] { cursor: pointer; user-select: none; display: flex; justify-content: space-between; align-items: center; }
.vs-sub[data-collapse]::after { content: '▾'; font-size: 9px; }
.vs-sub[data-collapse].collapsed::after { content: '▸'; }

.pill.s-fresh { background: #2d6da3; }


/* ---- Quick add (+) menu ---- */
.quickadd { position: relative; }
.qa-btn { width: 26px; height: 26px; border-radius: 50%; border: none; background: #3a7bd5; color: #fff; font-size: 17px; line-height: 1; cursor: pointer; }
.qa-btn:hover { background: #4a90d9; }
.qa-menu { display: none; position: absolute; right: 0; top: 32px; background: #1d2025; border: 1px solid #3a3d42; border-radius: 4px; min-width: 190px; z-index: 300; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.qa-menu a { display: block; padding: 8px 14px; color: var(--text); border-bottom: 1px solid #26292e; }
.qa-menu a:hover { background: #2a3340; text-decoration: none; }

.bulk-bar .bulk-count-wrap { margin-left: 6px; }


/* ---- Ticket detail header (Syncro layout) ---- */
.ticket-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; gap: 16px; flex-wrap: wrap; }
.ticket-head .th-num { font-size: 26px; font-weight: 700; color: #fff; margin-top: 6px; }
.ticket-head .th-subject { font-size: 17px; color: #d5d9dd; margin-top: 4px; max-width: 640px; }
.ticket-head .th-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---- Info rows (label left, control right) like Syncro Ticket Info ---- */
.info-row { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid #202329; }
.info-row:last-child { border-bottom: none; }
.info-row .ir-label { font-size: 12px; color: var(--text-dim); }
.info-row .ir-val { font-size: 13px; }
.info-row select, .info-row input { padding: 4px 8px; }

/* ---- Raw backup progress bars ---- */
.rb-row { margin-bottom: 12px; }
.rb-row-label { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.rb-row-count { font-size: 11px; }
.rb-track { background: #23262c; border-radius: 3px; height: 10px; overflow: hidden; }
.rb-fill { height: 10px; border-radius: 3px; transition: width 0.4s ease; }
.rb-fill.rb-pending { background: #3a3e45; width: 0 !important; }
.rb-fill.rb-running { background: var(--blue-strong); background-image: linear-gradient(135deg, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); background-size: 24px 24px; animation: rb-stripes 1s linear infinite; }
.rb-fill.rb-done { background: var(--green); }
.rb-fill.rb-error { background: var(--red); }
@keyframes rb-stripes { from { background-position: 0 0; } to { background-position: 24px 0; } }
