/* GTL CRM — Minimal custom styles (Tailwind via CDN handles most styling) */

/* Sidebar */
#sidebar {
  width: 220px;
  min-height: 100vh;
  background: #1e2433;
  flex-shrink: 0;
}

/* Main layout */
#app-layout {
  display: flex;
  min-height: 100vh;
}

#main-content {
  flex: 1;
  overflow-x: hidden;
  background: #f9fafb;
}

/* Nav link active state */
.nav-link.active {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-left: 3px solid #3b82f6;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.6rem 1rem;
  color: #94a3b8;
  text-decoration: none;
  border-left: 3px solid transparent;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: #e2e8f0;
}

/* Quill editor sizing */
#quill-editor {
  height: 300px;
}

/* Scrollable panels */
.scroll-panel {
  overflow-y: auto;
  max-height: calc(100vh - 140px);
}

/* Table row hover */
.tbl-row:hover {
  background: #f1f5f9;
  cursor: pointer;
}

/* Badge styles */
.badge-opened { background: #dcfce7; color: #166534; }
.badge-not-opened { background: #f1f5f9; color: #64748b; }
.badge-replied { background: #dcfce7; color: #166534; }
.badge-no-reply { background: #fef9c3; color: #854d0e; }

/* Mobile sidebar toggle */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    top: 0; left: -220px;
    z-index: 50;
    transition: left 0.25s;
    height: 100%;
  }
  #sidebar.open {
    left: 0;
  }
  #sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 40;
  }
  #sidebar-overlay.open {
    display: block;
  }
  #hamburger {
    display: flex !important;
  }
}

/* Thread email body */
.email-body-sm img { max-width: 100%; }
.email-body-sm a { color: #2563eb; text-decoration: underline; }

/* Spinner */
.spinner {
  border: 3px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  width: 20px; height: 20px;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: #fff;
  border-radius: 0.5rem;
  padding: 1.5rem;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
