/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--grad-brand);
  color: #ffffff;
  border: none;
  box-shadow: 0 6px 20px rgba(30, 58, 95, 0.2);
  padding: 14px 32px;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  box-shadow: 0 10px 32px rgba(30, 58, 95, 0.3);
  transform: translateY(-3px);
}

.btn-primary:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(30, 58, 95, 0.2);
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
}

.btn-outline:hover {
  background: var(--navy);
  color: #fff;
}

.btn-group {
  margin-left: auto;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 4px;
  margin: 16px 0;
  background: var(--bg-alt);
  padding: 4px;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.tab {
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  transition: all var(--transition);
}

.tab:hover {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.6);
}

.tab.active {
  background: var(--surface);
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

/* Tab Panels */
.tabpanel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.3s ease-out;
}

.tabpanel.active {
  display: block;
}

/* ============================================================
   FORMS / CONTROLS (Shared)
   ============================================================ */
.controls-row {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

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

.checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

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

.checkbox input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.inline {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  animation: fadeInUp 0.3s ease-out;
  max-width: 360px;
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.3);
  background: #fef2f2;
  color: #dc2626;
}

.toast.success {
  border-color: rgba(76, 175, 80, 0.3);
  background: #f0fdf4;
  color: var(--green);
}

.toast.info {
  border-color: rgba(30, 58, 95, 0.2);
  background: #eff6ff;
  color: var(--navy);
}

/* ============================================================
   LOADING SKELETON
   ============================================================ */
.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px 24px;
  animation: fadeIn 0.3s ease-out;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
}

/* ============================================================
   TAGS / REPORT HELPERS
   ============================================================ */
.tag {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.08), rgba(30, 58, 95, 0.05));
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 13px;
  margin-right: 6px;
}

.ok { color: var(--green); font-weight: 700; }
.warn { color: #d97706; font-weight: 700; }
.bad { color: #ef4444; font-weight: 700; }

/* Responsive Adjustments */
@media (max-width: 700px) {
  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
    text-align: center;
    padding: 10px 16px;
  }

  .controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .btn-group {
    margin-left: 0;
  }

  .toast {
    max-width: calc(100vw - 48px);
  }
}
