/* ============================================================
   Intel Portal — Executive Briefing Stylesheet
   ============================================================ */

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

:root {
  --bg-dark: #0a0a0f;
  --bg-panel: #0f1117;
  --bg-card: #111318;
  --bg-card-elevated: #161922;
  --bg-hover: #1c1f28;
  --border: rgba(52, 211, 153, 0.12);
  --border-light: rgba(52, 211, 153, 0.2);
  --accent: #34d399;
  --accent-glow: rgba(52, 211, 153, 0.15);
  --accent-hover: #10b981;
  --gold: #d4a853;
  --gold-glow: rgba(212, 168, 83, 0.1);
  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --danger: #ef4444;
  --success: #34d399;
  --warning: #fbbf24;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", monospace;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-elevated: 0 8px 40px rgba(0, 0, 0, 0.5);
}

body {
  font-family: var(--font-sans);
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---- LOGIN PAGE ---- */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(52, 211, 153, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(212, 168, 83, 0.03) 0%, transparent 50%),
    linear-gradient(180deg, #060a12 0%, #0c1220 100%);
}

.login-container {
  width: 100%;
  max-width: 440px;
  padding: 3rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-elevated);
}

.login-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.shield-icon {
  font-size: 3.5rem;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 0 12px rgba(52, 211, 153, 0.3));
}

.login-header h1 {
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  font-weight: 700;
  color: var(--text-primary);
}

.subtitle {
  color: var(--gold);
  font-size: 0.8rem;
  margin-top: 0.35rem;
  letter-spacing: 0.1em;
  font-weight: 500;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.form-group input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-sans);
  transition: all 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.error-msg {
  background: rgba(240, 68, 68, 0.08);
  color: var(--danger);
  border: 1px solid rgba(240, 68, 68, 0.25);
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  text-align: center;
}

.btn-login {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(52, 211, 153, 0.25);
}

.btn-login:hover {
  box-shadow: 0 6px 24px rgba(52, 211, 153, 0.35);
  transform: translateY(-1px);
}

.security-notice {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* ---- TOPBAR ---- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.nav-shield {
  font-size: 1.3rem;
  filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.3));
}

.nav-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.topbar-tab {
  padding: 0.45rem 1.2rem;
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 4px;
  transition: all 0.2s;
}
.topbar-tab:hover {
  color: var(--text-primary);
  background: rgba(52, 211, 153, 0.06);
}
.topbar-tab.active {
  color: var(--accent);
  background: rgba(52, 211, 153, 0.12);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.user-display {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.btn-logout {
  padding: 0.4rem 1rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* ---- DASHBOARD LAYOUT ---- */

.dashboard-body {
  display: flex;
  flex-direction: column;
}

.dashboard-layout {
  display: flex;
  height: calc(100vh - 60px);
}

/* ---- SIDEBAR ---- */

.sidebar {
  width: 320px;
  min-width: 280px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.search-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: var(--font-sans);
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.report-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

.report-item {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.report-item:hover {
  background: var(--bg-hover);
}

.report-item.active {
  background: var(--bg-card);
  border-left-color: var(--accent);
  box-shadow: inset 0 0 20px rgba(52, 211, 153, 0.03);
}

.report-item-passport {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.report-item-name {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 0.15rem;
  color: var(--text-primary);
}

.report-item-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.report-item-classification {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-top: 0.4rem;
}

.classification-top-secret {
  background: rgba(240, 68, 68, 0.12);
  color: var(--danger);
  border: 1px solid rgba(240, 68, 68, 0.25);
}

.classification-secret {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.classification-confidential {
  background: rgba(52, 211, 153, 0.12);
  color: var(--accent);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

/* ---- REPORT VIEWER ---- */

.report-viewer {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(52, 211, 153, 0.02) 0%, transparent 60%),
    var(--bg-dark);
  scroll-behavior: smooth;
}

.report-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
}

.placeholder-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.25;
}

.report-placeholder h2 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.report-placeholder p {
  font-size: 0.85rem;
}

.report-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.5rem 2.5rem 3rem;
}

/* ---- REPORT HEADER BANNER ---- */

.report-header-banner {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-elevated) 100%);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.report-header-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--accent));
  opacity: 0.7;
}

