/* 
 * Aadhini Connect — SaaS UI Design System
 * Theme: Modern Slate / Professional CRM
 */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

:root {
  /* Background Layers */
  --bg-main:             #0f172a;
  --bg-surface:          #1e293b;
  --bg-surface-elevated: #293548;
  --bg-surface-hover:    #334155;

  /* Borders */
  --border-subtle:  rgba(148, 163, 184, 0.1);
  --border-active:  rgba(148, 163, 184, 0.2);

  /* Accent — WhatsApp Brand Green */
  --accent:          #25d366;
  --accent-hover:    #20bd5a;
  --accent-muted:    rgba(37, 211, 102, 0.12);
  --accent-border:   rgba(37, 211, 102, 0.25);
  --accent-glow:     0 0 24px rgba(37, 211, 102, 0.2);

  /* Text */
  --text-main:   #f1f5f9;
  --text-sub:    #94a3b8;
  --text-dim:    #475569;

  /* Layout */
  --sidebar-width:           245px;
  --sidebar-collapsed-width: 76px;
  --transition:              cubic-bezier(0.4, 0, 0.2, 1);
  --radius:                  12px;
  --radius-sm:               8px;
  --radius-xs:               6px;
}

/* ─── Base ─── */
*, *::before, *::after { box-sizing: border-box; }

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

a { text-decoration: none; }

/* ─── Layout Shell ─── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar-saas {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  z-index: 1000;
  transition: width 0.3s var(--transition);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-saas.collapsed { width: var(--sidebar-collapsed-width); }

.sidebar-saas.collapsed .sidebar-text,
.sidebar-saas.collapsed .sidebar-header-text {
  opacity: 0;
  pointer-events: none;
  width: 0;
}

/* ─── Main Workspace ─── */
.main-workspace {
  flex-grow: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s var(--transition);
  padding: 1.5rem 2.5rem;
  max-width: 100%;
}
.page-inbox .main-workspace {
  padding: 1rem;
}
.main-workspace.expanded { margin-left: var(--sidebar-collapsed-width); }

/* ─── Surface Cards ─── */
.surface {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.surface-elevated {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-active);
  border-radius: var(--radius);
}

.glass {
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
}

/* ─── Navigation ─── */
.nav-item-saas {
  display: flex;
  align-items: center;
  padding: 0.65rem 1rem;
  margin: 2px 0;
  border-radius: var(--radius-sm);
  color: var(--text-sub);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s var(--transition);
  white-space: nowrap;
  overflow: hidden;
  border: 1px solid transparent;
  gap: 0.75rem;
}

.nav-item-saas:hover {
  background: var(--bg-surface-hover);
  color: var(--text-main);
}

.nav-item-saas.active {
  background: var(--accent-muted);
  color: var(--accent);
  border-color: var(--accent-border);
  font-weight: 600;
}

.nav-item-saas i {
  font-size: 1.1rem;
  min-width: 1.5rem;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

/* ─── KPI Cards ─── */
.kpi-card {
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
  border-color: var(--border-active);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.04em;
  line-height: 1;
}

/* ─── Tables ─── */
.saas-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.saas-table th {
  background: var(--bg-surface-elevated);
  color: var(--text-dim);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.875rem 1.25rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
}

.saas-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.875rem;
  color: var(--text-sub);
}

.saas-table tr:hover td {
  background: rgba(148, 163, 184, 0.04);
  color: var(--text-main);
}

/* ─── Badges ─── */
.badge-saas {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge-emerald { background: var(--accent-muted); color: var(--accent); border: 1px solid var(--accent-border); }
.badge-blue    { background: rgba(59, 130, 246, 0.1); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.2); }
.badge-amber   { background: rgba(245, 158, 11, 0.1); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-red     { background: rgba(239, 68, 68, 0.1); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-slate   { background: var(--bg-surface-elevated); color: var(--text-sub); border: 1px solid var(--border-subtle); }

/* ─── Buttons ─── */
.btn-saas-primary {
  background: var(--accent);
  color: #0a1628;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-saas-primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--accent-glow);
  transform: translateY(-1px);
}

.btn-saas-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-sub);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-saas-secondary:hover {
  background: var(--bg-surface-hover);
  color: var(--text-main);
  border-color: var(--border-active);
}

/* ─── Form Inputs ─── */
.saas-input {
  background: var(--bg-main);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.7rem 1rem;
  font-size: 0.875rem;
  font-family: "Inter", sans-serif;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.saas-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.saas-input::placeholder { color: var(--text-dim); }

/* ─── Animations ─── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  animation: fadeInUp 0.5s var(--transition) forwards;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.10s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.20s; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--border-active); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ─── Dropdown Override ─── */
.dropdown-menu {
  min-width: 200px;
}

.dropdown-menu-dark {
  --bs-dropdown-bg: var(--bg-surface-elevated) !important;
  --bs-dropdown-link-color: var(--text-sub) !important;
  --bs-dropdown-link-hover-color: var(--text-main) !important;
  --bs-dropdown-link-hover-bg: var(--bg-surface-hover) !important;
  background: var(--bg-surface-elevated) !important;
  border-color: var(--border-subtle) !important;
}

/* ─── Topbar ─── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s;
}

.topbar-icon-btn:hover { color: var(--text-main); border-color: var(--border-active); }

.topbar-search {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-main);
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  font-size: 0.85rem;
  font-family: "Inter", sans-serif;
  width: 220px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.topbar-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.topbar-search::placeholder { color: var(--text-dim); }

.topbar-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.45rem 0.875rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-sub);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}

.topbar-action-btn:hover { color: var(--text-main); border-color: var(--border-active); }

.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  background: var(--accent);
  color: #0f172a;
  font-size: 9px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-main);
}

/* ─── Notification Panel ─── */
.notification-panel {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius) !important;
  padding: 0 !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4) !important;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--text-sub);
  transition: background 0.15s;
  cursor: pointer;
}

