* { box-sizing: border-box; }
[v-cloak] { display: none; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: #1f2430;
  background: #eef1f5;
}

h1 { font-size: 18px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 14px; margin: 0 0 8px; }

.muted { color: #7a8194; font-weight: normal; }
.error { color: #c0392b; margin-top: 8px; white-space: pre-wrap; }
.ok { color: #1e8e3e; }
.fail { color: #c0392b; }
.nowrap { white-space: nowrap; }
.hint { margin-top: 8px; }

/* Шапка */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #fff;
  border-bottom: 1px solid #d9dee7;
}
.userbox { display: flex; align-items: center; gap: 10px; }

/* Панели */
.panels {
  display: grid;
  grid-template-columns: minmax(320px, 2fr) minmax(420px, 3fr);
  gap: 16px;
  padding: 16px 20px;
  align-items: start;
}
.panel {
  background: #fff;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  padding: 16px;
}

/* Лампочка состояния подключения */
.lamp {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
}
.lamp.on { background: #2ecc40; box-shadow: 0 0 6px #2ecc40; }
.lamp.off { background: #d0d5de; }

/* Формы подключения */
.connect-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.connect-form label:first-child { grid-column: 1 / -1; }
.connect-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #4a5163;
}
.connect-form button { grid-column: 1 / -1; justify-self: start; }

input {
  padding: 7px 10px;
  border: 1px solid #c4cad6;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
input:focus { outline: 2px solid #4a90d911; border-color: #4a90d9; }

/* Кнопки */
.btn {
  padding: 7px 14px;
  border: 1px solid #c4cad6;
  border-radius: 6px;
  background: #f6f8fb;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.btn:hover:not(:disabled) { background: #e9edf3; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary {
  background: #2b6cb0;
  border-color: #2b6cb0;
  color: #fff;
}
.btn.primary:hover:not(:disabled) { background: #245a94; }
.btn.danger {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
}

/* Блок копирования (левая панель) */
.copy-block {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e3e7ee;
}
.copy-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pause-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #4a5163;
}
.pause-label input { width: 80px; }

.progress-block { margin-top: 12px; }
.progress-bar {
  height: 10px;
  background: #e3e7ee;
  border-radius: 5px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #2b6cb0;
  transition: width 0.2s;
}
.progress-text { margin-top: 6px; }

/* Список этикеток (правая панель) */
.list-block { margin-top: 16px; }

/* Вкладки моделей */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #d9dee7;
  margin-bottom: 12px;
}
.tab {
  padding: 8px 14px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: none;
  font-size: 14px;
  font-family: inherit;
  color: #4a5163;
  cursor: pointer;
}
.tab:hover { background: #f6f8fb; }
.tab.active {
  background: #fff;
  border-color: #d9dee7;
  color: #1f2430;
  font-weight: 600;
  margin-bottom: -1px;
}
.tab-count {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 9px;
  background: #e3e7ee;
  font-size: 12px;
  font-weight: normal;
  color: #4a5163;
}
.list-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.search { flex: 1; min-width: 200px; }

.table-wrap {
  max-height: calc(100vh - 380px);
  min-height: 200px;
  overflow: auto;
  border: 1px solid #e3e7ee;
  border-radius: 6px;
}
table { border-collapse: collapse; width: 100%; }
thead th {
  position: sticky;
  top: 0;
  background: #f6f8fb;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #d9dee7;
  font-size: 13px;
  color: #4a5163;
  z-index: 1;
}
tbody td {
  padding: 6px 10px;
  border-bottom: 1px solid #eef1f5;
  vertical-align: top;
}
tbody tr:hover { background: #f6f8fb; }
tbody a { color: #2b6cb0; text-decoration: none; }
tbody a:hover { text-decoration: underline; }

tr.row-ok, tr.row-warning { background: #f0faf2; }
tr.row-error { background: #fdf1ef; }
tr.row-copying { background: #eff5fc; }
.status-cell { font-size: 13px; max-width: 260px; }

/* Модалка превью */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 25, 35, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.modal {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  max-width: 80vw;
  max-height: 85vh;
  overflow: auto;
  text-align: center;
}
.preview-body { margin: 10px 0; }
.preview-body img {
  max-width: 70vw;
  max-height: 65vh;
  border: 1px solid #e3e7ee;
}

/* Страница входа */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-box {
  background: #fff;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  padding: 28px;
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-box h1 { font-size: 17px; }
.login-box p { margin: 0; }
.login-box label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #4a5163;
}
