/* =============================================================================
   secure3 — KDS Fiber billing UI
   Compact, dense, professional. Brand: purple #8a0085, violet #9559aa, blue #92b5e5, gray #545454
   ============================================================================= */
:root {
  --kds-purple: #8a0085;
  --kds-purple-dark: #6d0069;
  --kds-violet: #9559aa;
  --kds-blue: #92b5e5;
  --kds-blue-light: #e4eefb;
  --kds-gray: #545454;
  --bg: #f4f4f7;
  --surface: #ffffff;
  --surface-2: #fafafc;
  --border: #e2e2ea;
  --border-strong: #c9c9d4;
  --text: #1f1f26;
  --muted: #6c6c78;
  --link: #7a1a78;
  --green: #1a7f37; --green-bg: #e6f4ea;
  --orange: #b45309; --orange-bg: #fff4e5;
  --red: #c62828;   --red-bg: #fdecec;
  --slate: #475569; --slate-bg: #e9edf2;
  --purple: #7c3aed; --purple-bg: #f1eafd;
  --teal: #0f766e;  --teal-bg: #e3f4f2;
  --gray: #6b7280;  --gray-bg: #eceef1;
  --blue: #1d4ed8;  --blue-bg: #e7eefc;
  --radius: 6px;
  --sidebar: 212px;
  --topbar: 44px;
  --font: 13px/1.4 -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: 12px/1.4 ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font: var(--font); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 17px; } h2 { font-size: 14.5px; } h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
p { margin: 0 0 8px; }
small, .small { font-size: 11.5px; }
.muted { color: var(--muted); }
.right { text-align: right; }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.neg { color: var(--red); }
.pos { color: var(--green); }
.nowrap { white-space: nowrap; }
.mono { font: var(--mono); }
.hidden { display: none !important; }
.mt { margin-top: 10px; } .mb { margin-bottom: 10px; } .mr { margin-right: 6px; } .ml { margin-left: 6px; }
.flex { display: flex; gap: 8px; align-items: center; } .flex-wrap { flex-wrap: wrap; } .grow { flex: 1; } .gap { gap: 12px; }
.between { justify-content: space-between; }
.cols { display: grid; gap: 12px; } .cols-2 { grid-template-columns: 1fr 1fr; } .cols-3 { grid-template-columns: repeat(3, 1fr); } .cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-main { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
@media (max-width: 1100px) { .cols-3, .cols-4 { grid-template-columns: 1fr 1fr; } .cols-main { grid-template-columns: 1fr; } }
@media (max-width: 700px)  { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }

/* ---- layout ------------------------------------------------------------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); flex: 0 0 var(--sidebar); background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: block; padding: 12px 14px 8px; } .brand img { height: 30px; display: block; }
.nav { padding: 4px 8px; flex: 1; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 5px; color: var(--text); font-weight: 500; font-size: 13px; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: #f3e5f3; color: var(--kds-purple); }
.nav .ic { width: 16px; text-align: center; color: var(--kds-violet); font-size: 13px; }
.nav .sub { padding-left: 24px; display: none; }
.nav .nav-group:has(> a.active) .sub, .nav .nav-group:has(.sub a.active) .sub { display: block; }
.nav .sub a { padding: 3px 8px; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.nav .sub a.active { color: var(--kds-purple); background: transparent; font-weight: 600; }
.sidebar-foot { border-top: 1px solid var(--border); padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-foot .user { display: flex; flex-direction: column; line-height: 1.2; color: var(--text); } .sidebar-foot small { color: var(--muted); text-transform: capitalize; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--topbar); background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; padding: 0 14px; position: sticky; top: 0; z-index: 20; }
.menu-toggle { display: none; }
.search { flex: 1; max-width: 560px; position: relative; }
.search input { width: 100%; height: 30px; border: 1px solid var(--border-strong); border-radius: 5px; padding: 0 10px; font: inherit; background: var(--surface-2); }
.search input:focus { outline: none; border-color: var(--kds-violet); background: #fff; box-shadow: 0 0 0 3px #9559aa22; }
.suggest { position: absolute; top: 34px; left: 0; right: 0; background: #fff; border: 1px solid var(--border-strong); border-radius: 6px; box-shadow: 0 8px 24px #0002; z-index: 30; max-height: 420px; overflow: auto; }
.suggest a { display: grid; grid-template-columns: 76px 1fr auto; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 12.5px; }
.suggest a:last-child { border-bottom: 0; } .suggest a:hover, .suggest a.sel { background: var(--kds-blue-light); text-decoration: none; }
.suggest .acct { font: var(--mono); color: var(--muted); }
.topbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.content { padding: 14px 16px 40px; }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: calc(-1 * var(--sidebar)); z-index: 40; transition: left .15s; box-shadow: 0 0 0 100vw #0000; }
  .sidebar.open { left: 0; box-shadow: 0 0 0 100vw #0004; }
  .menu-toggle { display: inline-flex; }
  .content { padding: 10px; }
}

/* ---- page header --------------------------------------------------------- */
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: 8px; }
.page-head .actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 4px; } .crumbs a { color: var(--muted); }

