@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #18282b;
  background: #f4f7f5;
  --bg: #f4f7f5;
  --nav: #122527;
  --nav-hover: #1b3538;
  --nav-active: #234346;
  --nav-text: #cad9d6;
  --accent: #137b69;
  --accent-hover: #0e6757;
  --accent-active: #0c5749;
  --accent-soft: #e5f4ef;
  --accent-dot: #6bd4b5;
  --ink: #18282b;
  --ink-secondary: #3b5250;
  --muted: #647f7b;
  --line: #e2eae7;
  --line-light: #edf2f0;
  --card: #ffffff;
  --shadow-card: 0 4px 20px rgba(18, 42, 40, 0.04);
  --shadow-hover: 0 8px 30px rgba(18, 42, 40, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --focus: #7ed9c0;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Shell Layout */
.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}

/* Sidebar */
aside {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 32px 16px 20px;
  display: flex;
  flex-direction: column;
  background: var(--nav);
  color: var(--nav-text);
  box-sizing: border-box;
  z-index: 10;
  overflow-y: auto;
  overflow-x: hidden;
  /* Hide scrollbar visually but keep scroll functional */
  scrollbar-width: none;
}
aside::-webkit-scrollbar {
  display: none;
}

.brand {
  padding: 0 12px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.05em;
  color: #fff;
}

.brand-dot {
  color: var(--accent-dot);
}

.brand small {
  display: block;
  margin-top: 8px;
  color: #8da4a1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 36px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar {
  display: none;
}

.nav button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 44px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  border-radius: 10px;
  color: #a9beba;
  font-weight: 600;
  font-size: 13.5px;
  transition: all .16s ease;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.nav button:hover {
  background: var(--nav-hover);
  color: #fff;
  transform: translateX(2px);
}

.nav button.active {
  background: var(--nav-active);
  color: #fff;
  font-weight: 800;
}

.nav button.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3.5px;
  border-radius: 4px;
  background: var(--accent-dot);
}

.nav-count:not(:empty) {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 99px;
  background: #234c49;
  color: var(--accent-dot);
  font-size: 11px;
  font-weight: 800;
}

/* Aside Bottom / User Profile */
.aside-bottom {
  margin-top: auto;
  padding: 16px 8px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.aside-user {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.aside-user-meta {
  min-width: 0;
  flex: 1;
}

.aside-user-meta strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aside-user-meta small {
  display: block;
  font-size: 11px;
  color: #8da4a1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.aside-logout {
  border: none;
  background: transparent;
  color: #7d9995;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  text-align: left;
  width: fit-content;
  transition: all .15s ease;
}

.aside-logout:hover {
  color: #fca5a5;
  background: rgba(255, 255, 255, 0.05);
}

/* Main Workspace */
main {
  max-width: 1540px;
  width: 100%;
  margin: 0 auto;
  padding: 42px clamp(24px, 4.5vw, 68px) 80px;
  box-sizing: border-box;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 26px;
  gap: 20px;
}

.eyebrow {
  color: #64827d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

h1 {
  margin: 8px 0 0;
  color: #16292b;
  font-size: clamp(28px, 2.5vw, 36px);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.15;
}

h2 {
  margin: 0 0 16px;
  color: #1a2c2e;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid #ccd8d4;
  border-radius: 10px;
  background: #fff;
  color: #27403e;
  font-weight: 750;
  font-size: 13px;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all .16s ease;
}

.button:hover {
  border-color: #a8c4bd;
  background: #f6faf8;
  transform: translateY(-1px);
}

.button:active {
  transform: none;
}

.button.primary {
  border: none;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(19, 123, 105, 0.2);
}

.button.primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 20px rgba(19, 123, 105, 0.28);
}

.button.primary:active {
  background: var(--accent-active);
}

/* Panel Containers */
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.content {
  padding: 26px 28px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line-light);
  box-sizing: border-box;
}

.toolbar strong {
  color: #1e3133;
  font-size: 14px;
  font-weight: 800;
}

.toolbar .muted {
  font-size: 12px;
}

.toolbar select, .toolbar input {
  min-height: 38px;
  padding: 6px 12px;
  border: 1px solid #d5dfdb;
  border-radius: 8px;
  color: #2b4543;
  font-size: 12.5px;
  font-weight: 600;
  background: #fff;
  transition: border-color .15s ease;
}

.toolbar select:focus, .toolbar input:focus {
  border-color: var(--accent);
}

.ticket-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ticket-search {
  min-width: 220px;
}

/* Queue Overview */
.queue-overview {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.queue-overview-intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-light);
}