.notif-item:hover { background: var(--bg-surface-elevated); color: var(--text-main); }

.notif-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-muted);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-item-logout { color: #f87171 !important; }
.nav-item-logout:hover { background: rgba(239,68,68,0.08) !important; color: #f87171 !important; }

/* ─── KPI Icon Variants ─── */
.kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.kpi-icon-green  { background: var(--accent-muted); color: var(--accent); border: 1px solid var(--accent-border); }
.kpi-icon-blue   { background: rgba(59,130,246,0.1); color: #60a5fa; border: 1px solid rgba(59,130,246,0.2); }
.kpi-icon-amber  { background: rgba(245,158,11,0.1); color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); }
.kpi-icon-purple { background: rgba(167,139,250,0.1); color: #a78bfa; border: 1px solid rgba(167,139,250,0.2); }

.kpi-label-tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-progress {
  height: 3px;
  background: var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 0.875rem;
}

.kpi-progress div { height: 100%; border-radius: 10px; transition: width 1s ease; }

/* ─── Quick Action Cards ─── */
.quick-action-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.quick-action-card:hover {
  border-color: var(--border-active);
  background: var(--bg-surface-elevated);
  transform: translateY(-2px);
}

/* ─── Onboarding Steps ─── */
.onboarding-step {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.onboarding-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-border);
  flex-shrink: 0;
}

.onboarding-btn {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}

.onboarding-btn:hover { color: var(--accent-hover); }

/* ─── System Status ─── */
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-green { background: var(--accent); box-shadow: 0 0 6px rgba(37, 211, 102, 0.5); }
.status-amber { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.5); }
.status-red   { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.5); }

.status-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

.status-tag-green { background: var(--accent-muted); color: var(--accent); border: 1px solid var(--accent-border); }
.status-tag-amber { background: rgba(245,158,11,0.1); color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); }
.status-tag-red   { background: rgba(239,68,68,0.1); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }

/* ─── Inbox 3-Panel Layout ─── */
.inbox-shell {
  display: grid;
  grid-template-columns: 300px 1fr 260px;
  height: calc(100vh - 140px);
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.inbox-left {
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  overflow: hidden;
}

.inbox-center {
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  overflow: hidden;
}

.inbox-right {
  border-left: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  overflow-y: auto;
}

.inbox-chat-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inbox-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.inbox-input-bar {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

/* ─── Conversation List Items ─── */
.inbox-left .p-4 {
    padding: 1.25rem !important;
}
.conv-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(148,163,184,0.05);
  text-decoration: none;
  transition: background 0.15s;
  cursor: pointer;
}

.conv-item:hover { background: var(--bg-surface-elevated); }
.conv-item.active { background: var(--accent-muted); border-left: 3px solid var(--accent); padding-left: calc(1rem - 3px); }

.conv-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-surface-elevated);
  color: var(--text-sub);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.conv-avatar.active { background: var(--accent); color: #0f172a; }

.conv-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: var(--accent);
  color: #0f172a;
  font-size: 9px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-main);
}

/* ─── Chat Bubbles ─── */
.chat-bubble-sent {
  background: var(--accent);
  color: #0f172a;
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 2px 12px rgba(37,211,102,0.15);
}

.chat-bubble-recv {
  background: var(--bg-surface);
  color: var(--text-main);
  padding: 0.75rem 1rem;
  border-radius: 16px 16px 16px 4px;
  border: 1px solid var(--border-subtle);
}

/* ─── Footer JS override for Bootstrap ─── */
.content-area {
  position: relative;
}
