:root {
  --sidebar-margin: 16px;
  font-family:
    Segoe UI,
    Arial,
    sans-serif;
  color: #233448;
  background: #f3f6fa;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
h1 {
  font-size: 30px;
  margin: 5px 0 20px;
  font-weight: 650;
}
p {
  line-height: 1.6;
}
#login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at top right, #d6e9f6, transparent 60%), #f3f6fa;
}
.login-card {
  width: min(440px, 92vw);
  padding: 42px;
  background: white;
  border: 1px solid #dce4ed;
  border-radius: 18px;
  box-shadow: 0 20px 70px #243c5510;
}
.brand {
  font-size: 28px;
  letter-spacing: -1px;
  color: #106c9b;
  font-weight: 800;
  margin-bottom: 36px;
}
.brand span {
  font-size: 11px;
  letter-spacing: 2px;
  vertical-align: middle;
  margin-left: 10px;
}
#login-button {
  margin-top: 24px;
  width: 100%;
}
#login-error {
  color: #b52c39;
  font-size: 13px;
}
main:not([hidden]) {
  display: flex;
  min-height: 100vh;
}
aside {
  width: 255px;
  flex-shrink: 0;
  align-self: flex-start;
  position: sticky;
  top: var(--sidebar-margin);
  margin-block: var(--sidebar-margin);
  height: calc(100vh - 2 * var(--sidebar-margin));
  height: calc(100dvh - 2 * var(--sidebar-margin));
  overflow: hidden;
  background: white;
  border-right: 1px solid #dce4ed;
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
}
aside .brand {
  padding-left: 12px;
  flex-shrink: 0;
}
#navigation {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.aside-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 32px 12px 0;
  font-size: 13px;
  line-height: 1.8;
  color: #61748b;
}
.content {
  padding: var(--sidebar-margin) 38px;
  width: calc(100% - 255px);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.content > :not(.grid-container) {
  flex-shrink: 0;
}
.grid-container {
  flex: 1;
  min-height: 160px;
  overflow: hidden;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: #6e829b;
  margin: 0;
}
.summary {
  border-radius: 10px;
  border: 1px solid #d9e5ef;
  padding: 20px 24px;
  background: #eaf3fa;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 24px;
  gap: 20px;
}
.summary span {
  display: block;
  font-size: 12px;
  color: #617b92;
  margin-bottom: 5px;
}
.summary strong {
  font-size: 20px;
}
.summary p {
  color: #617b92;
  font-size: 13px;
}
#toolbar {
  margin-bottom: 15px;
}
#grid {
  background: white;
  border: 1px solid #dce4ed;
  border-radius: 8px;
  overflow: hidden;
}
#notice {
  color: #b52c39;
  margin: 10px 0;
}
.footnote {
  font-size: 12px;
  color: #74859b;
  margin: 8px 0 0;
}
.editor-tabs {
  margin: 12px 0;
}
.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}
.editor-help {
  font-size: 12px;
  color: #61748b;
}
.json-area {
  width: 100%;
  min-height: 320px;
  font-family: Consolas, monospace;
  border: 1px solid #ccd7e2;
  padding: 12px;
}
.dx-list-item {
  border-radius: 6px;
  margin: 3px 0;
}
.dx-list-item-selected {
  background: #e6f2fa !important;
  color: #106c9b !important;
}
@media (max-width: 850px) {
  main:not([hidden]) {
    display: block;
  }
  aside {
    width: 100%;
    padding: 16px;
    position: static;
    height: auto;
    max-height: calc(100vh - 2 * var(--sidebar-margin));
    max-height: calc(100dvh - 2 * var(--sidebar-margin));
  }
  .aside-footer {
    padding: 8px;
  }
  .content {
    width: 100%;
    padding: var(--sidebar-margin) 20px;
  }
  .summary {
    display: block;
  }
  aside .brand {
    margin-bottom: 10px;
  }
  #navigation {
    max-height: 180px;
    overflow: auto;
  }
  h1 {
    font-size: 25px;
  }
}

.ticket-description, .comment p { white-space: pre-wrap; overflow-wrap: anywhere; }
.comment { background: #f3f6fa; border-radius: 8px; padding: 16px; margin: 12px 0; }
.comment-private { color: #b42318; background: #fff1f0; border-left: 4px solid #c62828; }
.comment-private strong, .comment-private p, .private-label { color: #b42318; }
.private-label { font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.report-preview { width: 100%; height: 48vh; border: 1px solid #dce4ed; background: white; }
.selection-layout { display: flex; flex-direction: column; height: 100%; gap: 12px; }
.selection-layout > :not(.selection-grid) { flex-shrink: 0; }
.selection-grid { flex: 1; min-height: 120px; min-width: 0; overflow: hidden; }
.selection-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.selection-status { margin: 0; font-size: 13px; }

.value-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.pill-blue { color: #17568c; background: #eaf3ff; border-color: #c2daf5; }
.pill-purple { color: #6941a5; background: #f2ebff; border-color: #dccaf6; }
.pill-amber { color: #854c05; background: #fff5d6; border-color: #efd492; }
.pill-green { color: #17643b; background: #e6f6ec; border-color: #b6e0c7; }
.pill-gray { color: #4b5563; background: #eef1f5; border-color: #d6dce4; }
.pill-red { color: #a51d2d; background: #ffebee; border-color: #f2b7bf; }

.sap-details { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr); gap: 0; }
.sap-details dt, .sap-details dd { margin: 0; padding: 12px; border-bottom: 1px solid #e2e8f0; overflow-wrap: anywhere; white-space: pre-wrap; }
.sap-details dt { font-weight: 600; color: #526579; background: #f3f6fa; }
.rich-content { overflow-wrap: anywhere; }
.rich-content p { margin: 8px 0; }
.comment-editor { margin: 12px 0; }
.comment-private .rich-content, .comment-private .rich-content * { color: #b42318 !important; }
.attachments-panel { margin: 24px 0; padding-top: 8px; border-top: 1px solid #dce4ed; }
.attachments-help { color: #61748b; font-size: 12px; }
.attachments-panel .selection-actions { margin-bottom: 12px; }