.queue-overview-title .overview-kicker {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.queue-overview-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.03em;
}

.queue-overview-total {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f4f8f6;
  padding: 8px 16px;
  border-radius: 99px;
  border: 1px solid #e0ece7;
}

.queue-total-num {
  font-size: 17px;
  font-weight: 800;
  color: var(--accent);
}

.queue-total-lbl {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.queue-overview-bars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.queue-meter {
  background: #f8faf9;
  border: 1px solid #e5ede9;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.queue-meter:hover {
  border-color: #d1ded7;
  box-shadow: 0 4px 14px rgba(19, 43, 46, 0.04);
}

.queue-meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.queue-meter-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.queue-meter-badge {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 800;
}

.queue-meter-badge.urgent {
  background: #fee2e2;
  color: #b91c1c;
}

.queue-meter-badge.active {
  background: #dbeafe;
  color: #1d4ed8;
}

.queue-meter-badge.waiting {
  background: #fef3c7;
  color: #b45309;
}

.meter-track {
  height: 6px;
  border-radius: 99px;
  background: #e2ebe6;
  overflow: hidden;
  margin-bottom: 8px;
}

.meter-track span {
  display: block;
  height: 100%;
  border-radius: 99px;
  transition: width .3s ease;
}

.queue-meter.urgent .meter-track span {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.queue-meter.active .meter-track span {
  background: linear-gradient(90deg, #137b69, #34d399);
}

.queue-meter.waiting .meter-track span {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.queue-meter-hint {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

/* Portfolio Overview (Tickets Executive Summary) */
.portfolio-overview {
  display: grid;
  grid-template-columns: 240px minmax(340px, 1.6fr) minmax(220px, 1fr);
  gap: 24px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.portfolio-progress {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 20px;
  border-right: 1px solid var(--line-light);
}

.progress-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--progress) * 1%), #e5ede9 0);
  flex-shrink: 0;
}

.progress-ring::before {
  content: '';
  position: absolute;
  inset: 6px;
  background: #fff;
  border-radius: 50%;
}

.progress-ring strong {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.portfolio-progress div {
  display: flex;
  flex-direction: column;
}

.portfolio-progress .overview-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--muted);
  text-transform: uppercase;
}

.portfolio-progress strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  margin-top: 3px;
}

.portfolio-progress small {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.portfolio-flow {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.overview-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.overview-head .overview-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--muted);
  text-transform: uppercase;
}

.overview-head strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.portfolio-track {
  display: flex;
  height: 8px;
  border-radius: 99px;
  background: #e8eee9;
  overflow: hidden;
  gap: 2px;
}

.portfolio-segment {
  height: 100%;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: filter .15s ease;
}

.portfolio-segment:hover {
  filter: brightness(1.15);
}

.portfolio-segment.new { background: #3b82f6; }
.portfolio-segment.working { background: #137b69; }
.portfolio-segment.waiting { background: #f59e0b; }
.portfolio-segment.done { background: #10b981; }
.portfolio-segment.closed { background: #94a3b8; }

.portfolio-legends {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.portfolio-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #e2eae7;
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--ink-secondary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}

.portfolio-legend:hover {
  border-color: #c5d6d0;
  background: #f1f6f4;
}

.portfolio-legend.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend-dot.new { background: #3b82f6; }
.legend-dot.working { background: #137b69; }
.legend-dot.waiting { background: #f59e0b; }
.legend-dot.done { background: #10b981; }
.legend-dot.closed { background: #94a3b8; }

.portfolio-legend strong {
  font-size: 11px;
  color: var(--ink);
  margin-left: 2px;
}

.portfolio-legend.selected strong {
  color: var(--accent);
}

.portfolio-hours {
  padding-left: 20px;
  border-left: 1px solid var(--line-light);
  display: flex;
  flex-direction: column;
}

.portfolio-hours .overview-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--muted);
  text-transform: uppercase;
}

.portfolio-hours strong {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  margin: 2px 0;
}

.portfolio-hours span:not(.overview-kicker) {
  font-size: 11px;
  color: var(--muted);
}

/* Rows: Ticket & Queue & Notification & Chat */
.ticket-row {
  display: grid;
  grid-template-columns: minmax(0,1.3fr) 130px 150px 120px;
  gap: 16px;
  align-items: center;
  min-height: 72px;
  padding: 14px 22px;
  border: none;
  border-bottom: 1px solid #edf2ef;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: background .15s ease;
}

.ticket-row:hover {
  background: #f6faf8;
}

.ticket-row:last-child {
  border-bottom: none;
}

.ticket-row strong {
  color: #1a2d2f;
  font-size: 13.5px;
  font-weight: 800;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-row small {
  margin-top: 4px;
  color: #6d8481;
  font-size: 11px;
  display: block;
}

.ticket-row .muted {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Queue Row specifics */
.queue-row {
  grid-template-columns: minmax(0,1.3fr) 210px 145px;
}

.queue-action {
  font-size: 12.5px;
  color: #5d7573;
}

.queue-action.actionable {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 8px;
  background: #e6f5f0;
  color: #116a5a;
  font-weight: 750;
  font-size: 12px;
  border: 1px solid #c8e5dc;
  width: fit-content;
}

/* Notification & Chat Rows */
.notification-row {
  grid-template-columns: minmax(0, 1fr) 100px;
}

.notification-row.unread {
  background: #f3faf7;
}

.notification-row.unread strong {
  color: var(--accent);
}

.chat-row {
  grid-template-columns: minmax(0, 1fr) 160px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.new {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge.working {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge.waiting {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge.done {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge.closed {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* Workspace & Detail Grids */
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .85fr);
  gap: 24px;
  align-items: start;
}

.context-stack {
  display: grid;
  gap: 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, .85fr);
  gap: 24px;
  align-items: start;
}

/* Focus Panel */
.focus-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.focus-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #4ade80);
}

.focus-overline {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}

.focus-panel h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.3;
}

.focus-panel p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.5;
}

.focus-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #f7faf9;
  border: 1px solid #e7efe9;
}

.focus-facts span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 2px;
}

.focus-facts strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.focus-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid #c9e4dc;
  cursor: pointer;
  transition: all .16s ease;
}

.focus-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(19, 123, 105, 0.2);
}

/* Activity Panel */
.activity-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: var(--shadow-card);
}

.activity-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-light);
}

.activity-heading h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.activity-heading span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: #f1f5f3;
  padding: 2px 8px;
  border-radius: 99px;
}

.activity-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid #f2f6f4;
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a4bab6;
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-dot.fresh {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(19, 123, 105, 0.2);
}

.activity-item strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}

.activity-item small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* Workload panel */
.workload-person {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #f2f6f4;
  font-size: 12.5px;
}

.workload-person:last-child {
  border-bottom: none;
}

.workload-person>span:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workload-person strong {
  color: var(--ink);
  font-weight: 700;
}

.workload-urgent {
  color: #b91c1c;
}

/* Ticket Stepper Progress */
.ticket-progress {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.ticket-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-light);
}

.ticket-progress-top .overview-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--muted);
  text-transform: uppercase;
}

