@import url("https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&family=Inter:wght@400;500;600&display=swap");

:root {
  --bg: #0e141b;
  --panel: #111827;
  --panel-light: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #8b1e1e;
  --border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.admin-body {
  display: grid;
}

.login-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 8, 11, 0.8);
  z-index: 20;
  backdrop-filter: blur(6px);
}

.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: grid;
  gap: 12px;
  width: min(360px, 90vw);
}

.admin-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand h2 {
  font-family: "Libre Baskerville", serif;
  font-size: 1.1rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.65rem;
  color: var(--muted);
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-size: 0.95rem;
  transition: background 0.15s, border-color 0.15s;
}

.menu-item:hover {
  background: rgba(139, 30, 30, 0.06);
  border-color: rgba(139, 30, 30, 0.3);
}

.menu-item.active {
  border-color: rgba(139, 30, 30, 0.6);
  background: rgba(139, 30, 30, 0.1);
}

.home-link {
  margin-top: auto;
  text-align: center;
  text-decoration: none;
  color: var(--muted);
}
.home-link:hover {
  color: var(--fg);
}

.content {
  padding: 24px clamp(20px, 5vw, 60px) 60px;
  display: grid;
  gap: 24px;
  align-content: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: grid;
  gap: 14px;
}

.tab-panel {
  display: none;
}

.tab-panel.active-tab {
  display: grid;
}

.parser {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.6);
}

#actions-container {
  display: grid;
  gap: 12px;
}

.accusation-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel-light);
}

.accusation-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(139, 30, 30, 0.12);
  border-bottom: 1px solid var(--border);
}

.accusation-num {
  font-weight: 600;
  font-size: 0.85rem;
  color: #ef4444;
  white-space: nowrap;
}

.accusation-title {
  font-size: 0.85rem;
  color: var(--muted);
}

.accusation-card-body {
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}

.accusation-row {
  display: grid;
  gap: 4px;
}

.accusation-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.accusation-text {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-line;
}

.accusation-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}

.accusation-meta-item {
  color: var(--muted);
}

.accusation-meta-item strong {
  color: var(--text);
}

.tck-highlight {
  color: #fbbf24;
}

.parser-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

input,
select,
textarea {
  font-family: inherit;
  background: var(--panel-light);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
}

textarea[readonly],
input[readonly] {
  opacity: 0.85;
  cursor: default;
  background: rgba(31, 41, 55, 0.6);
  border-style: dashed;
}

.tck-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tck-input-row input {
  flex: 1;
}

.tck-input-row .btn {
  white-space: nowrap;
  padding: 8px 12px;
  font-size: 0.85rem;
}

.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(139, 30, 30, 0.18);
  border: 1px solid rgba(139, 30, 30, 0.4);
  color: #fbbf24;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.chip-remove {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
}

.profile-header-section {
  display: grid;
  gap: 12px;
}

.accusations-heading {
  font-size: 1rem;
  color: var(--text);
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.btn {
  border: 1px solid var(--border);
  background: transparent;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  font-weight: 500;
}

.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: #f5f2ee;
}

.list {
  display: grid;
  gap: 8px;
}

.list-item {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(31, 41, 55, 0.65);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.list-item-content {
  flex: 1;
  min-width: 0;
}

.btn-delete {
  background: none;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.6);
}

.form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

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

.error {
  color: #fca5a5;
  font-size: 0.85rem;
}

.mentioned-names-section {
  margin-top: 8px;
  width: 100%;
}

.mentioned-names-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.mentioned-name-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.mentioned-name-text {
  font-size: 0.85rem;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.mentioned-role-select {
  font-family: "Inter", sans-serif;
  font-size: 0.78rem;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 6px;
  cursor: pointer;
  min-width: 100px;
}

.mentioned-role-select:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}

.form-mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.form-mode-header h2 {
  margin: 0;
}

.list-item {
  cursor: pointer;
  transition: border-color 0.15s;
}

.list-item:hover {
  border-color: var(--accent);
}

.list-item-active {
  border-color: var(--accent) !important;
  background: rgba(139, 30, 30, 0.08);
}

.list-item-content {
  flex: 1;
  min-width: 0;
}

.list-item-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.indictment-action-card .accusation-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.indictment-action-card .remove-ind-action {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
}

#indictment-actions-container {
  display: grid;
  gap: 12px;
}

#add-indictment-action {
  margin-top: 4px;
}

@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .form-row {
    flex-direction: column;
  }
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row > label {
  flex: 1;
}
