/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.5rem 1.125rem;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.2;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 250ms var(--spring);
  white-space: nowrap;
  user-select: none;
  letter-spacing: -0.01em;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.30);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover:not(:disabled) {
  background: #FF6259;
  box-shadow: 0 4px 12px rgba(255, 69, 58, 0.25);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: var(--text-base);
}

.btn-block {
  width: 100%;
}

/* === INPUTS === */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0;
}

.input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
}

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

.input:focus {
  background: var(--bg-card);
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.input-error {
  border-color: var(--danger) !important;
}

.input-search {
  padding-left: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2355555E' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.875rem center;
}

/* === APP HEADER — Dark Glass === */
.app-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: rgba(10, 10, 15, 0.82);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: var(--text-lg);
  cursor: pointer;
  transition: all 250ms var(--spring);
  text-decoration: none;
  flex-shrink: 0;
}

.app-header__back:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.05);
}

.app-header__title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.app-header__subtitle {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 400;
}

.app-header__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* === CARDS — Subtle glass on dark === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: all 300ms var(--spring);
}

.card:hover {
  border-color: var(--border-hover);
}

.card--interactive {
  cursor: pointer;
}

.card--interactive:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.card--expandable .card__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow), padding var(--transition-slow);
  padding-top: 0;
}

.card--expandable.card--expanded .card__body {
  max-height: 2000px;
  padding-top: var(--space-md);
}

.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
}

.card__title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card__description {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-xs);
  line-height: 1.5;
}

.card__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all 250ms var(--spring);
  flex-shrink: 0;
}

.card__toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.card--expanded .card__toggle {
  transform: rotate(180deg);
}

.card__footer {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 0.5px solid var(--border);
  flex-wrap: wrap;
}

/* === TAGS / CHIPS === */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: none;
  white-space: nowrap;
  transition: all var(--transition-fast);
  letter-spacing: 0;
}

.tag--accent {
  background: var(--accent-glow);
  color: var(--accent);
}

.tag--success {
  background: rgba(48, 209, 88, 0.12);
  color: var(--success);
}

.tag--warning {
  background: rgba(255, 214, 10, 0.12);
  color: var(--warning);
}

.tag--danger {
  background: rgba(255, 69, 58, 0.12);
  color: var(--danger);
}

.tag--info {
  background: rgba(100, 210, 255, 0.12);
  color: var(--info);
}

.tag--clickable {
  cursor: pointer;
}

.tag--clickable:hover {
  filter: brightness(1.1);
  transform: scale(1.03);
}

.tag--active {
  background: var(--accent);
  color: white;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

/* === MODAL — Dark overlay === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  padding: var(--space-lg);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(0.96) translateY(10px);
  transition: transform 400ms var(--spring);
  box-shadow: var(--shadow-xl);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 0.5px solid var(--border);
}

.modal__title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.modal__close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 250ms var(--spring);
  font-size: var(--text-sm);
}

.modal__close:hover {
  background: rgba(255, 255, 255, 0.10);
  color: var(--text-primary);
  transform: scale(1.1);
}

.modal__body {
  padding: var(--space-lg);
}

.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-lg);
  border-top: 0.5px solid var(--border);
}

/* === GRID === */
.grid {
  display: grid;
  gap: var(--space-md);
}

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

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

/* === DASHBOARD APP TILE === */
.app-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  cursor: pointer;
  transition: all 350ms var(--spring);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  box-shadow: none;
}

.app-tile:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.app-tile__icon {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
}

.app-tile__icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-tile__name {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.app-tile__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

.app-tile__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: auto;
  padding-top: var(--space-sm);
}

/* === AUTH PAGE === */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background: var(--bg-primary);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-lg);
  animation: slideUp 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-card__logo {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-card__logo-icon {
  font-size: 2.75rem;
  margin-bottom: var(--space-sm);
}

.auth-card__logo-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.auth-card__logo-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-xs);
  font-weight: 400;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.auth-error {
  padding: var(--space-sm) var(--space-md);
  background: var(--critical-bg);
  border: none;
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: var(--text-sm);
  display: none;
}

.auth-error.visible {
  display: block;
}

/* === STAT CARDS === */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  box-shadow: none;
}

.stat-card__icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.stat-card__value {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.stat-card__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* === KANBAN === */
.kanban {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  padding-bottom: var(--space-md);
  min-height: 400px;
}

.kanban-column {
  min-width: 300px;
  max-width: 340px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.kanban-column__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  position: sticky;
  top: 0;
}

.kanban-column__title {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.kanban-column__count {
  font-size: var(--text-xs);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  padding: 0.125rem 0.45rem;
  border-radius: 9999px;
  font-weight: 600;
}

.kanban-column__items {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  flex: 1;
}

@media (max-width: 768px) {
  .kanban {
    flex-direction: column;
  }
  .kanban-column {
    min-width: 100%;
    max-width: 100%;
  }
}

/* === FINDINGS LIST === */
.finding {
  padding: var(--space-md);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--border);
}

.finding--high { border-left-color: var(--success); }
.finding--medium { border-left-color: var(--warning); }
.finding--low { border-left-color: var(--danger); }

.finding__text {
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.6;
}

.finding__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  font-size: var(--text-xs);
  color: var(--text-muted);
  flex-wrap: wrap;
}

.finding__source {
  color: var(--accent);
  text-decoration: none;
}

.finding__source:hover {
  text-decoration: underline;
}

/* === PRIORITY BADGES === */
.priority {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: none;
}

.priority--critical {
  background: var(--critical-bg);
  color: var(--danger);
}

.priority--high {
  background: var(--high-bg);
  color: var(--warning);
}

.priority--medium {
  background: var(--medium-bg);
  color: var(--info);
}

.priority--low {
  background: var(--low-bg);
  color: var(--text-muted);
}

/* === CREDIBILITY === */
.credibility {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--text-xs);
}

.credibility__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.credibility--high .credibility__dot { background: var(--success); }
.credibility--medium .credibility__dot { background: var(--warning); }
.credibility--low .credibility__dot { background: var(--danger); }

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

.empty-state__icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  opacity: 0.3;
}

.empty-state__text {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 400;
}

/* === TOAST === */
.toast {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-xl);
  transform: translateY(20px);
  opacity: 0;
  transition: all 400ms var(--spring);
  z-index: 2000;
  font-weight: 500;
}

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

.toast--success { border-left: 3px solid var(--success); }
.toast--error { border-left: 3px solid var(--danger); }
