/*
 * Nevra Panel — Dark Theme
 * Palette: #abea07 (primary), #85d71a (secondary), #030202 (bg), #caf764 (accent)
 */

/* ========================================
   Reset & Base
   ======================================== */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #030202;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: #abea07;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #caf764;
}

img {
  max-width: 100%;
  height: auto;
}

/* ========================================
   Typography
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  color: #ffffff;
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

/* ========================================
   Layout — Sidebar
   ======================================== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: #0a0a0a;
  border-right: 1px solid rgba(171, 234, 7, 0.12);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(171, 234, 7, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo {
  width: 120px;
  height: auto;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
  overflow-y: auto;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav li {
  margin: 0.125rem 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  font-weight: 400;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: #abea07;
  background: rgba(171, 234, 7, 0.05);
  border-left-color: rgba(171, 234, 7, 0.3);
}

.nav-link.active {
  color: #abea07;
  background: rgba(171, 234, 7, 0.08);
  border-left-color: #abea07;
  font-weight: 500;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(171, 234, 7, 0.1);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.btn-logout:hover {
  color: #ff5555;
}

/* ========================================
   Layout — Main Content
   ======================================== */

.main-content {
  margin-left: 260px;
  min-height: 100vh;
  padding: 2rem 2.5rem;
}

/* ========================================
   Mobile Header
   ======================================== */

.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #0a0a0a;
  border-bottom: 1px solid rgba(171, 234, 7, 0.12);
  align-items: center;
  padding: 0 1rem;
  z-index: 90;
  gap: 0.75rem;
}

.menu-toggle {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

.mobile-logo {
  height: 28px;
  width: auto;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 95;
}

/* ========================================
   Cards
   ======================================== */

.card {
  background: #0e0e0e;
  border: 1px solid rgba(171, 234, 7, 0.1);
  border-radius: 8px;
  padding: 1.25rem;
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: rgba(171, 234, 7, 0.25);
}

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

.card-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-value {
  font-size: 2rem;
  font-weight: 700;
  color: #abea07;
  line-height: 1;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.card-discarded {
  border-color: rgba(255, 85, 85, 0.25);
}

.card-discarded:hover {
  border-color: rgba(255, 85, 85, 0.5);
}

.card-discarded .card-value {
  color: #ff5555;
}

/* Business card (button-style) */
.business-card {
  background: #0e0e0e;
  border: 1px solid rgba(171, 234, 7, 0.1);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: inherit;
  transition: all 0.2s ease;
}

.business-card:hover {
  border-color: #abea07;
  background: rgba(171, 234, 7, 0.04);
}

.business-card-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.business-card-category {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
}

/* ========================================
   Buttons
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid rgba(171, 234, 7, 0.4);
  background: transparent;
  color: #abea07;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn:hover {
  background: rgba(171, 234, 7, 0.08);
  border-color: #abea07;
}

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

.btn-primary {
  background: #abea07;
  color: #030202;
  border-color: #abea07;
}

.btn-primary:hover {
  background: #85d71a;
  border-color: #85d71a;
}

.btn-primary:disabled {
  background: rgba(171, 234, 7, 0.3);
  border-color: transparent;
  color: rgba(3, 2, 2, 0.6);
}

.btn-danger {
  border-color: rgba(255, 85, 85, 0.4);
  color: #ff5555;
}

.btn-danger:hover {
  background: rgba(255, 85, 85, 0.08);
  border-color: #ff5555;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ========================================
   Forms
   ======================================== */

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

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: #ffffff;
  background: #0a0a0a;
  border: 1px solid rgba(171, 234, 7, 0.2);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #abea07;
  box-shadow: 0 0 0 2px rgba(171, 234, 7, 0.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

/* ========================================
   Tables
   ======================================== */

.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(171, 234, 7, 0.15);
}

tbody td {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: rgba(171, 234, 7, 0.03);
}

tbody tr.clickable {
  cursor: pointer;
}

/* ========================================
   Status Badges
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 100px;
  white-space: nowrap;
}

.badge-prospect {
  background: rgba(160, 160, 160, 0.15);
  color: #a0a0a0;
  border: 1px solid rgba(160, 160, 160, 0.25);
}

.badge-contacted {
  background: rgba(250, 204, 21, 0.12);
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.25);
}

.badge-active {
  background: rgba(171, 234, 7, 0.12);
  color: #abea07;
  border: 1px solid rgba(171, 234, 7, 0.25);
}

.badge-prospected {
  background: rgba(171, 234, 7, 0.08);
  color: rgba(171, 234, 7, 0.6);
  border: 1px solid rgba(171, 234, 7, 0.15);
  font-size: 0.7rem;
}

.badge-discarded {
  background: rgba(255, 85, 85, 0.12);
  color: #ff5555;
  border: 1px solid rgba(255, 85, 85, 0.25);
}

/* ========================================
   Modal
   ======================================== */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: #0e0e0e;
  border: 1px solid rgba(171, 234, 7, 0.15);
  border-radius: 10px;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(171, 234, 7, 0.1);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: #ffffff;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(171, 234, 7, 0.1);
}

.modal-footer:empty {
  display: none;
}

/* ========================================
   Tabs (for notes)
   ======================================== */

.tabs {
  display: flex;
  border-bottom: 1px solid rgba(171, 234, 7, 0.12);
  margin-bottom: 1rem;
  gap: 0;
}

.tab {
  padding: 0.6rem 1rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab:hover:not(:disabled) {
  color: rgba(255, 255, 255, 0.7);
}

.tab.active {
  color: #abea07;
  border-bottom-color: #abea07;
}

.tab:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ========================================
   Notes
   ======================================== */

.note-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.note-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 0.35rem;
}

.note-content {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
}

/* ========================================
   Toast / Notifications
   ======================================== */

.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
  max-width: 360px;
}

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

