:root {
  --bg: #eaeeea;
  --card: #eaeeea;
  --text: #41787a;
  --muted: #a37061;
  --line: #ccc499;
  --primary: #41787a;
  --primary-hover: #84763e;
  --error-bg: #b99891;
  --error-text: #84763e;
  --info-bg: #8ac3b9;
  --info-text: #41787a;
  --status-iniciado: #cbbf75;
  --status-en-curso: #41787a;
  --status-cerrado: #8ac3b9;
}

[data-theme="dark"] {
  --bg: #1a1f20;
  --card: #243033;
  --text: #eaeeea;
  --muted: #ccc499;
  --line: #41787a;
  --primary: #8ac3b9;
  --primary-hover: #cbbf75;
  --error-bg: #5a433e;
  --error-text: #eaeeea;
  --info-bg: #274446;
  --info-text: #eaeeea;
  --status-iniciado: #cbbf75;
  --status-en-curso: #8ac3b9;
  --status-cerrado: #41787a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: radial-gradient(circle at top, #ccc499 0%, var(--bg) 46%);
  color: var(--text);
}

[data-theme="dark"] body {
  background: radial-gradient(circle at top, #2b3537 0%, var(--bg) 55%);
}

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

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: #eaeeeadc;
  backdrop-filter: blur(4px);
  margin-bottom: 1rem;
}

.brand {
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.9rem 0;
}

.brand span {
  letter-spacing: 0.01em;
}

.brand-mark {
  width: 150px;
  object-fit: contain;
  flex: 0 0 auto;
}

.site-header nav a {
  color: #84763e;
  font-weight: 600;
}

.site-header nav a:hover {
  color: #41787a;
}

[data-theme="dark"] .site-header {
  background: rgba(24, 31, 32, 0.92);
}

[data-theme="dark"] .site-header nav a {
  color: #cbbf75;
}

[data-theme="dark"] .site-header nav a:hover {
  color: #8ac3b9;
}

.theme-toggle {
  min-width: 108px;
}

.row {
  display: flex;
}

.between {
  justify-content: space-between;
}

.center {
  align-items: center;
}

.wrap {
  flex-wrap: wrap;
}

.gap-sm {
  gap: 0.65rem;
}

.card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

[data-theme="dark"] .card,
[data-theme="dark"] .modal,
[data-theme="dark"] .role-option,
[data-theme="dark"] .kpi-card,
[data-theme="dark"] .ticket-highlight-item,
[data-theme="dark"] .ticket-message-item,
[data-theme="dark"] .ticket-detail-focus,
[data-theme="dark"] .ticket-attachment-card,
[data-theme="dark"] .status-flag-body,
[data-theme="dark"] .notify-rule,
[data-theme="dark"] .history-change-item {
  background: #243033;
  border-color: var(--line);
  color: var(--text);
}

.card.narrow {
  max-width: 600px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.compact-grid {
  gap: 0.65rem;
}

label {
  display: block;
  margin-top: 0.8rem;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

label.inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0;
  font-weight: 500;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  background: #eaeeea;
  color: var(--text);
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: #1f282a;
  border-color: var(--line);
  color: var(--text);
}

textarea {
  resize: vertical;
}

.button,
button {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eaeeea;
  color: var(--text);
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  margin-top: 0.8rem;
}

[data-theme="dark"] .button,
[data-theme="dark"] button {
  background: #2a373a;
  border-color: #709598;
  color: #f2f8f8;
}

[data-theme="dark"] .button:hover,
[data-theme="dark"] button:hover {
  background: #334448;
  border-color: #8cb2b5;
  color: #ffffff;
}

.button.primary,
button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #eaeeea;
}

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

[data-theme="dark"] .button.primary,
[data-theme="dark"] button.primary {
  background: #e0d391;
  border-color: #f0e2a9;
  color: #131a1b;
  font-weight: 700;
}

[data-theme="dark"] .button.primary:hover,
[data-theme="dark"] button.primary:hover {
  background: #cfbf74;
  border-color: #e5d68f;
  color: #101617;
}

[data-theme="dark"] .button:focus-visible,
[data-theme="dark"] button:focus-visible {
  outline: 3px solid #f2df93;
  outline-offset: 2px;
}

.alert {
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.alert.error {
  background: var(--error-bg);
  color: var(--error-text);
}

.alert.info {
  background: var(--info-bg);
  color: var(--info-text);
}

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

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

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 0.4rem;
  vertical-align: top;
}

th {
  font-weight: 700;
  font-size: 0.9rem;
}