.ticket-progress-status {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 12px;
  border-radius: 99px;
}

.ticket-progress ol {
  display: flex;
  justify-content: space-between;
  position: relative;
  list-style: none;
  padding: 0;
  margin: 0;
}

.ticket-progress ol::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 28px;
  right: 28px;
  height: 2px;
  background: #e2eae7;
  z-index: 0;
}

.ticket-progress li {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #fff;
  padding: 0 10px;
}

.step-dot {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f5f3;
  color: #5d7572;
  font-size: 12px;
  font-weight: 800;
  border: 2px solid #e2eae7;
  transition: all .2s ease;
}

.ticket-progress li.passed .step-dot {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}

.ticket-progress li.current .step-dot {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(19, 123, 105, 0.15);
}

.step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.ticket-progress li.current .step-label {
  color: var(--accent);
  font-weight: 800;
}

.ticket-progress li.passed .step-label {
  color: var(--ink);
  font-weight: 700;
}

/* Next Step Callout */
.next-step {
  background: linear-gradient(135deg, #e8f5f1, #e1f1eb);
  border: 1px solid #c5e3d7;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  color: #125749;
}

.next-step span {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #1c6858;
  margin-bottom: 4px;
}

.next-step strong {
  font-size: 15px;
  font-weight: 800;
}

/* Detail Description & Meta */
.description {
  white-space: pre-wrap;
  margin: 0;
  line-height: 1.6;
  color: #263c3a;
  font-size: 14px;
}

.meta {
  display: grid;
  gap: 16px;
}

.meta>div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.meta strong {
  font-size: 14px;
  color: var(--ink);
  font-weight: 750;
}

.meta select {
  width: 100%;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid #cbd6d2;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

/* Messages & Composer */
.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 440px;
  overflow-y: auto;
  padding: 22px 24px;
  background: #fafcfb;
}

.message {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 14px 14px 14px 4px;
  background: #edf3f0;
  border: 1px solid #e1ebe6;
  color: #1c3031;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  align-self: flex-start;
}

.message.mine {
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
  background: #e2f4ed;
  border-color: #c9e8dc;
  color: #103c33;
}

.message small {
  display: block;
  font-size: 11px;
  color: #6a8480;
  margin-bottom: 4px;
  font-weight: 600;
}

.composer {
  border-top: 1px solid var(--line-light);
  padding: 18px 22px;
  display: flex;
  gap: 12px;
  align-items: flex-end;
  background: #fff;
}

.composer textarea {
  flex: 1;
  min-height: 52px;
  max-height: 140px;
  padding: 10px 14px;
  border: 1px solid #cad7d2;
  border-radius: 10px;
  font-size: 13px;
  resize: vertical;
  line-height: 1.45;
  background: #fff;
}

.composer textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(19, 123, 105, 0.14);
}

