:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f0f3f6;
  --surface-3: #e7ecef;
  --text: #171a1f;
  --muted: #5f6671;
  --line: #dfe4ea;
  --line-strong: #c9d0d8;
  --accent: #d6a10b;
  --accent-strong: #a87900;
  --teal: #0f766e;
  --teal-strong: #0b5f59;
  --danger: #b42318;
  --warning: #b54708;
  --ok: #16703b;
  --action: #1f2a2e;
  --action-hover: #0f766e;
  --action-text: #ffffff;
  --topbar-bg: #ffffff;
  --topbar-text: #171a1f;
  --topbar-muted: #5f6671;
  --topbar-line: #dfe4ea;
  --shadow: 0 16px 38px rgba(23, 26, 31, 0.08);
  --shadow-soft: 0 8px 22px rgba(23, 26, 31, 0.06);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #101315;
    --surface: #050607;
    --surface-2: #20262a;
    --surface-3: #283035;
    --text: #f3f4f2;
    --muted: #aab1b8;
    --line: #30373d;
    --line-strong: #434c54;
    --accent: #f2b319;
    --accent-strong: #ffd46b;
    --teal: #54c6b8;
    --teal-strong: #8bded4;
    --danger: #ff8a80;
    --warning: #ffbd77;
    --ok: #78d99b;
    --action: #f2b319;
    --action-hover: #ffd46b;
    --action-text: #171a1f;
    --topbar-bg: #050607;
    --topbar-text: #f3f4f2;
    --topbar-muted: #aab1b8;
    --topbar-line: #30373d;
    --shadow: 0 16px 38px rgba(0, 0, 0, 0.26);
    --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.2);
  }
}

/* Manuel tema geçişi — data-theme="dark" / data-theme="light" */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101315;
  --surface: #050607;
  --surface-2: #20262a;
  --surface-3: #283035;
  --text: #f3f4f2;
  --muted: #aab1b8;
  --line: #30373d;
  --line-strong: #434c54;
  --accent: #f2b319;
  --accent-strong: #ffd46b;
  --teal: #54c6b8;
  --teal-strong: #8bded4;
  --danger: #ff8a80;
  --warning: #ffbd77;
  --ok: #78d99b;
  --action: #f2b319;
  --action-hover: #ffd46b;
  --action-text: #171a1f;
  --topbar-bg: #050607;
  --topbar-text: #f3f4f2;
  --topbar-muted: #aab1b8;
  --topbar-line: #30373d;
  --shadow: 0 16px 38px rgba(0, 0, 0, 0.26);
  --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f0f3f6;
  --surface-3: #e7ecef;
  --text: #171a1f;
  --muted: #5f6671;
  --line: #dfe4ea;
  --line-strong: #c9d0d8;
  --accent: #d6a10b;
  --accent-strong: #a87900;
  --teal: #0f766e;
  --teal-strong: #0b5f59;
  --danger: #b42318;
  --warning: #b54708;
  --ok: #16703b;
  --action: #1f2a2e;
  --action-hover: #0f766e;
  --action-text: #ffffff;
  --topbar-bg: #ffffff;
  --topbar-text: #171a1f;
  --topbar-muted: #5f6671;
  --topbar-line: #dfe4ea;
  --shadow: 0 16px 38px rgba(23, 26, 31, 0.08);
  --shadow-soft: 0 8px 22px rgba(23, 26, 31, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

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

a:hover {
  color: var(--accent-strong);
}

button,
.button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--action);
  color: var(--action-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 800;
  padding: 0 18px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

button:hover,
.button:hover {
  background: var(--action-hover);
  color: var(--action-text);
  transform: translateY(-1px);
}

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

.button.secondary:hover {
  background: var(--surface-3);
}

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

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

.topbar {
  align-items: center;
  background: color-mix(in srgb, var(--topbar-bg) 96%, transparent);
  border-bottom: 1px solid var(--topbar-line);
  display: flex;
  gap: 22px;
  justify-content: space-between;
  min-height: 86px;
  padding: 10px clamp(16px, 4vw, 52px);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
}

.brand {
  align-items: center;
  color: var(--topbar-text);
  display: inline-flex;
  gap: 18px;
  min-width: 0;
}

.brand:hover {
  color: var(--topbar-text);
}

.brand-logo-frame {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  height: 66px;
  justify-content: center;
  overflow: visible;
  padding: 0;
  width: 206px;
}

.brand-logo {
  display: block;
  height: 66px;
  object-fit: contain;
  width: 206px;
}

.brand-logo-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :not([data-theme]) .brand-logo-light {
    display: none;
  }

  :not([data-theme]) .brand-logo-dark {
    display: block;
  }
}

[data-theme="dark"] .brand-logo-light {
  display: none;
}

[data-theme="dark"] .brand-logo-dark {
  display: block;
}

[data-theme="light"] .brand-logo-light {
  display: block;
}

[data-theme="light"] .brand-logo-dark {
  display: none;
}

.brand-text {
  border-left: 1px solid var(--topbar-line);
  display: grid;
  gap: 2px;
  min-width: 0;
  padding-left: 18px;
}

.brand-text strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
  max-width: 260px;
  overflow-wrap: anywhere;
}

.brand-text small {
  color: var(--topbar-muted);
  display: block;
  font-size: 13px;
}

.nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.nav a,
.link-button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--topbar-text);
  font-weight: 750;
  min-height: 40px;
  padding: 9px 12px;
}

.nav a:hover,
.link-button:hover {
  background: color-mix(in srgb, var(--topbar-text) 8%, transparent);
  border-color: var(--topbar-line);
  color: var(--accent);
  text-decoration: none;
}

.nav a.active {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--topbar-line));
  color: var(--accent);
}

.nav form {
  margin: 0;
}

.link-button {
  background: transparent;
  width: auto;
}

.nav-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.logout-form {
  margin: 0;
}

.icon-link-button {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  width: 34px;
}

.icon-link-button svg {
  flex: 0 0 auto;
}

@media (min-width: 1360px) {
  .admin-shell {
    --admin-sidebar: 292px;
    padding-left: var(--admin-sidebar);
  }

  .admin-shell .topbar {
    align-items: stretch;
    border-bottom: 0;
    border-right: 1px solid var(--topbar-line);
    bottom: 0;
    flex-direction: column;
    gap: 20px;
    height: 100svh;
    justify-content: flex-start;
    left: 0;
    min-height: 100svh;
    overflow-y: auto;
    padding: 22px 18px;
    position: fixed;
    right: auto;
    top: 0;
    width: var(--admin-sidebar);
  }

  .admin-shell .brand {
    align-items: flex-start;
    border-bottom: 1px solid var(--topbar-line);
    display: grid;
    gap: 14px;
    padding: 6px 4px 18px;
  }

  .admin-shell .brand-logo-frame {
    height: 76px;
    justify-content: flex-start;
    width: 236px;
  }

  .admin-shell .brand-logo {
    height: 76px;
    width: 236px;
  }

  .admin-shell .brand-text {
    border-left: 0;
    padding-left: 0;
  }

  .admin-shell .brand-text strong {
    font-size: 16px;
    max-width: none;
  }

  .admin-shell .nav {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
    justify-content: flex-start;
    width: 100%;
  }

  .admin-shell .nav a,
  .admin-shell .link-button {
    align-items: center;
    display: flex;
    justify-content: flex-start;
    min-height: 44px;
    padding: 10px 12px;
    width: 100%;
  }

  .admin-shell .nav a.active {
    box-shadow: inset 4px 0 0 var(--accent);
    color: var(--topbar-text);
  }

  .admin-shell .nav-actions {
    border-top: 1px solid var(--topbar-line);
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: auto;
    padding-top: 12px;
    width: 100%;
  }

  .admin-shell .nav-actions .logout-form {
    margin: 0;
    width: auto;
  }

  .admin-shell .nav-actions .notif-bell,
  .admin-shell .nav-actions .theme-toggle,
  .admin-shell .nav-actions .icon-link-button {
    align-items: center;
    background: color-mix(in srgb, var(--topbar-text) 5%, transparent);
    border: 1px solid var(--topbar-line);
    border-radius: var(--radius);
    color: var(--topbar-text);
    display: flex;
    justify-content: center;
    min-height: 44px;
    padding: 0;
    width: 100%;
  }

  .admin-shell .link-button {
    background: color-mix(in srgb, var(--danger) 8%, transparent);
    border-color: color-mix(in srgb, var(--danger) 22%, var(--topbar-line));
  }

  .admin-shell .nav-actions .link-button {
    justify-content: center;
  }

  .admin-shell .page {
    margin: 0;
    max-width: none;
    width: 100%;
  }
}

.page {
  margin: 0 auto;
  max-width: 1180px;
  padding: 34px clamp(16px, 4vw, 52px) 72px;
}

body.admin-shell {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 22%, var(--bg)) 0, var(--bg) 360px);
}

body.public-shell {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 18%, var(--bg)) 0, var(--bg) 340px);
}

.admin-shell .page {
  max-width: none;
  padding: 38px clamp(24px, 3vw, 64px) 82px;
  width: 100%;
}

.public-shell .page {
  max-width: 1120px;
}

.public-shell .page.auth-page {
  max-width: 100%;
}

