:root {
  --bg: #edf4ff;
  --surface: rgba(255, 255, 255, 0.96);
  --surface-soft: #f7faff;
  --surface-strong: #ffffff;
  --text: #13233f;
  --muted: #60728f;
  --line: #d3e0f3;
  --primary: #2e65f2;
  --primary-dark: #17388b;
  --primary-soft: rgba(46, 101, 242, 0.1);
  --success: #17885b;
  --warning: #c47d00;
  --danger: #c53d48;
  --shadow: 0 22px 56px rgba(21, 60, 122, 0.12);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI Variable", "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(82, 128, 236, 0.16), transparent 30%),
    linear-gradient(180deg, #f9fbff 0%, var(--bg) 100%);
  color: var(--text);
  text-rendering: optimizeLegibility;
}

body.is-loading {
  cursor: progress;
}

.app-shell {
  min-height: 100vh;
  padding: 18px 14px 40px;
}

.app-shell__inner {
  max-width: 1180px;
  margin: 0 auto;
}

.hero-card,
.panel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-card {
  padding: 22px 18px;
}

.hero-card--admin,
.hero-card--employee {
  margin-bottom: 18px;
}

.hero-card__topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.hero-card__topline h1 {
  margin-bottom: 0;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 800;
}

h1,
h2,
h3 {
  letter-spacing: -0.03em;
}

h1 {
  margin: 8px 0 8px;
  font-size: clamp(30px, 6vw, 52px);
  line-height: 0.98;
}

h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.subtitle,
.muted,
.hint {
  color: var(--muted);
}

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

.hint {
  font-size: 14px;
}

.stack-form {
  display: grid;
  gap: 12px;
}

.compact-form {
  align-content: start;
}

.two-column-form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-weight: 700;
}

.field input,
.field select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 15px;
  padding: 13px 15px;
  font: inherit;
  color: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.field input:focus,
.field select:focus,
.textarea:focus {
  outline: 2px solid rgba(46, 101, 242, 0.18);
  border-color: rgba(46, 101, 242, 0.45);
}

.textarea {
  min-height: 110px;
  resize: vertical;
}

.field--checkbox {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
}

.btn {
  border: 0;
  border-radius: 16px;
  padding: 11px 15px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--big {
  min-height: 52px;
}

.btn--small {
  padding: 9px 12px;
  font-size: 14px;
}

.btn--employee-main {
  min-height: 88px;
  padding: 18px;
  font-size: 20px;
  line-height: 1.15;
  border-radius: 22px;
  box-shadow: 0 18px 32px rgba(18, 49, 112, 0.14);
}

.btn--danger-soft {
  background: rgba(197, 61, 72, 0.1);
  color: #9f2230;
  border: 1px solid rgba(197, 61, 72, 0.2);
}

.btn--primary {
  background: linear-gradient(180deg, #3a74ff 0%, #2e65f2 100%);
  color: #fff;
  box-shadow: 0 14px 28px rgba(46, 101, 242, 0.18);
}

.btn--secondary {
  background: rgba(46, 101, 242, 0.1);
  color: var(--primary-dark);
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.link-cta {
  display: inline-flex;
  margin-top: 14px;
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.message {
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 700;
  margin-bottom: 14px;
}

.message--success {
  background: rgba(23, 136, 91, 0.12);
  color: var(--success);
}

.message--warning {
  background: rgba(196, 125, 0, 0.12);
  color: #9c6300;
}

.message--danger {
  background: rgba(197, 61, 72, 0.12);
  color: var(--danger);
}

.message--info {
  background: rgba(46, 101, 242, 0.09);
  color: var(--primary-dark);
}

.panel-card {
  padding: 16px;
  margin-bottom: 16px;
}

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

.panel-card__head h2 {
  margin: 0;
}

.info-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  flex: 0 0 auto;
}

.panel-split,
.panel-triplet,
.stats-grid,
.summary-list,
.detail-actions,
.filters-grid {
  display: grid;
  gap: 12px;
}

.stats-grid,
.stats-grid--ops,
.panel-triplet {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.toolbar,
.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.table-actions {
  display: grid;
  gap: 8px;
  min-width: 74px;
}

.table-actions__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-actions__row--compact {
  gap: 6px;
}

.table-actions__password {
  gap: 8px;
}

.table-actions__password input {
  min-width: 0;
  width: 100%;
  max-width: 170px;
}

.action-icon-link,
.action-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  color: var(--muted);
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(17, 44, 96, 0.08);
}

.action-icon-button {
  cursor: pointer;
}

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

.action-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

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

.action-icon--view {
  color: #7d8da7;
}

.action-icon--delete {
  color: #c53d48;
}

.action-icon--toggle {
  color: #8a97ab;
}

.action-icon--toggle-active {
  color: #8a97ab;
}

.action-icon--toggle-inactive {
  color: #17885b;
}

.inline-form--status {
  align-items: stretch;
}

.inline-form--status select {
  min-width: 180px;
}

.pending-box {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(46, 101, 242, 0.08) 0%, rgba(46, 101, 242, 0.03) 100%);
  border-radius: 18px;
  padding: 15px;
  margin: 16px 0;
}

.pending-box__title {
  font-weight: 800;
  font-size: 18px;
}

.pending-box__text {
  margin-top: 5px;
  color: var(--muted);
}

.mobile-actions,
.incident-grid,
.incident-repeater,
.ops-list {
  display: grid;
  gap: 12px;
}

.mobile-actions {
  margin-top: 16px;
}

.incident-card,
.incident-row,
.ops-item,
.summary-item,
.stat-card {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  border-radius: 18px;
}

.incident-card {
  padding: 16px;
}

.incident-card__top,
.incident-row__head,
.ops-item__main,
.ops-item__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.incident-card__eyebrow,
.incident-row__case {
  color: var(--primary);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

.incident-card h3,
.incident-row__employee {
  margin: 5px 0 0;
  font-size: 22px;
  line-height: 1;
}

.incident-meta,
.incident-row__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.incident-meta span,
.incident-row__meta span,
.mini-state,
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 800;
}

.incident-meta span,
.incident-row__meta span,
.mini-state,
.pill--soft {
  background: rgba(46, 101, 242, 0.08);
  color: var(--primary-dark);
}

.pill--warning {
  background: rgba(196, 125, 0, 0.12);
  color: #9b6400;
}

.incident-row {
  padding: 16px;
}

.incident-row__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e8eef8;
}

.toolbar--employee-card {
  margin-top: 12px;
}

.summary-item {
  padding: 14px 15px;
  display: grid;
  gap: 6px;
  background: var(--surface-soft);
}

.summary-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-item strong {
  font-size: 17px;
}

.stat-card {
  padding: 13px 14px;
  background: linear-gradient(180deg, rgba(46, 101, 242, 0.06), rgba(46, 101, 242, 0.02));
}

.stat-card__label {
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.stat-card__value {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 900;
  line-height: 0.95;
}

.stat-card--warning {
  border-color: rgba(196, 125, 0, 0.2);
  background: rgba(196, 125, 0, 0.08);
}

.stat-card--danger {
  border-color: rgba(197, 61, 72, 0.18);
  background: rgba(197, 61, 72, 0.08);
}

.stat-card--soft {
  border-color: rgba(46, 101, 242, 0.16);
}

.stat-card--wide {
  grid-column: 1 / -1;
}

.scope-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.scope-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}

.scope-chip--active {
  background: rgba(46, 101, 242, 0.12);
  color: var(--primary-dark);
}

.filters-form {
  margin-bottom: 14px;
}

.filters-collapsible {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.filters-collapsible__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--primary-dark);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.filters-collapsible__body {
  display: none;
}

.filters-collapsible.is-open .filters-collapsible__body {
  display: block;
}

.filters-grid__dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.attachment-list {
  margin: 0;
  padding-left: 18px;
}

.attachment-list li + li {
  margin-top: 8px;
}

.user-chip {
  display: inline-flex;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(46, 101, 242, 0.12);
  color: var(--primary-dark);
  margin-bottom: 14px;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
}

.app-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.app-table th,
.app-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #edf2fb;
  text-align: left;
  vertical-align: top;
}

