/* ─── WhatSender UI ──────────────────────────────────────────────────────── */
:root {
  --ws-green:   #25D366;
  --ws-dark:    #075E54;
  --ws-light:   #dcf8c6;
  --sidebar-bg: #0f1923;
  --sidebar-w:  260px;
  --top-h:      60px;
  --radius:     10px;
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #f0f2f5;
  color: #212529;
  overflow-x: hidden;
}

/* ─── Topbar ─────────────────────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--top-h); background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; z-index: 900;
  transition: left .3s;
}
.topbar .toggle-btn { font-size: 20px; cursor: pointer; color: #6c757d; }
.topbar .user-info { display: flex; align-items: center; gap: 10px; }
.topbar .user-info img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w); background: var(--sidebar-bg);
  overflow-y: auto; overflow-x: hidden;
  transition: transform .3s; z-index: 1000;
  display: flex; flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #ffffff25; border-radius: 4px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: #ffffff45; }
/* Smooth scroll inside sidebar */
.sidebar { scroll-behavior: smooth; }

.sidebar-brand {
  padding: 18px 20px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid #ffffff10; text-decoration: none;
}
.sidebar-brand .brand-icon {
  width: 50px; height: 50px; /*background: var(--ws-green);*/
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0; overflow: hidden;
}
.sidebar-brand .brand-icon img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.sidebar-brand .brand-name { color: #fff; font-weight: 700; font-size: 18px; letter-spacing: -.3px; }
.sidebar-brand .brand-sub  { color: #ffffff60; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }

.sidebar-section { padding: 16px 12px 4px; }
.sidebar-section-title { font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; color: #ffffff40; padding: 0 8px; margin-bottom: 4px; }

.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; margin-bottom: 2px;
  color: #c8d0da; text-decoration: none; font-size: 13.5px; font-weight: 500;
  transition: background .15s, color .15s;
}
.sidebar-nav a i { width: 18px; text-align: center; font-size: 15px; opacity: .85; }
.sidebar-nav a:hover { background: #ffffff12; color: #fff; }
.sidebar-nav a.active { background: var(--ws-green); color: #fff; }
.sidebar-nav a.active i { opacity: 1; }

.sidebar-nav a .badge-pill {
  margin-left: auto; font-size: 10px; padding: 2px 6px; border-radius: 10px;
  background: #ffffff20; color: #fff;
}

/* ─── Main Content ───────────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  padding-top: var(--top-h);
  min-height: 100vh;
  transition: margin-left .3s;
}
.content-body { padding: 24px; }
.page-header { margin-bottom: 20px; }
.page-title { font-size: 20px; font-weight: 700; margin: 0; }
.page-sub   { color: #6c757d; font-size: 13px; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: #fff; border: none;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.card-header {
  background: transparent; border-bottom: 1px solid #f0f0f0;
  padding: 14px 20px; font-weight: 600; font-size: 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.card-body { padding: 20px; }

/* ─── Stat Cards ─────────────────────────────────────────────────────────── */
.stat-card {
  border-radius: var(--radius); padding: 20px; color: #fff;
  display: flex; align-items: center; gap: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.stat-card .stat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  background: #ffffff25; display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-card .stat-label { font-size: 12px; opacity: .85; margin-bottom: 4px; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; line-height: 1; }
.stat-card .stat-change { font-size: 11px; opacity: .8; margin-top: 2px; }
.bg-ws-green { background: linear-gradient(135deg, #25D366, #1ebe59); }
.bg-ws-blue  { background: linear-gradient(135deg, #128C7E, #0d7168); }
.bg-ws-purple{ background: linear-gradient(135deg, #7b5ea7, #6a4d94); }
.bg-ws-orange{ background: linear-gradient(135deg, #f5a623, #e8920a); }
.bg-ws-red   { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.bg-ws-teal  { background: linear-gradient(135deg, #00b09b, #00967f); }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.table { --bs-table-bg: transparent; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: #6c757d; border-bottom: 2px solid #f0f0f0 !important; }
.table td { vertical-align: middle; font-size: 13.5px; }
.table-hover tbody tr:hover { background: #f8f9ff; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn-ws { background: var(--ws-green); color: #fff; border: none; }
.btn-ws:hover { background: #1ebe59; color: #fff; }
.btn-ws-dark { background: var(--ws-dark); color: #fff; border: none; }
.btn-ws-dark:hover { background: #064c42; color: #fff; }

/* ─── Device Cards ───────────────────────────────────────────────────────── */
.device-card {
  border-radius: var(--radius); border: 2px solid #f0f0f0;
  padding: 18px; text-align: center; transition: border-color .2s;
  cursor: pointer;
}
.device-card:hover { border-color: var(--ws-green); }
.device-card.connected { border-color: #25D366; }
.device-card.disconnected { border-color: #dee2e6; }
.device-card .device-icon { font-size: 36px; margin-bottom: 8px; }
.device-card .device-name { font-weight: 600; margin-bottom: 4px; }
.device-card .device-phone { font-size: 12px; color: #6c757d; }

/* ─── QR Container ───────────────────────────────────────────────────────── */
.qr-container {
  width: 220px; height: 220px; border: 2px dashed #dee2e6;
  border-radius: 12px; display: flex; align-items: center;
  justify-content: center; margin: 0 auto;
}
.qr-container img { width: 200px; height: 200px; }

/* ─── Auth ───────────────────────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh; background: linear-gradient(135deg, #0f1923 0%, #1a2a3a 100%);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.auth-card {
  background: #fff; border-radius: 16px; padding: 40px;
  width: 100%; max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .logo-circle {
  /*width: 100px; height: 100px; background: #fff;
  border: 1px solid #e9ecef; border-radius: 16px;*/ display: inline-flex; 
  align-items: center;
  justify-content: center; font-size: 28px; margin-bottom: 12px; overflow: hidden;
  /*box-shadow: 0 8px 24px rgba(0,0,0,.08);*/
}
.auth-card .auth-logo .logo-circle img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 148px !important;
  max-height: 148px !important;
  object-fit: contain !important;
}
.auth-title { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 4px; }
.auth-sub   { text-align: center; color: #6c757d; font-size: 13px; margin-bottom: 28px; }

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: 8px; border: 1.5px solid #dee2e6;
  padding: 9px 14px; font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--ws-green); box-shadow: 0 0 0 3px rgba(37,211,102,.15);
}
.form-label { font-size: 13px; font-weight: 500; margin-bottom: 5px; }

/* ─── Alerts / Flash ─────────────────────────────────────────────────────── */
.alert { border-radius: 8px; border: none; font-size: 13.5px; }
.alert-success { background: #d4edda; color: #155724; }
.alert-danger   { background: #f8d7da; color: #721c24; }
.alert-info     { background: #d1ecf1; color: #0c5460; }

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge { font-size: 11px; font-weight: 500; padding: 4px 8px; border-radius: 6px; }

/* ─── Chat bubble (support) ──────────────────────────────────────────────── */
.msg-bubble { max-width: 75%; }
.msg-bubble.user-msg { margin-left: auto; }
.msg-bubble .bubble-body {
  padding: 10px 14px; border-radius: 12px; font-size: 13.5px;
  line-height: 1.5; word-break: break-word;
}
.user-msg .bubble-body { background: var(--ws-light); color: #000; border-radius: 12px 12px 0 12px; }
.admin-msg .bubble-body { background: #f0f0f0; color: #000; border-radius: 12px 12px 12px 0; }
.bubble-meta { font-size: 11px; color: #888; margin-top: 3px; }

/* ─── Progress bar ───────────────────────────────────────────────────────── */
.progress { border-radius: 6px; height: 8px; }
.progress-bar { background: var(--ws-green); }

/* ─── Sidebar collapsed ──────────────────────────────────────────────────── */
body.sidebar-collapsed .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
body.sidebar-collapsed .main-content { margin-left: 0; }
body.sidebar-collapsed .topbar { left: 0; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar { left: 0; }
  .stat-card .stat-value { font-size: 20px; }
}

/* ─── Landing Page ───────────────────────────────────────────────────────── */
.landing-hero {
  background: linear-gradient(135deg, #0f1923 0%, #1a2a3a 100%);
  min-height: 100vh; display: flex; align-items: center;
  color: #fff; padding: 80px 0;
}
.landing-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  padding: 14px 0; transition: background .3s;
}
.landing-nav.scrolled { background: rgba(15,25,35,.95); backdrop-filter: blur(10px); }
.feature-icon-box {
  width: 60px; height: 60px; border-radius: 14px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff; margin-bottom: 16px;
}
.pricing-card {
  border-radius: 16px; border: 2px solid #e9ecef;
  padding: 32px 24px; text-align: center; transition: border-color .2s, transform .2s;
}
.pricing-card:hover { border-color: var(--ws-green); transform: translateY(-4px); }
.pricing-card.popular { border-color: var(--ws-green); }
.price-tag { font-size: 42px; font-weight: 800; color: var(--ws-dark); }
.price-tag sup { font-size: 22px; vertical-align: super; }
.price-tag span { font-size: 14px; font-weight: 400; color: #6c757d; }

/* ─── Misc ───────────────────────────────────────────────────────────────── */
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.text-ws-green { color: var(--ws-green); }
.border-ws-green { border-color: var(--ws-green) !important; }
.bg-light-green { background: rgba(37,211,102,.1); }
.overflow-auto-y { overflow-y: auto; }
.cursor-pointer { cursor: pointer; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fs-24 { font-size: 24px; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.rounded-10 { border-radius: 10px; }
.bg-ws-green-soft { background: rgba(37,211,102,.12); }
.card-footer { padding: 10px 20px; background: #fafafa; border-top: 1px solid #f0f0f0; border-radius: 0 0 var(--radius) var(--radius); font-size: 13px; }

/* ─── Subscription / Pricing ─────────────────────────────────────────────── */
.plan-card { border-radius: var(--radius); border: 2px solid #eee; transition: border-color .2s; }
.plan-card.active-plan { border-color: var(--ws-green); }
.plan-card .plan-header { padding: 20px; border-bottom: 1px solid #f0f0f0; }
.plan-card .plan-body   { padding: 20px; }
.plan-card .plan-price  { font-size: 32px; font-weight: 800; color: var(--ws-dark); }
.plan-card .plan-features li { padding: 6px 0; font-size: 13.5px; display: flex; gap: 8px; border-bottom: 1px solid #f8f8f8; }
.plan-card .plan-features li i { color: var(--ws-green); flex-shrink: 0; }

/* ─── Message type fields ─────────────────────────────────────────────────── */
.msg-field { display: none; }
.msg-field.visible { display: block; }
