* {
  box-sizing: border-box;
}

:root {
  --bg: #0b1426;
  --bg-soft: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.92);
  --bg-card-2: rgba(30, 41, 59, 0.98);
  --line: rgba(148, 163, 184, 0.2);
  --line-strong: #475569;
  --text: #f1f5f9;
  --muted: #cbd5f1;
  --blue: #3b82f6;
  --blue-2: #2563eb;
  --green-bg: #14532d;
  --green-text: #bbf7d0;
  --amber-bg: #78350f;
  --amber-text: #fde68a;
  --red-bg: #7f1d1d;
  --red-text: #fecaca;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: Inter, Arial, sans-serif;
  background: radial-gradient(circle at top, #1e3a8a 0%, #1e293b 50%, #0b1426 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: min(520px, 100%);
  background: var(--bg-card-2);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
}

.auth-brand {
  margin-bottom: 18px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 300px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
  border-right: 1px solid var(--line-strong);
  padding: 22px;
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.brand-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.35);
  flex-shrink: 0;
}

.logo {
  font-weight: 700;
  line-height: 1.2;
}

.logo .title {
  font-size: 18px;
  color: #ffffff;
}

.logo .subtitle {
  font-size: 12px;
  color: #dbeafe;
  font-weight: 500;
}

.logo .dept {
  font-size: 12px;
  color: #93c5fd;
  font-weight: 600;
}

.session-card {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.55);
}

.session-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #93c5fd;
  margin-bottom: 8px;
}

.session-form {
  margin-top: 10px;
}

.session-btn {
  width: 100%;
}

.main-content {
  flex: 1;
  padding: 26px;
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

h1,
h2,
h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

p {
  line-height: 1.45;
}

.section-intro {
  margin-top: 0;
  margin-bottom: 14px;
  color: var(--muted);
  max-width: 900px;
}

.badge {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: white;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.35);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: 1fr 1fr;
}

.grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.grid.four {
  grid-template-columns: repeat(4, 1fr);
}

.full {
  grid-column: 1 / -1;
}

.field {
  margin-bottom: 14px;
}

label {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
  color: #f1f5f9;
}

input,
textarea,
select,
button {
  font-size: 14px;
  border-radius: 12px;
  font-family: inherit;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 13px;
  background: #334155;
  color: #ffffff;
  border: 1px solid #64748b;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.2);
}

textarea {
  resize: vertical;
}

button {
  padding: 12px 16px;
  border: none;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.05s ease, filter 0.15s ease;
}

button:hover {
  filter: brightness(1.08);
}

button:active {
  transform: translateY(1px);
}

button.secondary {
  background: #475569;
}

button.secondary:hover {
  background: #64748b;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 16px 0;
}

.notice {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}

.notice.error {
  background: rgba(127, 29, 29, 0.28);
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.35);
}

.notice.success {
  background: rgba(20, 83, 45, 0.28);
  color: #bbf7d0;
  border-color: rgba(74, 222, 128, 0.35);
}

.court-prep-import-row {
  margin: 0;
}

.nav-btn {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: none;
  border-radius: 14px;
  margin-bottom: 10px;
  background: rgba(51, 65, 85, 0.95);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

.nav-btn.active,
.nav-btn:hover {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
}

.directory-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.directory-item {
  background: #1e293b;
  border: 1px solid #64748b;
  border-radius: 14px;
  padding: 14px;
}

.directory-item strong {
  display: inline-block;
  margin-bottom: 4px;
}

.small-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.person-card,
.vehicle-card {
  background: rgba(30, 41, 59, 0.96);
  border: 1px solid #64748b;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
}

.alert-box,
.vehicle-alert-box {
  background: linear-gradient(135deg, #3f1d1d, #551b1b);
  border: 1px solid #991b1b;
  color: #fecaca;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.analysis-box {
  background: #1e293b;
  border: 1px solid #64748b;
  border-radius: 14px;
  padding: 14px;
  min-height: 80px;
}

.compact-box {
  min-height: 0;
  margin-bottom: 14px;
}

.empty-state {
  text-align: left;
}

.empty-state strong {
  display: inline-block;
  margin-bottom: 4px;
}

.dashboard-brief-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
}

.dashboard-brief-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.dashboard-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.dashboard-quick-actions button {
  padding: 10px 12px;
}

.intel-block {
  margin-bottom: 16px;
}

.intel-item {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid #64748b;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 10px;
  word-break: break-word;
}

.case-builder-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.warrant-source-grid {
  align-items: end;
}

.warrant-affidavit-textarea {
  min-height: 420px;
  font-family: "Courier New", monospace;
  line-height: 1.55;
}

.stat-card {
  background: rgba(30, 41, 59, 0.96);
  border: 1px solid #64748b;
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}

.stat-num {
  font-size: 28px;
  font-weight: 800;
  color: #93c5fd;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.tag {
  display: inline-block;
  padding: 4px 8px;
  margin: 2px 4px 2px 0;
  border-radius: 999px;
  font-size: 12px;
  background: #475569;
  color: #e2e8f0;
  vertical-align: middle;
}

.tag.good {
  background: var(--green-bg);
  color: var(--green-text);
}

.tag.warn {
  background: var(--amber-bg);
  color: var(--amber-text);
}

.tag.danger {
  background: var(--red-bg);
  color: var(--red-text);
}

.legacy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.legacy-warning-item input {
  width: 100%;
}

.hidden {
  display: none;
}

hr {
  border: none;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  margin: 14px 0;
}

pre {
  overflow-x: auto;
  background: rgba(15, 23, 42, 0.9);
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #64748b;
  color: #e2e8f0;
}

ul {
  margin-top: 8px;
  margin-bottom: 8px;
}

@media (max-width: 1100px) {
  .grid.four,
  .legacy-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .grid.two,
  .grid.three,
  .grid.four,
  .legacy-grid,
  .dashboard-brief-grid {
    grid-template-columns: 1fr;
  }

  .main-content {
    padding: 14px;
  }

  .card-head {
    align-items: flex-start;
  }
}
#my-reports .grid.two .field {
  margin-bottom: 10px;
}