.app-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.export-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.app-tabs {
  display: grid;
  gap: 14px;
}

.app-tabs__nav {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.app-tabs__button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.app-tabs__button--active {
  background: rgba(46, 101, 242, 0.12);
  color: var(--primary-dark);
  border-color: rgba(46, 101, 242, 0.26);
}

.app-tabs__panel {
  display: none;
}

.app-tabs__panel--active {
  display: block;
}

.password-panel {
  max-width: 420px;
}

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

.app-pagebar .user-chip {
  margin-bottom: 0;
}

.ops-callouts .panel-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 250, 255, 0.98) 100%);
  border-color: #dbe6f5;
}

.ops-list {
  gap: 10px;
}

.ops-item {
  position: relative;
  padding: 14px 14px 14px 16px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}

.ops-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #2e65f2 0%, #5c84ef 100%);
}

.ops-item__main {
  align-items: baseline;
}

.ops-item__main strong {
  font-size: 17px;
}

.ops-item__main span,
.ops-item__meta span {
  color: var(--muted);
  font-size: 13px;
}

.toolbar--stack-mobile {
  flex-direction: column;
  align-items: stretch;
}

.toolbar--stack-mobile .btn {
  width: 100%;
}

.toolbar--employee-exit {
  margin-top: 16px;
}

.info-modal[hidden] {
  display: none;
}

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.info-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 28, 61, 0.52);
}

.info-modal__dialog {
  position: relative;
  width: min(92vw, 640px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  margin: 20px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.info-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.info-modal__head h3 {
  margin: 0;
}

.info-modal__close {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 22px;
  cursor: pointer;
}

.info-modal__body p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.55;
}

body.has-info-modal {
  overflow: hidden;
}

@media (min-width: 720px) {
  .app-shell {
    padding: 24px 18px 48px;
  }

  .hero-card {
    padding: 26px 24px;
  }

  .two-column-form,
  .summary-list,
  .incident-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-split {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .detail-actions {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .toolbar--stack-mobile {
    flex-direction: row;
    align-items: center;
  }

  .toolbar--stack-mobile .btn {
    width: auto;
  }
}

@media (max-width: 560px) {
  .app-pagebar {
    align-items: flex-start;
  }

  .hero-card__topline {
    align-items: center;
  }

  .hero-card__topline .btn {
    min-height: 44px;
    padding-inline: 16px;
  }
}

@media (min-width: 980px) {
  .app-shell {
    padding: 32px 24px 56px;
  }

  .hero-card {
    padding: 30px 28px;
  }

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

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

  .panel-triplet {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .panel-triplet > .panel-card:last-child {
    grid-column: auto;
  }

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

  .filters-collapsible__toggle {
    display: none;
  }

  .filters-collapsible__body {
    display: block;
  }

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

@media (max-width: 979px) {
  .panel-triplet > .panel-card:last-child {
    grid-column: 1 / -1;
  }
}