.composer .button.primary {
  min-height: 48px;
  padding: 0 20px;
}

/* Assigned Specialist */
.assigned-person {
  margin-top: 20px;
}

.person-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.person-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #d8ece5;
  color: #126351;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  overflow: hidden;
  flex-shrink: 0;
}

.person-avatar.large {
  width: 64px;
  height: 64px;
  font-size: 22px;
}

.person-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-heading h2 {
  margin: 2px 0 0;
  font-size: 16px;
}

.person-heading p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.person-bio {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--ink-secondary);
  line-height: 1.55;
  padding-top: 12px;
  border-top: 1px solid var(--line-light);
}

/* Hours Summary & Operations */
.operations-panel {
  margin-top: 20px;
}

.hours-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  background: #f5f9f7;
  border: 1px solid #e3ede8;
  border-radius: var(--radius-md);
  text-align: center;
}

.hours-summary small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.hours-summary strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.work-progress {
  height: 8px;
  border-radius: 99px;
  background: #e2eae6;
  overflow: hidden;
  margin-bottom: 18px;
}

.work-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #34d399);
  border-radius: 99px;
  transition: width .3s ease;
}

/* Estimate Panel */
.estimate-panel {
  margin-top: 20px;
}

.estimate-version {
  padding: 14px 0;
  border-top: 1px solid var(--line-light);
}

