/* ============================================================
   General Bots Cloud · Forms, Utilities & Auth
   Design: Monochrome — black & white
   ============================================================ */

/* ----------------------------------------------------------
   1. BUTTONS
   ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: all 0.15s ease;
  text-decoration: none;
}

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

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Primary */
.btn-primary {
  background: #000;
  color: #fff;
  border: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

/* Secondary */
.btn-secondary {
  background: var(--bg3);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--border-hover);
  background: var(--bg2);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--accent-dim);
  border-color: var(--accent);
}

/* Danger */
.btn-danger {
  background: rgba(0, 0, 0, 0.08);
  color: #888;
  border-color: rgba(0, 0, 0, 0.15);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.25);
}

/* Sizes */
.btn-sm {
  min-height: 34px;
  padding: 0 14px;
  font-size: 0.85rem;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

/* ----------------------------------------------------------
   2. FORMS
   ---------------------------------------------------------- */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.form-label-optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
  margin-left: 4px;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.form-control::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
  background: var(--surface);
}

.form-control:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237e7e8a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

.form-error {
  font-size: 0.8rem;
  color: #888;
  margin-top: 2px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* ----------------------------------------------------------
   3. STATS
   ---------------------------------------------------------- */

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.stat-change {
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 4px;
}

.stat-change.up {
  color: #2a2a2a;
}

.stat-change.down {
  color: #888;
}

.stat-icon {
  width: 20px;
  height: 20px;
  color: var(--accent);
  margin-bottom: 8px;
}

/* ----------------------------------------------------------
   4. MODAL
   ---------------------------------------------------------- */

.mgmt-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.mgmt-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.mgmt-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.mgmt-modal.active {
  pointer-events: auto;
}

.mgmt-modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Top border */
.mgmt-modal-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #000;
  border-radius: var(--radius) var(--radius) 0 0;
}

.mgmt-modal.active .mgmt-modal-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.mgmt-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-right: 32px;
}

.mgmt-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.mgmt-modal-close:hover {
  background: var(--bg3);
  color: var(--text);
}

.mgmt-modal-close svg {
  width: 18px;
  height: 18px;
}

.mgmt-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* ----------------------------------------------------------
   5. AUTH PAGES
   ---------------------------------------------------------- */

.mgmt-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  width: 100%;
}

.mgmt-auth-left {
  position: relative;
  background: #08080a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  overflow: hidden;
}

/* Cyan glow — top right */
.mgmt-auth-left::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.mgmt-auth-right {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}

.mgmt-auth-card {
  width: 100%;
  max-width: 420px;
}

.mgmt-auth-card h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.mgmt-auth-card p {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 28px;
  line-height: 1.6;
}

.mgmt-auth-card .form-group:last-of-type {
  margin-bottom: 24px;
}

/* OAuth / Social buttons in auth */
.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-social-btn:hover {
  border-color: var(--border-hover);
  background: var(--bg2);
}

.auth-social-btn svg {
  width: 18px;
  height: 18px;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

/* Alt link */
.auth-alt {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-alt a {
  color: var(--accent);
  font-weight: 600;
}

.auth-alt a:hover {
  text-decoration: underline;
}

/* ----------------------------------------------------------
   6. THEME TOGGLE
   ---------------------------------------------------------- */

.theme-toggle {
  position: fixed;
  top: 10px;
  right: 16px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 99px;
}

.theme-toggle button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  padding: 0;
}

.theme-toggle button:hover {
  color: var(--text);
}

.theme-toggle button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.theme-toggle button svg {
  width: 16px;
  height: 16px;
}

/* ----------------------------------------------------------
   8. UTILITIES
   ---------------------------------------------------------- */

.mgmt-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.mgmt-empty-icon {
  width: 48px;
  height: 48px;
  color: var(--muted);
  opacity: 0.4;
  margin-bottom: 14px;
}

.mgmt-empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.mgmt-empty-body {
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 340px;
  line-height: 1.5;
  margin-bottom: 18px;
}

/* Loading dots */
.loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotBounce 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes dotBounce {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Category pills */
.cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg3);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-pill:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.cat-pill.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

/* ----------------------------------------------------------
   9. PROFILE SECTIONS
   ---------------------------------------------------------- */

.mgmt-profile-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 18px;
}

.mgmt-profile-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.mgmt-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.mgmt-profile-row + .mgmt-profile-row {
  border-top: 1px solid var(--border);
}

.mgmt-profile-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.mgmt-profile-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.mgmt-profile-avatar-large {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.4rem;
}

/* ----------------------------------------------------------
   10. TOAST
   ---------------------------------------------------------- */

.mgmt-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  transform: translateY(16px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}

.mgmt-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mgmt-toast.success {
  border-left: 3px solid #555;
}

.mgmt-toast.error {
  border-left: 3px solid #888;
}

.mgmt-toast.info {
  border-left: 3px solid var(--accent);
}

/* ----------------------------------------------------------
   11. BREADCRUMB
   ---------------------------------------------------------- */

.mgmt-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 18px;
}

.mgmt-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.mgmt-breadcrumb a:hover {
  color: var(--accent);
}

.mgmt-breadcrumb-sep {
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.5;
}

.mgmt-breadcrumb-current {
  color: var(--text);
  font-weight: 600;
}

/* ----------------------------------------------------------
   12. TEXT UTILITIES
   ---------------------------------------------------------- */

.text-accent  { color: var(--accent); }
.text-accent2 { color: var(--accent2); }
.text-accent3 { color: var(--accent3); }
.text-muted   { color: var(--muted); }
.text-sm      { font-size: 0.85rem; }
.text-xs      { font-size: 0.75rem; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.fw-500       { font-weight: 500; }
.fw-600       { font-weight: 600; }
.fw-700       { font-weight: 700; }
.fw-800       { font-weight: 800; }

.mt-0  { margin-top: 0; }
.mt-1  { margin-top: 8px; }
.mt-2  { margin-top: 16px; }
.mt-3  { margin-top: 24px; }
.mt-4  { margin-top: 32px; }
.mb-0  { margin-bottom: 0; }
.mb-1  { margin-bottom: 8px; }
.mb-2  { margin-bottom: 16px; }
.mb-3  { margin-bottom: 24px; }

.gap-1 { gap: 8px; }
.gap-2 { gap: 14px; }
.gap-3 { gap: 20px; }

.d-flex      { display: flex; }
.d-grid      { display: grid; }
.flex-col    { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1      { flex: 1; }
.flex-wrap   { flex-wrap: wrap; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hidden { display: none !important; }
.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* ----------------------------------------------------------
   13. RESPONSIVE — AUTH & FORMS
   ---------------------------------------------------------- */

@media (max-width: 900px) {
  .mgmt-auth {
    grid-template-columns: 1fr;
  }

  .mgmt-auth-left {
    display: none;
  }

  .theme-toggle {
    top: 8px;
    right: 8px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

