:root {
  color-scheme: light;
  --bg: #f4fbfc;
  --panel: #ffffff;
  --panel-strong: #eefafa;
  --ink: #17255d;
  --muted: #587083;
  --line: #c7e4e7;
  --accent: #2fb8b2;
  --accent-dark: #24358f;
  --accent-soft: #e6f8f8;
  --gold: #f5c84b;
  --green: #20805f;
  --amber: #b7791f;
  --red: #b42318;
  --sidebar: #17255d;
  --sidebar-soft: rgba(255, 255, 255, 0.1);
  --shadow: 0 16px 36px rgba(23, 37, 93, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(47, 184, 178, 0.18), transparent 32rem),
    linear-gradient(135deg, #f4fbfc 0%, #f7f9ff 48%, #eefafa 100%);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(140deg, rgba(36, 53, 143, 0.14), rgba(47, 184, 178, 0.18)),
    radial-gradient(circle at 70% 20%, rgba(47, 184, 178, 0.22), transparent 28rem);
}

.auth-panel {
  width: min(480px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  width: 86px;
  height: auto;
  max-height: 52px;
  object-fit: contain;
  padding: 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
}

.sidebar .brand span {
  color: rgba(255, 255, 255, 0.74);
}

.sidebar .brand strong {
  color: #ffffff;
}

.sidebar .brand-logo {
  width: 104px;
  max-height: 64px;
  background: #ffffff;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.18));
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 18px;
  background:
    linear-gradient(165deg, rgba(47, 184, 178, 0.24), transparent 36%),
    linear-gradient(180deg, #17255d 0%, #24358f 54%, #168c8b 100%);
  color: #f8fbfd;
}

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

.nav-item {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.side-card {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: var(--sidebar-soft);
}

.side-card small {
  color: rgba(255, 255, 255, 0.68);
}

.main {
  display: grid;
  align-content: start;
  gap: 22px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(238, 250, 250, 0.5)),
    radial-gradient(circle at 100% 0%, rgba(36, 53, 143, 0.08), transparent 24rem);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

h3 {
  margin-bottom: 10px;
  font-size: 0.98rem;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.toolbar,
.form-grid,
.topbar-actions,
.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

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

.subnav {
  display: inline-flex;
  width: fit-content;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.subnav-item {
  min-height: 36px;
  padding: 8px 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.subnav-item.active {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: #ffffff;
}

.form-grid {
  align-items: end;
}

.panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(246, 252, 252, 0.92));
  box-shadow: var(--shadow);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.summary-card {
  display: grid;
  gap: 5px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(238, 250, 250, 0.88));
  box-shadow: var(--shadow);
}

.summary-card span,
.field span,
.muted {
  color: var(--muted);
}

.summary-card strong {
  font-size: 1.6rem;
}

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

.field span {
  font-size: 0.84rem;
  font-weight: 700;
}

input,
select,
textarea {
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(47, 184, 178, 0.28);
  border-color: var(--accent);
}

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

.primary-button,
.secondary-button,
.danger-button {
  display: inline-grid;
  min-height: 40px;
  place-items: center;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: #ffffff;
}

.primary-button:hover {
  background: linear-gradient(135deg, #17255d, #168c8b);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--line);
  color: var(--ink);
}

.secondary-button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.danger-button {
  background: #fff5f4;
  border-color: #ffd4d0;
  color: var(--red);
}

.status-row {
  display: none;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
}

.status-row.visible {
  display: block;
}

.status-row.error {
  border-color: #ffd4d0;
  background: #fff5f4;
  color: var(--red);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  background: linear-gradient(135deg, #eefafa, #f0f3fb);
  color: var(--accent-dark);
  font-size: 0.82rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.progress-track {
  width: 160px;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5f4f5;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
}

.progress-fill.good {
  background: var(--green);
}

.progress-fill.warn {
  background: var(--amber);
}

.tag {
  display: inline-grid;
  place-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--muted);
  font-weight: 700;
}

.tag.current {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.tag.previous {
  background: #fff5d6;
  color: #684300;
}

.recap-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  text-align: left;
}

.link-button:hover {
  color: var(--accent);
}

.list-item.link-button {
  width: 100%;
}

.list-item.link-button.active-filter {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.table-filter {
  width: 100%;
  min-width: 110px;
  min-height: 30px;
  margin-top: 6px;
  padding: 5px 7px;
  font-size: 0.82rem;
  text-transform: none;
}

.copy-row-image {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent-dark);
}

.copy-row-image::before,
.copy-row-image::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 2px;
  background: #ffffff;
}

.copy-row-image::before {
  transform: translate(3px, -3px);
  opacity: 0.55;
}

.copy-row-image::after {
  transform: translate(-2px, 2px);
}

.copy-row-image:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.compact-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.pagination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.page-size-control,
.pagination-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.page-size-control span {
  color: var(--muted);
  font-weight: 700;
}

.page-size-control select {
  min-width: 82px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.empty-state {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #f4fbfc);
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
}

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

.secret-box {
  padding: 12px;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  background: #f2fbfd;
  color: var(--accent-dark);
  font-family: Consolas, "Courier New", monospace;
  overflow-wrap: anywhere;
}

.qr-code {
  display: block;
  width: min(240px, 100%);
  height: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

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

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 16px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .summary-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .subnav {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }
}