/* ---- cards --------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.card-head h2, .card-head h3 { flex: 1; } .card-head .actions { display: flex; gap: 4px; }
.card-body { padding: 10px; }
.card-body.tight { padding: 0; }
.card + .card { margin-top: 12px; }
/* stat strip: one slim line of label · value pairs (no boxes) */
.kpis { display: flex; flex-wrap: wrap; align-items: stretch; margin-bottom: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 2px; }
.kpi { display: flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-right: 1px solid var(--border); font-size: 12.5px; color: var(--text); text-decoration: none; line-height: 1.3; white-space: nowrap; }
.kpi:last-child { border-right: 0; }
a.kpi:hover { background: #fff; text-decoration: none; }
.kpi .label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.kpi .value { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 11px; color: var(--muted); }
.kpi .sub::before { content: "· "; }
.kpi.warn .value { color: var(--orange); } .kpi.bad .value { color: var(--red); } .kpi.good .value { color: var(--green); } .kpi.brand .value { color: var(--kds-purple); }

/* ---- tables -------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th, .table td { padding: 4px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { background: var(--surface-2); font-weight: 600; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; position: sticky; top: 0; }
.table tbody tr:hover { background: #f7f3f8; }
.table tr.clickable { cursor: pointer; }
.table tr.selected { background: #f3e5f3; }
.table td.actions { white-space: nowrap; text-align: right; }
.table .sort { color: var(--muted); } .table .sort.on { color: var(--kds-purple); }
.table tfoot td { font-weight: 600; background: var(--surface-2); }
.table.compact th, .table.compact td { padding: 2px 6px; }
.table-wrap { overflow-x: auto; }
.empty { padding: 18px; text-align: center; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 6px; padding: 8px 10px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }
.pager a, .pager span.cur { padding: 2px 7px; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.pager span.cur { background: var(--kds-purple); color: #fff; border-color: var(--kds-purple); }

/* ---- badges -------------------------------------------------------------- */
.badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; line-height: 16px; white-space: nowrap; vertical-align: middle; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-slate, .badge-darkblue { background: var(--slate-bg); color: var(--slate); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-teal { background: var(--teal-bg); color: var(--teal); }
.badge-gray, .badge-yellow { background: var(--gray-bg); color: var(--gray); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-brand { background: #f3e5f3; color: var(--kds-purple); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }

/* ---- buttons ------------------------------------------------------------- */
[hidden] { display: none !important; }
.btn { display: inline-flex; align-items: center; gap: 5px; height: 27px; padding: 0 10px; border-radius: 5px; border: 1px solid var(--border-strong); background: #fff; color: var(--text); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none !important; line-height: 1; }
.btn:hover { background: var(--surface-2); border-color: #b5b5c2; }
.btn-primary { background: var(--kds-purple); border-color: var(--kds-purple); color: #fff; } .btn-primary:hover { background: var(--kds-purple-dark); border-color: var(--kds-purple-dark); }
.btn-secondary { background: var(--kds-blue-light); border-color: #bcd3f2; color: #1e3a8a; } .btn-secondary:hover { background: #d7e5f9; }
.btn-danger { color: var(--red); border-color: #e8b4b4; } .btn-danger:hover { background: var(--red-bg); }
.btn-ghost { border-color: transparent; background: transparent; } .btn-ghost:hover { background: var(--gray-bg); }
.btn-xs { height: 22px; padding: 0 7px; font-size: 11.5px; }
.btn-sm { height: 25px; padding: 0 8px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-group { display: inline-flex; gap: 4px; }
.icon-btn { padding: 0 6px; }

/* ---- forms --------------------------------------------------------------- */
label { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; display: block; margin-bottom: 2px; }
.input, input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=tel], input[type=url], input[type=month], select, textarea { width: 100%; height: 28px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 5px; font: inherit; background: #fff; color: var(--text); }
textarea { height: auto; min-height: 64px; padding: 6px 8px; resize: vertical; }
select { padding-right: 24px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--kds-violet); box-shadow: 0 0 0 3px #9559aa22; }
input[readonly] { background: var(--surface-2); color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 10px; }
.form-grid .span-2 { grid-column: span 2; } .form-grid .span-3 { grid-column: span 3; } .form-grid .span-all { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.check { display: flex; align-items: center; gap: 6px; font-size: 12.5px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text); }
.check input { width: auto; height: auto; }
.help { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.inline-form { display: inline; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; margin: 0 0 10px; } legend { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.filters { display: flex; gap: 6px; align-items: end; flex-wrap: wrap; margin-bottom: 10px; }
.filters > div { min-width: 120px; } .filters label { margin-bottom: 1px; }
.money-input { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- misc components ------------------------------------------------------- */
.flashes { padding: 10px 16px 0; }
.flash { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 5px; font-size: 12.5px; margin-bottom: 6px; border: 1px solid; }
.flash .x { margin-left: auto; background: none; border: 0; font-size: 16px; cursor: pointer; color: inherit; line-height: 1; }
.flash-success { background: var(--green-bg); color: var(--green); border-color: #bfe3c8; }
.flash-error { background: var(--red-bg); color: var(--red); border-color: #f1c0c0; }
.flash-warning { background: var(--orange-bg); color: var(--orange); border-color: #f5d7a8; }
.flash-info { background: var(--blue-bg); color: var(--blue); border-color: #c5d4f5; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 10px; overflow-x: auto; }
.tabs a { padding: 6px 10px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.active { color: var(--kds-purple); border-color: var(--kds-purple); }
.tabs .count { background: var(--gray-bg); border-radius: 8px; padding: 0 5px; font-size: 10.5px; margin-left: 4px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; font-size: 12.5px; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; }
.notes-box { white-space: pre-wrap; font-size: 12.5px; background: #fffbe6; border: 1px solid #f3e4a0; border-radius: 5px; padding: 6px 8px; max-height: 220px; overflow: auto; }
.pub-notes { background: var(--kds-blue-light); border-color: #bcd3f2; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.timeline li { padding: 4px 0 4px 12px; border-left: 2px solid var(--border); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--kds-violet); }
.timeline .when { color: var(--muted); font-size: 11px; }
dialog { border: 1px solid var(--border-strong); border-radius: 8px; padding: 0; width: min(640px, 94vw); box-shadow: 0 20px 50px #0004; }
dialog::backdrop { background: #0005; }
dialog .dlg-head { padding: 8px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; background: var(--surface-2); }
dialog .dlg-head h2 { flex: 1; } dialog .dlg-body { padding: 12px; } dialog .dlg-foot { padding: 8px 12px; border-top: 1px solid var(--border); display: flex; gap: 6px; justify-content: flex-end; }
dialog.wide { width: min(900px, 96vw); }
dialog.dlg-session { width: min(440px, 94vw); } dialog.dlg-session .dlg-body p { margin: 0 0 8px; } dialog.dlg-session .dlg-foot { justify-content: space-between; }
.session-left { font-variant-numeric: tabular-nums; color: var(--red, #b42318); }

/* ---- loading indicator: the logo in the middle, the dot of the "i" bouncing out of it, a beam travelling round ---- */
.loading { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; background: rgba(250, 247, 250, .8); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity: 0; transition: opacity .3s ease; }
.loading.on { opacity: 1; }
.loading-box { position: relative; width: 240px; height: 240px; display: grid; place-items: center; }
.loading-logo { position: relative; z-index: 1; width: 172px; animation: ld-hop 1.6s ease-in-out infinite; filter: drop-shadow(0 8px 18px rgba(138, 0, 133, .22)); }
/* the dot of the "i" in logo.png (x 57.5–60.3 %, y 19–28.3 %) is cut out of the picture and drawn by .loading-dot so it can jump */
.loading-logo img, .loading-shine { clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, 56.6% 17.2%, 56.6% 30.2%, 61.2% 30.2%, 61.2% 17.2%, 56.6% 17.2%); }
.loading-logo img { display: block; width: 100%; height: auto; }
.loading-shine { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .95) 50%, transparent 65%); background-size: 260% 100%; background-repeat: no-repeat;
  -webkit-mask: url(/assets/img/logo.png) center / 100% auto no-repeat; mask: url(/assets/img/logo.png) center / 100% auto no-repeat; animation: ld-shine 1.6s linear infinite; }
.loading-dot { position: absolute; left: 57.5%; top: 19%; width: 2.9%; aspect-ratio: 1; background: var(--kds-purple); border-radius: 22%; transform-origin: 50% 100%; animation: ld-jump 1.6s cubic-bezier(.35, 0, .4, 1) infinite; box-shadow: 0 1px 3px rgba(138, 0, 133, .35); }
.loading-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.loading-ring circle { fill: none; stroke-width: 3; stroke-linecap: round; transform-origin: 50% 50%; }
.loading-ring .track { stroke: rgba(138, 0, 133, .12); }
.loading-ring .beam { stroke: var(--kds-purple); stroke-dasharray: 70 260; animation: ld-spin 1.4s linear infinite; }
.loading-ring .beam-2 { stroke: #c86cc4; stroke-width: 2; stroke-dasharray: 36 240; animation: ld-spin 2.6s linear infinite reverse; opacity: .8; }
.loading-text { position: absolute; left: 0; right: 0; bottom: -30px; text-align: center; font-size: 13.5px; font-weight: 600; letter-spacing: .02em; color: var(--kds-purple-dark); }
.loading-dots { display: inline-block; margin-left: 3px; }
.loading-dots i { display: inline-block; width: 5px; height: 5px; margin: 0 1.5px; border-radius: 50%; background: var(--kds-purple); animation: ld-dot 1.2s ease-in-out infinite; vertical-align: 1px; }
.loading-dots i:nth-child(2) { animation-delay: .2s; } .loading-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes ld-spin { to { transform: rotate(360deg); } }
@keyframes ld-shine { from { background-position: 130% 0; } to { background-position: -130% 0; } }
@keyframes ld-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-5px); opacity: 1; } }
/* the dot crouches, pops up out of the logo (bigger = closer), drops back and squashes; the logo dips when it lands */
@keyframes ld-jump {
  0%, 10%  { transform: translateY(0) scale(1); border-radius: 22%; }
  17%      { transform: translateY(0) scale(1.3, .65); border-radius: 22%; }
  23%      { transform: translateY(-90%) scale(.85, 1.3); border-radius: 35%; }
  46%      { transform: translateY(-340%) scale(1.9); border-radius: 50%; }
  68%      { transform: translateY(-50%) scale(.9, 1.25); border-radius: 35%; }
  74%      { transform: translateY(0) scale(1.45, .6); border-radius: 22%; }
  82%      { transform: translateY(0) scale(.95, 1.1); border-radius: 22%; }
  90%, 100% { transform: translateY(0) scale(1); border-radius: 22%; }
}
@keyframes ld-hop {
  0%, 68%  { transform: translateY(0) scale(1); }
  75%      { transform: translateY(3px) scale(1.02, .95); }
  86%      { transform: translateY(-4px) scale(.995, 1.02); }
  100%     { transform: translateY(0) scale(1); }
}
/* "reduce motion" (Windows: Animation effects off): no light sweep and no logo dip, but the dot still hops and the beam still travels */
@media (prefers-reduced-motion: reduce) {
  .loading-shine, .loading-ring .beam-2 { animation: none; display: none; }
  .loading-logo { animation: ld-pulse 2s ease-in-out infinite; }
  .loading-ring .beam { animation-duration: 2.2s; }
}
@keyframes ld-pulse { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
.balance-big { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; }
.stat-row b { font-variant-numeric: tabular-nums; }
.progress { height: 6px; background: var(--gray-bg); border-radius: 3px; overflow: hidden; } .progress i { display: block; height: 100%; background: var(--kds-violet); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, #f6f1f6, #e9eef8); }
.login-card { width: 360px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 22px 24px; box-shadow: 0 12px 40px #0001; }
.login-card img { height: 36px; margin-bottom: 14px; }
.login-card .field { margin-bottom: 10px; }
.chip { display: inline-block; background: var(--gray-bg); border-radius: 4px; padding: 1px 6px; font-size: 11.5px; margin: 1px 2px 1px 0; }
.ledger .charge td.amt { color: var(--text); } .ledger .payment td.amt { color: var(--green); } .ledger .credit td.amt, .ledger .refund td.amt { color: var(--blue); }
.ledger tr.void td { text-decoration: line-through; color: var(--muted); }
.ledger tr.flag td:first-child { border-left: 3px solid var(--orange); }
.code { font: var(--mono); background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }
.callout { border-left: 3px solid var(--kds-violet); background: var(--surface-2); padding: 8px 10px; border-radius: 0 5px 5px 0; font-size: 12.5px; }
.callout.warn { border-color: var(--orange); background: var(--orange-bg); }
.callout.bad { border-color: var(--red); background: var(--red-bg); }
.callout.good { border-color: var(--green); background: var(--green-bg); }
.two-line { line-height: 1.25; } .two-line small { display: block; color: var(--muted); }
.status-steps { display: flex; gap: 0; font-size: 11.5px; } .status-steps span { padding: 3px 10px; border: 1px solid var(--border); background: #fff; color: var(--muted); } .status-steps span:first-child { border-radius: 5px 0 0 5px; } .status-steps span:last-child { border-radius: 0 5px 5px 0; } .status-steps span.done { background: var(--green-bg); color: var(--green); border-color: #bfe3c8; } .status-steps span.cur { background: var(--kds-purple); color: #fff; border-color: var(--kds-purple); }
@media print { .sidebar, .topbar, .flashes, .actions, .btn { display: none !important; } .content { padding: 0; } }

/* ---- small charts & misc ----------------------------------------------------- */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 140px; padding-top: 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; position: relative; }
.bar-stack { display: flex; align-items: flex-end; gap: 1px; width: 100%; height: 100%; }
.bar-stack i { display: block; flex: 1; border-radius: 2px 2px 0 0; min-height: 1px; }
.bar-stack i.up { background: var(--kds-purple); } .bar-stack i.down { background: var(--gray); opacity: .6; }
.bar-col small { position: absolute; bottom: -14px; font-size: 10px; color: var(--muted); }
.bars + .help { margin-top: 20px; }
.qr svg { display: block; border: 1px solid var(--border); border-radius: 6px; }
.count { background: var(--gray-bg); border-radius: 8px; padding: 0 5px; font-size: 10.5px; margin-left: 2px; }
.btn-secondary .count { background: #fff8; }

/* ---- notes ------------------------------------------------------------------- */
.note-add textarea { min-height: 38px; height: auto; padding: 5px 8px; resize: vertical; }
.notes { list-style: none; margin: 8px 0 0; padding: 0; }
.note { padding: 6px 8px; border-left: 3px solid #f3e4a0; background: #fffdf3; border-radius: 0 5px 5px 0; margin-bottom: 6px; }
#notes-public .note { border-left-color: #bcd3f2; background: #f6f9fe; }
.note.pinned { border-left-color: var(--kds-purple); }
.note.system { border-left-color: var(--border-strong); background: var(--surface-2); }
.note.removed { opacity: .75; background: var(--surface-2); border-left-color: var(--border); }
.note.removed .note-body { text-decoration: line-through; color: var(--muted); }
.note-body { font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
.note-meta { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 11px; color: var(--muted); margin-top: 3px; }
.note-meta .note-actions { margin-left: auto; display: inline-flex; gap: 2px; opacity: .55; }
.note:hover .note-actions { opacity: 1; }
.note .pin { font-size: 11px; }

/* ---- charts (server-side SVG) ---------------------------------------------- */
.chart { display: block; width: 100%; height: auto; font-family: inherit; }
.chart .c-grid { stroke: #ececf1; stroke-width: 1; }
.chart .c-tick { font-size: 10.5px; fill: var(--muted); }
.chart .c-end, .chart .c-cap { font-size: 10.5px; fill: var(--text); font-weight: 600; }
.chart .c-hits rect { cursor: crosshair; }
.chart .c-cross { stroke: var(--border-strong); stroke-width: 1; pointer-events: none; }
.c-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.c-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.c-card .card-body { padding: 8px 10px 6px; }
.c-table { margin-top: 6px; font-size: 12px; } .c-table summary { cursor: pointer; color: var(--kds-purple); font-size: 11.5px; }
.c-table .table-wrap { max-height: 300px; overflow: auto; margin-top: 4px; }
.c-tip { position: fixed; z-index: 50; background: #fff; border: 1px solid var(--border-strong); border-radius: 6px; box-shadow: 0 6px 20px #0002; padding: 6px 9px; font-size: 11.5px; pointer-events: none; min-width: 150px; }
.c-tip b.t { display: block; margin-bottom: 3px; color: var(--muted); font-weight: 600; }
.c-tip div { display: flex; justify-content: space-between; gap: 12px; }
.c-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.c-tip .v { font-variant-numeric: tabular-nums; font-weight: 600; }
.kpi .swatch { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 2px; align-self: center; }

/* ---- contracts ---------------------------------------------------------------- */
.contract { border: 1px solid var(--border); border-left: 3px solid var(--kds-blue); border-radius: 0 6px 6px 0; padding: 8px 10px; margin-bottom: 8px; background: #fff; }
.contract.expiring { border-left-color: var(--orange); } .contract.ended { border-left-color: var(--red); } .contract.month_to_month { border-left-color: var(--kds-violet); } .contract.terminated { border-left-color: var(--border-strong); opacity: .8; }
.contract .files { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.contract .chip.removed { opacity: .6; text-decoration: line-through; }
.contract .dl { font-size: 12px; }

/* ---- background jobs: live progress ------------------------------------------------ */
.job { border-left: 3px solid var(--kds-blue); margin-bottom: 12px; }
.job.queued { border-left-color: var(--border-strong); } .job.done { border-left-color: var(--green); } .job.failed { border-left-color: var(--red); }
.job .card-head h3 { text-transform: none; letter-spacing: 0; color: var(--text); font-size: 13.5px; }
.job-spin { display: inline-block; width: 11px; height: 11px; border: 2px solid var(--border-strong); border-top-color: var(--kds-purple); border-radius: 50%; animation: jobspin .9s linear infinite; vertical-align: -1px; }
.job.done .job-spin, .job.failed .job-spin { display: none; }
@keyframes jobspin { to { transform: rotate(360deg); } }
.job-bar { height: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.job-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--kds-purple), #c24dbd); transition: width .6s ease; }
.job.running .job-bar i { background-image: repeating-linear-gradient(45deg, var(--kds-purple) 0 10px, #a63aa1 10px 20px); background-size: 28px 28px; animation: jobstripe 1s linear infinite; }
.job.done .job-bar i { background: var(--green); } .job.failed .job-bar i { background: var(--red); }
@keyframes jobstripe { to { background-position: 28px 0; } }
.job-meta { margin-top: 6px; color: var(--muted); }
.job-msg { margin-top: 4px; font-size: 13px; min-height: 18px; }
.job-log { margin: 8px 0 0; max-height: 180px; overflow: auto; background: #1e1e26; color: #d8d8e0; padding: 8px 10px; border-radius: 5px; font-size: 11.5px; white-space: pre-wrap; }
.job-next { margin-top: 8px; }
.run-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.run-step { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; background: #fff; font-size: 12.5px; }
.run-step .n { display: inline-block; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); text-align: center; line-height: 18px; font-weight: 600; margin-right: 6px; font-size: 11px; }
.run-step.done { border-color: #bfe3c8; background: var(--green-bg); } .run-step.done .n { background: var(--green); color: #fff; border-color: var(--green); }
.run-step.cur { border-color: var(--kds-purple); box-shadow: 0 0 0 2px #f3e5f3; } .run-step.cur .n { background: var(--kds-purple); color: #fff; border-color: var(--kds-purple); }
.run-step .sub { color: var(--muted); font-size: 11.5px; margin-top: 2px; }

/* ---- service addresses with install status ------------------------------------- */
.loc { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--border); border-left: 3px solid var(--border); }
.loc:last-child { border-bottom: 0; }
.loc.active { border-left-color: var(--green); } .loc.pending_install, .loc.pending_construction { border-left-color: var(--orange); } .loc.lead { border-left-color: var(--teal); }
.loc.past { opacity: .75; }
.loc-main { min-width: 0; }
.loc-actions { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; align-content: flex-start; }
.product-tabs { margin-bottom: 10px; }
.product-type { margin-bottom: 12px; scroll-margin-top: 60px; }
.product-group td { background: var(--surface-2); border-top: 2px solid var(--border); scroll-margin-top: 60px; }

/* ---- dashboard work queues --------------------------------------------------------- */
.queues { display: flex; flex-direction: column; }
.q { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 12.5px; }
.q:last-child { border-bottom: 0; } .q:hover { background: var(--surface-2); text-decoration: none; }
.q-n { min-width: 34px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.q-l small { color: var(--muted); }
.q-zero { color: var(--muted); } .q-zero .q-n { font-weight: 500; }
.q-warn .q-n { color: var(--orange); } .q-bad .q-n { color: var(--red); } .q-info .q-n { color: var(--kds-purple); }
.picker .pk-head td, .picker .pk-sub td { cursor: pointer; user-select: none; }
.picker .pk-head td { background: var(--surface-2); border-top: 2px solid var(--border); font-size: 13px; }
.picker .pk-sub td { background: #fff; padding-left: 14px; font-weight: 600; }
.picker .pk-caret { color: var(--muted); text-align: center; width: 28px; }
.picker .pk-row td:nth-child(2) { padding-left: 22px; }
.nav .nav-gap { height: 10px; }
