:root {
  --bg: #05070c;
  --surface: rgba(10, 12, 18, 0.82);
  --surface-strong: #0b0e16;
  --border: rgba(255, 255, 255, 0.18);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.7);
  --primary: #3b82f6;
  --primary-strong: #60a5fa;
  --secondary: #111827;
  --ok: #49d796;
  --warn: #ffbc4f;
  --danger: #ff6f88;
  --elev-1: 0 10px 24px rgba(2, 8, 26, 0.42);
  --elev-2: 0 16px 34px rgba(1, 6, 23, 0.52);
  --inset-soft: inset 0 1px 0 rgba(220, 235, 255, 0.1), inset 0 -2px 0 rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  position: relative;
  background-image: url("/background-data-overlay.svg"), radial-gradient(circle at 20% 0%, rgba(59, 130, 246, 0.2) 0%, rgba(0, 0, 0, 0.65) 55%, var(--bg) 100%);
  background-size: cover, cover;
  background-position: center top, center;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed;
  color: var(--text);
}

body > * {
  position: relative;
  z-index: 1;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.12), rgba(59, 130, 246, 0.1), rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.3));
  background-size: 360% 360%;
  animation: monoDrift 9s linear infinite;
  opacity: 0.7;
  filter: blur(10px);
  transform: translateZ(0);
  will-change: background-position;
}

@keyframes monoDrift {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 100% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
  }
}

a {
  color: rgba(147, 197, 253, 0.95);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(8, 16, 42, 0.78);
  backdrop-filter: blur(8px);
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

h1 {
  margin: 0.15rem 0 0;
  font-size: 1.5rem;
}

h2,
h3,
h4 {
  margin: 0 0 0.6rem;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.2rem;
}

.page-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1rem;
  align-items: start;
}

.stack {
  display: grid;
  gap: 0.8rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--elev-2), var(--inset-soft);
  backdrop-filter: blur(8px);
}

.subtitle {
  margin: 0 0 0.7rem;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 0.75rem;
}

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

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

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

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

input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.56rem 0.62rem;
  min-height: 40px;
  background: rgba(9, 20, 50, 0.85);
  color: var(--text);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.06), inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 4px 12px rgba(1, 8, 30, 0.24);
  max-width: 100%;
}

input::placeholder,
textarea::placeholder {
  color: #8fa3d1;
}

textarea {
  resize: vertical;
}

.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.actions.compact {
  margin-top: 0.35rem;
}

.align-end {
  align-self: end;
}

button,
.link-button {
  border: 1px solid rgba(157, 192, 255, 0.28);
  border-radius: 8px;
  padding: 0.56rem 0.88rem;
  min-height: 40px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), #3f6ff4);
  color: #fff;
  font-weight: 600;
  font-size: 0.94rem;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 3px 0 rgba(20, 47, 122, 0.5), 0 8px 14px rgba(2, 10, 34, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(0);
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

button:hover,
.link-button:hover {
  background: linear-gradient(135deg, var(--primary-strong), #5d9fff);
  box-shadow: 0 4px 0 rgba(20, 47, 122, 0.55), 0 10px 16px rgba(2, 10, 34, 0.25), 0 0 10px rgba(118, 167, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.38);
  transform: translateY(-2px) scale(1.01);
  filter: saturate(1.08);
  text-decoration: none;
}

button:active,
.link-button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(20, 47, 122, 0.5), 0 4px 8px rgba(2, 10, 34, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

button.secondary,
.link-button.secondary {
  background: linear-gradient(135deg, #1b2f67, var(--secondary));
  box-shadow: 0 3px 0 rgba(16, 35, 86, 0.52), 0 8px 14px rgba(2, 10, 34, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

button.secondary:hover,
.link-button.secondary:hover {
  box-shadow: 0 4px 0 rgba(16, 35, 86, 0.58), 0 10px 16px rgba(2, 10, 34, 0.26), 0 0 10px rgba(95, 133, 235, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

button:focus-visible,
.link-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #9dc0ff;
  outline-offset: 2px;
}

.status {
  min-height: 1.15rem;
  margin: 0;
  color: #8fd4ff;
  font-weight: 600;
}

.hidden {
  display: none;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.detail-grid p {
  margin: 0;
  display: grid;
  gap: 0.2rem;
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.timeline li {
  display: grid;
  gap: 0.15rem;
  border-left: 3px solid var(--border);
  padding-left: 0.65rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(120px, 1fr));
  gap: 0.55rem;
}

.summary-card {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.55rem;
  display: grid;
  gap: 0.15rem;
  background: rgba(11, 21, 53, 0.72);
  box-shadow: var(--elev-1), var(--inset-soft);
}

.summary-card span {
  font-size: 1.15rem;
  font-weight: 700;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
}

.filters {
  margin-top: 0.4rem;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 0.56rem;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}

th {
  font-size: 0.86rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.03em;
  background: rgba(16, 33, 82, 0.82);
  box-shadow: inset 0 -1px 0 rgba(156, 187, 255, 0.18);
}

td {
  background: rgba(7, 15, 39, 0.36);
  box-shadow: inset 0 1px 0 rgba(188, 211, 255, 0.04);
}

.empty {
  text-align: center;
  color: var(--muted);
}

.board-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  overflow-x: auto;
}

.board-col {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(11, 22, 56, 0.78);
  padding: 0.55rem;
  min-height: 220px;
  box-shadow: var(--elev-1), var(--inset-soft);
}

.board-list {
  display: grid;
  gap: 0.45rem;
}

.board-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(8, 19, 49, 0.9);
  padding: 0.5rem;
  display: grid;
  gap: 0.25rem;
  box-shadow: 0 8px 16px rgba(1, 8, 27, 0.45), inset 0 1px 0 rgba(210, 228, 255, 0.08);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.46rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(108, 145, 255, 0.2);
  color: #cfe2ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 3px 8px rgba(4, 10, 30, 0.32);
}

.state-open {
  background: rgba(92, 138, 255, 0.25);
  color: #d8e6ff;
}

.state-work-in-progress {
  background: rgba(73, 215, 150, 0.22);
  color: #baf7dc;
}

.state-pending {
  background: rgba(255, 188, 79, 0.22);
  color: #ffe0aa;
}

.state-awaiting-signoff {
  background: rgba(128, 171, 255, 0.24);
  color: #deebff;
}

.state-resolved {
  background: rgba(147, 118, 255, 0.24);
  color: #e2d7ff;
}

.state-closed {
  background: rgba(120, 145, 193, 0.24);
  color: #d6e3ff;
}

.sla-ok {
  background: rgba(73, 215, 150, 0.22);
  color: #baf7dc;
}

.sla-warning {
  background: rgba(255, 188, 79, 0.22);
  color: #ffe0aa;
}

.sla-critical {
  background: rgba(255, 111, 136, 0.25);
  color: #ffd0da;
}

.signature-pad {
  width: 100%;
  max-width: 520px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f7fbff;
  touch-action: none;
}

.signature-preview {
  width: 100%;
  max-width: 640px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  padding: 0.4rem;
}

.site-watermark {
  position: fixed;
  right: 16px;
  bottom: 10px;
  margin: 0;
  font-size: 0.78rem;
  font-style: italic;
  font-family: "Segoe Script", "Brush Script MT", cursive;
  color: rgba(216, 232, 255, 0.72);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  user-select: none;
  z-index: 999;
}

#panelSection,
#wmPanelSection,
#workerPanelSection {
  font-size: 0.92rem;
}

#panelSection .card,
#wmPanelSection.card,
#workerPanelSection.card {
  padding: 0.8rem;
}

#panelSection h2,
#panelSection h3,
#panelSection h4,
#wmPanelSection h2,
#wmPanelSection h3,
#workerPanelSection h2,
#workerPanelSection h3 {
  margin-bottom: 0.45rem;
}

#panelSection .summary-grid {
  gap: 0.4rem;
}

#panelSection .summary-card {
  padding: 0.45rem;
}

#panelSection label,
#wmPanelSection label,
#workerPanelSection label {
  gap: 0.22rem;
  font-weight: 600;
}