.admin-shell .page-heading {
  align-items: center;
  margin-bottom: 26px;
}

.admin-shell .page-heading h1 {
  font-size: clamp(34px, 2.4vw, 46px);
}

.admin-shell .actions .button {
  min-width: 148px;
}

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

.page-heading h1 {
  font-size: 34px;
  line-height: 1.1;
  margin: 6px 0 0;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

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

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: clamp(18px, 3vw, 30px);
}

.admin-shell .panel {
  border-color: color-mix(in srgb, var(--line), var(--surface-3) 28%);
  box-shadow: 0 18px 42px color-mix(in srgb, #000000 11%, transparent);
}

.panel + .panel,
.ticket-detail + .panel {
  margin-top: 20px;
}

.panel h2 {
  font-size: 22px;
  line-height: 1.2;
  margin-top: 0;
}

.intro-panel,
.success-panel {
  border-left: 4px solid var(--accent);
}

.intro-panel p,
.success-panel p {
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 0;
  max-width: 760px;
}

.success-panel .button {
  margin-top: 18px;
}

.success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.receipt-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 auto;
  max-width: 760px;
  overflow: hidden;
}

.public-shell .page.receipt-page {
  max-width: 1360px;
}

.receipt-workspace {
  align-items: stretch;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(650px, 1fr) minmax(480px, 560px);
}

.receipt-page .receipt-shell {
  margin: 0;
  max-width: none;
}

.receipt-chat-column {
  display: grid;
  gap: 14px;
  align-self: stretch;
  min-width: 0;
}

.receipt-chat-column .chat-panel {
  overflow: hidden;
  position: sticky;
  top: 112px;
}

.receipt-chat-column .public-chat-panel {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 94%, var(--teal) 6%), var(--surface));
  border-color: color-mix(in srgb, var(--teal) 24%, var(--line));
  box-shadow: var(--shadow);
  display: grid;
  gap: 0;
  grid-template-rows: auto minmax(420px, 1fr) auto;
  height: 100%;
  min-height: 0;
}

.receipt-chat-column .chat-messages {
  max-height: none;
  min-height: 0;
}

.receipt-banner {
  align-items: center;
  background: var(--surface);
  border-bottom: 5px solid var(--accent);
  color: var(--text);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 32px);
}

.receipt-logo-frame {
  align-items: center;
  display: block;
  flex: 0 0 auto;
  max-width: 260px;
  width: 44%;
}

.receipt-logo {
  display: block;
  height: auto;
  width: 100%;
}

.receipt-logo-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :not([data-theme]) .receipt-logo-light {
    display: none;
  }

  :not([data-theme]) .receipt-logo-dark {
    display: block;
  }
}

[data-theme="dark"] .receipt-logo-light {
  display: none;
}

[data-theme="dark"] .receipt-logo-dark {
  display: block;
}

[data-theme="light"] .receipt-logo-light {
  display: block;
}

[data-theme="light"] .receipt-logo-dark {
  display: none;
}

.receipt-banner div {
  display: grid;
  gap: 4px;
  text-align: right;
}

.receipt-banner strong {
  color: var(--text);
  font-size: 15px;
}

.receipt-banner > div span {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 850;
}

.receipt-body {
  padding: clamp(22px, 4vw, 36px);
}

.receipt-status-icon {
  align-items: center;
  background: color-mix(in srgb, var(--teal) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--teal) 24%, var(--line));
  border-radius: 50%;
  color: var(--teal-strong);
  display: flex;
  font-size: 22px;
  font-weight: 950;
  height: 52px;
  justify-content: center;
  margin-bottom: 14px;
  width: 52px;
}

.receipt-title-row h2 {
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.15;
  margin: 6px 0 10px;
}

.receipt-title-row p,
.receipt-note p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.receipt-note {
  background: var(--surface-2);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  margin: 22px 0;
  padding: 18px;
}

.receipt-note strong {
  display: block;
  margin-bottom: 8px;
}

.receipt-body h3 {
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  margin: 24px 0 14px;
  padding-bottom: 10px;
}

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

.receipt-detail-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 7px;
  min-height: 72px;
  padding: 14px;
}

