@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Rajdhani:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg-primary: #050a0e;
  --bg-secondary: #0a1520;
  --bg-card: #0d1f2d;
  --bg-input: #071219;
  --bg-hover: #122030;
  --green-bright: #00ff88;
  --green-mid: #00cc6a;
  --green-dim: #007a40;
  --green-glow: rgba(0, 255, 136, 0.15);
  --green-border: rgba(0, 255, 136, 0.3);
  --blue-accent: #0088ff;
  --blue-dim: #004b8c;
  --danger-red: #ff3b5c;
  --warning-orange: #ff9500;
  --text-primary: #e0f0e8;
  --text-secondary: #7a9e8a;
  --text-muted: #3a5a48;
  --border-subtle: rgba(0, 255, 136, 0.1);
  --border-active: rgba(0, 255, 136, 0.4);
  --font-mono: 'Share Tech Mono', monospace;
  --font-display: 'Rajdhani', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: 0.2s ease;
  --glow-green: 0 0 20px rgba(0, 255, 136, 0.2);
  --sidebar-width: 240px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--green-dim);
  border-radius: 3px;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 255, 136, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 136, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

a {
  color: var(--green-bright);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--green-mid);
}

/* AUTH */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  box-shadow: var(--glow-green), 0 24px 48px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--green-bright), transparent);
  animation: scanline 3s linear infinite;
}

@keyframes scanline {

  0%,
  100% {
    opacity: 0.4;
  }

  50% {
    opacity: 1;
  }
}

.auth-logo {
  text-align: center;
  margin-bottom: 36px;
}

.auth-logo .shield-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 12px var(--green-bright));
}

.auth-logo h1 {
  font-size: 22px;
  color: var(--green-bright);
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
  letter-spacing: 0.12em;
}

.auth-logo p {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
  letter-spacing: 0.08em;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 28px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.auth-tab.active {
  color: var(--green-bright);
  border-bottom-color: var(--green-bright);
}

.auth-tab:hover:not(.active) {
  color: var(--text-primary);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px var(--green-glow);
  background: var(--bg-secondary);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 13px;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
}

.checkbox-label input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--green-dim);
  border-radius: 3px;
  background: var(--bg-input);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked {
  background: var(--green-mid);
  border-color: var(--green-bright);
}

.checkbox-label input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: -1px;
  left: 2px;
  font-size: 12px;
  color: var(--bg-primary);
  font-weight: bold;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--green-mid), var(--green-dim));
  color: var(--bg-primary);
  box-shadow: 0 4px 16px rgba(0, 204, 106, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--green-bright), var(--green-mid));
  box-shadow: 0 4px 24px rgba(0, 255, 136, 0.5);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  border-color: var(--green-border);
  background: var(--green-glow);
}

.form-message {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  margin-bottom: 16px;
  display: none;
}

.form-message.error {
  background: rgba(255, 59, 92, 0.1);
  border: 1px solid rgba(255, 59, 92, 0.3);
  color: var(--danger-red);
  display: block;
}

.form-message.success {
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid var(--green-border);
  color: var(--green-bright);
  display: block;
}

/* APP LAYOUT */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Hamburger */
.hamburger {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 700;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--green-bright);
  border-radius: 2px;
  transition: var(--transition);
}

/* Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    z-index: 500;
    pointer-events: none;
}

.sidebar-overlay.open {
    display: block;
    pointer-events: auto;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 9999;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--green-bright);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  margin-top: 4px;
  padding-left: 30px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
  text-decoration: none;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-item.active {
  color: var(--green-bright);
  background: var(--green-glow);
  border-left-color: var(--green-bright);
}

.nav-icon {
  font-size: 18px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--green-mid), var(--blue-accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--bg-primary);
  flex-shrink: 0;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--green-mid);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.btn-logout {
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px solid rgba(255, 59, 92, 0.2);
  border-radius: var(--radius-sm);
  color: var(--danger-red);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.05em;
}

.btn-logout:hover {
  background: rgba(255, 59, 92, 0.1);
  border-color: var(--danger-red);
}

/* MAIN */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 32px;
  min-width: 0;
}