.estimate-version:first-of-type {
  border-top: none;
}

.estimate-version .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.estimate-version p {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--ink-secondary);
  line-height: 1.5;
}

.estimate-actions {
  display: flex;
  gap: 10px;
  margin: 16px 0;
}

/* Form Styles */
.form {
  display: grid;
  gap: 16px;
}

.form label {
  display: grid;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: #243b38;
}

.field, textarea, select {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #ccd8d3;
  border-radius: 9px;
  font-family: inherit;
  font-size: 13px;
  box-sizing: border-box;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(19, 123, 105, 0.14);
  outline: none;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  border: none;
  background: none;
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  transition: color .15s ease;
}

.back:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Attachments */
.attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  background: #edf5f2;
  border: 1px solid #d4e5de;
  border-radius: 8px;
  color: #126351;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  margin-top: 6px;
  transition: all .15s ease;
}

.attachment-link:hover {
  background: #e2ede8;
  border-color: #b7d6ca;
}

.upload-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px dashed #b5ccc4;
  border-radius: 8px;
  color: #32544c;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  background: #fbfdfc;
  transition: all .15s ease;
}

.upload-label:hover {
  border-color: var(--accent);
  background: #f1f8f5;
}

.upload-label input {
  display: none;
}

/* Auth View */
.auth {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: #122527;
  box-sizing: border-box;
}

.auth-card {
  width: 100%;
  max-width: 430px;
  padding: 38px 34px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 800;
  color: #162a2d;
  letter-spacing: -.04em;
}

.auth-switch {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 0;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  text-align: center;
}

.auth-switch:hover {
  text-decoration: underline;
}

/* Notices & Empty states */
.notice {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  background: #fef3c7;
  color: #92400e;
  font-size: 13px;
  border: 1px solid #fde68a;
  font-weight: 600;
}

.empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.empty strong {
  display: block;
  font-size: 16px;
  color: #1a2e30;
  margin-bottom: 4px;
}

/* Profile & Organizations */
.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .85fr);
  gap: 24px;
  align-items: start;
}

.profile-heading {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.profile-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
}

.profile-note {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-card);
}

.profile-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line-light);
}

.profile-facts div strong {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  display: block;
}

.profile-facts div span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
}

.organization-card {
  margin-bottom: 20px;
}

.org-members {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.org-person {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f6faf8;
  border: 1px solid #e7f0ec;
  border-radius: 9px;
}

.team-person {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-light);
}

.team-person:last-child {
  border-bottom: none;
}