.pill {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0.15rem 0.55rem;
  font-size: 0.85rem;
  background: #ccc499;
  color: #84763e;
}

[data-theme="dark"] .pill {
  background: #2f3d40;
  color: #cbbf75;
}

.pre {
  white-space: pre-wrap;
  margin: 0;
}

.pre.small {
  font-size: 0.8rem;
}

.history-json {
  max-height: 420px;
  overflow: auto;
  background: #f7fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem;
  font-size: 0.84rem;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 0.8rem;
}

.user-create-form label {
  margin-top: 0.5rem;
}

.compact-inline {
  margin-top: 0.5rem;
  margin-bottom: 0.2rem;
}

.active-toggle-wrap {
  margin-top: 0.55rem;
}

.active-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.active-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  cursor: pointer;
  font-weight: 500;
}

.active-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.active-track {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #eaeeea;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  transition: background 0.2s ease;
}

.active-knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #b5c7cc;
  transition: transform 0.2s ease;
}

[data-theme="dark"] .active-knob {
  background: #eaeeea;
  border-color: #8ac3b9;
}

.active-toggle input:checked + .active-track {
  background: #8ac3b9;
  border-color: var(--primary);
}

.active-toggle input:checked + .active-track .active-knob {
  transform: translateX(18px);
  border-color: var(--primary);
}

.active-toggle input:focus-visible + .active-track {
  outline: 2px solid #41787a;
  outline-offset: 2px;
}

.active-text {
  color: var(--text);
}

.roles-fieldset {
  padding: 0.45rem 0.55rem 0.35rem;
}

.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.45rem;
}

.role-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.55rem;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.45rem;
  margin: 0;
  background: #eaeeea;
  cursor: pointer;
}

.role-option input {
  width: auto;
  margin-top: 0.2rem;
}

.role-name {
  font-weight: 700;
  line-height: 1.1;
}

.role-desc {
  grid-column: 2;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.2;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
}

.kpi-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  background: #eaeeea;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.kpi-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.kpi-value {
  font-size: 1.2rem;
  font-weight: 700;
}

.status-chart-grid {
  display: grid;
  grid-template-columns: minmax(150px, 200px) 1fr;
  align-items: center;
  gap: 1rem;
}

.status-stack-wrap {
  display: grid;
  gap: 0.8rem;
}

.status-stack-bar {
  position: relative;
  width: 100%;
  height: 24px;
  border-radius: 999px;
  background: #ccc499;
  overflow: hidden;
}

[data-theme="dark"] .status-stack-bar,
[data-theme="dark"] .status-track {
  background: #2f3d40;
}

.status-stack-segment {
  position: absolute;
  top: 0;
  bottom: 0;
}