.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: 26px;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.page-subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.status-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-bright);
  box-shadow: 0 0 6px var(--green-bright);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

.status-dot.inactive {
  background: var(--text-muted);
  box-shadow: none;
  animation: none;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  flex-wrap: wrap;
  gap: 8px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-title .icon {
  color: var(--green-bright);
}

.panel-body {
  padding: 20px;
}

.log-input-area {
  width: 100%;
  min-height: 200px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  color: var(--green-bright);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  outline: none;
  resize: vertical;
  transition: var(--transition);
}

.log-input-area:focus {
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.log-input-area::placeholder {
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.input-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.input-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.btn-analyze {
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--green-mid), var(--blue-dim));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0, 204, 106, 0.3);
  white-space: nowrap;
}

.btn-analyze:hover {
  background: linear-gradient(135deg, var(--green-bright), var(--blue-accent));
  box-shadow: 0 4px 30px rgba(0, 255, 136, 0.5);
  transform: translateY(-1px);
  color: var(--bg-primary);
}

.btn-analyze:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.result-panel {
  display: none;
}

.result-panel.visible {
  display: block;
}

.threat-score-section {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.score-circle {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.score-circle svg {
  transform: rotate(-90deg);
}

.score-circle .score-track {
  fill: none;
  stroke: var(--bg-input);
  stroke-width: 8;
}

.score-circle .score-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 1.2s ease, stroke 0.5s ease;
}

.score-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
}

.score-number {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

.score-label {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.score-info {
  flex: 1;
  min-width: 180px;
}

.score-summary {
  font-size: 13px;
  color: var(--text-secondary);
}

.threat-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.badge-safe {
  background: rgba(0, 255, 136, 0.1);
  color: #00ff88;
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.badge-low {
  background: rgba(0, 136, 255, 0.1);
  color: #0088ff;
  border: 1px solid rgba(0, 136, 255, 0.3);
}

.badge-medium {
  background: rgba(255, 149, 0, 0.1);
  color: #ff9500;
  border: 1px solid rgba(255, 149, 0, 0.3);
}

.badge-high {
  background: rgba(255, 59, 92, 0.1);
  color: #ff3b5c;
  border: 1px solid rgba(255, 59, 92, 0.3);
}

.badge-critical {
  background: rgba(255, 59, 92, 0.2);
  color: #ff0033;
  border: 1px solid #ff0033;
  animation: flicker 1.5s ease-in-out infinite;
}

@keyframes flicker {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border-subtle);
}

.analysis-card {
  background: var(--bg-card);
  padding: 20px;
}

.analysis-card.full-width {
  grid-column: 1 / -1;
}

.card-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--green-mid);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-label::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 1px;
  background: var(--green-mid);
}

.card-content {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.7;
}

.card-content .highlight {
  color: var(--green-bright);
  font-family: var(--font-mono);
  font-size: 12px;
}

.rec-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rec-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-primary);
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--green-dim);
}

.rec-list li::before {
  content: '▸';
  color: var(--green-bright);
  flex-shrink: 0;
  margin-top: 1px;
}

/* HISTORY */
.history-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-input {
  flex: 1;
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

.filter-input:focus {
  border-color: var(--green-mid);
}

.filter-input::placeholder {
  color: var(--text-muted);
}

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.filter-select option {
  background: var(--bg-card);
}

.history-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 560px;
}

.history-table th {
  text-align: left;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--green-mid);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  white-space: nowrap;
}

.history-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  color: var(--text-secondary);
}

.history-table tr:hover td {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.log-preview {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  min-width: 40px;
  text-align: center;
  white-space: nowrap;
}

.btn-view {
  padding: 5px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--green-bright);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-view:hover {
  background: var(--green-glow);
  border-color: var(--green-border);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.page-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.page-btn.active,
.page-btn:hover {
  background: var(--green-glow);
  border-color: var(--green-border);
  color: var(--green-bright);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 14, 0.85);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--glow-green), 0 32px 64px rgba(0, 0, 0, 0.8);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
  gap: 12px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--green-bright);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.btn-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-close:hover {
  background: rgba(255, 59, 92, 0.1);
  border-color: var(--danger-red);
  color: var(--danger-red);
}