.toast-success {
  background: rgba(171, 234, 7, 0.15);
  color: #abea07;
  border: 1px solid rgba(171, 234, 7, 0.3);
}

.toast-error {
  background: rgba(255, 85, 85, 0.15);
  color: #ff5555;
  border: 1px solid rgba(255, 85, 85, 0.3);
}

.toast-info {
  background: rgba(100, 160, 255, 0.15);
  color: #64a0ff;
  border: 1px solid rgba(100, 160, 255, 0.3);
}

/* ========================================
   Loading Spinner
   ======================================== */

.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(3, 2, 2, 0.8);
  z-index: 250;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(171, 234, 7, 0.15);
  border-top-color: #abea07;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Inline spinner (for buttons, sections) */
.spinner-inline {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(171, 234, 7, 0.2);
  border-top-color: #abea07;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

/* ========================================
   Login Page
   ======================================== */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.login-container {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-card {
  background: #0e0e0e;
  border: 1px solid rgba(171, 234, 7, 0.12);
  border-radius: 12px;
  padding: 2.5rem 2rem;
}

.login-logo {
  margin-bottom: 1.5rem;
}

.login-logo img {
  width: 100px;
  height: auto;
}

.login-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 2rem;
}

.login-card .form-group {
  text-align: left;
}

.login-error {
  font-size: 0.85rem;
  color: #ff5555;
  margin-bottom: 1rem;
  min-height: 1.25rem;
}

.login-footer {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.25);
}

/* ========================================
   Checkboxes (pipeline progression)
   ======================================== */

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.checkbox-group input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(171, 234, 7, 0.35);
  border-radius: 4px;
  background: #0a0a0a;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.checkbox-group input[type="checkbox"]:checked {
  background: #abea07;
  border-color: #abea07;
}

.checkbox-group input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #030202;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-group input[type="checkbox"]:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.checkbox-group label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

/* ========================================
   Toggle (service assignment)
   ======================================== */

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transition: transform 0.2s ease, background 0.2s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: rgba(171, 234, 7, 0.3);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: #abea07;
}

/* ========================================
   Section Headers
   ======================================== */

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

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
}

/* ========================================
   Empty State
   ======================================== */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: rgba(255, 255, 255, 0.3);
}

.empty-state p {
  font-size: 0.95rem;
}

/* ========================================
   Detail List (modal business details)
   ======================================== */

.detail-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.9rem;
}

.detail-label {
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
  white-space: nowrap;
}

.detail-value {
  color: rgba(255, 255, 255, 0.85);
  word-break: break-word;
}

.detail-value a {
  color: #abea07;
}

/* ========================================
   Service List (config view)
   ======================================== */

.service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: 0.75rem;
}

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

.service-name {
  flex: 1;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

.service-actions {
  display: flex;
  gap: 0.5rem;
}

/* ========================================
   Confirmation Dialog
   ======================================== */

.confirm-text {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.confirm-highlight {
  color: #facc15;
  font-weight: 500;
}

/* ========================================
   Utility Classes
   ======================================== */

.text-muted { color: rgba(255, 255, 255, 0.4); }
.text-green { color: #abea07; }
.text-sm { font-size: 0.8rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* ========================================
   Responsive — Mobile (<768px)
   ======================================== */

@media screen and (max-width: 767px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .mobile-header {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    padding: 1.25rem;
    padding-top: calc(56px + 1.25rem);
  }

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

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .modal {
    max-width: 100%;
    max-height: 90vh;
    margin: 0.5rem;
    border-radius: 8px;
  }

  .section-title {
    font-size: 1.25rem;
  }

  .toast-container {
    top: auto;
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
  }

  .toast {
    max-width: 100%;
  }

  .detail-list {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .detail-label {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.75rem;
  }
}

@media screen and (max-width: 480px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Responsive — Large screens (≥768px)
   ======================================== */

@media screen and (min-width: 768px) {
  .sidebar {
    transform: translateX(0);
  }

  .mobile-header {
    display: none;
  }

  .sidebar-overlay {
    display: none !important;
  }
}