.team-person .person-avatar {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.team-person > span:not(.person-avatar):not(.badge) {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.team-person strong {
  display: block;
  font-size: 13.5px;
  font-weight: 750;
  color: var(--ink);
}

.team-person small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

.team-person .badge {
  margin-left: auto;
}

.avatar-upload {
  font-size: 11px;
  font-weight: 750;
  color: var(--accent);
  cursor: pointer;
  margin-top: 8px;
  display: inline-block;
  padding: 3px 8px;
  background: var(--accent-soft);
  border-radius: 6px;
  transition: all .15s ease;
}

.avatar-upload:hover {
  background: var(--accent);
  color: #fff;
}

.avatar-remove {
  font-size: 11px;
  font-weight: 600;
  color: #ef4444;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  display: block;
  margin-top: 4px;
}

.profile-note p {
  color: #3b5452;
  font-size: 13px;
  line-height: 1.6;
}

/* Linked Chat to Ticket */
.linked-list {
  border-bottom: 1px solid var(--line-light);
  padding: 12px 22px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  background: #f7faf9;
}

.linked-list strong {
  font-size: 13px;
  color: var(--ink);
}

.chat-to-ticket {
  display: inline-block;
  margin-top: 8px;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 750;
  padding: 0;
  cursor: pointer;
}

.chat-to-ticket:hover {
  text-decoration: underline;
}

.chat-ticket-form {
  padding: 18px 22px;
  border-top: 1px solid var(--line-light);
  background: #fcfdfd;
}

/* Messengers & Deadline */
.messenger-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.messenger-header h2 {
  margin: 0;
}

.messenger-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 190px;
}

.messenger-card p {
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.55;
  margin: 0 0 16px;
}

.deadline-form {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deadline-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.deadline-form input {
  min-height: 38px;
  padding: 6px 10px;
}

.deadline-form .button {
  width: fit-content;
}

/* Responsive */
@media (max-width: 1080px) {
  .portfolio-overview {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .portfolio-progress {
    border-right: none;
    padding-right: 0;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line-light);
  }
  .portfolio-hours {
    border-left: none;
    padding-left: 0;
    padding-top: 16px;
    border-top: 1px solid var(--line-light);
  }
  .queue-overview-bars {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }
  aside {
    position: relative;
    height: auto;
    padding: 18px 20px;
  }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 16px;
  }
  .nav button {
    width: auto;
    font-size: 12.5px;
    padding: 8px 12px;
  }
  .aside-bottom {
    margin-top: 14px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .workspace-grid, .detail-grid, .profile-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  main {
    padding: 24px 16px 60px;
  }
  .top {
    flex-direction: column;
    align-items: flex-start;
  }
  .ticket-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .hide-mobile {
    display: none !important;
  }
  .queue-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .queue-overview-intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* ==========================================================================
   Track 2, 3, 4 Expansions: SLA, Internal Notes, Canned Responses, CSAT, Analytics
   ========================================================================== */

/* SLA Badges & Indicators */
.sla-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .01em;
  white-space: nowrap;
}
.sla-pill.sla-ontrack {
  background: #edf7f3;
  color: #137b69;
  border: 1px solid rgba(19, 123, 105, .2);
}
.sla-pill.sla-urgent {
  background: #fff8ec;
  color: #b45309;
  border: 1px solid rgba(180, 83, 9, .25);
}
.sla-pill.sla-overdue {
  background: #fdf2f2;
  color: #b91c1c;
  border: 1px solid rgba(185, 28, 28, .25);
  animation: pulse-border 2s infinite ease-in-out;
}
@keyframes pulse-border {
  0%, 100% { border-color: rgba(185, 28, 28, .25); }
  50% { border-color: rgba(185, 28, 28, .6); }
}

/* Internal Team Notes (Staff-only) */
.internal-notes-panel {
  background: #fffdf7;
  border: 1px solid #fae4be;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 18px;
}
.internal-notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.internal-notes-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  color: #8c5311;
}
.internal-notes-badge {
  background: #fdf1d6;
  color: #8c5311;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.internal-notes-notice {
  font-size: 12px;
  color: #9c6c2e;
  margin-bottom: 14px;
  padding: 6px 10px;
  background: rgba(247, 219, 167, 0.35);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.internal-notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  max-height: 280px;
  overflow-y: auto;
}
.internal-note-item {
  background: #ffffff;
  border: 1px solid #faebd0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink);
}
.internal-note-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
}
.internal-note-form {
  display: flex;
  gap: 8px;
}
.internal-note-form textarea {
  flex: 1;
  min-height: 48px;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid #e2d2b5;
  background: #fff;
  resize: vertical;
}
.internal-note-form textarea:focus {
  outline: none;
  border-color: #c9933b;
  box-shadow: 0 0 0 3px rgba(201, 147, 59, 0.15);
}

/* Canned Responses Popover & Button */
.canned-wrap {
  position: relative;
  display: inline-block;
}
.canned-btn {
  background: #f0f7f5;
  color: var(--accent);
  border: 1px solid rgba(19, 123, 105, 0.25);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all .15s;
}
.canned-btn:hover {
  background: #e2f2ee;
  border-color: var(--accent);
}
.canned-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 340px;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-hover);
  border-radius: var(--radius);
  padding: 10px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}