.modal-body {
  padding: 20px;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-title {
  font-family: var(--font-display);
  font-size: 16px;
  margin-bottom: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.empty-sub {
  font-family: var(--font-mono);
  font-size: 12px;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--green-bright);
  box-shadow: var(--glow-green);
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: calc(100vw - 40px);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  color: var(--danger-red);
  border-color: rgba(255, 59, 92, 0.4);
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
  .sidebar {
    position: fixed;
    z-index: 9999;
}

.sidebar * {
    pointer-events: auto;
}

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.6);
}

  .main-content {
    margin-left: 0;
    padding: 16px;
    padding-top: 72px;
  }

  .page-title {
    font-size: 20px;
  }

  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .analysis-card.full-width {
    grid-column: 1;
  }

  .auth-card {
    padding: 32px 20px;
  }

  .threat-score-section {
    flex-direction: column;
    align-items: flex-start;
  }

  .input-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-analyze {
    width: 100%;
    justify-content: center;
  }

  .history-filters {
    flex-direction: column;
  }

  .filter-input,
  .filter-select {
    width: 100%;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-pill {
    font-size: 10px;
    padding: 5px 10px;
  }

  .toast {
    right: 12px;
    bottom: 12px;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 12px;
    padding-top: 68px;
  }

  .auth-card {
    padding: 24px 16px;
  }

  .auth-logo .shield-icon {
    font-size: 36px;
  }

  .auth-logo h1 {
    font-size: 17px;
  }

  .page-title {
    font-size: 17px;
  }

  .score-number {
    font-size: 22px;
  }

  .card-content {
    font-size: 12px;
  }

  .rec-list li {
    font-size: 12px;
  }

  .history-table {
    min-width: 480px;
  }

  .log-preview {
    max-width: 110px;
  }


  .sidebar,
.sidebar * {
    pointer-events: auto !important;
}

.sidebar-overlay {
    pointer-events: none !important;
}

.sidebar-overlay.open {
    pointer-events: none !important;
}
}

.upload-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.upload-divider::before,
.upload-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.upload-divider span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.upload-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  background: var(--bg-input);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.upload-info h3 {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-primary);
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.upload-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  max-width: 360px;
}

.upload-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.file-input-label {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-input-label:hover {
  border-color: var(--green-border);
  color: var(--text-primary);
}

.file-input-label.has-file {
  color: var(--green-bright);
  border-color: var(--green-border);
}

.batch-results {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.batch-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.batch-result-item {
  border-bottom: 1px solid var(--border-subtle);
}

.batch-result-item:last-child {
  border-bottom: none;
}

.batch-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  transition: var(--transition);
  gap: 12px;
  flex-wrap: wrap;
}

.batch-result-header:hover {
  background: var(--bg-hover);
}

.batch-result-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.batch-result-line {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.batch-result-preview {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-result-body {
  display: none;
  padding: 0 20px 20px;
}

.batch-result-body.open {
  display: block;
}

.batch-result-error {
  padding: 14px 20px;
  color: var(--danger-red);
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(255, 59, 92, 0.05);
}

.btn-delete-account {
  margin-top: 8px;
  background: transparent;
  border: 1px solid #ff4d4d;
  color: #ff4d4d;
}
.btn-delete-account:hover {
  background: rgba(255, 77, 77, 0.1);
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay.hidden {
  display: none;
}
.modal-box {
  background: var(--bg-panel, #0d1a12);
  border: 1px solid var(--border-color, #1f3d2b);
  border-radius: 10px;
  padding: 28px;
  width: 90%;
  max-width: 400px;
}
.modal-title {
  color: #ff4d4d;
  margin-bottom: 10px;
}
.modal-text {
  color: var(--text-secondary, #a0aab0);
  font-size: 14px;
  margin-bottom: 18px;
}
.modal-input {
  width: 100%;
  padding: 10px;
  margin-bottom: 18px;
  background: #08120c;
  border: 1px solid var(--border-color, #1f3d2b);
  border-radius: 6px;
  color: #fff;
  font-family: var(--font-mono);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}


#delete-modal:not(.hidden) {
  opacity: 1;
  pointer-events: all;
}