@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/InterVariable.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --font-ui: "Inter", "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  --bg: #f2f4f6;
  --surface: #ffffff;
  --surface-soft: #f7f8f9;
  --surface-strong: #e9edf0;
  --text: #182028;
  --text-soft: #5f6b75;
  --text-faint: #7e8992;
  --border: #d8dee3;
  --border-strong: #b9c3cb;
  --accent: #b5121b;
  --accent-strong: #8f0e15;
  --accent-soft: #f8e9ea;
  --accent-contrast: #ffffff;
  --info: #24618a;
  --info-soft: #e7f0f6;
  --success: #26724d;
  --success-soft: #e5f3eb;
  --warning: #95620a;
  --warning-soft: #fff2d2;
  --danger: #b4232c;
  --danger-soft: #fbe8e9;
  --purple: #70508f;
  --purple-soft: #f0eaf5;
  --shadow-sm: 0 1px 2px rgba(20, 27, 33, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 27, 33, 0.1);
  --sidebar-width: 212px;
  --topbar-height: 56px;
  --content-padding: 18px;
  --panel-padding: 16px;
  --control-height: 40px;
  --layout-gap: 14px;
  --radius: 6px;
  --transition: 160ms ease;
}

body[data-density="Comoda"] {
  --sidebar-width: 228px;
  --topbar-height: 62px;
  --content-padding: 24px;
  --panel-padding: 20px;
  --control-height: 44px;
  --layout-gap: 20px;
  font-size: 15px;
}

body[data-role="admin"] {
  --accent: #1d4664;
  --accent-strong: #15364f;
  --accent-soft: #e5edf2;
}

body[data-role="soporte"] {
  --accent: #12665f;
  --accent-strong: #0c4e49;
  --accent-soft: #e2f0ee;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101417;
  --surface: #181d21;
  --surface-soft: #1f252a;
  --surface-strong: #2a3238;
  --text: #edf1f3;
  --text-soft: #abb5bc;
  --text-faint: #87939c;
  --border: #30383e;
  --border-strong: #465159;
  --accent-soft: #382328;
  --info: #72acd2;
  --info-soft: #1c303d;
  --success: #76c69d;
  --success-soft: #1b3026;
  --warning: #e4ba65;
  --warning-soft: #342c1e;
  --danger: #ef858b;
  --danger-soft: #3c2225;
  --purple: #b69bce;
  --purple-soft: #30283a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.28);
}

body[data-theme="dark"][data-role="admin"] {
  --accent: #5f98bf;
  --accent-strong: #8eb8d3;
  --accent-soft: #1d303d;
}

body[data-theme="dark"][data-role="soporte"] {
  --accent: #63b9af;
  --accent-strong: #8bcfc7;
  --accent-soft: #1a302e;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  transition: background-color var(--transition), color var(--transition);
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

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

h1 {
  margin-bottom: 5px;
  font-size: 1.64rem;
  line-height: 1.18;
  font-weight: 720;
}

h2 {
  margin-bottom: 5px;
  font-size: 1.12rem;
  line-height: 1.25;
  font-weight: 700;
}

body[data-density="Comoda"] h1 {
  font-size: 1.72rem;
}

h3 {
  margin-bottom: 4px;
  font-size: 0.98rem;
  line-height: 1.3;
}

.hidden {
  display: none !important;
}

.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.grow {
  flex: 1 1 auto;
}

.muted,
.page-subtitle {
  color: var(--text-soft);
}

.page-subtitle {
  margin: 0;
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.2;
  text-transform: uppercase;
}

.skip-link {
  position: fixed;
  z-index: 2000;
  top: 8px;
  left: 8px;
  padding: 9px 13px;
  transform: translateY(-150%);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
}

.skip-link:focus {
  transform: none;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent);
  outline-offset: 2px;
}

.auth-screen {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    url("../img/login-hero-hd.png") center center / cover no-repeat,
    #273137;
}

.auth-shade {
  position: absolute;
  inset: 0;
  background: rgba(11, 15, 18, 0.62);
}

.auth-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(100%, 1220px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 42px clamp(20px, 5vw, 72px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(100%, 520px);
  margin-bottom: 24px;
  color: #ffffff;
}

.auth-brand img {
  width: 70px;
  height: 70px;
  flex: 0 0 70px;
  object-fit: contain;
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: #ffffff;
}

.auth-brand .eyebrow {
  color: #f4c9cb;
}

.auth-brand h1 {
  margin-bottom: 2px;
  font-size: 2rem;
}

.auth-brand p:last-child {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.auth-box {
  width: min(100%, 480px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  color: #182028;
  backdrop-filter: blur(8px);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #d8dee3;
}

.auth-tab {
  min-height: 48px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #68747d;
  font-weight: 700;
  cursor: pointer;
}

.auth-tab.active {
  border-bottom-color: #b5121b;
  color: #991018;
}

.auth-box > form {
  padding: 28px;
}

.auth-box label {
  color: #34404a;
}

.auth-box input,
.auth-box select {
  border-color: #cbd3d9;
  background: #ffffff;
  color: #182028;
}

.form-heading {
  margin-bottom: 2px;
}

.form-heading p {
  margin-bottom: 0;
  color: #64717a;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 600;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.brand {
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
}

.brand img {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  object-fit: contain;
  border-radius: 50%;
  background: #ffffff;
}

.brand div {
  min-width: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.86rem;
}

.brand small {
  color: var(--text-soft);
  font-size: 0.72rem;
  line-height: 1.25;
  white-space: normal;
}

.sidebar-close {
  display: none;
  margin-left: auto;
}

.nav {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  padding: 10px 8px;
}

.nav-group-label {
  margin: 15px 10px 5px;
  color: var(--text-faint);
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
}

.nav-group-label:first-child {
  margin-top: 3px;
}

.nav-item {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-soft);
  font-weight: 620;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition), transform var(--transition);
}

.nav-item svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}