.report-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.report-title-block h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  letter-spacing: -0.01em;
}

.report-title-id {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.report-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.report-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.meta-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 600;
}

.meta-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 600;
}

.meta-value.mono {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
}

/* ---- REPORT BODY (Markdown) ---- */

.report-body-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 2.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
  line-height: 1.8;
}

.report-body-section h1, .report-body-section h2, .report-body-section h3 {
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.report-body-section h1:first-child { margin-top: 0; }

.report-body-section p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.report-body-section ul, .report-body-section ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.report-body-section li { margin-bottom: 0.35rem; }
.report-body-section strong { color: var(--text-primary); }

.report-body-section code {
  font-family: var(--font-mono);
  background: var(--bg-dark);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
}

.report-body-section blockquote {
  border-left: 3px solid var(--accent);
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  background: var(--accent-glow);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
}

.report-body-section table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.report-body-section th, .report-body-section td {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
  font-size: 0.85rem;
}

.report-body-section th {
  background: var(--bg-dark);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* ---- DOCUMENT VIEWER (auto-expanded) ---- */

.documents-section {
  margin-bottom: 1.5rem;
}

.documents-section-header {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.documents-section-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.document-embed {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
}

.document-embed-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-card-elevated);
  border-bottom: 1px solid var(--border);
}

.document-embed-icon {
  font-size: 1.1rem;
  opacity: 0.7;
}

.document-embed-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  flex: 1;
}

.document-embed-size {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.document-embed-body {
  background: var(--bg-dark);
}

.document-embed-body iframe {
  width: 100%;
  height: 800px;
  border: none;
  display: block;
}

.document-embed-body img {
  max-width: 100%;
  display: block;
}

.document-embed-body pre {
  padding: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
  margin: 0;
  background: var(--bg-dark);
  line-height: 1.6;
}

/* ---- SIDEBAR FOOTER ---- */

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.btn-upload {
  width: 100%;
  padding: 0.7rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.2s;
  box-shadow: 0 2px 12px rgba(52, 211, 153, 0.2);
}

.btn-upload:hover {
  box-shadow: 0 4px 20px rgba(52, 211, 153, 0.3);
  transform: translateY(-1px);
}

/* ---- BUTTONS ---- */

.btn-action {
  padding: 0.45rem 1rem;
  background: var(--bg-card-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.2s;
}

.btn-action:hover {
  color: var(--text-primary);
  border-color: var(--accent);
  background: var(--accent-glow);
}

.btn-delete {
  padding: 0.45rem 1rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.2s;
}

.btn-delete:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(240, 68, 68, 0.08);
}

/* ---- MODAL ---- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: var(--shadow-elevated);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h2 {
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

.modal-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem 0.6rem;
  line-height: 1;
  border-radius: 6px;
  transition: all 0.2s;
}

.modal-close:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(240, 68, 68, 0.08);
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-sans);
}

.modal select:focus {
  outline: none;
  border-color: var(--accent);
}

.modal textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-mono);
  resize: vertical;
  line-height: 1.5;
}

.modal textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.btn-cancel {
  padding: 0.7rem 1.5rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancel:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.modal-actions .btn-login {
  width: auto;
  padding: 0.7rem 2rem;
}

/* ---- DROP ZONE ---- */

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.drop-zone-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.drop-icon { font-size: 2rem; opacity: 0.5; }

.drop-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.file-list {
  list-style: none;
  margin-top: 0.75rem;
}

.file-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.file-list-item .file-name {
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.file-list-item .file-size {
  color: var(--text-muted);
  font-size: 0.72rem;
  margin: 0 0.75rem;
  white-space: nowrap;
}

.file-list-item .file-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 0.25rem;
}

.file-list-item .file-remove:hover {
  color: var(--danger);
}

/* ---- DELETE CONFIRM MODAL ---- */

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.confirm-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-elevated);
}