.receipt-detail-card span {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.receipt-detail-card strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.receipt-topic {
  background: color-mix(in srgb, #fff1f1 72%, var(--surface));
  border-color: #f1c8c8;
}

.receipt-topic span {
  color: #a33c3c;
}

.receipt-department {
  background: color-mix(in srgb, #e9f8ef 74%, var(--surface));
  border-color: #bfe6ce;
}

.receipt-department span {
  color: #1f7a45;
}

.receipt-priority {
  background: color-mix(in srgb, #fff7e6 76%, var(--surface));
  border-color: #efd697;
}

.receipt-priority span {
  color: #9a6800;
}

.receipt-status {
  background: color-mix(in srgb, #edf5ff 74%, var(--surface));
  border-color: #bfd5f0;
}

.receipt-status span {
  color: #245a94;
}

.receipt-message {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  color: var(--text);
  line-height: 1.7;
  min-height: 120px;
  overflow-wrap: anywhere;
  padding: 18px;
  white-space: pre-wrap;
}

.receipt-attachments {
  margin-top: 18px;
}

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

.receipt-attachment {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  display: grid;
  gap: 2px 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 10px 12px;
}

.receipt-attachment:hover {
  border-color: color-mix(in srgb, var(--teal) 52%, var(--line));
}

.receipt-attachment strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt-attachment small {
  color: var(--muted);
  font-size: 12px;
}

.receipt-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
}

.receipt-actions .button {
  min-width: 170px;
}

@media (prefers-color-scheme: dark) {
  .receipt-topic {
    background: color-mix(in srgb, #3c1f1f 74%, var(--surface));
    border-color: #673737;
  }

  .receipt-topic span {
    color: #ffb3b3;
  }

  .receipt-department {
    background: color-mix(in srgb, #173324 74%, var(--surface));
    border-color: #255b3b;
  }

  .receipt-department span {
    color: #99e5b3;
  }

  .receipt-priority {
    background: color-mix(in srgb, #3a2c14 74%, var(--surface));
    border-color: #6d5524;
  }

  .receipt-priority span {
    color: #ffd887;
  }

  .receipt-status {
    background: color-mix(in srgb, #162c43 74%, var(--surface));
    border-color: #2f587e;
  }

  .receipt-status span {
    color: #a9d2ff;
  }
}

[data-theme="dark"] .receipt-topic {
  background: color-mix(in srgb, #3c1f1f 74%, var(--surface));
  border-color: #673737;
}

[data-theme="dark"] .receipt-topic span {
  color: #ffb3b3;
}

[data-theme="dark"] .receipt-department {
  background: color-mix(in srgb, #173324 74%, var(--surface));
  border-color: #255b3b;
}

[data-theme="dark"] .receipt-department span {
  color: #99e5b3;
}

[data-theme="dark"] .receipt-priority {
  background: color-mix(in srgb, #3a2c14 74%, var(--surface));
  border-color: #6d5524;
}

[data-theme="dark"] .receipt-priority span {
  color: #ffd887;
}

[data-theme="dark"] .receipt-status {
  background: color-mix(in srgb, #162c43 74%, var(--surface));
  border-color: #2f587e;
}

[data-theme="dark"] .receipt-status span {
  color: #a9d2ff;
}

.locked-note {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  padding: 14px;
}

.narrow {
  max-width: 560px;
}

.auth-page {
  align-content: center;
  align-items: start;
  display: grid;
  grid-template-columns: minmax(0, 560px);
  justify-content: center;
  max-width: 100%;
  min-height: calc(100svh - 86px);
  padding: clamp(28px, 6vh, 72px) clamp(16px, 4vw, 52px) clamp(44px, 7vh, 78px);
}

.auth-page .page-heading {
  justify-content: center;
  margin-bottom: 18px;
  max-width: none;
  text-align: left;
  width: 100%;
}

.auth-page .page-heading > div:first-child {
  width: 100%;
}

.auth-page .actions {
  display: none;
}

.auth-card {
  align-self: start;
  margin-left: 0;
  margin-right: 0;
  width: 100%;
}

.admin-auth-card {
  overflow: hidden;
  padding: 0;
}

.auth-card-head {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent 62%),
    var(--surface-2);
  border-bottom: 1px solid var(--line);
  padding: 24px 26px 22px;
}

.auth-card-head span {
  color: var(--accent-strong);
  display: block;
  font-size: 12px;
  font-weight: 950;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.auth-card-head h2 {
  margin: 0 0 8px;
}

.auth-card-head p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
}

.auth-form {
  padding: 24px 26px 0;
}

.auth-remember {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 44px;
  padding: 10px 12px;
}

.auth-user-link {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 8px;
  justify-content: center;
  margin: 24px 26px 0;
  padding: 18px 0 22px;
  text-align: center;
}

.auth-user-link a {
  color: var(--accent-strong);
  font-weight: 900;
}

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

label {
  color: var(--muted);
  display: grid;
  font-size: 14px;
  font-weight: 800;
  gap: 8px;
}

input,
select,
textarea {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  letter-spacing: 0;
  min-height: 46px;
  padding: 11px 12px;
  width: 100%;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
}

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

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

.solution-note-field textarea {
  min-height: 96px;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.wide,
.comment-form textarea,
.form-grid button {
  grid-column: 1 / -1;
}

.support-form-shell {
  margin: 0 auto;
  max-width: 1120px;
}

.support-form-intro {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)) 0%, var(--surface) 52%, color-mix(in srgb, var(--teal) 10%, var(--surface)) 100%);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  margin-bottom: 18px;
  padding: clamp(20px, 3vw, 30px);
}

.support-form-intro span {
  color: var(--accent-strong);
  display: block;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.support-form-intro h2 {
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.12;
  margin: 0 0 12px;
}

.support-form-intro p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  margin: 0;
  max-width: 760px;
}

.recent-ticket-card {
  align-items: center;
  background: color-mix(in srgb, var(--teal) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--teal) 26%, var(--line));
  border-left: 5px solid var(--teal);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 16px;
}

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

.recent-ticket-card span {
  color: var(--teal-strong);
  display: block;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.recent-ticket-card strong {
  color: var(--text);
  display: block;
  font-size: 18px;
}

.recent-ticket-card p {
  color: var(--muted);
  margin: 4px 0 0;
}

.recent-ticket-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.support-form-card {
  padding: clamp(22px, 3.4vw, 34px);
}

.support-page .form-section {
  align-items: start;
  display: grid;
  gap: clamp(20px, 3vw, 34px);
  grid-template-columns: minmax(210px, 0.34fr) minmax(0, 1fr);
}

.support-page .form-section-title {
  margin-bottom: 0;
  position: sticky;
  top: 112px;
}

.form-section + .form-section {
  border-top: 1px solid var(--line);
  margin-top: 26px;
  padding-top: 26px;
}

.form-section-title {
  margin-bottom: 18px;
}

.form-section-title h2 {
  font-size: 21px;
  margin: 0 0 7px;
}

.form-section-title p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.support-form-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 26px;
  padding-top: 24px;
}

.support-form-footer p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.support-form-footer .button {
  min-width: 190px;
}

.stats {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 20px;
}

.dashboard-page .stats {
  gap: 16px;
  grid-template-columns: repeat(6, minmax(170px, 1fr));
  width: 100%;
}

.dashboard-workspace {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  width: 100%;
}

.dashboard-main,
.dashboard-side {
  display: grid;
  gap: 20px;
}

.dashboard-side {
  position: sticky;
  top: 28px;
}

.dashboard-side .panel + .panel,
.dashboard-main .panel + .panel {
  margin-top: 0;
}

.analytics-panel {
  margin-bottom: 20px;
}

.dashboard-page .analytics-panel {
  margin-bottom: 0;
  padding: clamp(22px, 2.4vw, 34px);
  width: 100%;
}

.analytics-title {
  align-items: baseline;
  margin-bottom: 22px;
}

.analytics-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.dashboard-page .analytics-grid {
  gap: 34px;
  grid-template-columns: minmax(0, 1.18fr) minmax(420px, 0.82fr);
}

.analytics-block {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 250px;
}

.dashboard-page .analytics-block {
  min-height: 310px;
}

.analytics-block + .analytics-block {
  border-left: 1px solid var(--line);
  padding-left: 28px;
}

.analytics-block h3 {
  font-size: 22px;
  line-height: 1.2;
  margin: 0 0 14px;
}

.trend-graph,
.status-graph {
  align-content: stretch;
  display: grid;
  gap: 14px;
  grid-template-rows: auto 1fr;
  min-height: 205px;
}

.dashboard-page .trend-graph,
.dashboard-page .status-graph {
  min-height: 248px;
}

.chart-summary {
  align-items: flex-end;
  display: flex;
  gap: 10px;
  min-height: 38px;
}

.chart-summary strong {
  color: var(--text);
  font-size: 34px;
  line-height: 1;
}

.chart-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
}

.daily-bars {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-height: 168px;
}

.dashboard-page .daily-bars {
  min-height: 214px;
}

.daily-bar-cell {
  align-items: stretch;
  display: grid;
  gap: 7px;
  grid-template-rows: 18px 1fr auto;
  min-width: 0;
}

.daily-bar-cell strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
}

.daily-bar-track {
  align-items: end;
  background:
    linear-gradient(to top, transparent calc(33.33% - 1px), color-mix(in srgb, var(--line), transparent 58%) calc(33.33% - 1px), color-mix(in srgb, var(--line), transparent 58%) 33.33%, transparent 33.33%),
    linear-gradient(to top, transparent calc(66.66% - 1px), color-mix(in srgb, var(--line), transparent 58%) calc(66.66% - 1px), color-mix(in srgb, var(--line), transparent 58%) 66.66%, transparent 66.66%);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: center;
  min-height: 120px;
  padding: 0 6px;
}

.dashboard-page .daily-bar-track {
  min-height: 162px;
  padding: 0 10px;
}

.daily-bar-track span {
  background: linear-gradient(180deg, color-mix(in srgb, var(--teal) 85%, #ffffff 15%), var(--teal));
  border-radius: 7px 7px 3px 3px;
  display: block;
  max-width: 38px;
  min-height: 3px;
  width: 100%;
}

.daily-bar-cell small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.status-bars {
  align-content: center;
  display: grid;
  gap: 12px;
  min-height: 168px;
}

.dashboard-page .status-bars {
  min-height: 214px;
}

.status-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(128px, 0.8fr) minmax(170px, 1.5fr) 74px;
}

.status-row-label {
  align-items: center;
  color: var(--text);
  display: flex;
  gap: 8px;
  min-width: 0;
}

.status-row-label span {
  border-radius: 999px;
  flex: 0 0 9px;
  height: 9px;
  width: 9px;
}

.status-row-label strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-row-track {
  background: color-mix(in srgb, var(--surface-2), var(--line) 18%);
  border: 1px solid color-mix(in srgb, var(--line), transparent 28%);
  border-radius: 999px;
  height: 20px;
  overflow: hidden;
}

.status-row-track span {
  border-radius: inherit;
  display: block;
  height: 100%;
}

.status-row-meta {
  align-items: baseline;
  color: var(--text);
  display: grid;
  gap: 6px;
  grid-template-columns: 18px 1fr;
  justify-content: end;
}

.status-row-meta strong {
  font-size: 13px;
  text-align: right;
}

.status-row-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.status-empty {
  align-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  display: flex;
  justify-content: center;
  min-height: 190px;
  padding: 18px;
  text-align: center;
}

.stats div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.dashboard-page .stats div {
  min-height: 110px;
  padding: 22px;
}

.stats div::before {
  background: var(--accent);
  content: "";
  display: block;
  height: 4px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.stats strong {
  display: block;
  font-size: 32px;
  line-height: 1;
  margin-bottom: 8px;
}

.dashboard-page .stats strong {
  font-size: clamp(32px, 2vw, 42px);
}

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

.section-title,
.ticket-head {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

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

.ticket-list {
  display: grid;
  gap: 10px;
}

.sr-only {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

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

.bulk-check {
  align-items: center;
  cursor: pointer;
  display: flex;
  flex-shrink: 0;
  padding: 4px;
}

.bulk-check input {
  accent-color: var(--teal);
  cursor: pointer;
  height: 18px;
  min-height: unset;
  width: 18px;
}

.bulk-bar {
  align-items: center;
  animation: panel-in 160ms ease;
  background: color-mix(in srgb, var(--teal) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--teal) 30%, var(--line));
  border-radius: var(--radius);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 10px 16px;
}

.bulk-bar span {
  font-size: 14px;
  font-weight: 800;
}

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

.bulk-actions .button {
  min-height: 36px;
  padding: 0 14px;
}

.ticket-row-wrap .ticket-row {
  flex: 1;
  min-width: 0;
}

.ticket-row {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  display: grid;
  gap: 12px;
  grid-template-columns: 136px minmax(0, 1fr) max-content max-content max-content;
  padding: 15px;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.admin-shell .ticket-row {
  grid-template-columns: 154px minmax(280px, 1fr) 112px 112px 64px;
  padding: 16px 18px;
}

.dashboard-page .ticket-list {
  gap: 12px;
}

.recent-panel {
  min-height: 340px;
}

.side-panel {
  padding: 22px;
}

.side-title {
  display: grid;
  gap: 5px;
  margin-bottom: 16px;
}

.side-title span {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.side-title h2 {
  font-size: 22px;
  margin: 0;
}

.flow-list,
.quick-actions,
.side-metrics dl {
  display: grid;
  gap: 10px;
}

.flow-item {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  display: grid;
  gap: 10px;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  min-height: 46px;
  padding: 10px 12px;
}

.flow-item:hover {
  background: var(--surface);
  border-color: var(--teal);
  color: var(--text);
}

.flow-item strong {
  font-size: 13px;
}

.flow-item em {
  color: var(--text);
  font-style: normal;
  font-weight: 900;
}

.flow-dot {
  border-radius: 999px;
  height: 9px;
  width: 9px;
}

.status-dot-open {
  background: #55aaff;
}

.status-dot-in_progress {
  background: #f2b319;
}

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

.status-dot-resolved {
  background: #58b77e;
}

.quick-actions .button,
.quick-actions .button.secondary {
  width: 100%;
}

.side-metrics dl {
  margin: 0;
}

.side-metrics dl div {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  min-height: 48px;
  padding: 10px 12px;
}

.side-metrics dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.side-metrics dd {
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
  margin: 0;
}

.ticket-row:hover {
  background: var(--surface);
  border-color: var(--teal);
  color: var(--text);
  transform: translateY(-1px);
}

.ticket-row strong,
.ticket-row small {
  display: block;
  overflow-wrap: anywhere;
}

.ticket-row > span:nth-child(2) {
  min-width: 0;
}

.ticket-row strong {
  line-height: 1.3;
}

.ticket-row small {
  margin-top: 4px;
}

.ticket-id {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--accent);
  display: inline-flex;
  font-family: var(--font-mono, monospace);
  font-size: .78rem;
  font-weight: 700;
  justify-content: center;
  letter-spacing: .03em;
  min-width: 0;
  padding: 8px 10px;
  white-space: nowrap;
  width: 100%;
}

.ticket-no-badge {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 4px;
  color: var(--accent);
  font-family: var(--font-mono, monospace);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 2px 7px;
}

.pill {
  border-radius: 6px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  justify-content: center;
  min-width: 88px;
  padding: 7px 10px;
}

.status-open,
.priority-high {
  background: #e8f2ff;
  color: #1455a0;
}

.status-in_progress,
.priority-urgent {
  background: #fff0db;
  color: var(--warning);
}

.status-waiting,
.priority-normal {
  background: #e8f5f3;
  color: var(--teal-strong);
}

.status-resolved,
.status-closed,
.priority-low {
  background: #e8f6ee;
  color: var(--ok);
}

@media (prefers-color-scheme: dark) {
  .status-open,
  .priority-high {
    background: #17304c;
    color: #a9d2ff;
  }

  .status-in_progress,
  .priority-urgent {
    background: #3c2a16;
    color: #ffca8a;
  }

  .status-waiting,
  .priority-normal {
    background: #133631;
    color: #8bded4;
  }

  .status-resolved,
  .status-closed,
  .priority-low {
    background: #183321;
    color: #99e5b3;
  }
}

.filters {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 160px 160px minmax(0, 1fr) max-content;
  margin-bottom: 18px;
}

.tickets-page .filters {
  gap: 14px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.tickets-page .filters label:last-of-type {
  grid-column: span 2;
}

.tickets-page .filters button {
  min-width: 170px;
}

.sla-badge {
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
  min-width: 38px;
  padding: 5px 8px;
  text-align: center;
}

.sla-fresh {
  background: #e8f6ee;
  color: var(--ok);
}

.sla-warn {
  background: #fff0db;
  color: var(--warning);
}

.sla-old {
  background: #fdecec;
  color: var(--danger);
}

.sla-done {
  background: var(--surface-3);
  color: var(--muted);
}

@media (prefers-color-scheme: dark) {
  .sla-fresh { background: #173322; color: #78d99b; }
  .sla-warn  { background: #3c2a16; color: #ffca8a; }
  .sla-old   { background: #3b1818; color: #ff8a80; }
}

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

.danger-btn {
  background: var(--danger);
  min-height: 38px;
  padding: 0 12px;
}

.danger-btn:hover {
  background: color-mix(in srgb, var(--danger) 80%, #000);
}

.user-row {
  grid-template-columns: minmax(0,1fr) max-content 140px max-content;
}

.ticket-detail {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) 340px;
}

.ticket-workspace {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) 360px;
}

.ticket-detail-page .ticket-workspace {
  gap: 24px;
  grid-template-columns: minmax(340px, 0.95fr) minmax(420px, 1.1fr) minmax(320px, 380px);
}

.ticket-detail-page .ticket-hero {
  padding: clamp(24px, 2.4vw, 36px);
}

.ticket-main,
.ticket-summary-column,
.ticket-chat-column,
.ticket-sidebar {
  display: grid;
  gap: 20px;
}

.ticket-main > .panel + .panel,
.ticket-summary-column > .panel + .panel,
.ticket-chat-column > .panel + .panel,
.ticket-sidebar > .panel + .panel {
  margin-top: 0;
}

.ticket-sidebar {
  position: sticky;
  top: 106px;
}

.ticket-detail-page .ticket-chat-column .chat-panel {
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr) auto;
  min-height: min(720px, calc(100svh - 148px));
  overflow: hidden;
  position: sticky;
  top: 106px;
}

.ticket-detail-page .ticket-chat-column .chat-messages {
  max-height: none;
  min-height: 0;
}

.ticket-sidebar .form-grid {
  grid-template-columns: 1fr;
}

.ticket-summary {
  min-height: 230px;
}

.ticket-hero {
  display: grid;
  gap: 18px;
}

.ticket-hero-top {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.ticket-hero-top h2 {
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.15;
  margin: 12px 0 8px;
}

.ticket-hero-top p {
  color: var(--muted);
  margin: 0;
}

.ticket-description-block {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px;
}

.ticket-description-block span {
  color: var(--accent-strong);
  display: block;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.ticket-description-block p {
  line-height: 1.7;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.ticket-meta-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.ticket-meta-grid div {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 82px;
  min-width: 0;
  padding: 14px 16px;
}

.ticket-meta-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 7px;
  text-transform: uppercase;
}

.ticket-meta-grid dd {
  color: var(--text);
  font-weight: 850;
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ticket-meta-email,
.ticket-meta-created {
  grid-column: 1 / -1;
}

.ticket-meta-email dd {
  font-size: clamp(15px, 1.1vw, 17px);
  letter-spacing: 0;
}

.operation-panel {
  border-top: 4px solid var(--accent);
}

.manage-head {
  margin-bottom: 18px;
}

.manage-head span {
  color: var(--accent-strong);
  display: block;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.manage-head h2 {
  margin-bottom: 8px;
}

.manage-head p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.manage-form {
  gap: 14px;
}

.resolution-card {
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: var(--radius);
  padding: 14px;
}

/* ── Denetim İzi ──────────────────────────────────── */
.audit-panel details summary { cursor: pointer; list-style: none; }
.audit-panel details summary::-webkit-details-marker { display: none; }
.audit-panel details summary h2 { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.audit-count { background: var(--surface); border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: .75rem; font-weight: 600; padding: 1px 7px; }
.audit-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.audit-row { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.audit-row:last-child { border-bottom: none; }
.audit-icon { font-size: 1rem; min-width: 22px; text-align: center; padding-top: 1px; }
.audit-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.audit-label { font-size: .85rem; font-weight: 600; color: var(--text); }
.audit-change { font-size: .8rem; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 4px; padding: 1px 6px; margin-top: 2px; width: fit-content; }
.audit-meta { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.audit-empty { color: var(--muted); font-size: .85rem; margin: 10px 0 0; }

/* ── SLA İhlal Paneli ─────────────────────────────── */
.sla-breach-panel { border-top: 3px solid var(--danger); }
.sla-breach-panel .section-title h2 { color: var(--danger); }
.breach-count { background: var(--danger); color: #fff; border-radius: 99px; font-size: .75rem; font-weight: 700; padding: 1px 8px; margin-left: 4px; }
.stat-breach strong { color: var(--danger) !important; }
.stat-breach span { color: var(--danger) !important; }

.mail-events-panel .compact-title {
  margin-bottom: 14px;
}

.mail-event-list {
  display: grid;
  gap: 10px;
}

.mail-resend-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.mail-resend-actions .button {
  min-height: 38px;
  padding-inline: 12px;
}

.mail-event {
  align-items: start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: var(--radius);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px;
}

.mail-event strong,
.mail-event span,
.mail-event small,
.mail-event em {
  display: block;
}

.mail-event strong {
  font-size: 14px;
}

.mail-event span,
.mail-event small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.mail-event .mail-smtp-response {
  color: color-mix(in srgb, var(--muted) 84%, var(--text));
  margin-top: 3px;
}

.mail-event em {
  color: var(--danger);
  font-size: 12px;
  font-style: normal;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.mail-event .mail-status {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  padding: 5px 8px;
  white-space: nowrap;
}

.mail-sent {
  border-left-color: var(--ok);
}

.mail-failed {
  border-left-color: var(--danger);
}

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

.mail-sent .mail-status {
  background: color-mix(in srgb, var(--ok) 14%, var(--surface));
  color: var(--ok);
}

.mail-failed .mail-status {
  background: color-mix(in srgb, var(--danger) 13%, var(--surface));
  color: var(--danger);
}

.mail-skipped .mail-status {
  background: color-mix(in srgb, var(--warning) 14%, var(--surface));
  color: var(--warning);
}

.description,
.comment p {
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.description {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 16px;
  padding: 16px;
}

.contact-grid {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 22px;
  margin-bottom: 0;
  padding-top: 18px;
}

.contact-grid div {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.contact-grid dt,
.contact-grid dd {
  display: block;
  overflow-wrap: anywhere;
}

.contact-grid dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
}

.contact-grid dd {
  color: var(--text);
  font-weight: 850;
  margin: 0;
}

.contact-grid.compact {
  border-top: 0;
  grid-template-columns: 1fr;
  margin-top: 0;
  padding-top: 0;
}

.empty-value {
  color: var(--muted);
  font-weight: 700;
}

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

.comments {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.comment {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.comment.internal {
  border-left: 4px solid var(--warning);
}

.comment small {
  display: block;
  margin-top: 4px;
}

.chat-panel {
  display: grid;
  gap: 14px;
}

.chat-title {
  align-items: center;
  margin-bottom: 0;
}

.chat-title p,
.follow-panel p {
  color: var(--muted);
  line-height: 1.55;
  margin: 6px 0 0;
}

.chat-messages {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(58vh, 560px);
  min-height: 280px;
  overflow-y: auto;
  padding: 16px;
}

.chat-message {
  display: flex;
  width: 100%;
}

.message-in {
  justify-content: flex-start;
}

.message-out {
  justify-content: flex-end;
}

.message-note {
  justify-content: center;
}

.message-bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  max-width: min(72%, 560px);
  padding: 12px 14px;
}

.message-out .message-bubble {
  background: color-mix(in srgb, var(--teal) 22%, var(--surface));
  border-color: color-mix(in srgb, var(--teal) 72%, var(--line));
}

.message-note .message-bubble {
  background: color-mix(in srgb, var(--warning) 18%, var(--surface));
  border-color: color-mix(in srgb, var(--warning) 62%, var(--line));
  max-width: min(84%, 620px);
}

.message-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 8px;
  justify-content: space-between;
}

.message-meta strong {
  color: var(--text);
}

.message-bubble p {
  line-height: 1.55;
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-form {
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
}

.chat-note-toggle {
  padding: 0 2px;
}

.chat-input-row {
  align-items: flex-end;
  display: flex;
  gap: 8px;
}

.chat-panel .wa-send-btn {
  background: var(--teal);
  color: #ffffff;
}

.chat-panel .wa-send-btn:hover {
  background: var(--teal-strong);
}

[data-theme="dark"] .chat-panel .wa-send-btn {
  color: #071a18;
}

@media (prefers-color-scheme: dark) {
  :not([data-theme]) .chat-panel .wa-send-btn {
    color: #071a18;
  }
}

.chat-textarea {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  color: var(--text);
  flex: 1;
  font: inherit;
  font-size: 14.5px;
  letter-spacing: 0;
  line-height: 1.45;
  max-height: 120px;
  min-height: 42px;
  overflow-y: auto;
  padding: 9px 14px;
  resize: none;
  width: 100%;
}

.chat-textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 18%, transparent);
  outline: none;
}

.chat-textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
}

.chat-locked {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 800;
  line-height: 1.55;
  padding: 14px;
}

.chat-empty {
  align-content: center;
  display: grid;
  gap: 10px;
  justify-items: center;
  margin: auto;
  max-width: 320px;
  text-align: center;
}

.chat-empty-mark {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--teal) 28%, transparent), transparent),
    var(--surface);
  border: 1px solid color-mix(in srgb, var(--teal) 42%, var(--line));
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  display: block;
  height: 46px;
  position: relative;
  width: 46px;
}

.chat-empty-mark::before,
.chat-empty-mark::after {
  background: var(--teal);
  border-radius: 2px;
  content: "";
  display: block;
  height: 3px;
  left: 12px;
  position: absolute;
  width: 22px;
}

.chat-empty-mark::before {
  top: 17px;
}

.chat-empty-mark::after {
  top: 26px;
  width: 14px;
}

.chat-empty-title {
  color: var(--text);
  font-size: 15px;
}

.chat-empty-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.receipt-chat-column .public-chat-panel .chat-title {
  align-items: flex-start;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 72%, transparent), transparent),
    var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0;
  padding: 22px;
}

.receipt-chat-column .public-chat-panel .chat-title h2 {
  font-size: 24px;
  letter-spacing: 0;
  margin: 0;
}

.receipt-chat-column .public-chat-panel .chat-title p {
  max-width: 300px;
}

.receipt-chat-column .public-chat-panel .chat-title .pill {
  flex: 0 0 auto;
  min-width: 112px;
}

.receipt-chat-column .public-chat-panel .chat-messages {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--teal) 4%, transparent), transparent 34%),
    linear-gradient(0deg, color-mix(in srgb, var(--line) 36%, transparent) 1px, transparent 1px),
    var(--surface-2);
  background-size: auto, 100% 58px, auto;
  border: 0;
  border-radius: 0;
  padding: 22px;
}

.receipt-chat-column .public-chat-panel .chat-messages.is-empty .wa-messages-list {
  justify-content: center;
}

.receipt-chat-column .public-chat-panel .chat-form {
  background: var(--surface);
  border-top: 1px solid var(--line);
  gap: 10px;
  padding: 14px 16px 16px;
}

.receipt-chat-column .public-chat-panel .chat-input-row {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid color-mix(in srgb, var(--teal) 34%, var(--line));
  border-radius: var(--radius);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 8%, transparent);
  gap: 8px;
  padding: 6px;
}

.receipt-chat-column .public-chat-panel .chat-textarea {
  background: transparent;
  border: 0;
  border-radius: 0;
  min-height: 44px;
  padding: 11px 12px;
}

.receipt-chat-column .public-chat-panel .chat-textarea:focus {
  box-shadow: none;
}

.receipt-chat-column .public-chat-panel .wa-send-btn {
  background: var(--teal);
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--teal-strong) 72%, var(--teal));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--teal) 26%, transparent);
  color: #ffffff;
  height: 46px;
  transform: none;
  width: 50px;
}

.receipt-chat-column .public-chat-panel .wa-send-btn:hover {
  background: var(--teal-strong);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--teal) 34%, transparent);
  transform: none;
}

[data-theme="light"] .receipt-chat-column .public-chat-panel .wa-send-btn {
  color: #ffffff;
}

[data-theme="dark"] .receipt-chat-column .public-chat-panel .wa-send-btn {
  color: #071a18;
}

@media (prefers-color-scheme: dark) {
  :not([data-theme]) .receipt-chat-column .public-chat-panel .wa-send-btn {
    color: #071a18;
  }
}

.receipt-chat-column .public-chat-panel .chat-locked {
  background: color-mix(in srgb, var(--warning) 10%, var(--surface));
  border: 0;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  margin: 16px;
}

.public-self-close {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding: 16px;
}

.public-self-close strong {
  color: var(--text);
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.public-self-close p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
}

.public-self-close-form {
  display: grid;
  gap: 10px;
}

.public-self-close-form label {
  color: var(--text);
  display: grid;
  font-size: 13px;
  font-weight: 850;
  gap: 6px;
}

.public-self-close-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.public-self-close-form textarea {
  min-height: 68px;
  resize: vertical;
}

.public-self-close-form .button {
  background: var(--surface-2);
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  color: var(--text);
  width: 100%;
}

.public-self-close-form .button:hover {
  background: var(--accent);
  color: #111820;
}

.receipt-chat-column .public-chat-waiting {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--teal) 8%, transparent), transparent 36%),
    var(--surface);
  grid-template-rows: auto 1fr auto;
}

.public-chat-waiting .chat-waiting-body {
  align-content: center;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 72%, transparent), transparent),
    var(--surface);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 16px;
  justify-items: center;
  min-height: 430px;
  padding: clamp(26px, 4vw, 44px);
  text-align: center;
}

