:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --danger: #dc2626;
  --success: #16a34a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 230px;
  background: #111827;
  color: #e5e7eb;
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
}

.brand-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #9ca3af;
}

.brand-title {
  margin: 4px 0 2px;
  font-size: 18px;
}

.brand-sub {
  margin: 0;
  font-size: 12px;
  color: #9ca3af;
}

.nav {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
}

.nav-item:hover {
  background: #1f2937;
}

.nav-item--active {
  background: #e5e7eb;
  color: #111827;
}

.sidebar-note {
  margin-top: auto;
  padding-top: 8px;
  font-size: 11px;
  border-top: 1px solid #1f2937;
  color: #9ca3af;
}

.main {
  flex: 1;
  padding: 24px 32px 32px;
}

.panel {
  max-width: 1400px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 20px 22px 22px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

.panel-head h2 {
  margin: 6px 0 4px;
  font-size: 22px;
}

.breadcrumb {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #9ca3af;
}

.subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.grid-two {
  display: block;
}

.card {
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 18px 18px 20px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

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

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

@media (max-width: 1100px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="datetime-local"],
.form-group select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 13px;
}

.form-group--checkbox label {
  font-weight: 400;
}

.form-group--full {
  grid-column: 1 / -1;
}

.form-actions {
  grid-column: 1 / -1;
  margin-top: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.btn--primary {
  background: var(--accent);
  color: #ffffff;
}

.btn--secondary {
  background: #f9fafb;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--border);
  padding-inline: 8px;
}

.alert {
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 13px;
}

.alert--error {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.alert--success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.phone-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 4px 0;
}

.phone-item {
  display: flex;
  gap: 4px;
}

.phone-item input {
  flex: 1;
}

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

@media (max-width: 900px) {
  .preview-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.preview-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.preview {
  min-height: 110px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #020617;
  color: #e5e7eb;
  border: 1px solid #111827;
  font-size: 12px;
  overflow: auto;
  white-space: pre-wrap;
}

.table-wrap {
  margin-top: 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  width: 100%;
  min-width: 1200px;
  border-collapse: collapse;
  font-size: 12px;
}

.table-wrap th,
.table-wrap td {
  padding: 6px 8px;
  border-bottom: 1px solid #e5e7eb;

table input[type="datetime-local"] {
  width: 190px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 12px;
}

.table-wrap th {
  background: #f9fafb;
  text-align: left;
}

.table-wrap tr:last-child td {
  border-bottom: none;
}

.pill {
  display: inline-block;
  padding: 2px 6px;
  margin: 1px 2px 1px 0;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
}

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

.bundle-select {
  min-width: 140px;
  padding: 4px 6px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.bundle-progress {
  margin-top: 4px;
  width: 130px;
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  display: none;
}

.bundle-progress__bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.4s ease;
}

.bundle-progress--success .bundle-progress__bar {
  background: var(--success);
}

.bundle-progress--error .bundle-progress__bar {
  background: var(--danger);
}