.donut-chart {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background:
    conic-gradient(
      var(--status-iniciado) 0 calc(var(--p1) * 1%),
      var(--status-en-curso) calc(var(--p1) * 1%) calc(var(--p12) * 1%),
      var(--status-cerrado) calc(var(--p12) * 1%) 100%
    );
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-chart.empty {
  background: conic-gradient(#ccc499 0 100%);
}

.donut-center {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #eaeeea;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

[data-theme="dark"] .donut-center {
  background: #1f282a;
}

.donut-center strong {
  font-size: 1.3rem;
}

.donut-center span {
  color: var(--muted);
  font-size: 0.82rem;
}

.status-legend {
  display: grid;
  gap: 0.5rem;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.45rem;
}

.dot.iniciado,
.status-fill.iniciado {
  background: var(--status-iniciado);
}

.dot.en-curso,
.status-fill.en-curso {
  background: var(--status-en-curso);
}

.dot.cerrado,
.status-fill.cerrado {
  background: var(--status-cerrado);
}

.status-bars {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.3rem;
}

.status-row {
  display: grid;
  grid-template-columns: 80px 1fr 30px;
  align-items: center;
  gap: 0.55rem;
}

.status-row-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.status-track {
  height: 24px;
  border-radius: 999px;
  background: #ccc499;
  overflow: hidden;
}

.status-fill {
  height: 100%;
  border-radius: 999px;
}

.ticket-overview-card h1 {
  margin-bottom: 0.2rem;
}

.ticket-detail-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(320px, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.ticket-overview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.7rem;
}

.ticket-overview-title {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 700;
  color: #41787a;
}

.ticket-highlight-grid {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.55rem;
}

.ticket-highlight-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eaeeea;
  padding: 0.55rem 0.65rem;
  display: grid;
  gap: 0.15rem;
}

.ticket-highlight-item.updated {
  border-color: #8ac3b9;
  background: #eaeeea;
}

.ticket-highlight-item.priority {
  border-color: #cbbf75;
  background: #eaeeea;
}

.ticket-highlight-item.status {
  border-color: #41787a;
  background: #eaeeea;
}

.ticket-highlight-label {
  font-size: 0.76rem;
  color: #a37061;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ticket-highlight-value {
  font-size: 1rem;
  color: #41787a;
}

.ticket-info-request-banner {
  margin-top: 0.75rem;
  border: 1px solid #cbbf75;
  border-radius: 10px;
  background: #fff8dd;
  padding: 0.55rem 0.65rem;
  display: grid;
  gap: 0.15rem;
}

.ticket-info-request-banner strong {
  color: #6f5b16;
  font-size: 0.92rem;
}

.ticket-info-request-banner span {
  color: #7e6e34;
  font-size: 0.84rem;
  line-height: 1.25;
}

[data-theme="dark"] .ticket-info-request-banner {
  background: #3b341e;
  border-color: #cbbf75;
}

[data-theme="dark"] .ticket-info-request-banner strong {
  color: #f2df93;
}

[data-theme="dark"] .ticket-info-request-banner span {
  color: #e5d7a2;
}

.ticket-meta-inline {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  font-size: 0.88rem;
  color: #41787a;
}

.ticket-detail-focus {
  margin-top: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eaeeea;
  padding: 0.65rem 0.75rem;
}

.ticket-detail-focus h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.ticket-message-list {
  display: grid;
  gap: 0.65rem;
}

.ticket-message-scroll {
  max-height: 68vh;
  overflow: auto;
  padding-right: 0.2rem;
}

.ticket-message-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eaeeea;
  padding: 0.6rem 0.7rem;
  display: grid;
  gap: 0.4rem;
}

.ticket-message-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: baseline;
}

.ticket-message-body {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.35;
}

.ticket-message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ticket-attachment-card {
  border: 1px solid #ccc499;
  border-radius: 10px;
  background: #eaeeea;
  padding: 0.35rem;
  display: grid;
  gap: 0.35rem;
  max-width: 220px;
}

.ticket-attachment-thumb {
  width: 100%;
  max-width: 200px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #ccc499;
  background: #eaeeea;
  display: block;
}

[data-theme="dark"] .ticket-attachment-thumb {
  background: #1f282a;
  border-color: var(--line);
}

.ticket-attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #ccc499;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  background: #eaeeea;
  font-size: 0.82rem;
}

[data-theme="dark"] .ticket-attachment-link {
  background: #1f282a;
  border-color: var(--line);
}

.ticket-attachment-link small {
  color: var(--muted);
}

.ticket-history-scroll {
  max-height: 44vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.ticket-history-scroll table {
  margin: 0;
}

.ticket-history-scroll thead th {
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}

.filter-form-inline {
  display: flex;
  align-items: end;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.filter-form-inline label {
  margin: 0;
}

.filter-form-inline select {
  width: min(240px, 100%);
}

.ticket-list-head h2 {
  margin: 0;
}

.no-top-margin {
  margin-top: 0;
}

.modal {
  width: min(720px, 94vw);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  background: #eaeeea;
  color: var(--text);
}

.modal::backdrop {
  background: rgba(65, 120, 122, 0.45);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
}

.modal-header h3 {
  margin: 0;
}

.modal-body {
  padding: 0.85rem 1rem 1rem;
}

.modal-actions {
  margin-top: 0.9rem;
}

.transition-matrix-card .button {
  margin-top: 0.9rem;
}

.status-create-form .button {
  margin-top: 0.95rem;
}

.status-flag-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.5rem;
}

.status-flag-card {
  display: block;
  margin: 0;
  cursor: pointer;
}

.status-flag-card input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.status-flag-body {
  display: grid;
  gap: 0.15rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.45rem 0.55rem;
  background: #f8fcfd;
}

.status-flag-title {
  font-weight: 700;
  font-size: 0.9rem;
}

.status-flag-desc {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.25;
}

.status-flag-card input:checked + .status-flag-body {
  border-color: #83bec4;
  background: #ebf7f8;
}

.transition-matrix-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 70vh;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eaeeea;
}

.transition-matrix {
  min-width: 760px;
  width: 100%;
  border-collapse: collapse;
}

.transition-matrix th,
.transition-matrix td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  padding: 0.45rem 0.35rem;
}

