/* Agency OS — Custom styles (Tailwind handles the rest) */

/* ─── Collapsible sidebar ──────────────────────────────────────────────────── */
#sidebar {
  width: 220px;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
#sidebar.collapsed {
  width: 56px;
}

/* Logo / header row */
.sidebar-header {
  display: flex;
  align-items: center;
  padding: 0.875rem 0.75rem;
  min-height: 56px;
  gap: 0.5rem;
}

/* Chevron toggle button */
.sidebar-toggle-btn {
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  color: #475569;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.sidebar-toggle-btn:hover { color: #94a3b8; background: rgba(255,255,255,0.06); }

#sidebar-chevron {
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
#sidebar.collapsed #sidebar-chevron { transform: rotate(180deg); }

/* Elements that hide when collapsed */
.nav-label {
  overflow: hidden;
  white-space: nowrap;
  max-width: 160px;
  transition: max-width 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s;
}
#sidebar.collapsed .nav-label {
  max-width: 0;
  opacity: 0;
}

/* Section headings */
.nav-section-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #475569;
  padding: 0.25rem 0.5rem 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
  overflow: hidden;
  max-width: 180px;
  transition: max-width 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s, padding 0.22s;
}
#sidebar.collapsed .nav-section-label {
  max-width: 0;
  opacity: 0;
  padding-left: 0;
  padding-right: 0;
}

/* ─── Nav active state ─────────────────────────────────────────────────────── */
.nav-active {
  background-color: rgba(255,255,255,0.08);
  color: #fff;
}
.nav-active svg {
  color: #6ee7b7;
}

/* ─── Sidebar nav item ─────────────────────────────────────────────────────── */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.45rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  color: #94a3b8;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, padding 0.22s, gap 0.22s, justify-content 0.22s;
}
.nav-item:hover {
  background-color: rgba(255,255,255,0.06);
  color: #e2e8f0;
}
.nav-item svg {
  width: 1.125rem !important;
  height: 1.125rem !important;
  flex-shrink: 0;
}
#sidebar.collapsed .nav-item {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  gap: 0;
}

/* Form inputs */
.field {
  display: block;
  width: 100%;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  color: #e2e8f0;
  padding: 0.6rem 0.875rem;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
}
.field:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.field::placeholder { color: #475569; }
select.field option { background: #1e293b; }

/* Primary button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #6366f1;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}
.btn-primary:hover:not(:disabled) { background: #4f46e5; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Secondary button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  border: 1px solid #334155;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-secondary:hover { background: #1e293b; color: #e2e8f0; }

/* Status badges */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge-green  { background: rgba(52,211,153,0.1); color: #34d399; }
.badge-amber  { background: rgba(251,191,36,0.1);  color: #fbbf24; }
.badge-blue   { background: rgba(96,165,250,0.1);  color: #60a5fa; }
.badge-slate  { background: rgba(100,116,139,0.1); color: #64748b; }
.badge-red    { background: rgba(248,113,113,0.1); color: #f87171; }

/* Card */
.card {
  background: #1e293b;
  border: 1px solid #1e293b;
  border-radius: 0.75rem;
  padding: 1.5rem;
}

/* Response panel */
.response-panel {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-top: 1rem;
  font-family: 'Fira Code', 'Cascadia Code', monospace;
}

/* Tab system */
.tab-btn {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 0.375rem;
  color: #64748b;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.15s;
  white-space: nowrap;
}
.tab-btn:hover { color: #e2e8f0; background: rgba(255,255,255,0.04); }
.tab-btn.tab-active { background: #6366f1; color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 2.5rem; height: 1.375rem; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #334155; border-radius: 9999px; cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider:before {
  content: ''; position: absolute;
  width: 1rem; height: 1rem;
  left: 3px; bottom: 3px;
  background: white; border-radius: 50%;
  transition: transform 0.2s;
}
.toggle input:checked + .toggle-slider { background: #6366f1; }
.toggle input:checked + .toggle-slider:before { transform: translateX(1.125rem); }

/* Animate spin for loading */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.animate-spin { animation: spin 0.7s linear infinite; }