.canned-category {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  padding: 4px 6px 2px;
}
.canned-item {
  text-align: left;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 7px 10px;
  cursor: pointer;
  transition: background .12s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.canned-item:hover {
  background: var(--bg);
}
.canned-item strong {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}
.canned-item small {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* CSAT Star Rating Widget */
.csat-box {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
  border: 1px solid #d8e8e2;
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 18px;
  text-align: center;
}
.csat-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
}
.csat-subtitle {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 14px;
}
.csat-stars {
  display: inline-flex;
  gap: 8px;
  font-size: 28px;
  color: #d1d5db;
  cursor: pointer;
  margin-bottom: 12px;
}
.csat-star {
  transition: transform .12s, color .12s;
  user-select: none;
}
.csat-star:hover,
.csat-star.active {
  color: #f59e0b;
  transform: scale(1.15);
}
.csat-comment {
  width: 100%;
  max-width: 440px;
  margin: 0 auto 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  resize: vertical;
  background: #fff;
}
.csat-result {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

/* Analytics Dashboard */
.analytics-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: box-shadow .2s;
}
.kpi-card:hover {
  box-shadow: var(--shadow-hover);
}
.kpi-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.kpi-val {
  font-size: 26px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 4px;
}
.kpi-val.accent {
  color: var(--accent);
}
.kpi-hint {
  font-size: 11.5px;
  color: var(--muted);
}
.analytics-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 900px) {
  .analytics-split {
    grid-template-columns: 1fr;
  }
}
.csat-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}
.csat-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.csat-bar-track {
  flex: 1;
  height: 8px;
  background: #eef2f0;
  border-radius: 999px;
  overflow: hidden;
}
.csat-bar-fill {
  height: 100%;
  background: #f59e0b;
  border-radius: 999px;
}
.staff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 10px;
}
.staff-table th, .staff-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.staff-table th {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  background: var(--bg);
}
.staff-table tr:hover td {
  background: rgba(244, 247, 245, 0.6);
}

/* ==========================================================================
   Track 2: Knowledge Base & Self-Service Styles
   ========================================================================== */
.kb-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}
.kb-search-wrap {
  flex: 1;
  min-width: 260px;
  max-width: 520px;
}
.kb-cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.kb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all .15s ease;
}
.kb-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.kb-chip.active {
  background: var(--nav);
  color: #ffffff;
  border-color: var(--nav);
}
.kb-chip-count {
  font-size: 11px;
  opacity: .85;
}
.kb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.kb-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  box-shadow: var(--shadow-card);
}
.kb-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}
.kb-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.kb-cat-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
}
.kb-internal-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: #fef3c7;
  color: #92400e;
}
.kb-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 8px;
}
.kb-card-snippet {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 14px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kb-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line-light);
  padding-top: 10px;
}
.kb-reader {
  max-width: 820px;
  margin: 0 auto;
}
.kb-reader-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  margin: 20px 0 30px;
  white-space: pre-wrap;
  word-break: break-word;
}
.kb-feedback-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 24px;
}
.kb-feedback-actions {
  display: flex;
  gap: 8px;
}
.kb-feedback-btn {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: all .15s ease;
}
.kb-feedback-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