.nav-item:hover {
  transform: translateY(-1px);
  background: var(--surface-soft);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-badge {
  min-width: 21px;
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--danger);
  color: #ffffff;
  font-size: 0.7rem;
  text-align: center;
}

.sidebar-footer {
  padding: 11px 13px 14px;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
}

.sidebar-footer small {
  display: block;
  margin-top: 8px;
  font-size: 0.7rem;
}

.connection-state {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 650;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}

.connection-state.offline .connection-dot {
  background: var(--warning);
  box-shadow: 0 0 0 3px var(--warning-soft);
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 500;
  top: 0;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px clamp(14px, 2vw, 28px);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: blur(12px);
}

.topbar-leading,
.topbar-actions {
  display: flex;
  align-items: center;
}

.topbar-leading {
  min-width: 0;
  gap: 11px;
}

.topbar-actions {
  gap: 6px;
}

.route-title {
  min-width: 0;
}

.route-title small,
.route-title strong {
  display: block;
}

.route-title small {
  color: var(--text-soft);
  font-size: 0.7rem;
}

.route-title strong {
  overflow: hidden;
  font-size: 0.96rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-toggle {
  display: none;
}

.profile-button {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.profile-button:hover {
  border-color: var(--border);
  background: var(--surface-soft);
}

.profile-button > svg {
  width: 15px;
}

.topbar-user {
  min-width: 0;
  text-align: left;
}

.topbar-user strong,
.topbar-user small {
  display: block;
  overflow: hidden;
  max-width: 190px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user strong {
  font-size: 0.82rem;
}

.topbar-user small {
  color: var(--text-soft);
  font-size: 0.69rem;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 750;
}

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

.avatar.small {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  font-size: 0.72rem;
}

.avatar.medium {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.avatar.large {
  width: 116px;
  height: 116px;
  font-size: 1.6rem;
}

.view {
  width: min(100%, 1520px);
  margin: 0 auto;
  padding: var(--content-padding) clamp(14px, 2vw, 28px) 36px;
}

.view[aria-busy="true"] {
  min-height: 50vh;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.compact-heading {
  margin-bottom: 14px;
}

.page-heading h1 {
  margin-bottom: 4px;
}

.page-actions,
.quick-actions,
.form-actions,
.dialog-actions,
.remote-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.button,
.icon-button {
  display: inline-flex;
  min-height: var(--control-height);
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-weight: 680;
  line-height: 1;
  cursor: pointer;
  transition: transform var(--transition), background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.button {
  padding: 9px 13px;
}

.button svg,
.icon-button svg {
  width: 18px;
  height: 18px;
}

.button:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled),
.icon-button:active:not(:disabled) {
  transform: translateY(0);
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}

.button.primary:hover:not(:disabled) {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 22%, transparent);
}

.button.secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.button.secondary:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--surface-soft);
}

.button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-soft);
}

.button.ghost:hover:not(:disabled) {
  background: var(--surface-soft);
  color: var(--text);
}

.button.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #ffffff;
}

.button.wide {
  width: 100%;
}

.button.icon,
.icon-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
}

.icon-button {
  background: transparent;
  color: var(--text-soft);
}

.icon-button:hover:not(:disabled) {
  background: var(--surface-soft);
  color: var(--text);
}

.icon-button.danger-soft {
  color: var(--danger);
}

.icon-button.danger-soft:hover:not(:disabled) {
  background: var(--danger-soft);
  color: var(--danger);
}

.button.text {
  min-height: 30px;
  justify-content: flex-start;
  padding: 4px 0;
  border-color: transparent;
  background: transparent;
  color: var(--accent);
}

button:disabled,
.button.disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  color: var(--text-soft);
  font-size: 0.79rem;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid var(--border);
  border-radius: 5px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

input,
select {
  padding: 8px 10px;
}

textarea {
  min-height: 86px;
  padding: 10px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--surface-strong);
  color: var(--text-soft);
  cursor: not-allowed;
}

.input-with-icon {
  position: relative;
  display: block;
}

.input-with-icon > svg {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 11px;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

.input-with-icon > input,
.input-with-icon > textarea {
  padding-left: 36px;
}

.input-password > input {
  padding-right: 42px;
}

.input-icon-button {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 4px;
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}

.input-icon-button svg {
  width: 17px;
  height: 17px;
}

.field-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.field-help {
  align-self: flex-end;
  color: var(--text-faint);
  font-size: 0.7rem;
  font-weight: 500;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

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

.form-grid.compact {
  gap: 12px;
}

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

.panel {
  min-width: 0;
  padding: var(--panel-padding);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title h2,
.section-title h3,
.section-title p {
  margin-bottom: 0;
}

.toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border-block: 1px solid var(--border);
  background: var(--surface);
}

.toolbar > label {
  min-width: 165px;
}

.toolbar .search-field {
  min-width: 260px;
}

.toggle-field {
  display: inline-flex;
  min-height: 40px;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.toggle-field input {
  width: 17px;
  min-height: 17px;
}

.segmented-control {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.segmented-control button {
  display: inline-flex;
  width: 36px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}

.segmented-control button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.segmented-control svg {
  width: 17px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--layout-gap);
  margin-bottom: var(--layout-gap);
}

.metric {
  position: relative;
  min-width: 0;
  padding: var(--panel-padding);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.metric-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
}

.metric-icon svg {
  width: 18px;
}

.metric-label {
  margin-top: 12px;
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 650;
}

.metric-value {
  display: block;
  margin-top: 2px;
  font-size: 1.6rem;
  font-weight: 760;
  line-height: 1.15;
}

.metric-note {
  display: block;
  margin-top: 5px;
  color: var(--text-faint);
  font-size: 0.7rem;
}

.dashboard-layout,
.home-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--layout-gap);
}

.span-2 {
  grid-column: span 2;
}

.status-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 8px;
}