.confirm-box h3 {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.confirm-box p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn-confirm-delete {
  padding: 0.6rem 1.5rem;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-confirm-delete:hover {
  background: #dc2626;
  box-shadow: 0 4px 16px rgba(240, 68, 68, 0.3);
}

/* ---- MAP ---- */

.map-section {
  margin-bottom: 1.5rem;
}

.map-coords {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  letter-spacing: 0.03em;
}

.map-container {
  height: 400px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

/* Fix Leaflet tiles in dark theme */
.map-container .leaflet-control-attribution {
  background: rgba(0, 0, 0, 0.6) !important;
  color: var(--text-muted) !important;
  font-size: 0.6rem;
}

.map-container .leaflet-control-attribution a {
  color: var(--text-secondary) !important;
}

/* ---- Hidden attribute overrides (required when CSS sets display) ---- */

[hidden] {
  display: none !important;
}

/* ---- SITE FOOTER ---- */
.site-footer {
  text-align: center;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}
.site-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.site-footer a:hover {
  text-decoration: underline;
}

/* ---- PRINT STYLES ---- */

@media print {
  body, .dashboard-body {
    background: #fff !important;
    color: #1a1a2e !important;
  }

  .topbar, .sidebar, .report-placeholder,
  .report-header-actions, .btn-delete, .btn-action {
    display: none !important;
  }

  .dashboard-layout {
    display: block !important;
    height: auto !important;
  }

  .report-viewer {
    overflow: visible !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .report-content {
    max-width: 100% !important;
    padding: 0 !important;
  }

  .report-header-banner {
    background: #fff !important;
    border: 2px solid #ddd !important;
    box-shadow: none !important;
    color: #1a1a2e !important;
  }

  .report-header-banner::before {
    background: #333 !important;
  }

  .report-title-block h1 {
    color: #1a1a2e !important;
  }

  .report-title-id {
    color: #666 !important;
  }

  .meta-label {
    color: #888 !important;
  }

  .meta-value {
    color: #1a1a2e !important;
  }

  .meta-value.mono {
    color: #2563eb !important;
  }

  .report-meta-grid {
    border-top-color: #ddd !important;
  }

  .report-item-classification {
    border-color: #999 !important;
    background: transparent !important;
    color: #333 !important;
  }

  .report-body-section {
    background: #fff !important;
    border-color: #ddd !important;
    box-shadow: none !important;
    color: #333 !important;
  }

  .report-body-section p, .report-body-section li {
    color: #444 !important;
  }

  .report-body-section strong {
    color: #1a1a2e !important;
  }

  .report-body-section th {
    background: #f5f5f5 !important;
    color: #666 !important;
  }

  .report-body-section th, .report-body-section td {
    border-color: #ddd !important;
  }

  .report-body-section blockquote {
    background: #f0f4ff !important;
    border-left-color: #2563eb !important;
    color: #444 !important;
  }

  .report-body-section h1, .report-body-section h2, .report-body-section h3 {
    color: #1a1a2e !important;
    border-bottom-color: #ddd !important;
  }

  .document-embed {
    border-color: #ddd !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  .document-embed-header {
    background: #f5f5f5 !important;
    border-bottom-color: #ddd !important;
    color: #1a1a2e !important;
  }

  .document-embed-body {
    background: #fff !important;
  }

  .document-embed-body canvas {
    max-width: 100% !important;
    height: auto !important;
  }

  .documents-section-header {
    color: #888 !important;
  }

  .documents-section-header::after {
    background: #ddd !important;
  }

  .map-section {
    page-break-inside: avoid;
  }

  .map-container {
    border-color: #ddd !important;
  }

  .map-coords {
    color: #2563eb !important;
  }
}

/* ---- RESPONSIVE ---- */

@media (max-width: 768px) {
  .dashboard-layout {
    flex-direction: column;
    height: auto;
  }

  .sidebar {
    width: 100%;
    min-width: unset;
    max-height: 35vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .report-viewer {
    min-height: 65vh;
  }

  .report-content {
    padding: 1rem;
  }

  .login-container {
    margin: 1rem;
  }

  .report-meta-grid {
    grid-template-columns: 1fr 1fr;
  }

  .report-header-top {
    flex-direction: column;
    gap: 1rem;
  }

  .admin-layout {
    flex-direction: column;
  }

  .admin-panel {
    min-width: unset;
  }

  .admin-filters {
    flex-wrap: wrap;
  }

  .admin-form-row {
    grid-template-columns: 1fr;
  }
}

/* ---- ADMIN PAGE ---- */

.admin-layout {
  display: flex;
  height: calc(100vh - 60px);
  gap: 0;
}

.admin-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border);
}

.admin-panel:last-child {
  border-right: none;
}

.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}

.admin-panel-header h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  font-weight: 600;
}

.admin-add-user {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 0.7fr auto;
  gap: 1rem;
  align-items: end;
}

.admin-msg {
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: center;
}

.admin-msg-error {
  background: rgba(240, 68, 68, 0.08);
  color: var(--danger);
  border: 1px solid rgba(240, 68, 68, 0.25);
}

.admin-msg-success {
  background: rgba(52, 211, 153, 0.08);
  color: var(--accent);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  flex: 1;
  overflow-y: auto;
  display: block;
}

.admin-table thead {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.admin-table tbody {
  display: block;
  overflow-y: auto;
  max-height: calc(100vh - 320px);
  width: 100%;
}

.admin-table tbody tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.admin-table th {
  padding: 0.75rem 1.5rem;
  text-align: left;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 0.75rem 1.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.admin-table tr:hover td {
  background: var(--bg-hover);
}

.admin-role-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.admin-role-admin {
  background: rgba(240, 68, 68, 0.12);
  color: var(--danger);
  border: 1px solid rgba(240, 68, 68, 0.25);
}

.admin-role-analyst {
  background: rgba(52, 211, 153, 0.12);
  color: var(--accent);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

/* ---- Activity Feed ---- */

.admin-filters {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  align-items: end;
}

.admin-filters .form-group {
  margin-bottom: 0;
  flex: 1;
  min-width: 100px;
}

.admin-filters select,
.admin-filters input[type="date"] {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: var(--font-sans);
}

.admin-filters select:focus,
.admin-filters input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
}

.admin-activity-feed {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.admin-activity-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.admin-activity-item:hover {
  background: var(--bg-hover);
}

.admin-action-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  white-space: nowrap;
  min-width: 80px;
  text-align: center;
}

.admin-action-login {
  background: rgba(52, 211, 153, 0.12);
  color: var(--accent);
}

.admin-action-logout {
  background: rgba(107, 114, 128, 0.15);
  color: var(--text-muted);
}

.admin-action-view {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
}

.admin-action-create {
  background: rgba(52, 211, 153, 0.12);
  color: var(--accent);
}

.admin-action-edit {
  background: rgba(251, 191, 36, 0.12);
  color: var(--warning);
}

.admin-action-delete {
  background: rgba(240, 68, 68, 0.12);
  color: var(--danger);
}

.admin-action-export {
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
}

.admin-action-search {
  background: rgba(212, 168, 83, 0.10);
  color: var(--gold);
}

.admin-action-default {
  background: rgba(107, 114, 128, 0.1);
  color: var(--text-muted);
}

.admin-activity-user {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 80px;
}

.admin-activity-details {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-activity-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: var(--font-mono);
}