#panelSection input,
#panelSection select,
#panelSection textarea,
#wmPanelSection input,
#wmPanelSection select,
#wmPanelSection textarea,
#workerPanelSection input,
#workerPanelSection select,
#workerPanelSection textarea {
  min-height: 34px;
  padding: 0.42rem 0.5rem;
}

#panelSection button,
#wmPanelSection button,
#workerPanelSection button,
#panelSection .link-button,
#wmPanelSection .link-button,
#workerPanelSection .link-button {
  min-height: 30px;
  padding: 0.34rem 0.58rem;
  font-size: 0.82rem;
  line-height: 1.05;
  box-shadow: 0 1px 0 rgba(20, 47, 122, 0.35), 0 4px 8px rgba(2, 10, 34, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

#panelSection th,
#panelSection td,
#wmPanelSection th,
#wmPanelSection td,
#workerPanelSection th,
#workerPanelSection td {
  padding: 0.42rem;
  font-size: 0.88rem;
}

#panelSection .actions,
#wmPanelSection .actions,
#workerPanelSection .actions {
  gap: 0.4rem;
}

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

  .board-grid {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
  }

  .cols-4,
  .summary-grid,
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    font-size: 14px;
  }

  .container {
    padding: 0.8rem;
  }

  .topbar-inner,
  .row-between {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-inner .actions {
    width: 100%;
  }

  .topbar-inner .actions .link-button,
  .topbar-inner .actions button {
    width: 100%;
    justify-content: center;
  }

  .cols-2,
  .cols-4,
  .summary-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .summary-card span {
    font-size: 1.02rem;
  }

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

  #panelSection,
  #wmPanelSection,
  #workerPanelSection {
    font-size: 0.88rem;
  }

  #panelSection .card,
  #wmPanelSection.card,
  #workerPanelSection.card,
  .card {
    padding: 0.68rem;
  }

  #panelSection table,
  #wmPanelSection table,
  #workerPanelSection table {
    min-width: 620px;
  }

  #panelSection th,
  #panelSection td,
  #wmPanelSection th,
  #wmPanelSection td,
  #workerPanelSection th,
  #workerPanelSection td {
    padding: 0.38rem;
    font-size: 0.82rem;
  }

  #panelSection button,
  #wmPanelSection button,
  #workerPanelSection button,
  #panelSection .link-button,
  #wmPanelSection .link-button,
  #workerPanelSection .link-button {
    min-height: 28px;
    padding: 0.3rem 0.5rem;
    font-size: 0.78rem;
    white-space: normal;
  }

  #panelSection td:last-child .actions,
  #wmPanelSection td:last-child .actions,
  #workerPanelSection td:last-child .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
  }

  #panelSection td:last-child button,
  #wmPanelSection td:last-child button,
  #workerPanelSection td:last-child button {
    width: 100%;
  }
}