.waiting-mark {
  background: var(--surface-2);
  border: 1px solid color-mix(in srgb, var(--teal) 40%, var(--line));
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  display: block;
  height: 58px;
  position: relative;
  width: 58px;
}

.waiting-mark::before,
.waiting-mark::after {
  background: var(--teal);
  border-radius: 2px;
  content: "";
  display: block;
  height: 4px;
  left: 17px;
  position: absolute;
  width: 24px;
}

.waiting-mark::before {
  top: 22px;
}

.waiting-mark::after {
  top: 33px;
  width: 16px;
}

.chat-waiting-body h3 {
  font-size: 22px;
  margin: 2px 0 0;
}

.chat-waiting-body > p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
  max-width: 390px;
}

.waiting-steps {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  max-width: 420px;
  width: 100%;
}

.waiting-step {
  align-items: center;
  background: color-mix(in srgb, var(--surface-2) 68%, var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  grid-template-columns: 18px minmax(0, 1fr);
  min-height: 64px;
  padding: 12px 14px;
  text-align: left;
}

.waiting-step > span {
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  display: block;
  height: 12px;
  width: 12px;
}

.waiting-step.is-done > span {
  background: var(--teal);
  border-color: var(--teal);
}

.waiting-step.is-active {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
}

.waiting-step.is-active > span {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.waiting-step strong,
.waiting-step small {
  display: block;
}

.waiting-step strong {
  color: var(--text);
  font-size: 14px;
}

.waiting-step small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 2px;
}

.chat-waiting-foot {
  background: color-mix(in srgb, var(--warning) 8%, var(--surface));
  border-left: 4px solid var(--accent);
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: grid;
  gap: 12px;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.5;
  padding: 16px 18px;
}

.chat-waiting-foot > span {
  display: block;
}

.chat-waiting-foot .public-self-close {
  background: transparent;
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 12px 0 0;
}

.follow-panel .button {
  margin-top: 14px;
  width: 100%;
}

.follow-panel code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 12px;
  overflow-wrap: anywhere;
  padding: 10px;
}

