:root {
  --navy: #0b1739;
  --navy-soft: #162650;
  --blue: #2764ff;
  --blue-dark: #174bd1;
  --ink: #17203a;
  --muted: #667085;
  --line: #e5e9f2;
  --surface: #ffffff;
  --background: #f5f7fb;
  --green: #16835b;
  --red: #d43f50;
  --amber: #b56a00;
  --radius: 16px;
  --shadow: 0 12px 35px rgba(20, 35, 75, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

.font-modern { font-family: Inter, "Segoe UI", sans-serif; }
.font-classic { font-family: Georgia, "Times New Roman", serif; }
.font-technical { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.compact-mode .workspace-content { padding-top: 20px; }
.compact-mode .ticket-row { padding-block: 13px; }
.compact-mode .panel,
.compact-mode .stat-card { box-shadow: 0 4px 14px rgba(20, 35, 75, 0.05); }

a {
  color: inherit;
}

.container {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  background: var(--navy);
  color: #fff;
}

.header-content {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 19px;
  font-weight: 750;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  background: var(--blue);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.main-nav form {
  margin: 0;
}

.user-name {
  padding-left: 20px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.nav-logout {
  padding: 0;
  border: 0;
  background: transparent;
  color: #bfc8e4;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}

.nav-logout:hover {
  color: #fff;
}

.main-nav > a:not(.button) {
  color: #bfc8e4;
  font-size: 14px;
  text-decoration: none;
}

.main-nav > a.active,
.main-nav > a:hover {
  color: #fff;
}

.page-content {
  padding: 48px 0 64px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 6px;
  font-size: 24px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hero {
  display: flex;
  min-height: 260px;
  align-items: center;
  justify-content: space-between;
  gap: 44px;
  margin-bottom: 28px;
  padding: 44px 48px;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(125deg, var(--navy) 0%, #152b63 70%, #214ca6 100%);
  color: #fff;
  box-shadow: var(--shadow);
}

.hero .eyebrow {
  color: #8eb1ff;
}

.hero h1 {
  max-width: 650px;
}

.hero-copy {
  max-width: 650px;
  margin: 0;
  color: #c6d0ec;
  font-size: 17px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.button-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 20px rgba(39, 100, 255, 0.25);
}

.button-primary:hover {
  background: var(--blue-dark);
}

.button-secondary {
  border: 1px solid #cfd6e6;
  background: #fff;
  color: var(--ink);
}

.button-ghost {
  background: transparent;
  color: var(--muted);
}

.button-danger {
  border: 1px solid #f0c3c9;
  background: #fff;
  color: var(--red);
}

.button-small {
  min-height: 38px;
  padding: 8px 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(20, 35, 75, 0.04);
}

.stat-card strong {
  display: block;
  margin: 8px 0 2px;
  font-size: 34px;
  line-height: 1;
}

.stat-card > span:last-child,
.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.accent-blue {
  border-top-color: var(--blue);
}

.accent-red {
  border-top-color: var(--red);
}

.accent-green {
  border-top-color: var(--green);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-heading,
.page-heading,
.ticket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.section-heading {
  padding: 24px 26px;
  border-bottom: 1px solid var(--line);
}

.page-heading {
  margin-bottom: 28px;
}

.page-heading p,
.ticket-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.page-heading.compact {
  display: block;
}

.page-heading h1,
.ticket-header h1 {
  font-size: 38px;
}

.text-link {
  color: var(--blue);
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.ticket-list {
  overflow: hidden;
  border-radius: inherit;
}

.ticket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 21px 26px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background 0.15s ease;
}

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

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

.ticket-main h3 {
  margin: 7px 0 3px;
  font-size: 17px;
}

.ticket-main p,
.ticket-side {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.reference {
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.badge {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf0f6;
  color: #505b73;
  font-size: 11px;
  font-weight: 800;
}

.status-nowe {
  background: #e8efff;
  color: #2856c4;
}

.status-w-realizacji {
  background: #fff0d8;
  color: #9b5a00;
}

.status-rozwiazane,
.status-zamkniete {
  background: #e1f5ec;
  color: #13704e;
}

.priority-wysoki,
.priority-krytyczny {
  background: #ffeaed;
  color: #b42d3c;
}

.ticket-side {
  display: grid;
  flex: 0 0 150px;
  gap: 5px;
  text-align: right;
}

.ticket-side strong {
  color: var(--ink);
}

.filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

input,
textarea,
select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cfd6e6;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(39, 100, 255, 0.12);
}

.filters input {
  flex: 1 1 340px;
}

.filters select {
  flex: 0 1 190px;
}

.queue-views {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
}

.queue-views a {
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.queue-views a:hover,
.queue-views a.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.ticket-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.ticket-tags span,
.ticket-tags a {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 10px;
  font-weight: 750;
  text-decoration: none;
}

.ticket-tags-large {
  margin: -8px 0 18px;
}

.team-dot,
.team-label i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--team-color);
}

.team-label {
  color: var(--muted);
}

.satisfaction-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(300px, 1.3fr);
  gap: 24px;
  padding: 24px;
}

.rating-form {
  display: grid;
  gap: 12px;
}

.rating-options {
  display: flex;
  gap: 7px;
}

.rating-options input {
  position: absolute;
  opacity: 0;
}

.rating-options span {
  display: block;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
}

.rating-options input:checked + span {
  border-color: #e5a000;
  background: #fff7d6;
  color: #8a5a00;
}

.rating-result strong {
  display: block;
  color: #e5a000;
  font-size: 24px;
}

.contract-hours-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 22px;
}

.contract-hours-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.contract-hours-grid article > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.hours-progress {
  height: 8px;
  margin: 13px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.hours-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.company-hours-report {
  margin-bottom: 18px;
  overflow: hidden;
}

.company-hours-report .section-heading > span {
  color: var(--muted);
  font-size: 12px;
}

.company-hours-report th {
  text-align: center;
}

.company-hours-report th:first-child,
.company-hours-report td:first-child {
  text-align: left;
}

.limit-exceeded {
  color: #b42318;
  font-weight: 750;
}

.usage-badge {
  display: inline-block;
  min-width: 62px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e9f7ef;
  color: #166534;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.usage-badge.over-limit {
  background: #fee4e2;
  color: #b42318;
}

.operational-health {
  margin-bottom: 28px;
  overflow: hidden;
}

.health-count {
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff1d6;
  color: #8a5a00;
  font-size: 12px;
  font-weight: 800;
}

.health-count.healthy {
  background: #e9f7ef;
  color: #166534;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 20px 24px;
}

.health-card {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
}

.health-card.warning {
  border-color: #f2cc8f;
  background: #fffaf0;
}

.health-card.danger {
  border-color: #f4b4ae;
  background: #fff5f4;
}

.health-card span,
.health-card small {
  color: var(--muted);
  font-size: 11px;
}

.health-card strong {
  font-size: 28px;
}

.health-card small a {
  color: var(--blue);
}

.contract-alert-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.contract-alert-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
}

.contract-alert-list > div:last-child {
  border-bottom: 0;
}

.contract-alert-list span {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.contract-alert-list b {
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff1d6;
  color: #8a5a00;
  font-size: 11px;
}

.contract-alert-list b.over-limit {
  background: #fee4e2;
  color: #b42318;
}

.license-page {
  width: min(760px, calc(100% - 32px));
  margin: 48px auto;
}

.license-card {
  display: grid;
  gap: 18px;
}

.license-summary {
  padding: 24px;
}

.license-summary dl {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 12px;
  margin: 0;
}

.license-summary dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.license-summary dd {
  margin: 0;
}

.instance-code {
  display: block;
  margin-top: 12px;
  padding: 14px;
  overflow-wrap: anywhere;
  border-radius: 8px;
  background: #f2f5f9;
  font-size: 16px;
}

.license-form {
  display: grid;
  gap: 16px;
}

.license-form textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.license-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid #f2cc8f;
  border-radius: var(--radius);
  background: #fffaf0;
  color: #8a5a00;
  font-size: 13px;
}

.license-warning a {
  color: inherit;
  font-weight: 800;
}

.assistant-shell {
  width: min(940px, 100%);
  margin: 0 auto;
}

.assistant-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.assistant-hero h1 {
  margin: 4px 0 8px;
  font-size: 38px;
}

.assistant-hero p:last-child {
  margin: 0;
  color: var(--muted);
}

.assistant-badge {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.assistant-chat {
  overflow: hidden;
}

.assistant-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  padding: 24px;
}

.assistant-answer {
  display: flex;
  gap: 14px;
  margin: 0 24px 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  background: #f8faff;
}

.assistant-answer.confidence-low {
  border-left-color: #e5a000;
}

.assistant-answer p {
  margin: 0 0 6px;
}

.assistant-answer small {
  color: var(--muted);
}

.assistant-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--navy);
  color: var(--navy-contrast);
  font-size: 12px;
  font-weight: 850;
}

.assistant-sources {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 24px 24px;
}

.assistant-sources a {
  display: grid;
  gap: 6px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
}

.assistant-sources span,
.assistant-sources small {
  color: var(--muted);
  font-size: 11px;
}

.assistant-prompts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 0 24px 24px;
}

.assistant-prompts > span {
  color: var(--muted);
  font-size: 12px;
}

.prompt-chip {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--blue);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.assistant-disclaimer {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.form-page {
  max-width: 850px;
  margin: 0 auto;
}

.form-panel {
  padding: 30px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 750;
}

.full-width {
  grid-column: 1 / -1;
}

textarea {
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.error-box,
.flash {
  margin-bottom: 20px;
  padding: 14px 18px;
  border-radius: 10px;
}

.error-box {
  border: 1px solid #f0c3c9;
  background: #fff2f3;
  color: #8f2633;
}

.error-box h2 {
  font-size: 16px;
}

.error-box ul {
  margin-bottom: 0;
}

.flash.notice {
  border: 1px solid #aaddc8;
  background: #eaf8f2;
  color: #126245;
}

.flash.alert {
  border: 1px solid #f0c3c9;
  background: #fff2f3;
  color: #8f2633;
}

.authentication-page {
  min-height: 100vh;
  background: var(--navy);
}

.login-page {
  min-height: 100vh;
}

.login-page > .flash {
  position: fixed;
  z-index: 2;
  top: 22px;
  left: 50%;
  width: min(520px, calc(100% - 32px));
  transform: translateX(-50%);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(380px, 0.85fr) minmax(440px, 1.15fr);
}

.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 8vw, 100px);
  background: #fff;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 80px;
  color: var(--navy);
  font-size: 20px;
  font-weight: 800;
}

.login-brand .brand-mark {
  color: #fff;
}

.login-heading {
  margin-bottom: 28px;
}

.login-heading h1 {
  font-size: 40px;
}

.login-heading > p:last-child,
.login-help {
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 20px;
}

.login-submit {
  width: 100%;
  margin-top: 4px;
}

.login-help {
  margin: 24px 0 0;
  font-size: 12px;
  text-align: center;
}

.login-aside {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(50px, 9vw, 120px);
  background:
    radial-gradient(circle at 78% 22%, rgba(48, 111, 255, 0.5), transparent 32%),
    linear-gradient(145deg, #0b1739 20%, #152d68 70%, #214ca6);
  color: #fff;
}

.login-aside .eyebrow {
  color: #8eb1ff;
}

.login-aside h2 {
  max-width: 560px;
  margin-bottom: 18px;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.login-aside > p:last-child {
  max-width: 520px;
  color: #c6d0ec;
  font-size: 18px;
}

.ticket-header {
  margin-bottom: 28px;
}

.ticket-header .ticket-meta {
  margin-bottom: 12px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 22px;
}

.ticket-description,
.details-card {
  padding: 28px;
}

.ticket-description > p:last-child {
  margin-bottom: 0;
}

.details-card h2 {
  margin-bottom: 22px;
}

.details-card dl {
  margin: 0;
}

.details-card dt {
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.details-card dd {
  margin: 3px 0 0;
}

.details-card a {
  color: var(--blue);
}

.danger-zone {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.empty-state {
  padding: 56px 24px;
  text-align: center;
}

.empty-state p {
  color: var(--muted);
}

@media (max-width: 820px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero,
  .page-heading,
  .ticket-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-card {
    min-height: 100vh;
  }

  .login-aside {
    display: none;
  }
}

@media (max-width: 600px) {
  .container {
    width: min(100% - 24px, 1160px);
  }

  .site-header {
    padding: 12px 0;
  }

  .header-content,
  .main-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav {
    width: 100%;
    gap: 12px;
  }

  .main-nav .button {
    width: 100%;
  }

  .page-content {
    padding-top: 28px;
  }

  .hero {
    padding: 30px 24px;
  }

  .hero .button {
    width: 100%;
  }

  .stats-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .full-width {
    grid-column: auto;
  }

  .ticket-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .ticket-side {
    display: flex;
    flex-basis: auto;
    justify-content: space-between;
    width: 100%;
    text-align: left;
  }
}

.update-version-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.update-version-card {
  display: grid;
  gap: 8px;
}

.update-version-card span,
.update-version-card small,
.update-state small {
  color: var(--muted);
}

.update-version-card strong {
  font-size: clamp(26px, 4vw, 40px);
}

.update-state,
.update-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.update-state {
  justify-content: flex-start;
}

.update-state h2,
.update-actions h2 {
  margin: 0 0 6px;
}

.update-state p,
.update-actions p {
  margin: 0;
}

.update-state-icon {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.update-state-warning .update-state-icon {
  background: #fef3c7;
  color: #92400e;
}

.update-state-error .update-state-icon {
  background: #fee2e2;
  color: #991b1b;
}

.button-disabled {
  cursor: wait;
  opacity: 0.55;
}

.update-log summary {
  cursor: pointer;
  font-weight: 800;
}

.update-log pre {
  max-height: 360px;
  margin: 18px 0 0;
  padding: 16px;
  overflow: auto;
  border-radius: 10px;
  background: #101828;
  color: #d1fadf;
  white-space: pre-wrap;
}

@media (max-width: 720px) {
  .update-version-grid {
    grid-template-columns: 1fr;
  }

  .update-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Portal personalization and operational workflows */
.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  padding: 4px;
}

.global-incident {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 18px;
  border: 1px solid #f0c36a;
  border-radius: 14px;
  background: #fff8e6;
  color: #754b00;
}

.global-incident p {
  margin: 3px 0 0;
}

.global-incident.severity-info {
  background: #edf6ff;
  border-color: #9cc9f5;
  color: #164d7a;
}

.global-incident.severity-critical {
  background: #fff0f1;
  border-color: #ef9da6;
  color: #922838;
}

.time-tracking-panel,
.remote-consent-panel {
  margin-bottom: 20px;
}

.remote-consent-panel,
.running-work {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.timer-start-form {
  display: flex;
  gap: 12px;
  align-items: center;
}

.manual-time-entry {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.manual-time-entry summary {
  color: var(--blue);
  cursor: pointer;
  font-weight: 700;
}

.compact-grid {
  margin-top: 16px;
}

.time-entry-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.time-entry-list > div {
  display: grid;
  grid-template-columns: 130px 1fr 90px 100px;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.time-entry-list small {
  grid-column: 2 / -1;
  color: var(--muted);
}

.layout-minimal .app-sidebar {
  width: 220px;
}

.layout-minimal .workspace-content {
  max-width: 1080px;
  margin-inline: auto;
}

.layout-analytical .workspace-content {
  max-width: none;
}

.layout-analytical .panel {
  border-radius: 8px;
  box-shadow: none;
}

@media (max-width: 700px) {
  .global-incident,
  .remote-consent-panel,
  .running-work {
    align-items: flex-start;
    flex-direction: column;
  }

  .timer-start-form {
    align-items: stretch;
    flex-direction: column;
  }

  .time-entry-list > div {
    grid-template-columns: 1fr 1fr;
  }
}

.template-launcher {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.template-launcher > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.template-chip {
  padding: 7px 11px;
  border: 1px solid #cdd6e7;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.template-chip.active {
  border-color: var(--blue);
  background: #edf3ff;
  color: var(--blue);
}

.dynamic-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 20px;
  border: 1px solid #cfe0ff;
  border-radius: 13px;
  background: #f7f9ff;
}

.dynamic-fields .eyebrow {
  grid-column: 1 / -1;
}

.knowledge-suggestions {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.knowledge-suggestions a {
  display: grid;
  padding: 10px 12px;
  border: 1px solid #cfe0ff;
  border-radius: 9px;
  background: #f7f9ff;
  color: inherit;
  font-size: 12px;
  text-decoration: none;
}

.knowledge-suggestions a span {
  color: var(--muted);
}

.project-progress {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
  padding: 20px 24px;
}

.project-progress > div:first-child {
  display: flex;
  justify-content: space-between;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ecf3;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.approval-pending {
  background: #fff0d8;
  color: #9b5a00;
}

.approval-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border-color: #f0d39f;
  background: #fffbf1;
}

.approval-actions,
.relation-form,
.relation-list > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.relations-panel {
  overflow: hidden;
}

.relation-list {
  display: grid;
  gap: 10px;
  padding: 20px 24px;
}

.relation-list > div {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.relation-list form {
  margin-left: auto;
}

.relation-form {
  padding: 20px 24px;
  border-top: 1px solid var(--line);
}

.relation-form select {
  min-width: 160px;
}

.custom-field-summary {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.custom-field-summary dl {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px;
}

.custom-field-summary dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.custom-field-summary dd {
  margin: 0;
}

.integrity-badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.integrity-badge.valid {
  background: #e1f5ec;
  color: #13704e;
}

.integrity-badge.invalid {
  background: #ffeaed;
  color: #b42d3c;
}

.asset-detail-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
}

.routing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.routing-card {
  padding: 22px;
}

.routing-card > div:first-child {
  display: grid;
  gap: 8px;
}

.routing-card dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px;
}

.routing-card dt {
  color: var(--muted);
  font-size: 12px;
}

.routing-card dd {
  margin: 0;
}

.integration-help {
  margin-top: 20px;
  padding: 22px;
  border: 1px solid #cfe0ff;
  border-radius: 13px;
  background: #f7f9ff;
}

.code-input,
.integration-help code {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.field-tech-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.running-timer {
  display: grid;
  min-width: 250px;
  gap: 5px;
  padding: 18px;
  border-radius: 14px;
  background: var(--navy);
  color: #fff;
}

.field-ticket-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.field-ticket-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.field-ticket-card p {
  color: var(--muted);
}

.field-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.field-primary {
  width: 100%;
  min-height: 52px;
}

.camera-form {
  margin-top: 8px;
}

.camera-button {
  width: 100%;
}

.camera-button input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
}

@media (max-width: 820px) {
  .asset-detail-grid,
  .routing-grid,
  .field-ticket-grid {
    grid-template-columns: 1fr;
  }

  .field-tech-header,
  .approval-panel,
  .relation-form {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  .field-ticket-card {
    padding: 18px;
  }

  .field-actions {
    grid-template-columns: 1fr;
  }

  .field-actions .button,
  .camera-button {
    min-height: 54px;
    font-size: 15px;
  }

  .dynamic-fields {
    grid-template-columns: 1fr;
  }
}

.nav-count {
  min-width: 22px;
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  text-align: center;
}

.profile-autofill {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid #cfe0ff;
  border-radius: 12px;
  background: #f3f7ff;
}

.profile-autofill div {
  display: grid;
  flex: 1;
}

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

.profile-autofill .profile-source {
  color: var(--blue);
  font-weight: 750;
}

.category-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.category-option {
  position: relative;
  display: grid;
  min-height: 112px;
  place-items: center;
  gap: 7px;
  padding: 15px;
  border: 2px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
  text-align: center;
}

.category-option:has(input:checked) {
  border-color: var(--blue);
  background: #f3f7ff;
  box-shadow: 0 0 0 3px rgba(39, 100, 255, 0.1);
}

.category-option input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
}

.category-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--category-color) 14%, white);
  color: var(--category-color);
  font-size: 11px;
  font-weight: 850;
}

.drop-zone {
  display: grid;
  min-height: 145px;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 20px;
  border: 2px dashed #bdc9de;
  border-radius: 13px;
  background: #fafbfe;
  cursor: pointer;
  text-align: center;
}

.drop-zone.dragging {
  border-color: var(--blue);
  background: #edf3ff;
}

.drop-zone span,
.drop-zone small {
  color: var(--muted);
}

.drop-zone input {
  width: auto;
  min-height: 0;
  margin-top: 8px;
  border: 0;
  padding: 0;
}

.status-timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-bottom: 22px;
  padding: 22px;
}

.timeline-step {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: #98a2b3;
  font-size: 12px;
  text-align: center;
}

.timeline-step::before {
  position: absolute;
  z-index: 0;
  top: 14px;
  right: 50%;
  left: -50%;
  height: 2px;
  background: #e2e7f0;
  content: "";
}

.timeline-step:first-child::before {
  display: none;
}

.timeline-step span {
  z-index: 1;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #e8ecf3;
}

.timeline-step.complete {
  color: var(--blue);
}

.timeline-step.complete::before,
.timeline-step.complete span {
  background: var(--blue);
  color: #fff;
}

.ticket-main-column {
  display: grid;
  gap: 22px;
}

.conversation,
.audit-log {
  overflow: hidden;
}

.comment-list {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.comment {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8faff;
}

.comment.internal {
  border-color: #f3d49c;
  background: #fff8e9;
}

.comment-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
}

.comment-heading span {
  color: var(--muted);
  font-size: 12px;
}

.comment p:last-child {
  margin-bottom: 0;
}

.comment-form {
  display: grid;
  gap: 12px;
  padding: 24px;
  border-top: 1px solid var(--line);
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.comment-actions input[type="file"] {
  min-height: 0;
  padding: 0;
  border: 0;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.checkbox-line input {
  width: 18px;
  min-height: 18px;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.attachment-chip {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 8px;
  background: #edf3ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.sla-breached {
  background: #ffeaed;
  color: #b42d3c;
}

.audit-row {
  display: grid;
  grid-template-columns: 130px 160px 1fr;
  gap: 14px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.audit-row span,
.audit-row p {
  margin: 0;
  color: var(--muted);
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.chart-panel {
  overflow: hidden;
}

.mini-columns {
  display: flex;
  min-height: 190px;
  align-items: end;
  justify-content: space-around;
  gap: 12px;
  padding: 28px;
}

.mini-columns div {
  display: grid;
  height: 150px;
  align-content: end;
  justify-items: center;
  gap: 5px;
}

.mini-columns span {
  width: 28px;
  max-height: 110px;
  border-radius: 7px 7px 2px 2px;
  background: linear-gradient(180deg, #5e8aff, var(--blue));
}

.mini-columns small {
  color: var(--muted);
}

.horizontal-chart {
  display: grid;
  gap: 14px;
  padding: 28px;
}

.horizontal-chart div {
  display: grid;
  grid-template-columns: 120px 1fr 30px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.horizontal-chart i {
  height: 9px;
  border-radius: 999px;
  background: var(--blue);
}

.knowledge-preview {
  margin-bottom: 28px;
  overflow: hidden;
}

.knowledge-hero {
  margin-bottom: 28px;
  padding: 42px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--navy), #214ca6);
  color: #fff;
  text-align: center;
}

.knowledge-hero .eyebrow {
  color: #9bb9ff;
}

.knowledge-hero p {
  color: #cbd6f2;
}

.knowledge-search {
  display: flex;
  max-width: 720px;
  gap: 10px;
  margin: 24px auto 0;
}

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 24px;
}

.knowledge-card {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: inherit;
  text-decoration: none;
}

.knowledge-card:hover {
  border-color: #b8c9f3;
  box-shadow: 0 10px 25px rgba(20, 35, 75, 0.08);
}

.knowledge-card span,
.knowledge-card small {
  color: var(--muted);
}

.knowledge-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  background: #edf3ff;
  color: var(--blue) !important;
  font-weight: 850;
}

.knowledge-article {
  max-width: 850px;
  margin: 0 auto;
  padding: 38px;
}

.knowledge-article h1 {
  margin-top: 20px;
}

.article-summary {
  color: var(--muted);
  font-size: 18px;
}

.article-content {
  margin: 30px 0;
  font-size: 16px;
}

.article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.notification-list {
  overflow: hidden;
}

.notification-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

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

.notification-row div {
  display: grid;
}

.notification-row small {
  color: var(--muted);
}

.notification-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
}

.report-summary {
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 900px) {
  .category-picker,
  .knowledge-grid {
    grid-template-columns: 1fr 1fr;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .status-timeline {
    overflow-x: auto;
    grid-template-columns: repeat(5, 150px);
  }
}

@media (max-width: 600px) {
  .category-picker,
  .knowledge-grid {
    grid-template-columns: 1fr;
  }

  .comment-actions,
  .article-footer,
  .knowledge-search {
    align-items: stretch;
    flex-direction: column;
  }

  .audit-row {
    grid-template-columns: 1fr;
  }
}

/* Roles and notification settings */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.role-card {
  display: flex;
  min-height: 270px;
  flex-direction: column;
  padding: 22px;
}

.role-card-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e8ebef;
}

.role-card-header h2 {
  margin: 9px 0 5px;
  font-size: 20px;
}

.role-card-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.role-card-header > strong {
  color: var(--blue);
  font-size: 26px;
  white-space: nowrap;
}

.role-card-header small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.permission-summary {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 7px;
  padding: 18px 0;
}

.permission-summary span {
  height: fit-content;
  padding: 5px 8px;
  border-radius: 5px;
  background: #eef2f7;
  color: #536175;
  font-size: 10px;
  font-weight: 700;
}

.permission-summary span.muted {
  background: transparent;
  color: #9aa3b0;
  font-weight: 500;
}

.role-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid #e8ebef;
}

.role-card-actions form {
  margin: 0;
}

.role-card-actions button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
}

.permissions-fieldset {
  margin: 26px 0 0;
  padding: 0;
  border: 0;
}

.permissions-fieldset legend {
  margin-bottom: 13px;
  font-size: 14px;
  font-weight: 800;
}

.permissions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.permission-option,
.setting-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dfe3e9;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.permission-option:has(input:checked),
.setting-option:has(input:checked) {
  border-color: #9ebcff;
  background: #f4f7ff;
}

.permission-option input,
.setting-option input {
  width: 17px;
  min-height: 17px;
  margin: 2px 0 0;
}

.permission-option span,
.setting-option span {
  display: grid;
}

.permission-option strong,
.setting-option strong {
  font-size: 12px;
}

.permission-option small,
.setting-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.notification-section {
  margin-bottom: 16px;
}

.setting-options {
  display: grid;
  gap: 10px;
  padding: 20px;
}

.setting-options.two-columns {
  grid-template-columns: 1fr 1fr;
}

.notification-details {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  padding: 20px;
}

.notification-details .field > small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 820px) {
  .roles-grid,
  .permissions-grid,
  .setting-options.two-columns,
  .notification-details {
    grid-template-columns: 1fr;
  }
}

/* Application workspace */
.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 250px minmax(0, 1fr);
  background: #f1f3f7;
}

.app-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 22px 16px 18px;
  background: #202733;
  color: #fff;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px 24px;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.sidebar-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: #f36f45;
}

.sidebar-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav a {
  display: flex;
  min-height: 45px;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 7px;
  color: #aeb7c4;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: #333d4b;
  color: #fff;
}

.nav-icon {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border: 1px solid #566170;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 900;
}

.sidebar-nav a.active .nav-icon {
  border-color: #f36f45;
  background: #f36f45;
}

.nav-section {
  margin: 24px 12px 8px;
  color: #737f8f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.sidebar-user {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 16px 8px 0;
  border-top: 1px solid #3a4350;
}

.sidebar-user div {
  min-width: 0;
}

.sidebar-user strong,
.sidebar-user span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user strong {
  font-size: 12px;
}

.sidebar-user div > span {
  color: #8f9aaa;
  font-size: 10px;
}

.user-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 50%;
  background: #dfe6f3;
  color: #34435d;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.sidebar-user .user-avatar {
  background: #f36f45;
  color: #fff;
}

.sidebar-logout {
  width: 30px;
  height: 30px;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8995a5;
  cursor: pointer;
  font-size: 0;
}

.sidebar-logout::after {
  content: "×";
  font-size: 22px;
}

.app-workspace {
  min-width: 0;
}

.workspace-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 32px;
  border-bottom: 1px solid #dfe3e9;
  background: #fff;
}

.workspace-header > div {
  display: grid;
}

.workspace-context {
  color: #8992a2;
  font-size: 11px;
}

.workspace-header strong {
  font-size: 15px;
}

.workspace-content {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 32px;
}

.dashboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.dashboard-heading h1,
.customer-welcome h1 {
  margin-bottom: 8px;
  font-size: 34px;
}

.dashboard-heading > div > p:last-child,
.customer-welcome > div > p:last-child {
  margin: 0;
  color: var(--muted);
}

.queue-alert {
  display: flex;
  min-width: 220px;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid #f0d0c5;
  border-radius: 10px;
  background: #fff8f5;
}

.queue-alert > span {
  color: #d95731;
  font-size: 30px;
  font-weight: 850;
}

.queue-alert div {
  display: grid;
}

.queue-alert small {
  color: var(--muted);
}

.customer-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: 24px;
  padding: 32px 36px;
  border: 1px solid #dce3ef;
  border-radius: 14px;
  background: linear-gradient(115deg, #fff 35%, #edf4ff);
}

.compact-stats {
  gap: 12px;
}

.compact-stats .stat-card {
  padding: 18px 20px;
  border-top-width: 3px;
  border-radius: 10px;
  box-shadow: none;
}

.compact-stats .stat-card strong {
  font-size: 30px;
}

.app-workspace .panel {
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(32, 39, 51, 0.04);
}

.app-workspace .ticket-row {
  padding: 17px 22px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 28px;
}

.admin-navigation {
  align-self: start;
  overflow: hidden;
  border: 1px solid #dfe3e9;
  border-radius: 9px;
  background: #fff;
}

.admin-navigation p {
  margin: 0;
  padding: 15px 17px;
  border-bottom: 1px solid #e5e8ed;
  color: #818b9b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-navigation a,
.admin-navigation .disabled {
  display: block;
  padding: 12px 17px;
  border-bottom: 1px solid #eef0f3;
  color: #526074;
  font-size: 13px;
  text-decoration: none;
}

.admin-navigation a.active {
  border-left: 3px solid #f36f45;
  background: #f7f8fa;
  color: #202733;
  font-weight: 800;
}

.admin-navigation .disabled {
  color: #adb4bf;
}

.admin-content {
  min-width: 0;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.admin-metrics article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid #dfe3e9;
  border-radius: 9px;
  background: #fff;
}

.admin-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.admin-metrics strong {
  font-size: 26px;
}

.user-list {
  padding: 0 22px;
}

.user-row,
.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-row {
  padding: 15px 0;
  border-bottom: 1px solid #ebedf1;
}

.user-row:last-child {
  border-bottom: 0;
}

.user-row > div,
.user-cell > div {
  display: grid;
  flex: 1;
}

.user-row div span,
.user-cell div span {
  color: var(--muted);
  font-size: 12px;
}

.role-badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf0f5;
  color: #5b6678;
  font-size: 10px;
  font-weight: 800;
}

.role-badge.admin {
  background: #ffebe4;
  color: #b84827;
}

.account-group-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.account-group-card {
  display: flex;
  min-height: 96px;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.account-group-card:hover,
.account-group-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(44, 107, 237, 0.12);
}

.account-group-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.account-group-card strong {
  font-size: 28px;
}

.account-type-badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.account-type-badge.end-user {
  background: #dbeafe;
  color: #1d4ed8;
}

.account-type-badge.it-technician {
  background: #d1fae5;
  color: #047857;
}

.account-type-badge.software-admin {
  background: #ffedd5;
  color: #9a3412;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #e8ebef;
  text-align: left;
}

.admin-table th {
  background: #f8f9fb;
  color: #7c8798;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-table td {
  font-size: 12px;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.table-actions a,
.table-actions button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.table-actions button {
  color: var(--red);
}

.requester-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dbe1ea;
  border-radius: 9px;
  background: #f7f9fc;
}

.requester-summary > div {
  display: grid;
}

.requester-summary span:last-child {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .sidebar-brand > span:last-child,
  .sidebar-nav a > span:last-child,
  .nav-section,
  .sidebar-user > div {
    display: none;
  }

  .sidebar-brand,
  .sidebar-nav a {
    justify-content: center;
  }

  .sidebar-user {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .admin-metrics {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    display: block;
  }

  .app-sidebar {
    position: static;
    width: 100%;
    height: auto;
  }

  .sidebar-brand {
    justify-content: flex-start;
  }

  .sidebar-brand > span:last-child {
    display: inline;
  }

  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar-nav a > span:last-child {
    display: inline;
  }

  .sidebar-user {
    display: none;
  }

  .workspace-header,
  .workspace-content {
    padding-right: 18px;
    padding-left: 18px;
  }

  .dashboard-heading,
  .customer-welcome {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-navigation {
    display: flex;
    overflow-x: auto;
  }

  .admin-navigation p,
  .admin-navigation .disabled {
    display: none;
  }

  .admin-navigation a {
    white-space: nowrap;
  }
}

/* Calendar, reports and categories */
.calendar-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.calendar-header h1 {
  margin-bottom: 8px;
  font-size: 36px;
}

.calendar-header p:last-child {
  margin: 0;
  color: var(--muted);
}

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

.calendar-controls strong {
  min-width: 150px;
  text-align: center;
}

.calendar-arrow {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #d4d9e1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 22px;
  text-decoration: none;
}

.calendar {
  overflow: hidden;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  border-bottom: 1px solid #dfe3e9;
  background: #f7f8fa;
}

.calendar-weekdays span {
  padding: 11px;
  color: #737e8f;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 150px;
  padding: 9px;
  border-right: 1px solid #e5e8ed;
  border-bottom: 1px solid #e5e8ed;
  background: #fff;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day.outside {
  background: #f8f9fb;
}

.calendar-date {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  margin-bottom: 6px;
  color: #576276;
  font-size: 11px;
  font-weight: 750;
}

.calendar-day.outside .calendar-date {
  color: #b1b8c2;
}

.calendar-day.today .calendar-date {
  border-radius: 50%;
  background: #f36f45;
  color: #fff;
}

.calendar-events {
  display: grid;
  gap: 5px;
}

.calendar-event {
  display: grid;
  padding: 6px 7px;
  border-left: 3px solid var(--category-color);
  border-radius: 4px;
  background: #f5f7fa;
  color: var(--ink);
  text-decoration: none;
}

.calendar-event:hover {
  background: #edf1f6;
}

.calendar-event > span,
.calendar-event small {
  color: #778293;
  font-size: 9px;
}

.calendar-event strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-legend {
  display: flex;
  gap: 20px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 11px;
}

.calendar-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

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

.legend-dot.scheduled {
  background: var(--blue);
}

.legend-dot.created {
  background: #a2aab7;
}

.report-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid #dfe3e9;
  border-radius: 9px;
  background: #fff;
}

.report-filters .field label {
  font-size: 11px;
}

.export-menu {
  position: relative;
}

.export-menu summary {
  cursor: pointer;
  list-style: none;
}

.export-menu summary::-webkit-details-marker {
  display: none;
}

.export-menu-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 34px rgba(20, 40, 60, 0.16);
}

.export-menu-list a {
  display: block;
  padding: 11px 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.export-menu-list a:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.report-summary article {
  padding: 18px;
  border: 1px solid #dfe3e9;
  border-radius: 9px;
  background: #fff;
}

.report-summary span {
  color: var(--muted);
  font-size: 11px;
}

.report-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.report-chart {
  padding: 20px;
}

.report-chart h2 {
  margin-bottom: 18px;
  font-size: 16px;
}

.chart-row {
  margin-bottom: 14px;
}

.chart-row > div:first-child {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  color: #566276;
  font-size: 11px;
}

.chart-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f4;
}

.chart-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f36f45, #ff9a68);
}

.chart-empty {
  color: var(--muted);
  font-size: 12px;
}

.report-table-wrap {
  overflow-x: auto;
}

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

.category-name i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.role-badge.active {
  background: #e1f5ec;
  color: #13704e;
}

input.color-input {
  width: 72px;
  padding: 6px;
  cursor: pointer;
}

.color-field > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.color-field output {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.theme-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 20px;
  padding: 20px;
}

.theme-preview > div {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2px 12px;
}

.theme-preview small {
  grid-column: 2;
  color: var(--muted);
}

.preview-logo {
  display: grid;
  width: 42px;
  height: 42px;
  grid-row: 1 / 3;
  place-items: center;
  border-radius: min(var(--radius), 12px);
  background: var(--blue);
  color: var(--blue-contrast);
  font-size: 12px;
  font-weight: 850;
}

/* Theme overrides: keep configurable values authoritative over legacy component colors. */
.app-shell {
  background: var(--background);
}

.app-sidebar {
  background: var(--navy);
  color: var(--navy-contrast);
}

.sidebar-brand,
.sidebar-nav a.active,
.sidebar-nav a:hover {
  color: var(--navy-contrast);
}

.sidebar-brand .brand-mark,
.sidebar-nav a.active .nav-icon,
.sidebar-user .user-avatar {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--blue-contrast);
}

.sidebar-nav a {
  border-radius: min(var(--radius), 12px);
  color: color-mix(in srgb, var(--navy-contrast) 72%, transparent);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--navy-hover);
}

.nav-icon,
.sidebar-user {
  border-color: color-mix(in srgb, var(--navy-contrast) 28%, transparent);
}

.nav-section,
.sidebar-user div > span,
.sidebar-logout {
  color: color-mix(in srgb, var(--navy-contrast) 58%, transparent);
}

.workspace-header,
.admin-navigation,
.admin-metrics article,
input,
textarea,
select {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.app-workspace .panel,
.compact-stats .stat-card,
.admin-navigation,
.admin-metrics article {
  border-radius: var(--radius);
}

.admin-navigation p,
.admin-navigation a,
.admin-navigation .disabled {
  border-color: var(--line);
}

.admin-navigation a.active {
  border-left-color: var(--blue);
  background: var(--blue-soft);
  color: var(--ink);
}

.button-primary {
  color: var(--blue-contrast);
}

input:focus,
textarea:focus,
select:focus {
  outline-color: color-mix(in srgb, var(--blue) 22%, transparent);
}

.layout-minimal .app-shell {
  grid-template-columns: 220px minmax(0, 1fr);
}

.layout-minimal .workspace-content {
  max-width: 1080px;
}

.layout-analytical .app-shell {
  grid-template-columns: 270px minmax(0, 1fr);
}

.layout-analytical .workspace-content {
  max-width: none;
}

.layout-analytical .app-workspace .panel {
  box-shadow: none;
}

.layout-operational .app-shell {
  grid-template-columns: 250px minmax(0, 1fr);
}

.layout-operational .workspace-content {
  width: min(1500px, 100%);
}

.layout-operational .ticket-row {
  border-left: 3px solid transparent;
}

.layout-operational .ticket-row:hover {
  border-left-color: var(--blue);
  background: var(--blue-soft);
}

.compact-mode .app-sidebar {
  padding-block: 14px;
}

.compact-mode .sidebar-brand {
  padding-bottom: 14px;
}

.compact-mode .sidebar-nav a {
  min-height: 38px;
  padding-block: 6px;
}

.compact-mode .workspace-header {
  min-height: 58px;
}

.compact-mode .workspace-content {
  padding: 20px 24px;
}

.compact-mode .page-heading {
  margin-bottom: 18px;
}

.compact-mode .form-panel {
  padding: 20px;
}

@media (max-width: 720px) {
  .layout-minimal .app-sidebar,
  .layout-analytical .app-sidebar,
  .layout-operational .app-sidebar {
    width: 100%;
  }

  .theme-preview {
    align-items: stretch;
    flex-direction: column;
  }

  .theme-preview .button {
    width: 100%;
  }
}

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

.checkbox-field input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.checkbox-field label {
  margin: 0;
}

@media (max-width: 1100px) {
  .report-filters {
    grid-template-columns: repeat(3, 1fr);
  }

  .report-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .account-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar {
    overflow-x: auto;
  }

  .calendar-weekdays,
  .calendar-grid {
    min-width: 850px;
  }

  .report-summary {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .account-group-grid {
    grid-template-columns: 1fr;
  }

  .report-filters,
  .report-summary {
    grid-template-columns: 1fr;
  }

  .calendar-controls {
    flex-wrap: wrap;
  }
}
