/* KSeF app styles (independent implementation, visually aligned to bksystem2) */
:root {
  --bg: #111827;
  --panel: #1f2937;
  --line: #374151;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #1d4ed8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.auth-title,
h1 {
  margin: 0 0 16px;
  font-size: 24px;
  color: #f8fafc;
}

h2 {
  margin: 0 0 12px;
  font-size: 20px;
  color: #e5e7eb;
}

header {
  height: 56px;
  border-bottom: 1px solid #111827;
  background: #1f2937;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px;
  font-size: 14px;
  color: #f8fafc;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.header-left {
  flex: 1 1 auto;
  overflow: auto;
}

.header-right {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ctrl-btn {
  border: 1px solid #475569;
  border-radius: 8px;
  background: #334155;
  color: #f8fafc;
  font-size: 12px;
  padding: 6px 10px;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
}

.ctrl-btn:hover {
  background: #3b4b60;
  border-color: #64748b;
}

.ctrl-btn.is-active {
  background: var(--accent);
  border-color: #1e40af;
  color: #fff;
}

.ctrl-select {
  border: 1px solid #475569;
  border-radius: 8px;
  background: #0f172a;
  color: #e5e7eb;
  font-size: 12px;
  padding: 6px 8px;
}

.container {
  padding: 14px 16px 18px;
}

.submenu {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
}

.users-section {
  padding: 10px;
  border: 1px solid #334155;
  background: #101a2b;
  border-radius: 10px;
  margin-bottom: 10px;
}

.users-section-head {
  border-bottom: 1px solid #334155;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  margin-bottom: 0;
}

.users-section-actions {
  border-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

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

.notice {
  background: #0f3a28;
  color: #86efac;
  border: 1px solid #166534;
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 8px;
}

.error {
  background: #3b0f1a;
  color: #fecaca;
  border: 1px solid #7f1d1d;
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 8px;
}

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

.empty {
  padding: 14px;
  color: var(--muted);
  font-size: 14px;
}

.card,
.auth-card {
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  background: var(--panel);
}

.auth-card {
  width: min(420px, 95vw);
  margin-bottom: 0;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.35);
  background: #0f172a;
}

.field {
  margin-bottom: 10px;
}

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

.field input,
.auth-card input {
  width: 100%;
  max-width: 420px;
  padding: 8px;
  border: 1px solid #64748b;
  border-radius: 8px;
  box-sizing: border-box;
  background: #1a2434;
  color: #e5e7eb;
}

.auth-card input {
  margin-bottom: 12px;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.link-btn {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid #475569;
  border-radius: 8px;
  text-decoration: none;
  color: #e5e7eb;
  background: #1f2937;
}

.link-btn:hover {
  background: #334155;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #111827;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

th,
td {
  border-bottom: 1px solid #253041;
  padding: 10px;
  vertical-align: top;
  text-align: left;
}

th {
  background: #0f172a;
  color: #cbd5e1;
}

tr:hover td {
  background: #162033;
}

.candidate-row {
  border-top: 1px solid #334155;
  padding: 6px 0;
  font-size: 12px;
}

.candidate-row:first-child {
  border-top: 0;
}

.entity-card {
  border: 1px solid #8fa0b8;
  border-radius: 12px;
  background: #1a2434;
  padding: 10px;
  margin: 10px 0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

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

.local-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  color: #bfdbfe;
  background: #1e3a8a;
  border: 1px solid #3b82f6;
  vertical-align: middle;
}

.mid-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  color: #fed7aa;
  background: #7c2d12;
  border: 1px solid #fb923c;
  vertical-align: middle;
}
