/* Shared styles for the template/batch admin pages. Loaded alongside
   /index.css, which provides :root vars, .page-header, .user-bar, .form,
   fieldset/legend, inputs and .actions. */

.top-nav {
  display: flex;
  gap: 4px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.top-nav a {
  color: #fff;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 6px;
  opacity: .8;
}
.top-nav a:hover { opacity: 1; background: rgba(255,255,255,.12); }
.top-nav a.active { opacity: 1; background: rgba(255,255,255,.2); }

.panel {
  max-width: 1100px;
  margin: 24px auto 60px;
  padding: 0 20px;
}

.panel-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.panel-toolbar h2 { margin: 0; font-size: 18px; color: var(--navy); }

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: #1a6841; }
.btn-secondary { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn-secondary:hover { background: var(--navy); color: #fff; }
.btn-danger { background: #fff; color: #b3261e; border: 1px solid #b3261e; }
.btn-danger:hover { background: #b3261e; color: #fff; }
.btn-link {
  background: none;
  border: none;
  color: var(--navy);
  text-decoration: underline;
  cursor: pointer;
  font-size: 12.5px;
  padding: 0;
}
.btn:disabled { opacity: .6; cursor: wait; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  overflow: hidden;
}
table.data-table th, table.data-table td {
  text-align: left;
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--gray-border);
}
table.data-table th { background: #f4f6fa; color: var(--navy); font-size: 12px; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table td.actions-cell { display: flex; gap: 10px; white-space: nowrap; }
table.data-table .muted { color: var(--gray-text); font-size: 12px; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.badge-pending { background: #eef1f6; color: var(--gray-text); }
.badge-sent { background: #e4f5ec; color: var(--green); }
.badge-failed { background: #fdeceb; color: #b3261e; }
.badge-draft { background: #eef1f6; color: var(--gray-text); }
.badge-processing { background: #fff4dd; color: #8a5a00; }
.badge-done { background: #e4f5ec; color: var(--green); }

.var-tag {
  display: inline-block;
  background: #eef1f6;
  color: var(--navy);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 11px;
  margin: 2px 3px 2px 0;
  font-family: monospace;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--gray-text);
  font-size: 13px;
  background: #fff;
  border: 1px dashed var(--gray-border);
  border-radius: 10px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,44,81,.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 640px;
}
.modal h3 { margin: 0 0 16px; color: var(--navy); font-size: 16px; }
.modal .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 12.5px; font-weight: 700; color: #33475a; }
.modal .field input[type="text"],
.modal .field textarea,
.modal .field select {
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid var(--gray-border);
  font-size: 13px;
  font-weight: 400;
  color: var(--navy);
  font-family: inherit;
}
.modal .field textarea { resize: vertical; min-height: 120px; font-family: monospace; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.breadcrumb { font-size: 12.5px; color: var(--gray-text); margin-bottom: 12px; }
.breadcrumb a { color: var(--navy); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.stat-row { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.stat-card {
  background: #fff;
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  padding: 12px 18px;
  min-width: 110px;
}
.stat-card .stat-value { font-size: 20px; font-weight: 800; color: var(--navy); }
.stat-card .stat-label { font-size: 11px; color: var(--gray-text); text-transform: uppercase; }

.error-text { color: #b3261e; font-size: 12px; }