.checkbox {
  align-items: center;
  display: flex;
  flex-direction: row;
}

.checkbox input {
  min-height: auto;
  width: auto;
}

.user-list {
  display: grid;
  gap: 10px;
}

.user-row {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 140px 140px;
  padding: 14px;
}

.notice {
  animation: notice-fade 420ms ease 3.4s forwards;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 800;
  margin-bottom: 16px;
  padding: 12px 14px;
}

@keyframes notice-fade {
  to {
    max-height: 0;
    margin-bottom: 0;
    opacity: 0;
    overflow: hidden;
    padding-bottom: 0;
    padding-top: 0;
  }
}

.notice-success {
  background: #e8f6ee;
  border-color: #cbe9d6;
  color: var(--ok);
}

.notice-error {
  background: #fdecec;
  border-color: #f6caca;
  color: var(--danger);
}

@media (prefers-color-scheme: dark) {
  .notice-success {
    background: #173322;
    border-color: #245d36;
  }

  .notice-error {
    background: #3b1818;
    border-color: #703030;
  }
}

.empty {
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 18px;
}

@media (max-width: 920px) {
  .brand-text {
    display: none;
  }
}

@media (max-width: 1280px) {
  .admin-shell .page {
    max-width: none;
    width: 100%;
  }

  .dashboard-page .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-page .analytics-grid,
  .dashboard-workspace,
  .settings-grid-extra,
  .support-page .form-section {
    grid-template-columns: 1fr;
  }

  .dashboard-side {
    position: static;
  }

  .dashboard-page .analytics-block + .analytics-block {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 26px;
  }

  .support-page .form-section-title {
    position: static;
  }

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

  .ticket-detail-page .ticket-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  }

  .ticket-detail-page .ticket-sidebar {
    grid-column: 1 / -1;
    position: static;
  }

  .ticket-detail-page .ticket-chat-column .chat-panel {
    position: static;
  }
}