/* Live KB suggestion in ticket creation */
.kb-suggest-box {
  margin: 8px 0 16px;
  background: #f0fdf9;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 14px;
  animation: fadeIn 0.2s ease-out;
}
.kb-suggest-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #065f46;
  margin-bottom: 10px;
}
.kb-suggest-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kb-suggest-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  background: #ffffff;
  border: 1px solid #d1fae5;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  transition: all .15s ease;
}
.kb-suggest-item:hover {
  background: #ecfdf5;
  border-color: var(--accent);
}
.kb-suggest-item strong {
  font-size: 13.5px;
  color: var(--ink);
}
.kb-suggest-item small {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Track 4: Git References & Webhooks Styles
   ========================================================================== */
.git-panel {
  margin-top: 18px;
}
.git-links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.git-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.git-link-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.git-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.git-pill.branch {
  background: #dbeafe;
  color: #1e40af;
}
.git-pill.commit {
  background: #f3f4f6;
  color: #374151;
}
.git-pill.pr {
  background: #ede9fe;
  color: #5b21b6;
}
.git-link-text {
  flex: 1;
  min-width: 0;
}
.git-link-text a {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.git-link-text a:hover {
  text-decoration: underline;
}
.git-delete-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.git-delete-btn:hover {
  color: #ef4444;
}

/* Webhooks management */
.webhooks-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}
.webhook-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
}
.webhook-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.webhook-url {
  font-size: 14.5px;
  font-weight: 700;
  font-family: monospace;
  color: var(--ink);
  word-break: break-all;
}
.webhook-events-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.webhook-ev-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: monospace;
}
.webhook-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-light);
}
.webhook-logs-drawer {
  margin-top: 12px;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 12.5px;
}
.webhook-log-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-light);
  font-family: monospace;
}
.webhook-log-status {
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.webhook-log-status.ok {
  background: #dcfce7;
  color: #166534;
}
.webhook-log-status.err {
  background: #fee2e2;
  color: #991b1b;
}

/* ==========================================================================
   Track 3: Billing & Invoicing Styles
   ========================================================================== */
.billing-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.billing-kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.billing-kpi-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.billing-kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.billing-kpi.positive .billing-kpi-value {
  color: var(--accent);
}
.billing-kpi.danger .billing-kpi-value {
  color: #ef4444;
}
.billing-kpi-hint {
  font-size: 12px;
  color: var(--muted);
}

.billing-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.billing-tab {
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.billing-tab:hover {
  color: var(--ink);
  background: var(--line-light);
}
.billing-tab.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.billing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.billing-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
}
.billing-table td {
  padding: 14px;
  border-bottom: 1px solid var(--line-light);
  vertical-align: middle;
}
.billing-table tbody tr:hover {
  background: #fbfdfc;
}

.billing-doc-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.billing-doc-pill.act {
  background: #e0f2fe;
  color: #0369a1;
}
.billing-doc-pill.invoice {
  background: #dcfce7;
  color: #15803d;
}

.billing-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.billing-status.paid {
  background: #dcfce7;
  color: #166534;
}
.billing-status.issued {
  background: #fef3c7;
  color: #b45309;
}
.billing-status.cancelled {
  background: #f1f5f9;
  color: #64748b;
}

.hours-finance {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--ink-secondary);
}
.hours-finance strong {
  color: var(--accent);
  font-size: 15px;
}

.billing-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 37, 39, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}
.billing-modal-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0,0,0,0.18);
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
}
.billing-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.billing-modal-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
}
.billing-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}
.billing-modal-close:hover {
  color: var(--ink);
}

.billing-filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.billing-filter-pill {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.billing-filter-pill:hover {
  border-color: var(--accent);
  color: var(--ink);
}
.billing-filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.billing-ticket-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  background: #fafcfb;
  margin: 8px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.billing-ticket-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--line-light);
}
.billing-ticket-item:last-child {
  border-bottom: none;
}
.billing-ticket-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.billing-ticket-item label {
  display: flex;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
}

.billing-btn-sm {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  transition: all 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}
.billing-btn-sm:hover {
  background: var(--line-light);
  border-color: var(--accent);
}
.billing-btn-sm.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.billing-btn-sm.primary:hover {
  background: #0f6656;
}
.billing-btn-sm.danger {
  color: #dc2626;
  border-color: #fecaca;
}
.billing-btn-sm.danger:hover {
  background: #fee2e2;
}

.billing-client-meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}
.billing-tx-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}
.billing-tx-badge.deposit {
  background: #dcfce7;
  color: #15803d;
}
.billing-tx-badge.charge {
  background: #fee2e2;
  color: #b91c1c;
}
.billing-tx-badge.refund {
  background: #e0e7ff;
  color: #4338ca;
}



