/* /style.css */
:root {
  --brand: #0f4c81;
  --brand2: #1f6fb2;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #d1d5db;
  --ok: #166534;
  --danger: #b91c1c;
  --shadow: 0 10px 30px rgba(15, 76, 129, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app-wrapper {
  width: 100%;
  min-height: 100%;
  overflow-y: auto;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.topbar {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff;
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.topbar p {
  margin: 0;
  opacity: 0.95;
  line-height: 1.5;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.tab-btn {
  border: none;
  background: #e5e7eb;
  color: #374151;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.3s;
}

.tab-btn.active {
  color: #fff;
}

.tab-btn[data-tab="tab0"] {
  background: #fef3c7;
  color: #92400e;
}

.tab-btn[data-tab="tab0"].active {
  background: #f59e0b;
}

.tab-btn[data-tab="tab1"] {
  background: #dbeafe;
  color: #1e40af;
}

.tab-btn[data-tab="tab1"].active {
  background: #3b82f6;
}

.tab-btn[data-tab="tab2"] {
  background: #fecaca;
  color: #991b1b;
}

.tab-btn[data-tab="tab2"].active {
  background: #ef4444;
}

.tab-btn[data-tab="tab3"] {
  background: #c7d2fe;
  color: #312e81;
}

.tab-btn[data-tab="tab3"].active {
  background: #6366f1;
}

.panel {
  display: none;
  background: var(--card);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel.active {
  display: block;
}

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

.field {
  grid-column: span 12;
}

.field.col-6 {
  grid-column: span 6;
}

.field.col-4 {
  grid-column: span 4;
}

.field.col-3 {
  grid-column: span 3;
}

.field.col-8 {
  grid-column: span 8;
}

.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

button {
  border: none;
  border-radius: 10px;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 700;
}

.primary {
  background: var(--brand);
  color: #fff;
}

.secondary {
  background: #e5e7eb;
  color: #111827;
}

.success {
  background: #dcfce7;
  color: var(--ok);
}

.danger {
  background: #fee2e2;
  color: var(--danger);
}

.ghost {
  background: #eff6ff;
  color: #1d4ed8;
}

.subcard {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  margin-top: 14px;
}

.subcard h3 {
  margin: 0 0 10px;
}

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

.pill {
  display: inline-block;
  white-space: nowrap;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  margin: 4px 6px 0 0;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  background: #fff;
}

th,
td {
  border: 1px solid #e5e7eb;
  padding: 10px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  word-break: break-word;
  max-width: 300px;
}

th {
  background: #eff6ff;
}

.muted {
  color: var(--muted);
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 10px;
}

.count-box {
  background: #eff6ff;
  padding: 10px 14px;
  border-radius: 10px;
  color: #1e40af;
  font-weight: 700;
}

.small {
  font-size: 12px;
}

.logo-preview-wrap {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.logo-box-ui {
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  min-width: 220px;
}

.logo-box-ui img {
  width: 140px;
  height: 140px;
  display: block;
  margin-top: 10px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #f0f0f0;
}

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

.table-wrap {
  overflow: auto;
}

.import-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  cursor: pointer;
}

.checkbox-actions {
  margin: 0 0 10px 0;
}

.position-item {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 8px;
  margin-bottom: 6px;
  background: #fff;
  border: 1px solid #e5e7eb;
  transition: all 0.2s;
}

.position-item:hover {
  background: #f0f9ff;
  border-color: #3b82f6;
}

.position-item input[type="checkbox"] {
  width: auto;
  margin-right: 10px;
  transform: scale(1.2);
  cursor: pointer;
}

.position-item label {
  cursor: pointer;
  user-select: none;
  display: inline;
  font-weight: 400;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
  background: #f9fafb;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

@media (max-width: 900px) {
  .field.col-6,
  .field.col-4,
  .field.col-3,
  .field.col-8 {
    grid-column: span 12;
  }
}