@media (max-width: 1120px) {
  .receipt-workspace {
    grid-template-columns: 1fr;
  }

  .receipt-chat-column .chat-panel {
    position: static;
  }

  .receipt-chat-column .public-chat-panel {
    min-height: auto;
  }
}

.search-result {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  margin-top: 20px;
  padding: 16px;
}

.search-result-head {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.search-result-head strong {
  display: block;
  margin-bottom: 4px;
}

.search-result-head small {
  color: var(--muted);
}

@media (max-width: 760px) {
  .topbar,
  .page-heading,
  .section-title,
  .ticket-head,
  .ticket-hero-top {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    position: static;
  }

  .brand-logo-frame {
    height: 58px;
    width: 184px;
  }

  .brand-logo {
    height: 58px;
    width: 184px;
  }

  .page-heading h1 {
    font-size: 28px;
  }

  .form-grid,
  .stats,
  .dashboard-page .stats,
  .filters,
  .tickets-page .filters,
  .ticket-detail,
  .ticket-workspace,
  .ticket-detail-page .ticket-workspace,
  .receipt-workspace,
  .ticket-meta-grid,
  .ticket-row,
  .admin-shell .ticket-row,
  .receipt-detail-grid,
  .receipt-attachment-list,
  .settings-grid-extra,
  .contact-grid,
  .user-row,
  .dashboard-workspace,
  .analytics-grid,
  .department-create-form,
  .department-row,
  .department-update-form {
    grid-template-columns: 1fr;
  }

  .analytics-block {
    min-height: auto;
  }

  .analytics-block + .analytics-block {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 22px;
  }

  .trend-graph,
  .status-graph {
    min-height: 220px;
  }

  .chart-summary strong {
    font-size: 30px;
  }

  .status-row {
    grid-template-columns: minmax(112px, 0.9fr) minmax(120px, 1.3fr) 66px;
  }

  .tickets-page .filters label:last-of-type {
    grid-column: auto;
  }

  .receipt-chat-column .chat-panel {
    position: static;
  }

  .receipt-chat-column .public-chat-panel {
    grid-template-rows: auto minmax(320px, auto) auto;
  }

  .receipt-chat-column .public-chat-panel .chat-title {
    align-items: stretch;
    flex-direction: column;
  }

  .ticket-sidebar {
    position: static;
  }

  .ticket-detail-page .ticket-chat-column .chat-panel {
    min-height: auto;
  }

  .actions,
  .nav,
  .ticket-pills,
  .support-form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .recent-ticket-card,
  .recent-ticket-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    justify-content: stretch;
  }

  .nav a,
  .link-button,
  .button,
  button {
    width: 100%;
  }

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

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

  .receipt-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .receipt-banner img {
    max-width: 210px;
    width: 80%;
  }

  .receipt-banner div {
    text-align: left;
  }
}

/* ── Wizard (adım adım form) ─────────────────────────────────── */
.wizard-wrap {
  max-width: 680px;
  margin: 0 auto;
}

.wizard-progress {
  align-items: center;
  display: flex;
  margin-bottom: 28px;
}

.wizard-step {
  align-items: center;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  gap: 6px;
  opacity: 0.38;
  transition: opacity 220ms;
}

.wizard-step.active,
.wizard-step.done {
  opacity: 1;
}

.wizard-icon {
  align-items: center;
  background: var(--surface-3);
  border: 2px solid var(--line);
  border-radius: 50%;
  display: flex;
  font-size: 18px;
  height: 44px;
  justify-content: center;
  transition: background 220ms, border-color 220ms;
  width: 44px;
}

.wizard-step.active .wizard-icon {
  background: var(--action);
  border-color: var(--action);
  filter: invert(1) brightness(10);
}

.wizard-step.done .wizard-icon {
  background: var(--teal);
  border-color: var(--teal);
  filter: invert(1) brightness(10);
}

.wizard-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

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

.wizard-connector {
  background: var(--line);
  flex: 1;
  height: 2px;
  margin: 0 6px;
  margin-bottom: 18px;
  transition: background 220ms;
}

.wizard-connector.active {
  background: var(--teal);
}

.wizard-panel {
  animation: panel-in 200ms ease;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wizard-hint {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 20px;
}

.wizard-nav {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
}

.wizard-summary {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 0;
  margin-bottom: 4px;
  overflow: hidden;
}

.summary-row {
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 140px 1fr;
  padding: 10px 14px;
}

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

.summary-row dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.summary-row dd {
  color: var(--text);
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.req { color: var(--danger); }

.file-drop {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--teal) 6%, transparent), transparent 44%),
    var(--surface-2);
  border: 1px dashed color-mix(in srgb, var(--teal) 44%, var(--line-strong));
  border-radius: var(--radius);
  cursor: pointer;
  display: grid;
  gap: 10px;
  padding: 16px;
}

.file-drop input {
  background: transparent;
  border: 0;
  min-height: auto;
  padding: 0;
}

.file-drop span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

/* ── Ayarlar sayfası ─────────────────────────────────────────── */
.settings-form {
  display: grid;
  gap: 20px;
}

.settings-section h2 {
  margin-bottom: 6px;
}

.settings-hint {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0 0 16px;
}

.settings-test-row {
  align-items: center;
  display: flex;
  gap: 14px;
  margin-top: 18px;
}

.test-result {
  font-size: 14px;
  font-weight: 700;
}

.test-ok  { color: var(--ok); }
.test-fail { color: var(--danger); }

.settings-actions {
  display: flex;
  justify-content: flex-end;
}

.settings-grid-extra {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 20px;
}

.department-manager {
  grid-column: 1 / -1;
}

.department-create-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) max-content;
  margin-top: 16px;
}

.department-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.department-row {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) max-content;
  padding: 10px;
}

.department-update-form {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) max-content;
}

.department-row input,
.department-create-form input {
  min-height: 40px;
}

.backup-action {
  margin: 14px 0;
}

.backup-maintenance {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.backup-maintenance small {
  color: var(--muted);
  font-weight: 800;
}

.backup-list {
  display: grid;
  gap: 8px;
}

.backup-item {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px;
}

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

.backup-item strong {
  overflow-wrap: anywhere;
}

.backup-item span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.backup-item em {
  color: var(--muted);
  flex: 0 0 auto;
  font-style: normal;
  font-weight: 900;
}

.backup-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.tiny-btn {
  min-height: 34px;
  padding: 7px 12px;
}

.system-status-panel {
  align-self: start;
}

.settings-form > .system-status-panel {
  margin-bottom: 20px;
}

.system-status-list {
  display: grid;
  gap: 10px;
}

.system-status-item {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 58px;
  padding: 11px 12px;
}

.system-status-item strong,
.system-status-item small {
  display: block;
}

.system-status-item small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.status-light {
  border-radius: 999px;
  box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 14%, transparent);
  height: 10px;
  width: 10px;
}

.status-light.status-ok {
  color: #4fc081;
  background: #4fc081;
}

.status-light.status-warn {
  color: #f5b91f;
  background: #f5b91f;
}

.status-light.status-error {
  color: #ef4444;
  background: #ef4444;
}

.password-form {
  margin-top: 14px;
}

/* ── Hazır yanıtlar ──────────────────────────────────────────── */
.chat-top-bar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding: 6px 2px 2px;
}

.qr-select {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  max-width: 260px;
  min-height: 36px;
  padding: 6px 10px;
}