.transition-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #ccc499;
}

.transition-matrix tbody th {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #eaeeea;
}

[data-theme="dark"] .transition-matrix-wrap {
  background: #1b2426;
  border-color: #709598;
}

[data-theme="dark"] .transition-matrix th,
[data-theme="dark"] .transition-matrix td {
  border-color: #5d7f82;
}

[data-theme="dark"] .transition-matrix thead th {
  background: #36484c;
  color: #fff3bf;
}

[data-theme="dark"] .transition-matrix tbody th {
  background: #2a393c;
  color: #f2f8f8;
}

[data-theme="dark"] .transition-matrix td {
  background: #243134;
}

.transition-matrix thead th:first-child {
  left: 0;
  z-index: 4;
}

.transition-matrix th:first-child {
  text-align: left;
  min-width: 170px;
}

.transition-matrix tr:last-child th,
.transition-matrix tr:last-child td {
  border-bottom: 0;
}

.transition-matrix th:last-child,
.transition-matrix td:last-child {
  border-right: 0;
}

.transition-cell input {
  width: auto;
  margin: 0;
}

.matrix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.65rem;
  font-size: 0.86rem;
}

[data-theme="dark"] .matrix-legend {
  color: #d9e8e9;
}

.matrix-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.matrix-toggle {
  display: inline-flex;
  cursor: pointer;
  margin: 0;
}

.matrix-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.matrix-toggle-ui {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid #84763e;
  background: #eaeeea;
  display: inline-block;
  position: relative;
}

.matrix-toggle-ui::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border-right: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: rotate(45deg);
}

