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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  background: #f5f5f5;
  color: #222;
}

/* ── Navigation ─────────────────────────────────────────────────────────── */
nav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  height: 48px;
  background: #1a1a2e;
  color: #fff;
}

nav .brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  margin-right: auto;
}

nav a {
  color: #ccc;
  text-decoration: none;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

nav a:hover { color: #fff; background: rgba(255,255,255,0.08); }
nav a.active { color: #fff; background: rgba(255,255,255,0.15); }

/* ── Content ─────────────────────────────────────────────────────────────── */
#content {
  padding: 24px 16px;
  max-width: 1100px;
  width: 100%;
}

@media (min-width: 600px) {
  #content { padding: 32px 32px; }
}

h1, h2, h3 { font-weight: 600; margin-bottom: 12px; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }

p { line-height: 1.6; margin-bottom: 8px; }
p.error { color: #c0392b; }

/* ── Create section ──────────────────────────────────────────────────────── */
.create-section { margin-bottom: 8px; }
.create-section h2 { margin-bottom: 14px; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  margin-top: 12px;
}
.checkbox-row input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; }

textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
textarea:focus { border-color: #1a1a2e; }

/* ── Group banner ────────────────────────────────────────────────────────── */
#v-group-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #e8eaf6;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: #1a1a2e;
  margin-bottom: 12px;
}

#v-group-banner code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  margin: 0 4px;
}

#v-clear-group {
  height: auto;
  padding: 0 6px;
  background: none;
  color: #666;
  font-size: 16px;
  line-height: 1;
}
#v-clear-group:hover { color: #1a1a2e; opacity: 1; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

label { display: block; font-size: 12px; color: #555; margin-bottom: 4px; }

input[type="text"],
input[type="email"],
input[type="number"] {
  height: 34px;
  padding: 0 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
input:focus { border-color: #1a1a2e; }

button {
  height: 34px;
  padding: 0 16px;
  background: #1a1a2e;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.15s;
}
button:hover { opacity: 0.85; }
button:disabled { opacity: 0.4; cursor: default; }

/* ── Table ───────────────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
  background: #fafafa;
  border-bottom: 1px solid #eee;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f9f9f9; }

/* ── Module header (title + context selector row) ───────────────────────── */
.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.module-header h1 { margin-bottom: 0; }

/* ── Context selector ────────────────────────────────────────────────────── */
#v-context-wrap { position: relative; }

.context-btn {
  height: 30px;
  padding: 0 14px;
  background: #e8eaf6;
  color: #1a1a2e;
  border: none;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.15s;
}
.context-btn:hover { background: #c5cae9; }

.context-popup {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  overflow: hidden;
  z-index: 100;
}

.context-item {
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
}
.context-item:hover { background: #f5f5f5; }
.context-item.active { font-weight: 600; color: #1a1a2e; background: #e8eaf6; }

/* ── Voucher cards ───────────────────────────────────────────────────────── */
.voucher-card {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.voucher-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 12px;
}

.voucher-row:last-child { border-bottom: none; }

.voucher-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #888;
  white-space: nowrap;
}

.voucher-code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  word-break: break-all;
}

.voucher-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.badge-yes { background: #d4edda; color: #1a6630; }
.badge-no  { background: #f8d7da; color: #842029; }

.voucher-row-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-trash {
  margin-left: 0;
  height: auto;
  padding: 2px 6px;
  background: none;
  color: #aaa;
  font-size: 15px;
  line-height: 1;
  transition: color 0.15s;
}
.btn-trash:hover { color: #c0392b; opacity: 1; }

.list-empty { color: #999; font-size: 13px; margin-top: 8px; }

/* ── Info / progress box (managed by netRequest.js) ─────────────────────── */
#net-info-box {
  position: fixed;
  bottom: 24px;
  right: 24px;
  min-width: 260px;
  background: #1a1a2e;
  color: #fff;
  border-radius: 8px;
  padding: 14px 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 9999;
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

#net-info-box .net-description { font-size: 13px; margin-bottom: 8px; }

#net-info-box .net-progress-track {
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  overflow: hidden;
}

#net-info-box .net-progress-fill {
  height: 100%;
  background: #4fc3f7;
  border-radius: 2px;
  transition: width 0.3s ease;
}
