/* ============================================================
   assets/css/app.css
   Dr. Bit WhatsPlat
   ============================================================ */

:root {
  --drbit-primary:   #1e40af;
  --drbit-dark:      #0f172a;
  --drbit-sidebar:   #0f172a;
  --drbit-surface:   #f8fafc;
  --drbit-border:    #e2e8f0;
  --sidebar-width:   240px;
  --navbar-height:   56px;
}

/* ── Base ────────────────────────────────────────────────── */
body { background: var(--drbit-surface); color: #1e293b; }

/* ── Navbar ──────────────────────────────────────────────── */
.drbit-navbar {
  background: var(--drbit-dark) !important;
  height: var(--navbar-height);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1030;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.drbit-navbar .navbar-brand { font-size: 1rem; font-weight: 700; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: calc(100vh - var(--navbar-height));
  background: var(--drbit-dark);
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 1020;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.sidebar .nav-link {
  color: rgba(255,255,255,0.6);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.sidebar .nav-link i { font-size: 1.1rem; }
.sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,0.07); }
.sidebar .nav-link.active { color: #fff; background: var(--drbit-primary); }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,0.08); }
.plan-badge {
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 10px 12px;
  color: rgba(255,255,255,0.8);
}
.plan-badge .small { font-size: 0.78rem; }

/* ── Main content ────────────────────────────────────────── */
.main-content {
  margin-top: var(--navbar-height);
  margin-left: var(--sidebar-width);
  min-height: calc(100vh - var(--navbar-height));
}

/* ── Avatar ──────────────────────────────────────────────── */
.avatar-sm {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--drbit-primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  border: 1px solid var(--drbit-border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--drbit-border);
  border-radius: 12px 12px 0 0 !important;
  font-weight: 600;
  padding: 1rem 1.25rem;
}

/* ── Stats cards ─────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border: 1px solid var(--drbit-border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.8rem; color: #64748b; margin-top: 2px; }

/* ── Instance cards ──────────────────────────────────────── */
.instance-card {
  background: #fff;
  border: 1px solid var(--drbit-border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: box-shadow 0.2s;
}
.instance-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.instance-card.connected { border-left: 4px solid #16a34a; }
.instance-card.disconnected { border-left: 4px solid #dc2626; }
.instance-card.connecting { border-left: 4px solid #f59e0b; }
.instance-card.pending { border-left: 4px solid #94a3b8; }

/* ── Status dot ──────────────────────────────────────────── */
.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.connected    { background: #16a34a; box-shadow: 0 0 6px #16a34a; }
.status-dot.disconnected { background: #dc2626; }
.status-dot.connecting   { background: #f59e0b; animation: pulse 1s infinite; }
.status-dot.pending      { background: #94a3b8; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── QR Code container ───────────────────────────────────── */
.qr-container {
  background: #fff;
  border: 2px dashed var(--drbit-border);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.qr-container img { max-width: 250px; border-radius: 8px; }

/* ── Auth pages ──────────────────────────────────────────── */
.auth-body {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-container { width: 100%; max-width: 460px; }
.auth-container.auth-wide { max-width: 720px; }
.auth-card {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-title  { font-size: 1.5rem; font-weight: 700; color: #0f172a; margin-bottom: 0.25rem; }
.auth-subtitle { color: #64748b; font-size: 0.9rem; }

/* ── Plan option selector ────────────────────────────────── */
.plan-option {
  display: block;
  cursor: pointer;
  border: 2px solid var(--drbit-border);
  border-radius: 10px;
  padding: 0.75rem;
  text-align: center;
  transition: all 0.2s;
  background: #fff;
}
.plan-option input[type="radio"] { display: none; }
.plan-option:hover { border-color: var(--drbit-primary); }
.plan-option.selected {
  border-color: var(--drbit-primary);
  background: #eff6ff;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary { background: var(--drbit-primary); border-color: var(--drbit-primary); }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }

/* ── Tables ──────────────────────────────────────────────── */
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; }
.table td { vertical-align: middle; }

/* ── Page header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.page-title { font-size: 1.4rem; font-weight: 700; margin: 0; }
.page-subtitle { color: #64748b; font-size: 0.85rem; margin: 0; }

/* ── Admin sidebar ───────────────────────────────────────── */
.admin-sidebar { background: #1a1a2e; }
.admin-sidebar .nav-link.active { background: #e11d48; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 991px) {
  .main-content { margin-left: 0; }
  .sidebar { display: none !important; }
}
