/* ============================================================
   SMS Reminder Manager - Main Stylesheet
   Premium Admin Dashboard Theme
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --primary: #6366f1;
  --primary-dark: #4f52cc;
  --primary-light: #a5b4fc;
  --secondary: #0ea5e9;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;
  --dark: #0f172a;
  --dark-2: #1e293b;
  --dark-3: #334155;
  --muted: #64748b;
  --light: #f1f5f9;
  --border: #e2e8f0;
  --white: #ffffff;

  --sidebar-width: 260px;
  --topbar-height: 64px;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .08);
  --shadow-md: 0 4px 24px rgba(99, 102, 241, .14);
  --transition: all .22s cubic-bezier(.4, 0, .2, 1);

  /* Sidebar colors */
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-active: rgba(99, 102, 241, .15);
  --sidebar-text: #94a3b8;
  --sidebar-icon: #64748b;
}

/* ── Reset / Base ───────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: .9375rem;
  color: var(--dark);
  background: var(--light);
  overflow-x: hidden;
  line-height: 1.6;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1030;
  overflow-y: auto;
  overflow-x: hidden;
  transition: var(--transition);
  scrollbar-width: thin;
  scrollbar-color: var(--dark-3) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--dark-3);
  border-radius: 4px;
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  min-height: var(--topbar-height);
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--white);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .4);
}

.brand-text {
  flex: 1;
}

.brand-name {
  display: block;
  font-size: .9375rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}

.brand-tagline {
  display: block;
  font-size: .7rem;
  color: var(--sidebar-text);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.sidebar-toggle-btn {
  background: none;
  border: none;
  color: var(--sidebar-text);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: var(--transition);
}

.sidebar-toggle-btn:hover {
  color: var(--white);
  background: var(--sidebar-hover);
}

/* User */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.user-avatar {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-name {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: .65rem;
  background: rgba(99, 102, 241, .25);
  color: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, .3);
  padding: 1px 7px;
  border-radius: 20px;
}

/* Navigation */
.sidebar-nav {
  list-style: none;
  padding: 12px 12px;
  margin: 0;
  flex: 1;
}

.nav-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sidebar-icon);
  padding: 16px 8px 6px;

  first-of-type {
    padding-top: 8px;
  }
}

.nav-item .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--border-radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-item .nav-link i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item .nav-link span:first-of-type {
  flex: 1;
}

.nav-badge {
  background: rgba(99, 102, 241, .2);
  color: var(--primary-light);
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 22px;
  text-align: center;
}

.nav-item .nav-link:hover {
  color: var(--white);
  background: var(--sidebar-hover);
}

.nav-item.active .nav-link {
  color: var(--primary-light);
  background: var(--sidebar-active);
  font-weight: 600;
}

.nav-item.active .nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-logout:hover {
  color: #fca5a5 !important;
  background: rgba(239, 68, 68, .1) !important;
}

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  gap: 16px;
  box-shadow: 0 1px 0 var(--border);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-toggle {
  background: none;
  border: none;
  font-size: 1.375rem;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
  line-height: 1;
}

.topbar-toggle:hover {
  color: var(--primary);
  background: var(--light);
}

.breadcrumb {
  margin: 0;
  font-size: .8125rem;
}

.breadcrumb-item a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  color: var(--primary);
}

.breadcrumb-item.active {
  color: var(--dark);
  font-weight: 500;
}

.breadcrumb-item+.breadcrumb-item::before {
  color: var(--muted);
}

.topbar-time,
.topbar-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8125rem;
  color: var(--muted);
  font-weight: 500;
}

.topbar-logout {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 1.125rem;
  transition: var(--transition);
}

.topbar-logout:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, .08);
}

/* ── Page Content ───────────────────────────────────────────── */
.page-content {
  padding: 28px 28px;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--dark);
  margin: 0;
  line-height: 1.2;
}

.page-subtitle {
  font-size: .8125rem;
  color: var(--muted);
  margin: 4px 0 0;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title i {
  color: var(--primary);
}

.card-body {
  padding: 22px;
}

/* Stat cards */
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  transition: var(--transition);
  opacity: 0;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: inherit;
}

.stat-card:hover::after {
  opacity: 1;
}

.stat-card-primary::after {
  background: var(--primary);
}

.stat-card-success::after {
  background: var(--success);
}

.stat-card-warning::after {
  background: var(--warning);
}

.stat-card-danger::after {
  background: var(--danger);
}