.status-tile {
  padding: 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition), transform var(--transition);
}

.status-tile:hover {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.status-tile strong,
.status-tile span {
  display: block;
}

.status-tile strong {
  font-size: 1.35rem;
}

.status-tile span {
  color: var(--text-soft);
  font-size: 0.73rem;
}

.bar-chart,
.rank-board,
.workload-list,
.health-summary,
.compact-list,
.action-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(88px, 0.8fr) minmax(80px, 1.4fr) 36px;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
}

.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface-strong);
}

.bar-fill {
  width: 0;
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 300ms ease;
}

.rank-item,
.workload-item,
.health-item,
.compact-item,
.action-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.rank-item:last-child,
.workload-item:last-child,
.health-item:last-child,
.compact-item:last-child,
.action-item:last-child {
  border-bottom: 0;
}

.rank-number {
  display: inline-flex;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-strong);
  font-size: 0.7rem;
  font-weight: 750;
}

.item-body {
  min-width: 0;
  flex: 1 1 auto;
}

.item-body strong,
.item-body span {
  display: block;
}

.item-body strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-body span {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 0.72rem;
}

.count-label {
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 650;
}

.status-chip,
.priority-chip,
.sla-chip {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--text-soft);
  font-size: 0.68rem;
  font-weight: 720;
  line-height: 1;
  white-space: nowrap;
}

.status-chip.info,
.sla-chip.in-time {
  background: var(--info-soft);
  color: var(--info);
}

.status-chip.success,
.sla-chip.finished {
  background: var(--success-soft);
  color: var(--success);
}

.status-chip.warning,
.sla-chip.due-soon {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-chip.danger,
.sla-chip.overdue,
.priority-chip.critical {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-chip.purple {
  background: var(--purple-soft);
  color: var(--purple);
}

.priority-chip.high {
  background: var(--warning-soft);
  color: var(--warning);
}

.priority-chip.medium {
  background: var(--info-soft);
  color: var(--info);
}

.priority-chip.low {
  background: var(--success-soft);
  color: var(--success);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

th,
td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--text-soft);
  font-size: 0.69rem;
  font-weight: 750;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  font-size: 0.79rem;
}

tbody tr {
  transition: background-color var(--transition);
}

tbody tr:hover {
  background: var(--surface-soft);
}

.table-primary,
.table-secondary {
  display: block;
}

.table-primary {
  font-weight: 680;
}

.table-secondary {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 0.7rem;
}

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

body[data-density="Compacta"] th,
body[data-density="Compacta"] td {
  padding-block: 6px;
}

body[data-density="Comoda"] .nav-item {
  min-height: 44px;
}

body[data-density="Comoda"] .ticket-list-item {
  min-height: 114px;
}

body[data-density="Comoda"] .conversation-item {
  min-height: 72px;
}

body[data-density="Comoda"] .compact-panel {
  padding: 18px 20px;
}

.empty-state,
.error-state,
.loading-state {
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 30px;
  color: var(--text-soft);
  text-align: center;
}

.empty-state.compact {
  min-height: 120px;
  padding: 18px;
}

.empty-state > svg,
.error-state > svg,
.loading-state > svg {
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  color: var(--text-faint);
}

.empty-state h2,
.error-state h2 {
  color: var(--text);
}

.empty-state p,
.error-state p {
  max-width: 480px;
  margin-bottom: 0;
}

.spinner {
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
  border: 3px solid var(--surface-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface-strong);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.55; }
}

