:root {
  color-scheme: light;
  --bg: #0b1020;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.14);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.68);
  --brand: #7c3aed;
  --brand2: #22c55e;
  --danger: #ef4444;
  --shadow: 0 16px 50px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 700px at 10% 5%, rgba(124, 58, 237, 0.32), transparent 55%),
    radial-gradient(900px 600px at 90% 25%, rgba(34, 197, 94, 0.22), transparent 55%),
    radial-gradient(900px 700px at 50% 110%, rgba(59, 130, 246, 0.22), transparent 55%), var(--bg);
  color: var(--text);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 16, 32, 0.72);
  backdrop-filter: blur(10px);
}

.topbar__title {
  display: grid;
  gap: 4px;
}

.app-title {
  font-weight: 750;
  letter-spacing: 0.2px;
  font-size: 16px;
}

.app-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.topbar__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.layout {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 14px;
  padding: 14px;
  max-width: 1200px;
  margin: 0 auto;
}

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

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.06));
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card__header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.card__title {
  font-weight: 720;
  letter-spacing: 0.2px;
}

.card__subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
}

.toolbar__left,
.toolbar__right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.toolbar__divider {
  width: 1px;
  height: 26px;
  background: var(--border);
}

.add-row {
  display: grid;
  grid-template-columns: 1fr 140px 110px;
  gap: 10px;
  padding: 0 14px 12px;
}

@media (max-width: 620px) {
  .add-row {
    grid-template-columns: 1fr;
  }
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 10px 12px;
  font-weight: 650;
  font-size: 13px;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
  user-select: none;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0px);
}

.btn--primary {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.9), rgba(34, 197, 94, 0.55));
  border-color: rgba(255, 255, 255, 0.22);
}

.btn--primary:hover {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.98), rgba(34, 197, 94, 0.62));
}

.btn--file {
  position: relative;
  overflow: hidden;
}

.btn--file input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.input,
.select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
}

.input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.input:focus,
.select:focus {
  border-color: rgba(124, 58, 237, 0.75);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

.table-wrap {
  padding: 0 14px 14px;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.14);
}

.table thead th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  position: sticky;
  top: 0;
}

.table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: middle;
}

.table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.col-check {
  width: 70px;
}

.col-env {
  width: 110px;
}

.col-actions {
  width: 52px;
}

.name-edit {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  outline: none;
}

.name-edit:focus {
  border-color: rgba(124, 58, 237, 0.7);
  background: rgba(255, 255, 255, 0.04);
}

.icon-btn {
  width: 38px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
}

.icon-btn:hover {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
}

.hint {
  padding: 0 14px 14px;
  font-size: 12px;
  color: var(--muted);
}

.footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 14px 18px;
  color: var(--muted);
  font-size: 12px;
}

.form {
  padding: 12px 14px 14px;
  display: grid;
  gap: 12px;
}

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

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

.preview {
  margin-top: 6px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: grid;
  gap: 8px;
}

.preview__title {
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
}

.preview__box {
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  height: 180px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.preview__name {
  text-align: center;
  padding: 10px;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

/* Print window base styles are generated in JS (separate document). */