.stat-card-info::after {
  background: var(--info);
}

.stat-card-secondary::after {
  background: var(--secondary);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon-primary {
  background: rgba(99, 102, 241, .12);
  color: var(--primary);
}

.stat-icon-success {
  background: rgba(16, 185, 129, .12);
  color: var(--success);
}

.stat-icon-warning {
  background: rgba(245, 158, 11, .12);
  color: var(--warning);
}

.stat-icon-danger {
  background: rgba(239, 68, 68, .12);
  color: var(--danger);
}

.stat-icon-info {
  background: rgba(6, 182, 212, .12);
  color: var(--info);
}

.stat-icon-secondary {
  background: rgba(14, 165, 233, .12);
  color: var(--secondary);
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1;
}

.stat-label {
  font-size: .8rem;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 500;
}

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

.stat-change.up {
  color: var(--success);
}

.stat-change.down {
  color: var(--danger);
}

/* ── Tables ─────────────────────────────────────────────────── */
.table-card {
  border-radius: var(--border-radius);
  overflow: hidden;
}

.table {
  margin: 0;
}

.table thead th {
  background: var(--light);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  white-space: nowrap;
}

.table tbody td {
  padding: 13px 16px;
  font-size: .875rem;
  border-bottom: 1px solid rgba(226, 232, 240, .6);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table-hover tbody tr:hover {
  background: rgba(99, 102, 241, .03);
}

/* Badges */
.badge-overdue {
  background: rgba(239, 68, 68, .1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, .2);
}

.badge-current {
  background: rgba(16, 185, 129, .1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, .2);
}

.badge-warning {
  background: rgba(245, 158, 11, .1);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, .2);
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-control,
.form-select {
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  padding: .5rem .875rem;
  font-size: .875rem;
  transition: var(--transition);
  background: var(--white);
  color: var(--dark);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
  outline: none;
}

.form-label {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--dark-3);
  margin-bottom: .375rem;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  font-size: .875rem;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  padding: .5rem 1.125rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(99, 102, 241, .3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, .4);
  color: var(--white);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}

.btn-success:hover {
  background: #059669;
  color: var(--white);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-danger:hover {
  background: #dc2626;
  color: var(--white);
}

.btn-warning {
  background: var(--warning);
  color: var(--dark);
}

.btn-warning:hover {
  background: #d97706;
  color: var(--dark);
}

.btn-info {
  background: var(--info);
  color: var(--white);
}

.btn-info:hover {
  background: #0891b2;
  color: var(--white);
}

.btn-secondary {
  background: var(--dark-3);
  color: var(--white);
}

.btn-secondary:hover {
  background: var(--dark-2);
  color: var(--white);
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-sm {
  padding: .325rem .75rem;
  font-size: .8rem;
}

.btn-icon {
  padding: .5rem .6rem;
}

/* action buttons in table */
.btn-action {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: .875rem;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--muted);
  text-decoration: none;
}

.btn-action:hover {
  border-color: transparent;
  transform: scale(1.08);
  color: var(--white);
}

.btn-action-primary:hover {
  background: var(--primary);
}

.btn-action-success:hover {
  background: var(--success);
}

.btn-action-danger:hover {
  background: var(--danger);
}

.btn-action-info:hover {
  background: var(--info);
}

.btn-action-warning:hover {
  background: var(--warning);
  color: var(--dark);
}

/* ── Modals ─────────────────────────────────────────────────── */
.modal-content {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
}

.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
}

.modal-title {
  font-weight: 700;
  font-size: 1rem;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
}

/* ── Chat UI ────────────────────────────────────────────────── */
.chat-container {
  height: calc(100vh - var(--topbar-height) - 200px);
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
  border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.flex-1 {
  flex: 1;
}

.flex-grow-1 {
  flex-grow: 1;
}


.chat-bubble-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 4px;
  width: 100%;
}



.chat-content-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  align-items: flex-start;
}

.chat-bubble-wrap.outbound .chat-content-wrap {
  align-items: flex-end;
}



.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-avatar-outbound {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: var(--white);
}

.chat-avatar-inbound {
  background: linear-gradient(135deg, var(--success), var(--info));
  color: var(--white);
}

.chat-bubble {
  max-width: 68%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: .875rem;
  line-height: 1.5;
  position: relative;
}

.chat-bubble.outbound {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.chat-bubble.inbound {
  background: var(--white);
  color: var(--dark);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow);
}