.qr-list {
  display: grid;
  gap: 10px;
}

.qr-row {
  align-items: start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 14px;
}

.qr-info strong {
  display: block;
  margin-bottom: 4px;
}

.qr-info p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  max-width: 580px;
  white-space: pre-wrap;
}

/* ── Dosya ekleri ─────────────────────────────────────────────── */
.attach-btn {
  align-items: center;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  flex-shrink: 0;
  height: 42px;
  justify-content: center;
  padding: 0 4px;
  transition: color 140ms;
  width: 36px;
}

.attach-btn:hover {
  color: var(--teal);
}

.attach-input {
  height: 0;
  opacity: 0;
  position: absolute;
  width: 0;
}

.attach-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 2px 0;
}

.attach-chip {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  display: inline-flex;
  font-size: 12px;
  gap: 6px;
  max-width: 200px;
  overflow: hidden;
  padding: 4px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attach-panel {
  margin-top: 0 !important;
}

.attach-count {
  background: var(--surface-2);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 900;
  padding: 2px 8px;
}

.attach-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.attach-item {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  gap: 10px;
  padding: 10px 12px;
}

.attach-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.attach-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.attach-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attach-meta {
  color: var(--muted);
  font-size: 12px;
}

.chat-attachments {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.chat-attachment {
  align-items: center;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: var(--radius);
  color: var(--text);
  display: flex;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
}

.chat-attachment:hover {
  border-color: color-mix(in srgb, var(--teal) 56%, var(--line));
}

.chat-attachment-icon {
  flex: 0 0 auto;
}

.chat-attachment span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.chat-attachment strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-attachment small {
  color: var(--muted);
  font-size: 11px;
}

/* ── Admin chat panel: WA-style balonlar ─────────────────────── */

.chat-messages {
  display: flex;
  flex-direction: column;
}

.chat-messages .wa-messages-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px;
  justify-content: flex-end;
  min-height: 100%;
}

/* Admin gelen mesaj (kullanıcıdan) */
.chat-panel .wa-msg-in .wa-bubble {
  background: var(--surface-3);
  border-top-left-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  margin-left: 8px;
}

.chat-panel .wa-msg-in .wa-bubble::before {
  background: var(--surface-3);
}

/* Admin giden mesaj (IT Destek'ten) */
.chat-panel .wa-msg-out .wa-bubble {
  background: color-mix(in srgb, var(--teal) 20%, var(--surface));
  border-top-right-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  margin-right: 8px;
}

.chat-panel .wa-msg-out .wa-bubble::before {
  background: color-mix(in srgb, var(--teal) 20%, var(--surface));
}

/* Admin metin renkleri */
.chat-panel .wa-bubble-text {
  color: var(--text);
}

.chat-panel .wa-bubble-meta {
  color: var(--muted);
}

.chat-panel .wa-sender {
  color: var(--teal-strong);
}

/* İç not balonu */
.wa-msg-note {
  justify-content: center;
}

.wa-bubble-note {
  background: color-mix(in srgb, var(--warning) 14%, var(--surface));
  border: 1px dashed color-mix(in srgb, var(--warning) 50%, transparent);
  border-radius: 8px;
  max-width: min(84%, 580px);
}

.wa-bubble-note .wa-sender {
  color: var(--warning);
}

/* ── WhatsApp-style Chat ─────────────────────────────────────── */

.wa-body {
  --wa-bg: #efeae2;
  --wa-bubble-in: #ffffff;
  --wa-bubble-out: #d9fdd3;
  --wa-bubble-shadow: rgba(0, 0, 0, 0.08);
  --wa-topbar-bg: #008069;
  --wa-topbar-text: #ffffff;
  --wa-topbar-sub: rgba(255, 255, 255, 0.75);
  --wa-strip-bg: #fffbef;
  --wa-strip-border: #e8d48b;
  --wa-input-bg: #f0f2f5;
  --wa-input-field: #ffffff;
  --wa-send-bg: #00a884;
  --wa-send-hover: #00917a;
  --wa-text: #111b21;
  --wa-meta: #667781;
  --wa-sender: #20c997;
  --wa-locked-bg: #fffbef;
  --wa-locked-border: #e8d48b;
  --wa-locked-text: #7a5c00;

  background: var(--wa-bg);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
}

@media (prefers-color-scheme: dark) {
  .wa-body {
    --wa-bg: #0b141a;
    --wa-bubble-in: #202c33;
    --wa-bubble-out: #005c4b;
    --wa-bubble-shadow: rgba(0, 0, 0, 0.3);
    --wa-topbar-bg: #202c33;
    --wa-topbar-text: #e9edef;
    --wa-topbar-sub: rgba(233, 237, 239, 0.65);
    --wa-strip-bg: #111e16;
    --wa-strip-border: #1e3824;
    --wa-input-bg: #1f2c34;
    --wa-input-field: #2a3942;
    --wa-send-bg: #00a884;
    --wa-send-hover: #00c49a;
    --wa-text: #e9edef;
    --wa-meta: #8696a0;
    --wa-sender: #06cf9c;
    --wa-locked-bg: #111e16;
    --wa-locked-border: #1e3824;
    --wa-locked-text: #8bded4;
  }
}

/* Topbar */
.wa-topbar {
  align-items: center;
  background: var(--wa-topbar-bg);
  color: var(--wa-topbar-text);
  display: flex;
  flex-shrink: 0;
  gap: 12px;
  min-height: 60px;
  padding: 10px 14px;
}

.wa-back {
  align-items: center;
  border-radius: 50%;
  color: var(--wa-topbar-text);
  display: inline-flex;
  flex-shrink: 0;
  height: 38px;
  justify-content: center;
  min-height: unset;
  padding: 0;
  transition: background 140ms;
  width: 38px;
}

.wa-back:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--wa-topbar-text);
}