.ticket-workspace {
  display: grid;
  min-height: min(600px, calc(100dvh - var(--topbar-height) - 110px));
  grid-template-columns: minmax(330px, 0.84fr) minmax(520px, 1.5fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.ticket-workspace.empty {
  display: block;
  min-height: 0;
}

.ticket-workspace.empty .ticket-list-panel {
  border-right: 0;
}

.ticket-workspace.empty .ticket-list .empty-state {
  min-height: 240px;
}

.ticket-workspace.empty .ticket-detail-panel {
  display: none;
}

.ticket-list-panel {
  min-width: 0;
  border-right: 1px solid var(--border);
}

.ticket-list {
  max-height: calc(100vh - 235px);
  overflow-y: auto;
}

.ticket-pagination {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 10px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.75rem;
}

.ticket-pagination[hidden] {
  display: none;
}

.ticket-list-item {
  display: block;
  width: 100%;
  min-height: 106px;
  padding: 13px 15px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background-color var(--transition), box-shadow var(--transition);
}

.ticket-list-item:hover {
  background: var(--surface-soft);
}

.ticket-list-item.active {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.ticket-item-top,
.ticket-item-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ticket-code {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 760;
}

.ticket-person,
.ticket-problem {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-person {
  margin-top: 6px;
  font-weight: 690;
}

.ticket-problem {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.ticket-item-meta {
  justify-content: flex-start;
  margin-top: 8px;
}

.ticket-detail-panel {
  min-width: 0;
  background: var(--surface);
}

.ticket-detail {
  min-height: min(600px, calc(100dvh - var(--topbar-height) - 110px));
}

.ticket-detail-header {
  position: sticky;
  z-index: 4;
  top: var(--topbar-height);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.ticket-detail-scroll {
  padding: 20px;
}

.ticket-summary-grid,
.review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.summary-field {
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.summary-field dt {
  color: var(--text-soft);
  font-size: 0.69rem;
  font-weight: 650;
}

.summary-field dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-weight: 620;
}

.ticket-description {
  margin: 20px 0;
  padding: 14px;
  border-left: 3px solid var(--accent);
  background: var(--surface-soft);
  white-space: pre-wrap;
}

.ticket-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
  padding: 15px;
  border-block: 1px solid var(--border);
}

.resolution-box {
  margin-block: 15px;
  padding: 15px;
  border-left: 3px solid var(--success);
  background: var(--success-soft);
}

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

.timeline {
  position: relative;
  margin-top: 16px;
  padding-left: 24px;
}

.timeline::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 8px;
  width: 1px;
  background: var(--border);
  content: "";
}

.timeline-item {
  position: relative;
  padding: 0 0 18px 14px;
}

.timeline-dot {
  position: absolute;
  top: 4px;
  left: -20px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.timeline-item.internal .timeline-dot {
  background: var(--warning);
  box-shadow: 0 0 0 1px var(--warning);
}

.timeline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.timeline-head time {
  color: var(--text-faint);
  font-size: 0.68rem;
  white-space: nowrap;
}

.timeline-item p {
  margin: 4px 0 0;
  color: var(--text-soft);
  white-space: pre-wrap;
}

.comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 14px;
}

.comment-form textarea {
  min-height: 58px;
}

.draft-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-size: 0.73rem;
}

.draft-state svg {
  width: 16px;
}

.form-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.form-stepper li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-faint);
  font-size: 0.75rem;
  font-weight: 650;
}

.form-stepper li::after {
  height: 1px;
  flex: 1 1 auto;
  margin-inline: 8px;
  background: var(--border);
  content: "";
}

.form-stepper li:last-child::after {
  display: none;
}

.form-stepper li > span {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  font-size: 0.7rem;
}

.form-stepper li.active,
.form-stepper li.completed {
  color: var(--accent);
}

.form-stepper li.active > span,
.form-stepper li.completed > span {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.guided-form {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.form-step {
  display: none;
  min-height: 0;
  padding: clamp(18px, 2.5vw, 28px);
}

.form-step.active {
  display: block;
  animation: step-in 180ms ease;
}

@keyframes step-in {
  from { opacity: 0; transform: translateX(8px); }
}

.form-step > header {
  margin-bottom: 22px;
}

.guided-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}

.dynamic-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding-top: 4px;
}

.knowledge-suggestion {
  padding: 12px 14px;
  border-left: 3px solid var(--info);
  background: var(--info-soft);
  color: var(--info);
}

.file-drop {
  display: flex;
  min-height: 100px;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  text-align: left;
  cursor: pointer;
}

.file-drop:hover,
.file-drop.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.file-drop > svg {
  width: 28px;
  color: var(--accent);
}

.file-drop strong,
.file-drop small {
  display: block;
}

.file-drop small {
  margin-top: 3px;
  color: var(--text-soft);
  font-weight: 500;
}

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

.file-preview {
  padding: 10px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.register-area-control {
  display: flex;
  gap: 6px;
}

.register-area-control select {
  min-width: 0;
  flex: 1;
}

.register-area-control .icon-button {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
}

.register-area-status {
  display: block;
  margin-top: 4px;
  color: var(--danger);
  font-size: 0.7rem;
  line-height: 1.35;
}

.register-area-status.hidden {
  display: none;
}

.messages-layout {
  position: relative;
  display: grid;
  height: calc(100dvh - var(--topbar-height) - (var(--content-padding) * 2));
  min-height: 520px;
  grid-template-columns: minmax(340px, 370px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.conversation-column,
.chat-column,
.message-context {
  min-width: 0;
  min-height: 0;
}

.conversation-column {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}

.conversation-list-header {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.conversation-list-header h1,
.conversation-list-header p {
  margin-bottom: 0;
}

.conversation-list-header h1 {
  font-size: 1.18rem;
}

.conversation-list-actions,
.compose-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.conversation-search {
  padding: 9px 11px 7px;
  border-bottom: 1px solid var(--border);
}

.message-filter-chips {
  display: flex;
  gap: 5px;
  padding: 7px 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
}

.filter-chip {
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.71rem;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.filter-chip:hover,
.filter-chip.active {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}

.archived-conversations-row {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  font-size: 0.74rem;
  cursor: pointer;
}

.archived-conversations-row > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.archived-conversations-row svg {
  width: 16px;
}

.archived-conversations-row:hover,
.archived-conversations-row.active {
  background: var(--surface-soft);
  color: var(--text);
}

.message-compose {
  max-height: min(390px, 58%);
  overflow-y: auto;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.conversation-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
}

.conversation-item {
  display: flex;
  width: 100%;
  min-height: 68px;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.conversation-item:hover {
  background: var(--surface-soft);
}

.conversation-item.active {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.conversation-preview {
  min-width: 0;
  flex: 1;
}

.conversation-preview-head,
.conversation-preview-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.conversation-preview strong,
.conversation-preview p {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-preview p,
.conversation-preview time {
  color: var(--text-soft);
  font-size: 0.72rem;
}

.conversation-purpose {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--text-soft);
  font-size: 0.67rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-avatar-wrap,
.presence-avatar {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.presence-indicator {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--text-faint);
}

.presence-indicator.online {
  background: var(--success);
}

.presence-indicator.reciente,
.presence-indicator.recent {
  background: var(--warning);
}

.presence-indicator.offline {
  background: var(--text-faint);
}

.unread-badge,
.notification-badge {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--danger);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 750;
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 1px;
  padding: 0 4px;
}

.notifications-wrap {
  position: relative;
}

.notifications-panel {
  position: absolute;
  z-index: 800;
  top: calc(100% + 10px);
  right: 0;
  width: min(380px, calc(100vw - 24px));
  max-height: 480px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.notifications-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.notification-item {
  display: flex;
  width: 100%;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.notification-item.unread {
  background: var(--accent-soft);
}

.notification-item svg {
  width: 17px;
  flex: 0 0 17px;
  color: var(--accent);
}

.chat-column {
  position: relative;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(color-mix(in srgb, var(--surface-soft) 96%, transparent), color-mix(in srgb, var(--surface-soft) 96%, transparent)),
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--border) 54%, transparent) 1px, transparent 1px);
  background-size: auto, 22px 22px;
}

#message-detail:not(.empty-state) {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.conversation-header {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.conversation-back {
  display: none;
}

.conversation-header-body {
  min-width: 0;
  flex: 1;
}

.conversation-header-body strong,
.conversation-header-body span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-header-body span {
  color: var(--text-soft);
  font-size: 0.71rem;
}

.message-thread {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  padding: 16px clamp(12px, 2.2vw, 28px);
  scroll-behavior: smooth;
}

.message-bubble {
  align-self: flex-start;
  width: fit-content;
  max-width: min(72%, 650px);
  padding: 9px 11px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.message-bubble.own {
  align-self: flex-end;
  border-color: color-mix(in srgb, var(--accent) 20%, var(--border));
  background: var(--accent-soft);
}

.message-bubble.system {
  align-self: center;
  max-width: 82%;
  border-style: dashed;
  background: var(--info-soft);
  color: var(--info);
  text-align: center;
}

.message-bubble.pending {
  opacity: 0.76;
}

.message-bubble.pending.failed {
  border-color: var(--danger);
  opacity: 1;
}

.message-bubble p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 0.63rem;
}

.message-meta svg {
  width: 13px;
  height: 13px;
}

.message-day-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0;
}

.message-day-separator span {
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.66rem;
  font-weight: 650;
  box-shadow: var(--shadow-sm);
}

.message-scroll-bottom {
  position: absolute;
  z-index: 8;
  right: 18px;
  bottom: 76px;
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-soft);
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

.message-scroll-bottom:hover {
  color: var(--accent);
}

.message-scroll-bottom svg {
  width: 17px;
}

.message-reply-action {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.message-reply-action:hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
}

.quoted-message {
  margin-bottom: 6px;
  padding: 6px 8px;
  border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--text-soft);
  font-size: 0.7rem;
}

.message-attachment {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.message-attachment:hover {
  border-color: var(--accent);
}

.message-composer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.reply-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  padding: 7px 9px;
  border-left: 2px solid var(--accent);
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 0.72rem;
}

.composer-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 7px;
}

.composer-row textarea {
  max-height: 130px;
  min-height: 40px;
  resize: none;
}

.disabled-composer {
  background: var(--surface-soft);
}

.disabled-composer > p {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 0.74rem;
}

.restriction-note {
  padding: 11px;
  border: 1px solid var(--warning);
  background: var(--warning-soft);
}

.message-context {
  position: absolute;
  z-index: 25;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(350px, calc(100% - 24px));
  overflow-y: auto;
  padding: 0 16px 16px;
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: -12px 0 28px rgba(20, 27, 33, 0.16);
  animation: context-in 160ms ease;
}

.message-context-backdrop {
  position: absolute;
  z-index: 24;
  inset: 0;
  border: 0;
  background: rgba(10, 14, 17, 0.3);
  cursor: pointer;
}

.context-drawer-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 -16px 16px;
  padding: 8px 12px 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

@keyframes context-in {
  from { transform: translateX(24px); opacity: 0; }
}

.context-profile {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.context-profile .avatar {
  margin-bottom: 9px;
}

.context-section {
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}

.context-section:last-child {
  border-bottom: 0;
}

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

.inventory-user-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: var(--layout-gap);
}

.compact-panel {
  padding: 14px 16px;
}

.sync-status {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 11px;
  margin-bottom: var(--layout-gap);
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--info);
  border-radius: var(--radius);
  background: var(--info-soft);
  color: var(--info);
}

.sync-status.success {
  border-left-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}

.sync-status.warning {
  border-left-color: var(--warning);
  background: var(--warning-soft);
  color: var(--warning);
}

.sync-status.danger {
  border-left-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.sync-status-icon,
.file-type-icon,
.file-drop-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: color-mix(in srgb, currentColor 10%, var(--surface));
}

.sync-status-icon svg,
.file-type-icon svg,
.file-drop-icon svg {
  width: 18px;
}

.sync-status .item-body strong,
.sync-status .item-body span {
  color: inherit;
}

.timeline-list {
  display: flex;
  flex-direction: column;
}

.timeline-row,
.compact-list-row {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.timeline-row:last-child,
.compact-list-row:last-child {
  border-bottom: 0;
}

.compact-list-row.interactive {
  cursor: pointer;
}

.compact-list-row.interactive:hover {
  background: var(--surface-soft);
}

.timeline-marker {
  display: inline-flex;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--text-soft);
}

.timeline-marker.success {
  background: var(--success-soft);
  color: var(--success);
}

.timeline-marker.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.timeline-marker svg {
  width: 14px;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--text-faint);
}

.status-dot.warning {
  background: var(--warning);
}

.inventory-import-panel {
  margin-bottom: var(--layout-gap);
}

.section-copy {
  max-width: 720px;
  margin: 3px 0 0;
  color: var(--text-soft);
  font-size: 0.75rem;
}

.import-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.file-drop-field {
  position: relative;
  display: flex;
  min-height: 66px;
  align-items: center;
  flex-direction: row;
  gap: 11px;
  padding: 10px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  cursor: pointer;
}

.file-drop-field:hover,
.file-drop-field:focus-within {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.file-drop-field strong,
.file-drop-field small {
  display: block;
}

.file-drop-field small {
  margin-top: 2px;
  color: var(--text-soft);
  font-weight: 500;
}

.file-drop-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  opacity: 0;
}

.import-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.import-preview-head h3,
.import-preview-head p {
  margin-bottom: 0;
}

.import-count-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(90px, 1fr));
  gap: 7px;
  margin: 12px 0;
}