.chat-meta {
  font-size: .7rem;
  color: var(--muted);
  margin-top: 4px;
  padding: 0 4px;
}

.chat-status-icon {
  font-size: .7rem;
}

.status-delivered {
  color: var(--success);
}

.status-sent {
  color: var(--info);
}

.status-failed {
  color: var(--danger);
}

.status-pending {
  color: var(--muted);
}

.chat-input-area {
  border-top: 1px solid var(--border);
  padding: 16px;
  background: var(--white);
  border-radius: 0 0 var(--border-radius-sm) var(--border-radius-sm);
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.chat-textarea {
  flex: 1;
  resize: none;
  max-height: 120px;
  min-height: 42px;
  overflow-y: auto;
}

/* ── Status Badges ──────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-sent {
  background: rgba(6, 182, 212, .1);
  color: var(--info);
}

.status-delivered {
  background: rgba(16, 185, 129, .1);
  color: var(--success);
}

.status-failed {
  background: rgba(239, 68, 68, .1);
  color: var(--danger);
}

.status-pending {
  background: rgba(100, 116, 139, .1);
  color: var(--muted);
}

.status-received {
  background: rgba(99, 102, 241, .1);
  color: var(--primary);
}

/* ── Progress Bars ──────────────────────────────────────────── */
.progress {
  height: 6px;
  border-radius: 3px;
  background: var(--light);
}

.progress-bar {
  border-radius: 3px;
}

/* ── Alerts (overrides) ─────────────────────────────────────── */
.alert {
  border: none;
  border-radius: var(--border-radius-sm);
  font-size: .875rem;
  border-left: 4px solid;
}

.alert-success {
  border-color: var(--success);
  background: rgba(16, 185, 129, .08);
  color: #065f46;
}

.alert-danger {
  border-color: var(--danger);
  background: rgba(239, 68, 68, .08);
  color: #991b1b;
}

.alert-warning {
  border-color: var(--warning);
  background: rgba(245, 158, 11, .08);
  color: #92400e;
}

.alert-info {
  border-color: var(--info);
  background: rgba(6, 182, 212, .08);
  color: #164e63;
}

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  border: none;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  min-width: 280px;
}

/* ── DataTables overrides ───────────────────────────────────── */
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  padding: .4rem .75rem;
  font-size: .8rem;
}

.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
}

.dataTables_info {
  font-size: .8rem;
  color: var(--muted);
}

.dataTables_paginate .paginate_button {
  border-radius: 6px !important;
  font-size: .8rem !important;
}

.dataTables_paginate .paginate_button.current {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--white) !important;
}

/* ── Sidebar Overlay (mobile) ───────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 1020;
  backdrop-filter: blur(2px);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1199.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .sidebar-overlay.show {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }
}

@media (max-width: 767.98px) {
  .page-content {
    padding: 16px;
  }

  .topbar {
    padding: 0 16px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .topbar-date,
  .topbar-time {
    display: none;
  }

  .chat-bubble {
    max-width: 88%;
  }
}

/* ── Utilities ──────────────────────────────────────────────── */
.text-primary {
  color: var(--primary) !important;
}

.text-muted {
  color: var(--muted) !important;
}

.fw-600 {
  font-weight: 600;
}

.fw-700 {
  font-weight: 700;
}