.wa-avatar {
  align-items: center;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: var(--wa-topbar-text);
  display: inline-flex;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 800;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.wa-topbar-info {
  flex: 1;
  min-width: 0;
}

.wa-topbar-info strong {
  display: block;
  font-size: 16px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wa-topbar-info span {
  color: var(--wa-topbar-sub);
  font-size: 13px;
}

/* Ticket strip */
.wa-ticket-strip {
  background: var(--wa-strip-bg);
  border-bottom: 1px solid var(--wa-strip-border);
  flex-shrink: 0;
  padding: 8px 16px;
}

.wa-ticket-strip strong {
  color: var(--wa-text);
  display: block;
  font-size: 13.5px;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wa-ticket-strip p {
  color: var(--wa-meta);
  font-size: 12.5px;
  line-height: 1.4;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Flash inside wa layout */
.wa-body .notice {
  flex-shrink: 0;
  margin: 6px 12px 0;
}

/* Messages area */
.wa-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px 14px;
}

.wa-messages-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 100%;
  justify-content: flex-end;
}

.wa-empty {
  align-self: center;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 10px;
  color: var(--wa-meta);
  font-size: 13px;
  margin: auto;
  max-width: 300px;
  padding: 10px 18px;
  text-align: center;
}

@media (prefers-color-scheme: dark) {
  .wa-empty {
    background: rgba(32, 44, 51, 0.9);
  }
}

/* Message rows */
.wa-msg {
  display: flex;
}

.wa-msg-in {
  justify-content: flex-start;
}

.wa-msg-out {
  justify-content: flex-end;
}

/* Extra gap when direction changes */
.wa-msg-in + .wa-msg-out,
.wa-msg-out + .wa-msg-in {
  margin-top: 8px;
}

/* Bubbles */
.wa-bubble {
  border-radius: 8px;
  max-width: min(72%, 480px);
  padding: 7px 12px 20px;
  position: relative;
  word-break: break-word;
}

.wa-msg-in .wa-bubble {
  background: var(--wa-bubble-in);
  border-top-left-radius: 2px;
  box-shadow: 0 1px 2px var(--wa-bubble-shadow);
  margin-left: 8px;
}

.wa-msg-out .wa-bubble {
  background: var(--wa-bubble-out);
  border-top-right-radius: 2px;
  box-shadow: 0 1px 2px var(--wa-bubble-shadow);
  margin-right: 8px;
}

/* Bubble tails via clip-path */
.wa-msg-in .wa-bubble::before {
  background: var(--wa-bubble-in);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
  content: "";
  height: 12px;
  left: -7px;
  position: absolute;
  top: 0;
  width: 7px;
}

.wa-msg-out .wa-bubble::before {
  background: var(--wa-bubble-out);
  clip-path: polygon(0 0, 0 100%, 100% 0);
  content: "";
  height: 12px;
  position: absolute;
  right: -7px;
  top: 0;
  width: 7px;
}

.wa-sender {
  color: var(--wa-sender);
  display: block;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.wa-bubble-text {
  color: var(--wa-text);
  font-size: 14.5px;
  line-height: 1.5;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.wa-bubble-meta {
  bottom: 5px;
  color: var(--wa-meta);
  font-size: 11px;
  line-height: 1;
  position: absolute;
  right: 9px;
}

/* Input bar */
.wa-input-bar {
  align-items: flex-end;
  background: var(--wa-input-bg);
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  padding: 8px 10px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.wa-textarea {
  background: var(--wa-input-field);
  border: none;
  border-radius: 24px;
  color: var(--wa-text);
  flex: 1;
  font: inherit;
  font-size: 15px;
  letter-spacing: 0;
  line-height: 1.45;
  max-height: 120px;
  min-height: 44px;
  overflow-y: auto;
  padding: 10px 16px;
  resize: none;
  width: 100%;
}

.wa-textarea:focus {
  border-color: transparent;
  box-shadow: none;
  outline: none;
}

.wa-textarea::placeholder {
  color: var(--wa-meta);
}

.wa-send-btn {
  align-items: center;
  background: var(--wa-send-bg);
  border: none;
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  flex-shrink: 0;
  height: 48px;
  justify-content: center;
  min-height: unset;
  padding: 0;
  transition: background 140ms, transform 140ms;
  width: 48px;
}

.wa-send-btn:hover {
  background: var(--wa-send-hover);
  transform: scale(1.06);
}

.wa-send-btn:disabled {
  opacity: 0.55;
  transform: none;
}

/* Locked bar */
.wa-locked-bar {
  align-items: center;
  background: var(--wa-locked-bg);
  border-top: 1px solid var(--wa-locked-border);
  color: var(--wa-locked-text);
  display: flex;
  flex-shrink: 0;
  font-size: 13.5px;
  gap: 10px;
  justify-content: center;
  padding: 14px 20px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  text-align: center;
}

@media (max-width: 480px) {
  .wa-bubble {
    max-width: 86%;
  }
}

/* ── Tema toggle butonu ─────────────────────────────────────── */
.theme-toggle {
  align-items: center;
  background: transparent;
  border: 1px solid var(--topbar-line);
  border-radius: 20px;
  color: var(--topbar-muted);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  gap: 0;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  transition: background 160ms, border-color 160ms, color 160ms;
  width: 34px;
}

.theme-toggle:hover {
  background: var(--topbar-line);
  color: var(--topbar-text);
}

/* Varsayılan (sistem veya açık tema): ay simgesi görünür */
.theme-icon-moon { display: flex; }
.theme-icon-sun  { display: none; }

/* Koyu tema aktifken güneş simgesi */
[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun  { display: flex; }

@media (prefers-color-scheme: dark) {
  :not([data-theme]) .theme-icon-moon { display: none; }
  :not([data-theme]) .theme-icon-sun  { display: flex; }
}

/* ── Memnuniyet anketi (yıldız puanlama) ───────────────────── */
.rating-panel {
  text-align: center;
}

.rating-panel h2 {
  font-size: 16px;
  margin-bottom: 4px;
}

.rating-hint {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}

.rating-form {
  display: flex;
  justify-content: center;
}

.star-rating {
  display: flex;
  gap: 6px;
}

.star-btn {
  background: transparent;
  border: none;
  color: var(--line-strong);
  cursor: pointer;
  font-size: 36px;
  line-height: 1;
  min-height: auto;
  padding: 4px 2px;
  transition: color 120ms, transform 120ms;
}

.star-btn:hover,
.star-btn.star-hover {
  color: #f2b319;
  transform: scale(1.2);
}

.rating-done .rating-stars-display {
  color: #f2b319;
  font-size: 32px;
  letter-spacing: 2px;
  margin: 8px 0 4px;
}

.rating-thanks {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

/* ── Bildirim zili ──────────────────────────────────────────── */
.notif-bell {
  align-items: center;
  background: transparent;
  border: 1px solid var(--topbar-line);
  border-radius: 20px;
  color: var(--topbar-muted);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  position: relative;
  transition: background 160ms, border-color 160ms, color 160ms;
  width: 34px;
}

.notif-bell:hover {
  background: var(--topbar-line);
  color: var(--topbar-text);
}

.notif-bell.has-alert {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--topbar-line));
  color: var(--topbar-text);
}

.notif-bell.has-urgent .notif-badge {
  background: #f59e0b;
  color: #111827;
}

.nav-actions .notif-bell,
.nav-actions .theme-toggle,
.nav-actions .icon-link-button {
  flex: 0 0 auto;
  width: 34px;
}

.notif-badge {
  background: #ef4444;
  border-radius: 10px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  min-width: 16px;
  padding: 2px 4px;
  position: absolute;
  right: -4px;
  text-align: center;
  top: -4px;
}

/* ── Kategori sayfası ───────────────────────────────────────── */
.cat-list { display: flex; flex-direction: column; gap: 8px; }

.cat-row {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  gap: 12px;
  padding: 10px 14px;
}

.cat-dot {
  border-radius: 50%;
  flex-shrink: 0;
  height: 14px;
  width: 14px;
}

.color-picker-row {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.color-input {
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  height: 38px;
  padding: 2px;
  width: 52px;
}

.color-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.color-preset {
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  height: 22px;
  min-height: auto;
  padding: 0;
  transition: transform 120ms, border-color 120ms;
  width: 22px;
}

.color-preset:hover { transform: scale(1.2); border-color: var(--line-strong); }

/* ── SLA ayarları grid ──────────────────────────────────────── */
.sla-grid { grid-template-columns: repeat(4, 1fr) !important; }

.sla-field input {
  border-top: 3px solid transparent;
}

.sla-field.sla-urgent input { border-top-color: #ef4444; }
.sla-field.sla-high   input { border-top-color: #f97316; }
.sla-field.sla-normal input { border-top-color: #3b82f6; }
.sla-field.sla-low    input { border-top-color: #22c55e; }

/* ── Ayarlar onay kutusu satırı ─────────────────────────────── */
.checkbox-label {
  align-items: center;
  cursor: pointer;
  display: flex !important;
  flex-direction: row !important;
  gap: 10px;
  font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── Raporlar sayfası ───────────────────────────────────────── */
.quick-reports {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  margin-top: 16px;
}

.report-card {
  align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  text-decoration: none;
  transition: border-color 160ms, background 160ms, transform 120ms;
}

.report-card:hover {
  background: var(--surface-3);
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--text);
}

.report-icon { font-size: 28px; margin-bottom: 4px; }
.report-card strong { font-size: 14px; }
.report-card small { color: var(--muted); font-size: 12px; }

@media (max-width: 600px) {
  .sla-grid { grid-template-columns: 1fr 1fr !important; }
}

/* ── Etiketler (Tags) ───────────────────────────────────────── */
.tag-panel h2 { font-size: 13px; font-weight: 700; margin: 0 0 10px; }
.tag-form { display: flex; flex-direction: column; gap: 8px; }
.tag-checkboxes { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-check-label { display: flex; align-items: center; gap: 0; cursor: pointer; }
.tag-check-label input[type=checkbox] { position: absolute; opacity: 0; width: 0; height: 0; }
.tag-check-label input[type=checkbox]:checked + .tag-chip { opacity: 1; box-shadow: 0 0 0 2px currentColor; }
.tag-chip {
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.65;
  padding: 3px 10px;
  transition: opacity 120ms, box-shadow 120ms;
  cursor: pointer;
}
.tag-check-label:hover .tag-chip { opacity: 1; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Webhooks ────────────────────────────────────────────────── */
.webhook-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.webhook-row {
  align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px;
}
.webhook-info { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.webhook-url { font-size: 13px; word-break: break-all; }
.webhook-event-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.event-badge {
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  padding: 2px 6px;
}
.webhook-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.webhook-events-fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.webhook-events-fieldset legend { color: var(--muted); font-size: 12px; font-weight: 600; padding: 0 6px; }
.webhook-events-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.webhook-events-list .checkbox-label { font-size: 13px; }
.webhook-events-list code { font-size: 11px; background: var(--surface-3); border-radius: 3px; padding: 1px 5px; }

/* ── 2FA (TOTP) ──────────────────────────────────────────────── */
.totp-qr-wrap { margin: 16px 0; }
.totp-qr { border: 4px solid var(--surface-3); border-radius: var(--radius); display: block; }
.totp-qr-error {
  align-items: center;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  display: flex;
  font-size: 13px;
  height: 200px;
  justify-content: center;
  padding: 16px;
  text-align: center;
  width: 200px;
}

.totp-secret {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  word-break: break-all;
}

/* ── Raporlar geliştirilmiş ──────────────────────────────────── */
.reports-grid { display: flex; flex-direction: column; gap: 20px; margin-bottom: 20px; }
.report-stats-section h2 { font-size: 15px; margin-bottom: 12px; }
.report-table-wrap { overflow-x: auto; }
.report-table {
  border-collapse: collapse;
  font-size: 13px;
  min-width: 360px;
  width: 100%;
}
.report-table th {
  background: var(--surface-2);
  border-bottom: 2px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 8px 12px;
  text-align: left;
  text-transform: uppercase;
}
.report-table td {
  border-bottom: 1px solid var(--line);
  color: var(--text);
  padding: 9px 12px;
}
.report-table tr:last-child td { border-bottom: none; }
.report-table tr:hover td { background: var(--surface-2); }

/* ── pill-sm (küçük pill) ────────────────────────────────────── */
.pill.pill-sm { font-size: 10px; padding: 1px 7px; }

@media (max-width: 768px) {
  .webhook-row { flex-direction: column; }
  .webhook-actions { flex-wrap: wrap; }
}