.import-count {
  padding: 9px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface-soft);
}

.import-count strong,
.import-count span {
  display: block;
}

.import-count strong {
  font-size: 1.15rem;
}

.import-count span {
  color: var(--text-soft);
  font-size: 0.68rem;
}

.import-count.success {
  border-top-color: var(--success);
}

.import-count.warning {
  border-top-color: var(--warning);
}

.import-count.danger {
  border-top-color: var(--danger);
}

.import-count.info {
  border-top-color: var(--info);
}

.import-preview-table {
  max-height: 360px;
}

.inventory-admin-secondary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--layout-gap);
  margin-top: var(--layout-gap);
}

.device-summary {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.device-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.device-title svg {
  color: var(--accent);
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.health-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.presence-board {
  display: flex;
  flex-direction: column;
}

.presence-row {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

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

.presence-avatar .avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  font-size: 0.72rem;
}

.catalog-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.catalog-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.catalog-group.archived {
  opacity: 0.68;
}

.catalog-group-header {
  display: grid;
  min-height: 66px;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.catalog-toggle {
  transition: transform var(--transition);
}

.catalog-group.open .catalog-toggle {
  transform: rotate(90deg);
}

.catalog-group-body {
  display: none;
  padding: 0 14px 14px 52px;
}

.catalog-group.open .catalog-group-body {
  display: block;
}

.catalog-type {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.catalog-description {
  color: var(--text-soft);
  font-size: 0.73rem;
}

.catalog-type.archived {
  opacity: 0.62;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.compact-title {
  min-height: 42px;
}

.dynamic-fields-editor {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.dynamic-field-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dynamic-field-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(160px, 1.2fr) minmax(110px, 0.65fr) minmax(150px, 1fr) auto auto;
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.compact-toggle {
  min-height: 40px;
  justify-content: center;
}

.form-help {
  margin: 9px 0 0;
  color: var(--text-soft);
  font-size: 0.72rem;
}

.directory-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.directory-list.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border-top: 0;
}

.directory-item {
  display: grid;
  min-height: 68px;
  grid-template-columns: auto minmax(170px, 1fr) minmax(160px, 1fr) minmax(110px, 0.7fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.directory-list.grid .directory-item {
  display: flex;
  min-height: 190px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.directory-actions {
  display: flex;
  gap: 4px;
}

.profile-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
}

.profile-summary {
  align-self: start;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.profile-photo-wrap {
  position: relative;
  width: 116px;
  height: 116px;
  margin: 0 auto 14px;
}

.profile-photo {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-photo-action {
  position: absolute;
  right: 1px;
  bottom: 1px;
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
}

.profile-photo-action svg {
  width: 16px;
}

.profile-photo-action input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  opacity: 0;
}

.profile-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.verified-field {
  position: relative;
}

.verification-state {
  position: absolute;
  top: 50%;
  right: 8px;
  display: inline-flex;
  align-items: center;
  transform: translateY(-50%);
}

.verified-field input {
  padding-right: 38px;
}

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

.verification-card {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.verification-card .item-body {
  min-width: 130px;
  flex: 1 1 160px;
}

.verification-buttons {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
}

.verification-state svg {
  width: 17px;
  color: var(--success);
}

.person-cell {
  display: flex;
  min-width: 210px;
  align-items: center;
  gap: 9px;
}

.row-inactive {
  opacity: 0.66;
}

.field-locked select {
  background: var(--surface-soft);
}

.knowledge-layout {
  display: grid;
  min-height: min(540px, calc(100dvh - var(--topbar-height) - 120px));
  grid-template-columns: minmax(280px, 0.75fr) minmax(440px, 1.5fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.knowledge-list {
  border-right: 1px solid var(--border);
}

.knowledge-item {
  display: block;
  width: 100%;
  min-height: 100px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.knowledge-item:hover,
.knowledge-item.active {
  background: var(--accent-soft);
}

.knowledge-item p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 0.75rem;
}

.knowledge-detail {
  padding: clamp(20px, 4vw, 44px);
}

.knowledge-content {
  max-width: 760px;
  white-space: pre-wrap;
}

.app-dialog {
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
}

.app-dialog.wide-dialog {
  width: min(820px, calc(100vw - 24px));
}

.app-dialog::backdrop {
  background: rgba(10, 14, 17, 0.62);
}

.dialog-content {
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
}

.dialog-header {
  border-bottom: 1px solid var(--border);
}

.dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}

.dialog-content > .form-grid,
.dialog-content > #catalog-form-fields {
  padding: 18px;
}

.modal-overlay {
  position: fixed;
  z-index: 1400;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 14, 17, 0.62);
}

.confirm-modal {
  width: min(430px, 100%);
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.toast-area {
  position: fixed;
  z-index: 1800;
  right: 18px;
  bottom: 18px;
  display: flex;
  width: min(390px, calc(100vw - 28px));
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--info);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toast-in 180ms ease;
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--danger);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast p {
  margin: 0;
}

.toast small {
  display: block;
  margin-top: 2px;
  color: var(--text-soft);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
}

.offline-banner {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 15px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 0.75rem;
  font-weight: 650;
}

.offline-banner svg {
  width: 16px;
}

.chat-widget {
  position: fixed;
  z-index: 1000;
  right: 20px;
  bottom: 20px;
}

.chat-toggle {
  display: inline-flex;
  width: 50px;
  height: 50px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform var(--transition), background-color var(--transition);
}

.chat-toggle:hover {
  transform: translateY(-2px);
  background: var(--accent-strong);
}

.chat-toggle svg {
  width: 22px;
}

.chat-panel {
  position: absolute;
  right: 0;
  bottom: 62px;
  display: grid;
  width: min(390px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 100px));
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.chat-header {
  position: relative;
  z-index: 3;
  display: flex;
  min-height: 62px;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.assistant-avatar {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.chat-header > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.assistant-heading {
  min-width: 0;
  flex: 1;
}

.chat-header strong,
.chat-header small {
  display: block;
}

.chat-header small {
  color: var(--text-soft);
  font-size: 0.68rem;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 14px;
  background: var(--surface-soft);
}

.assistant-message {
  position: relative;
  align-self: flex-start;
  max-width: 88%;
  padding: 9px 11px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  white-space: pre-wrap;
}

.assistant-message.user {
  align-self: flex-end;
  border-color: color-mix(in srgb, var(--accent) 20%, var(--border));
  background: var(--accent-soft);
}

.assistant-message-content {
  overflow-wrap: anywhere;
}

.assistant-sources {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--border);
}

.assistant-sources button,
.assistant-suggestions button,
.assistant-message-tools button,
.assistant-history button {
  font: inherit;
}

.assistant-sources button {
  display: flex;
  width: 100%;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border: 0;
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--info);
  font-size: 0.68rem;
  text-align: left;
  cursor: pointer;
}

.assistant-sources button:hover {
  background: var(--info-soft);
}

.assistant-sources svg {
  width: 14px;
  flex: 0 0 14px;
}

.assistant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.assistant-actions button {
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 650;
  cursor: pointer;
}

.assistant-confirmation {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 7px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--warning);
  border-radius: 4px;
  background: var(--warning-soft);
}

.assistant-confirmation > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--warning);
  font-size: 0.7rem;
  font-weight: 680;
}

.assistant-confirmation svg {
  width: 15px;
}

.assistant-message-tools {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  margin-top: 5px;
}

.assistant-message-tools button {
  display: inline-flex;
  width: 25px;
  height: 25px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
}

.assistant-message-tools button:hover,
.assistant-message-tools button.active {
  background: var(--surface-strong);
  color: var(--accent);
}

.assistant-message-tools svg {
  width: 13px;
}

.assistant-suggestions {
  display: flex;
  gap: 5px;
  padding: 7px 10px 5px;
  overflow-x: auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
  scrollbar-width: thin;
}

.assistant-suggestions:empty {
  display: none;
}

.assistant-suggestions button {
  min-height: 29px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.67rem;
  white-space: nowrap;
  cursor: pointer;
}

.assistant-suggestions button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.assistant-history {
  position: absolute;
  z-index: 2;
  top: 62px;
  right: 0;
  bottom: 0;
  left: 0;
  overflow-y: auto;
  background: var(--surface);
}

.assistant-history > header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.assistant-history [data-assistant-conversation] {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.assistant-history [data-assistant-conversation]:hover {
  background: var(--surface-soft);
}

.assistant-loading .assistant-message-content {
  min-width: 42px;
  min-height: 16px;
}

.assistant-loading .assistant-message-content::after {
  display: inline-block;
  width: 18px;
  overflow: hidden;
  color: var(--text-faint);
  content: "\2026";
  animation: assistant-pulse 900ms ease-in-out infinite;
}

@keyframes assistant-pulse {
  50% { opacity: 0.35; }
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 7px;
  padding: 10px;
  border-top: 1px solid var(--border);
}

.chat-form textarea {
  max-height: 100px;
  min-height: 38px;
  resize: none;
}

.mobile-nav {
  display: none;
}

@media (max-width: 1279px) {
  .sidebar {
    transform: translateX(-105%);
    box-shadow: var(--shadow-md);
    transition: transform 220ms ease;
  }

  .sidebar.open {
    transform: none;
  }

  .sidebar-close,
  .menu-toggle {
    display: inline-flex;
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 590;
    inset: 0;
    background: rgba(10, 14, 17, 0.54);
  }

  .workspace {
    margin-left: 0;
  }
}

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

  .dashboard-layout,
  .home-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .messages-layout {
    grid-template-columns: minmax(320px, 350px) minmax(0, 1fr);
  }

  .directory-list.grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dynamic-field-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  }
}

@media (max-width: 900px) {
  :root {
    --topbar-height: 56px;
  }

  .ticket-workspace {
    grid-template-columns: minmax(280px, 0.8fr) minmax(430px, 1.2fr);
  }

  .ticket-summary-grid,
  .review-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-board {
    grid-template-columns: repeat(2, minmax(100px, 1fr));
  }

  .profile-layout {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .directory-item {
    grid-template-columns: auto minmax(150px, 1fr) minmax(140px, 1fr) auto;
  }

  .directory-item > .directory-site {
    display: none;
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
    font-size: 14px;
  }

  .auth-content {
    justify-content: flex-end;
    padding: 28px 14px calc(22px + env(safe-area-inset-bottom));
  }

  .auth-brand {
    margin-bottom: 14px;
  }

  .auth-brand img {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
  }

  .auth-brand h1 {
    font-size: 1.55rem;
  }

  .auth-box {
    width: 100%;
  }

  .auth-box > form {
    max-height: 58vh;
    overflow-y: auto;
    padding: 20px;
  }

  .topbar {
    padding-inline: 10px;
  }

  .route-title small {
    display: none;
  }

  .topbar-user,
  .profile-button > svg {
    display: none;
  }

  .profile-button {
    padding: 2px;
  }

  .view {
    padding: 18px 12px 28px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 16px;
  }

  .page-heading > .button,
  .page-heading > .page-actions {
    width: 100%;
  }

  .page-actions .button {
    flex: 1 1 auto;
  }

  h1 {
    font-size: 1.45rem;
  }

  .metrics-grid,
  .dashboard-layout,
  .home-layout,
  .form-grid,
  .dynamic-fields,
  .inventory-user-summary,
  .verification-actions {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .span-2 {
    grid-column: auto;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .toolbar > label,
  .toolbar .search-field {
    min-width: 0;
    width: 100%;
  }

  .ticket-workspace {
    display: block;
    min-height: 0;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .ticket-list-panel,
  .ticket-detail-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .ticket-list-panel {
    border-right: 1px solid var(--border);
  }

  .ticket-list {
    max-height: none;
  }

  .ticket-detail-panel {
    display: none;
  }

  .ticket-workspace.detail-open .ticket-list-panel {
    display: none;
  }

  .ticket-workspace.detail-open .ticket-detail-panel {
    display: block;
  }

  .ticket-detail-header {
    top: var(--topbar-height);
  }

  .ticket-summary-grid,
  .review-grid,
  .ticket-controls {
    grid-template-columns: 1fr;
  }

  .mobile-detail-back {
    display: inline-flex !important;
  }

  .form-stepper li {
    gap: 0;
    font-size: 0;
  }

  .form-stepper li > span {
    font-size: 0.7rem;
  }

  .form-step {
    min-height: 0;
    padding: 20px 15px;
  }

  .guided-actions {
    position: sticky;
    z-index: 5;
    bottom: calc(58px + env(safe-area-inset-bottom));
    padding: 10px 12px;
  }

  .guided-actions .button {
    min-width: 0;
  }

  .messages-layout {
    display: block;
    height: calc(100dvh - var(--topbar-height) - 82px);
    min-height: 430px;
  }

  .conversation-column,
  .chat-column {
    height: 100%;
  }

  .chat-column {
    display: none;
  }

  .messages-layout.conversation-open .conversation-column {
    display: none;
  }

  .messages-layout.conversation-open .chat-column {
    display: flex;
  }

  .conversation-back {
    display: inline-flex;
  }

  .message-thread {
    padding: 12px 9px;
  }

  .message-bubble {
    max-width: 88%;
  }

  .message-context {
    width: 100%;
  }

  .inventory-admin-secondary,
  .import-upload-row {
    grid-template-columns: 1fr;
  }

  .import-count-grid {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
  }

  .import-upload-row .button {
    width: 100%;
  }

  .catalog-group-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .catalog-group-header > .sla-chip {
    display: none;
  }

  .catalog-group-body {
    padding-left: 42px;
  }

  .catalog-type {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .catalog-type > .priority-chip {
    display: none;
  }

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

  .dynamic-field-row > .icon-button {
    justify-self: end;
  }

  .directory-list.grid {
    grid-template-columns: 1fr;
  }

  .directory-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .directory-item > .directory-area,
  .directory-item > .directory-site {
    display: none;
  }

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

  .profile-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 16px;
    text-align: left;
  }

  .profile-photo-wrap {
    width: 80px;
    height: 80px;
    grid-row: span 3;
    margin: 0;
  }

  .profile-photo,
  .profile-summary .avatar.large {
    width: 80px;
    height: 80px;
  }

  .knowledge-layout {
    display: block;
    min-height: 0;
  }

  .knowledge-list {
    border-right: 0;
  }

  .knowledge-detail {
    display: none;
  }

  .knowledge-layout.detail-open .knowledge-list {
    display: none;
  }

  .knowledge-layout.detail-open .knowledge-detail {
    display: block;
  }

  .mobile-nav {
    position: fixed;
    z-index: 550;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    height: calc(58px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(4, 1fr);
    padding: 3px 4px env(safe-area-inset-bottom);
    border-top: 1px solid var(--border);
    background: var(--surface);
  }

  .mobile-nav-item {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    border: 0;
    background: transparent;
    color: var(--text-soft);
    font-size: 0.62rem;
    cursor: pointer;
  }

  .mobile-nav-item.active {
    color: var(--accent);
  }

  .mobile-nav-item svg {
    width: 20px;
    height: 20px;
  }

  .chat-widget {
    right: 12px;
    bottom: calc(70px + env(safe-area-inset-bottom));
  }

  .chat-panel {
    position: fixed;
    inset: var(--topbar-height) 0 calc(58px + env(safe-area-inset-bottom));
    width: 100%;
    height: auto;
    border: 0;
    border-radius: 0;
  }

  .toast-area {
    right: 10px;
    bottom: calc(68px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 430px) {
  .auth-brand p:last-child {
    display: none;
  }

  .auth-box > form {
    max-height: 62vh;
  }

  .status-board {
    grid-template-columns: 1fr 1fr;
  }

  .metrics-grid {
    gap: 8px;
  }

  .metric {
    min-height: 126px;
  }

  .metric {
    padding: 13px;
  }

  .metric-value {
    font-size: 1.35rem;
  }

  .ticket-detail-scroll,
  .ticket-detail-header {
    padding: 14px;
  }

  .dialog-content > .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