.fw-800 {
  font-weight: 800;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

.rounded-xl {
  border-radius: var(--border-radius);
}

.rounded-lg {
  border-radius: var(--border-radius-sm);
}

/* ── Loading Spinner ────────────────────────────────────────── */
.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, .7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

/* ── Chart containers ───────────────────────────────────────── */
.chart-container {
  position: relative;
}

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  background: var(--light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.empty-state h5 {
  font-weight: 700;
  color: var(--dark);
}

.empty-state p {
  color: var(--muted);
  font-size: .875rem;
}

/* ── Login Page ─────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #312e81 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, .35);
}

.login-logo {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--white);
  margin: 0 auto 24px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, .4);
}

/* ── Keyframe Animations ────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .4;
  }
}

.animate-fade-in {
  animation: fadeInUp .3s ease forwards;
}

.badge-live::before {
  animation: pulse-dot 1.5s ease-in-out infinite;
}

/* ── Animations ─────────────────────────────────────────────── */
.animate-fade-in {
  animation: fadeIn .4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-out {
  transition: all .4s ease;
  opacity: 0;
  transform: translateX(20px);
}

@keyframes pulse-dot {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
  }

  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

/* ── Notifications ─────────────────────────────────────────── */
.notif-dropdown {
  width: 340px;
  border-radius: var(--border-radius);
  overflow: hidden;
  z-index: 1100;
}

.notif-item {
  display: flex;
  padding: 12px 16px;
  gap: 12px;
  text-decoration: none !important;
  color: var(--dark) !important;
  transition: var(--transition);
  border-bottom: 1px solid var(--light);
}

.notif-item:hover {
  background: var(--light);
}

.notif-avatar {
  width: 40px;
  height: 40px;
  background: var(--sidebar-active);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.notif-content {
  flex: 1;
  min-width: 0;
}

.notif-sender {
  font-weight: 700;
  font-size: .85rem;
  margin-bottom: 2px;
}

.notif-preview {
  font-size: .8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-time {
  font-size: .7rem;
  color: var(--muted);
  margin-top: 4px;
}

.bell-shake {
  animation: bell-shake .5s ease-in-out;
}

@keyframes bell-shake {
  0% {
    transform: rotate(0);
  }

  15% {
    transform: rotate(15deg);
  }

  30% {
    transform: rotate(-15deg);
  }

  45% {
    transform: rotate(10deg);
  }

  60% {
    transform: rotate(-10deg);
  }

  75% {
    transform: rotate(5deg);
  }

  85% {
    transform: rotate(-5deg);
  }

  100% {
    transform: rotate(0);
  }
}

@keyframes pulse-shadow {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

.animate-pulse {
  animation: pulse-shadow 2s infinite;
}

@media (max-width: 576px) {
  .notif-dropdown {
    width: 280px;
    position: fixed !important;
    right: 10px !important;
    left: auto !important;
    transform: none !important;
  }
}

/*  Auth body / wrapper  */
.auth-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #312e81 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
}

.auth-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, .35);
  animation: fadeInUp .4s ease;
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.auth-logo .brand-icon {
  width: 64px;
  height: 64px;
  font-size: 2rem;
  box-shadow: 0 8px 24px rgba(99, 102, 241, .4);
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--dark);
  text-align: center;
  margin-bottom: 6px;
}

.auth-subtitle {
  color: var(--muted);
  text-align: center;
  margin-bottom: 32px;
  font-size: .9rem;
}

/* Sidebar collapsed state */
.sidebar.collapsed {
  width: 72px;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .sidebar-user .user-info,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-item .nav-link span,
.sidebar.collapsed .nav-badge {
  display: none;
}

.sidebar.collapsed .main-content {
  margin-left: 72px;
}

.main-content.sidebar-collapsed {
  margin-left: 72px;
}

/* ── Chat Interface ─────────────────────────────────────────── */
.chat-container {
  display: flex !important;
  flex-direction: row !important;
  height: calc(100vh - 220px);
  min-height: 500px;
  background: var(--white);
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.chat-sidebar {
  width: 350px !important;
  min-width: 350px !important;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: #fcfdfe;
  flex-shrink: 0;
}

.chat-sidebar-search {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.conversation-list {
  flex: 1;
  overflow-y: auto;
}

.conversation-item {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid rgba(0, 0, 0, .03);
  text-decoration: none !important;
}

.conversation-item:hover {
  background: rgba(99, 102, 241, .05);
}

.conversation-item.active {
  background: rgba(99, 102, 241, .1);
  border-left: 4px solid var(--primary);
}

.avatar-initials {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.conversation-info {
  flex: 1;
  overflow: hidden;
}

.conversation-name {
  font-weight: 700;
  font-size: .95rem;
  color: var(--dark);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-last-msg {
  font-size: .8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
}

.chat-messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: .9rem;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  line-height: 1.4;
}

.message-inbound {
  align-self: flex-start;
  background: var(--white);
  color: var(--dark);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}

.message-outbound {
  align-self: flex-end;
  background: var(--primary);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.message-time {
  font-size: .65rem;
  margin-top: 4px;
  opacity: .7;
  display: block;
}

.chat-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--white);
}

.chat-input-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.chat-input {
  border-radius: 20px !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
}

.conversation-time {
  font-size: .7rem;
  color: var(--muted);
  flex-shrink: 0;
}

/* Custom Scrollbar for Chat List */
.conversation-list::-webkit-scrollbar {
  width: 5px;
}

.conversation-list::-webkit-scrollbar-track {
  background: transparent;
}

.conversation-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.conversation-list:hover::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.chat-messages:hover::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
}