.matrix-toggle input:checked + .matrix-toggle-ui,
.matrix-toggle-ui.preview.on {
  border-color: #1b7c86;
  background: linear-gradient(180deg, #13a2af 0%, #0a7e89 100%);
  box-shadow: inset 0 0 0 2px #dff7f9;
}

.matrix-toggle input:checked + .matrix-toggle-ui::after,
.matrix-toggle-ui.preview.on::after {
  border-right-color: #f6fffe;
  border-bottom-color: #f6fffe;
}

[data-theme="dark"] .matrix-toggle-ui {
  border-color: #97b9bc;
  background: #2a393c;
  box-shadow: inset 0 0 0 1px #1a2325;
}

[data-theme="dark"] .matrix-toggle input:checked + .matrix-toggle-ui,
[data-theme="dark"] .matrix-toggle-ui.preview.on {
  border-color: #cfeee9;
  background: linear-gradient(180deg, #96d2c9 0%, #4d8d90 100%);
  box-shadow: inset 0 0 0 2px #1b2f31;
}

[data-theme="dark"] .matrix-toggle input:checked + .matrix-toggle-ui::after,
[data-theme="dark"] .matrix-toggle-ui.preview.on::after {
  border-right-color: #102224;
  border-bottom-color: #102224;
}

[data-theme="dark"] .matrix-toggle input:focus-visible + .matrix-toggle-ui {
  outline: 2px solid #cbbf75;
  outline-offset: 2px;
}

.matrix-diagonal {
  color: var(--muted);
  font-weight: 700;
}

[data-theme="dark"] .matrix-diagonal {
  color: #c9d7d9;
}

.status-head-tags {
  display: flex;
  gap: 0.2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.status-head-tags em {
  font-style: normal;
  font-size: 0.68rem;
  border: 1px solid #ccc499;
  border-radius: 999px;
  padding: 0 0.32rem;
  color: #3f555a;
}

[data-theme="dark"] .status-head-tags em {
  border-color: #8eb3b6;
  background: #36474b;
  color: #fff1bc;
}

.status-head {
  display: grid;
  gap: 0.1rem;
}

.status-head small {
  color: var(--muted);
  font-weight: 400;
}

[data-theme="dark"] .status-head small {
  color: #c8d8da;
}

.status-head-note {
  font-size: 0.68rem;
  line-height: 1.2;
  color: #4d6368;
}

[data-theme="dark"] .status-head-note {
  color: #b7c9cc;
}

.notify-rule {
  display: grid;
  gap: 0.12rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.3rem 0.4rem;
  background: #f8fcfd;
  min-width: 180px;
}

.notify-rule.on {
  border-color: #8ac4c9;
  background: #edf9fa;
}

.notify-rule.off {
  border-color: #d0dbde;
  background: #f5f8f9;
}

[data-theme="dark"] .notify-rule {
  border-color: #709598;
  background: #223033;
  color: #eef6f6;
}

[data-theme="dark"] .notify-rule.on {
  border-color: #8ac3b9;
  background: #234248;
}

[data-theme="dark"] .notify-rule.off {
  border-color: #83979b;
  background: #2d3539;
}

.notify-rule-row {
  font-size: 0.75rem;
  line-height: 1.2;
}

.notify-rule-row.rich {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  flex-wrap: wrap;
}

.notify-event-chip {
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.08rem 0.42rem;
  border: 1px solid #ccc499;
  color: #2b444a;
  background: #eef5f7;
}

.notify-event-chip.change {
  border-color: #9ec7cb;
  background: #e7f5f6;
  color: #155b63;
}

.notify-event-chip.same {
  border-color: #c4cad8;
  background: #eff2f8;
  color: #38475e;
}

[data-theme="dark"] .notify-event-chip {
  border-color: #87aab0;
  background: #2d3e42;
  color: #eef8f8;
}

[data-theme="dark"] .notify-event-chip.change {
  border-color: #94c9cf;
  background: #2a5960;
  color: #f1fffe;
}

[data-theme="dark"] .notify-event-chip.same {
  border-color: #b4c2da;
  background: #404b61;
  color: #f1f5ff;
}

.notify-state-chip,
.notify-recipient-chip {
  font-size: 0.66rem;
  border-radius: 999px;
  padding: 0.07rem 0.42rem;
  border: 1px solid #ccc499;
  background: #f6fafb;
  color: #385359;
}

[data-theme="dark"] .notify-state-chip,
[data-theme="dark"] .notify-recipient-chip {
  border-color: #88a4a9;
  background: #2e3c40;
  color: #ecf6f6;
}

.notify-state-chip.on {
  border-color: #86c8aa;
  background: #eaf8f1;
  color: #166140;
  font-weight: 700;
}

.notify-state-chip.off {
  border-color: #d2d8db;
  background: #f3f5f6;
  color: #697a80;
}

[data-theme="dark"] .notify-state-chip.on {
  border-color: #8ac3b9;
  background: #24563f;
  color: #e7fff5;
  font-weight: 700;
}

[data-theme="dark"] .notify-state-chip.off {
  border-color: #9caeb2;
  background: #3a4448;
  color: #eef3f4;
}

.notify-recipient-chip.creator {
  border-color: #9ebcc2;
  background: #edf6f8;
  color: #1f5d68;
}

.notify-recipient-chip.assignee {
  border-color: #92b9da;
  background: #eaf3fc;
  color: #1f4f80;
}

.notify-recipient-chip.both {
  border-color: #c1b0db;
  background: #f1ebfb;
  color: #4e3a70;
}

[data-theme="dark"] .notify-recipient-chip.creator {
  border-color: #9ec2c8;
  background: #2a4f56;
  color: #ecfbff;
}

[data-theme="dark"] .notify-recipient-chip.assignee {
  border-color: #9dbddd;
  background: #2b4d6a;
  color: #ebf3ff;
}

[data-theme="dark"] .notify-recipient-chip.both {
  border-color: #d8c886;
  background: #4e4731;
  color: #fff6d1;
}

.notify-recipient-chip.muted {
  color: #73868c;
  background: #f4f7f8;
}

[data-theme="dark"] .notify-recipient-chip.muted {
  border-color: #84979b;
  background: #384448;
  color: #d4dfe1;
}

.history-change-list {
  display: grid;
  gap: 0.55rem;
}

.history-change-item {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7fbfc;
  padding: 0.55rem 0.65rem;
  display: grid;
  gap: 0.22rem;
}

.history-change-field {
  font-size: 0.78rem;
  font-weight: 700;
  color: #41787a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.history-change-value {
  font-size: 0.95rem;
  color: var(--text);
}

.history-change-value.long {
  white-space: pre-wrap;
  line-height: 1.35;
}

.public-otp-policy {
  margin: 0.75rem 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fcfd;
  padding: 0.6rem 0.7rem;
}

.public-otp-policy h2 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.public-otp-policy ul {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.2rem;
  color: var(--muted);
  font-size: 0.88rem;
}

[data-theme="dark"] .public-otp-policy {
  background: #243033;
  border-color: var(--line);
}

@media (max-width: 740px) {
  .brand-mark {
    width: 56px;
    height: 56px;
  }

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

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

  .ticket-message-scroll {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .ticket-history-scroll {
    max-height: none;
  }

  .donut-chart {
    margin: 0 auto;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  .modal {
    width: 96vw;
  }
}
