/* ═══════════════════════════════════════════════════════════════
   RAI CLOUD  –  Global Stylesheet
   Colors: Primary #075E54 | Accent #1EBE5A | BG #F4F6F8
═══════════════════════════════════════════════════════════════════ */

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

:root {
  --green:        #075E54;
  --green-dark:   #054a43;
  --green-accent: #1EBE5A;
  --green-light:  #e8f5e9;
  --bg:           #F4F6F8;
  --white:        #ffffff;
  --black:        #111b21;
  --grey:         #757575;
  --grey-light:   #e0e0e0;
  --grey-border:  #eeeeee;
  --error:        #d32f2f;
  --sent-bubble:  #dcf8c6;
  --recv-bubble:  #ffffff;
  --shadow-sm:    0 1px 4px rgba(0,0,0,.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.14);
  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    20px;
  --radius-pill:  999px;
  --sidebar-w:    260px;
  --header-h:     56px;
  --bn-h:         60px;
  --transition:   .2s ease;
}

html { font-size: 15px; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--black);
  line-height: 1.5;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; background: none; }
input, textarea, select { font-family: inherit; }
.hidden { display: none !important; }

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

/* ═══════════════════════════════════════════════════════════════
   AUTH VIEW
═══════════════════════════════════════════════════════════════════ */
.auth-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  position: relative;
  overflow: hidden;
}
.auth-view::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../assets/images/login.png') center/cover no-repeat;
  opacity: .18;
}

.auth-card {
  position: relative;
  background: var(--white);
  border-radius: 28px;
  padding: 40px 36px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .5s cubic-bezier(.22,.61,.36,1);
}
.auth-logo-wrap {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--green-light);
  margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.auth-logo img { width: 52px; height: 52px; object-fit: contain; }
.auth-logo-title { font-size: 18px; font-weight: 800; color: var(--green); }
.auth-logo-sub   { font-size: 13px; color: var(--grey); margin-top: 2px; }

.auth-heading { font-size: 22px; font-weight: 800; color: var(--green); margin-bottom: 4px; }
.auth-subheading { font-size: 13px; color: var(--grey); margin-bottom: 24px; }

/* Form elements */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--grey); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px; }
.form-control {
  width: 100%; height: 50px;
  padding: 0 16px 0 44px;
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  font-size: 14px; color: var(--black);
  transition: border-color var(--transition);
}
.form-control:focus { outline: none; border-color: var(--green); background: var(--white); }
.form-control.error { border-color: var(--error); }
.input-wrap { position: relative; }
.input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--grey); width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
}
.input-icon svg { width: 18px; height: 18px; }
.input-eye {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--grey); background: none; border: none; cursor: pointer;
  display: flex; align-items: center;
}
.input-eye svg { width: 18px; height: 18px; }
.form-error { color: var(--error); font-size: 12px; margin-top: 4px; }

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* Checkbox */
.check-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.check-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--grey); }
.check-label input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--green); }
.link-green { color: var(--green); font-size: 13px; font-weight: 600; }
.link-green:hover { text-decoration: underline; }

/* Buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 50px;
  border-radius: var(--radius-pill);
  font-size: 15px; font-weight: 700; letter-spacing: .2px;
  transition: all var(--transition);
  border: none; cursor: pointer;
}
.btn-primary {
  background: var(--green);
  color: var(--white);
  box-shadow: 0 8px 24px rgba(7,94,84,.30);
}
.btn-primary:hover:not(:disabled) { background: var(--green-dark); box-shadow: 0 10px 28px rgba(7,94,84,.35); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-outline {
  background: transparent;
  color: var(--green);
  border: 1.5px solid var(--green);
}
.btn-outline:hover { background: var(--green-light); }
.btn-danger { background: var(--error); color: var(--white); }
.btn-sm { height: 38px; font-size: 13px; padding: 0 20px; width: auto; }
.btn-xs { height: 32px; font-size: 12px; padding: 0 14px; width: auto; }
.btn-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--grey); }
.auth-footer a { color: var(--green); font-weight: 700; }

/* OTP inputs */
.otp-row { display: flex; gap: 10px; justify-content: center; margin: 24px 0; }
.otp-input {
  width: 48px; height: 56px;
  text-align: center; font-size: 20px; font-weight: 700;
  border: 2px solid var(--grey-light); border-radius: var(--radius-md);
  background: var(--bg);
  transition: border-color var(--transition);
}
.otp-input:focus { outline: none; border-color: var(--green); background: var(--white); }

/* Stepper */
.step-bar { display: flex; align-items: center; margin-bottom: 28px; }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: var(--grey-light); color: var(--grey);
  transition: all var(--transition);
}
.step-dot.active { background: var(--green); color: var(--white); }
.step-dot.done { background: var(--green-accent); color: var(--white); }
.step-line { flex: 1; height: 2px; background: var(--grey-light); margin: 0 6px; }
.step-line.done { background: var(--green-accent); }

/* Password strength */
.pass-strength { margin-top: 6px; }
.pass-strength-bar { height: 4px; border-radius: 2px; background: var(--grey-light); overflow: hidden; }
.pass-strength-fill { height: 100%; border-radius: 2px; transition: all .3s; }
.pass-strength-label { font-size: 11px; margin-top: 3px; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   APP SHELL LAYOUT
═══════════════════════════════════════════════════════════════════ */
#app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--green);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  flex-shrink: 0;
  z-index: 200;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo { width: 36px; height: 36px; object-fit: contain; }
.sidebar-title { font-size: 17px; font-weight: 800; color: var(--white); letter-spacing: .3px; }

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  cursor: pointer;
}
.avatar-ring {
  width: 38px; height: 38px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
}
.sb-avatar { width: 100%; height: 100%; object-fit: cover; }
.avatar-placeholder { color: var(--white); font-weight: 700; font-size: 15px; }
.sb-user-info { flex: 1; overflow: hidden; }
.sb-name { font-size: 13px; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-email { font-size: 11px; color: rgba(255,255,255,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav { flex: 1; padding: 8px 0; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px;
  color: rgba(255,255,255,.75);
  font-size: 13.5px; font-weight: 500;
  transition: all var(--transition);
  border-radius: 0; position: relative;
  cursor: pointer; user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: var(--white); }
.nav-item.active { background: rgba(255,255,255,.15); color: var(--white); font-weight: 600; }
.nav-icon { width: 22px; height: 22px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 20px; height: 20px; }
.nav-divider { height: 1px; background: rgba(255,255,255,.1); margin: 6px 0; }
.nav-logout { color: rgba(255,100,100,.85); }
.nav-logout:hover { background: rgba(255,0,0,.08); color: #ff6b6b; }

/* Badge */
.badge {
  background: var(--green-accent); color: var(--white);
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px;
  margin-left: auto;
}

/* ── Main wrapper ──────────────────────────────────────────────── */
.main-wrapper {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden;
}

.mobile-header {
  display: none;
  align-items: center; gap: 12px;
  height: var(--header-h);
  background: var(--green);
  padding: 0 16px;
  flex-shrink: 0;
}
.hamburger-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--white); background: rgba(255,255,255,.12);
}
.hamburger-btn svg { width: 22px; height: 22px; }
.mobile-title { flex: 1; font-size: 16px; font-weight: 700; color: var(--white); }
.mobile-header-actions { display: flex; gap: 6px; }

.page-content { flex: 1; overflow-y: auto; padding: 24px; }

/* ── Sidebar overlay (mobile) ──────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 190;
}

/* ── Bottom nav (mobile) ───────────────────────────────────────── */
.bottom-nav {
  display: none;
  height: var(--bn-h);
  background: var(--white);
  border-top: 1px solid var(--grey-border);
  box-shadow: 0 -2px 12px rgba(0,0,0,.06);
  flex-shrink: 0;
}
.bn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 10px; font-weight: 500;
  color: var(--grey); transition: color var(--transition); cursor: pointer;
  position: relative;
}
.bn-item svg { width: 22px; height: 22px; }
.bn-item.active { color: var(--green); }
.bn-item .badge { position: absolute; top: 6px; right: calc(50% - 18px); }

/* ═══════════════════════════════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════════════════════════════════ */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.page-title { font-size: 20px; font-weight: 800; color: var(--black); }
.page-title small { font-size: 13px; color: var(--grey); font-weight: 400; display: block; }

/* ═══════════════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════════════════ */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.card-title { font-size: 14px; font-weight: 700; color: var(--black); margin-bottom: 16px; }

/* ═══════════════════════════════════════════════════════════════
   STATS GRID
═══════════════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 18px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 6px;
}
.stat-icon {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  background: var(--green-light); display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 22px; height: 22px; color: var(--green); }
.stat-val { font-size: 26px; font-weight: 800; color: var(--black); line-height: 1; }
.stat-label { font-size: 12px; color: var(--grey); font-weight: 500; }

/* Hero banner */
.hero-banner {
  background: linear-gradient(135deg, var(--green) 0%, #0d8f80 100%);
  border-radius: var(--radius-lg); padding: 24px; color: var(--white);
  margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between;
  overflow: hidden; position: relative;
}
.hero-banner::after {
  content: '';
  position: absolute; right: -20px; top: -20px;
  width: 140px; height: 140px;
  border-radius: 50%; background: rgba(255,255,255,.06);
}
.hero-banner-title { font-size: 18px; font-weight: 800; }
.hero-banner-sub { font-size: 13px; opacity: .8; margin-top: 4px; }
.hero-banner-btn {
  background: var(--white); color: var(--green);
  border: none; border-radius: var(--radius-pill);
  padding: 8px 18px; font-size: 13px; font-weight: 700;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: all var(--transition);
}
.hero-banner-btn:hover { background: var(--green-light); }

/* ═══════════════════════════════════════════════════════════════
   INBOX / CONVERSATIONS
═══════════════════════════════════════════════════════════════════ */
.inbox-layout { display: flex; height: calc(100vh - var(--header-h) - 48px); gap: 0; }
.conversation-list {
  width: 340px; flex-shrink: 0;
  background: var(--white); border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.inbox-search-bar {
  padding: 12px; border-bottom: 1px solid var(--grey-border);
}
.search-input-wrap { position: relative; }
.search-input-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--grey); }
.search-input {
  width: 100%; height: 38px; padding: 0 12px 0 36px;
  background: var(--bg); border: 1.5px solid transparent;
  border-radius: var(--radius-pill); font-size: 13px;
  transition: border-color var(--transition);
}
.search-input:focus { outline: none; border-color: var(--green); }
.inbox-filters { display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--grey-border); overflow-x: auto; }
.filter-chip {
  padding: 4px 12px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; cursor: pointer;
  background: var(--bg); color: var(--grey);
  transition: all var(--transition); white-space: nowrap; border: none;
}
.filter-chip.active { background: var(--green); color: var(--white); }
.conv-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.conv-list-end {
  flex: 1; min-height: 100px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 20px;
}
.conv-list-end-logo { width: 40px; height: 40px; opacity: .18; }
.conv-list-end p { font-size: 11.5px; font-weight: 700; letter-spacing: .6px; color: var(--grey-light); }
.conv-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; cursor: pointer;
  border-bottom: 1px solid var(--grey-border);
  transition: background var(--transition);
}
.conv-item:hover { background: var(--bg); }
.conv-item.active { background: var(--green-light); }
.conv-item:last-child { border-bottom: none; }
.conv-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--green-light); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: var(--green);
  overflow: hidden;
}
.conv-avatar img { width: 100%; height: 100%; object-fit: cover; }
.conv-info { flex: 1; overflow: hidden; }
.conv-top { display: flex; align-items: center; justify-content: space-between; }
.conv-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.conv-time { font-size: 11px; color: var(--grey); flex-shrink: 0; }
.conv-bottom { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.conv-last-msg { font-size: 12px; color: var(--grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.conv-tick { display: inline-flex; vertical-align: -2px; margin-right: 3px; }
.conv-unread {
  background: var(--green-accent); color: var(--white);
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px; flex-shrink: 0;
}

/* Chat area */
.chat-area {
  flex: 1; display: flex; flex-direction: column;
  background: #e5ddd5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cpath fill='%23d4c5b0' fill-opacity='.08' d='M100 0h100v100H100zM0 100h100v100H0zM200 100h100v100H200zM100 200h100v100H100z'/%3E%3C/svg%3E");
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); margin-left: 14px;
}
.chat-header {
  background: var(--green); color: var(--white);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
}
.chat-contact-name { font-size: 15px; font-weight: 600; }
.chat-contact-status { font-size: 12px; opacity: .8; }
.chat-messages { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.msg-bubble {
  max-width: 78%; width: fit-content; min-width: 72px; padding: 6px 14px 4px;
  border-radius: 12px; font-size: 14px; line-height: 1.35;
  position: relative; word-break: break-word;
}
.msg-bubble.sent { background: var(--sent-bubble); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-bubble.recv { background: var(--recv-bubble); align-self: flex-start; border-bottom-left-radius: 4px; box-shadow: var(--shadow-sm); }
.msg-bubble.media { padding: 3px; min-width: 0; }
.msg-bubble.media .msg-time { margin-top: 2px; padding-right: 2px; }
.msg-time { font-size: 11px; color: var(--grey); margin-top: 2px; text-align: right; }
.msg-status { display: inline-block; margin-left: 4px; }

/* ── Per-message actions, reactions, quoted reply (mirrors Flutter's long-press menu) ── */
.msg-action-btn {
  position: absolute; top: 2px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.55); color: var(--grey);
  opacity: 0; transition: opacity .15s;
  cursor: pointer; border: none; padding: 0;
}
.msg-bubble:hover .msg-action-btn, .msg-action-btn:focus { opacity: 1; }
.msg-bubble.recv .msg-action-btn { background: rgba(0,0,0,.05); }
.msg-pin-badge { position: absolute; top: -8px; left: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--green); color: white; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.msg-pin-badge svg { width: 10px; height: 10px; }

.msg-quoted {
  background: rgba(0,0,0,.06); border-left: 3px solid var(--green);
  border-radius: 4px; padding: 3px 6px; margin-bottom: 4px;
  max-width: 240px;
}
.msg-quoted-name { font-size: 10.5px; font-weight: 700; color: var(--green); line-height: 1.3; }
.msg-quoted-text { font-size: 11.5px; color: var(--grey); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.msg-reactions { display: flex; gap: 4px; margin-top: 2px; flex-wrap: wrap; }
.msg-reaction-pill {
  background: var(--white); border: 1px solid var(--grey-border); border-radius: var(--radius-pill);
  font-size: 12px; padding: 1px 7px; cursor: pointer; box-shadow: var(--shadow-sm);
}
.msg-reaction-pill.mine { border-color: var(--green); background: var(--green-light); }

.msg-select-check {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--grey-light);
  background: var(--white); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: white;
}
.msg-select-check.checked { background: var(--green); border-color: var(--green); }
.msg-select-check svg { width: 13px; height: 13px; }
.msg-row.select-mode { cursor: pointer; }
.msg-row.selected .msg-bubble { outline: 2px solid var(--green); outline-offset: 1px; }

/* ── Message action bottom-sheet (emoji row + action list) ─────── */
.msg-emoji-row { display: flex; gap: 4px; overflow-x: auto; padding: 4px 4px 12px; border-bottom: 1px solid var(--grey-border); margin-bottom: 8px; }
.msg-emoji-btn {
  background: none; border: none; font-size: 24px; padding: 6px; border-radius: 50%;
  cursor: pointer; flex-shrink: 0; transition: background .15s;
}
.msg-emoji-btn.active, .msg-emoji-btn:hover { background: var(--green-light); }
.msg-action-list { display: flex; flex-direction: column; }
.msg-action-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 4px;
  cursor: pointer; font-size: 14px; color: var(--black); border-radius: 8px;
}
.msg-action-item:hover { background: var(--bg); }
.msg-action-item.danger { color: #e53935; }
.msg-action-icon { display: flex; align-items: center; justify-content: center; width: 20px; color: var(--grey); }
.msg-action-item.danger .msg-action-icon { color: #e53935; }

/* ── Reply preview bar above composer ───────────────────────────── */
.reply-preview-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); border-top: 1px solid var(--grey-border);
  padding: 8px 14px;
}
.reply-preview-accent { width: 3px; align-self: stretch; background: var(--green); border-radius: 2px; }
.reply-preview-body { flex: 1; min-width: 0; }
.reply-preview-title { font-size: 12.5px; font-weight: 700; color: var(--green); }
.reply-preview-text { font-size: 12.5px; color: var(--grey); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── In-chat search bar ──────────────────────────────────────────── */
.chat-search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--white); border-bottom: 1px solid var(--grey-border);
  padding: 10px 14px;
}
.chat-search-input { flex: 1; border: none; outline: none; font-size: 14px; background: transparent; }

/* ── Forward-to conversation picker ─────────────────────────────── */
.forward-list { max-height: 340px; overflow-y: auto; margin: -4px -4px 0; }
.forward-list .list-item.active { background: var(--green-light); }

.chat-input-area {
  background: var(--white); padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--grey-border);
}
.chat-text-input {
  flex: 1; min-height: 40px; max-height: 120px;
  padding: 10px 14px;
  border: 1.5px solid var(--grey-light); border-radius: 24px;
  font-size: 14px; resize: none; line-height: 1.4;
  transition: border-color var(--transition);
}
.chat-text-input:focus { outline: none; border-color: var(--green); }
.chat-send-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--green); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background var(--transition);
}
.chat-send-btn:hover { background: var(--green-dark); }
.chat-send-btn svg { width: 20px; height: 20px; }
.chat-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--bg); gap: 12px; color: var(--grey);
}
.chat-empty svg { width: 64px; height: 64px; color: var(--green-light); }
.chat-empty p { font-size: 15px; font-weight: 500; }

/* ── Chat input bar (mirrors Flutter's pill + circular mic/send) ── */
.chat-input-bar {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 8px 10px; background: transparent;
}
.chat-input-pill {
  flex: 1; display: flex; align-items: flex-end;
  background: var(--white); border-radius: 28px;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  padding: 4px 4px 4px 14px;
}
.cib-text {
  flex: 1; border: none; outline: none; resize: none;
  font-size: 15px; font-family: inherit; line-height: 1.3;
  padding: 10px 6px; max-height: 120px; background: transparent;
}
.cib-icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--grey); flex-shrink: 0; transition: background var(--transition);
}
.cib-icon-btn:hover { background: var(--bg); }
.cib-send-btn {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  background: var(--green); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.cib-send-btn:hover { background: var(--green-dark); }
.cib-send-btn svg { width: 22px; height: 22px; }

.cib-recording-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); margin: 0 10px 8px; padding: 10px 16px;
  border-radius: 24px; box-shadow: 0 1px 6px rgba(0,0,0,.06);
  font-size: 13px; font-weight: 600; color: var(--black);
}
.cib-rec-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--error);
  animation: pulse-rec 1s infinite;
}
@keyframes pulse-rec { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ── Attachment grid (mirrors Flutter's bottom-sheet 4x2 grid) ──── */
.attach-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 18px 8px; padding: 8px 0 4px;
}
.attach-option {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; text-align: center;
}
.attach-option span { font-size: 11px; color: var(--grey); font-weight: 500; }
.attach-option-icon {
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--transition);
}
.attach-option:hover .attach-option-icon { transform: scale(1.08); }
.attach-option-icon svg { width: 26px; height: 26px; }

/* ── Voice Note bubble (WhatsApp-style) ─────────────────────────── */
.voice-bubble {
  display: flex; align-items: center; gap: 6px;
  min-width: 190px; max-width: 260px;
}
.voice-play-btn {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--green); color: white;
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; transition: background .15s;
}
.voice-play-btn:hover { background: var(--green-dark, #064e44); }
.voice-wave {
  display: flex; align-items: center; gap: 2px; flex: 1; height: 28px; min-width: 40px;
}
.voice-bar {
  width: 3px; border-radius: 2px; background: currentColor; opacity: .45; min-height: 4px;
}
.voice-dur { font-size: 11px; color: var(--grey); white-space: nowrap; min-width: 26px; flex-shrink: 0; }
.voice-speed-btn {
  font-size: 10.5px; font-weight: 700; color: var(--green);
  background: rgba(7,94,84,.1); border: none; border-radius: var(--radius-pill);
  padding: 2px 6px; cursor: pointer; flex-shrink: 0; white-space: nowrap;
}
.voice-speed-btn:hover { background: rgba(7,94,84,.18); }
.voice-dl-btn {
  color: var(--grey); opacity: .6; flex-shrink: 0;
  display: flex; align-items: center;
}
.voice-dl-btn:hover { opacity: 1; }

/* ── Document / Location bubble cards ────────────────────────────── */
.msg-doc-card, .msg-location-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 8px;
  background: rgba(0,0,0,.03); min-width: 180px;
  color: inherit; text-decoration: none;
}
.msg-doc-icon {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  background: var(--green-light); color: var(--green);
  display: flex; align-items: center; justify-content: center;
}
.msg-doc-info { display: flex; flex-direction: column; overflow: hidden; }
.msg-doc-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.msg-doc-size { font-size: 11px; color: var(--grey); }
.msg-location-icon { font-size: 24px; }

/* ═══════════════════════════════════════════════════════════════
   CONTACTS / LIST TABLE
═══════════════════════════════════════════════════════════════════ */
.list-card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.list-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--grey-border);
  flex-wrap: wrap;
}
.list-items { }
.list-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; border-bottom: 1px solid var(--grey-border);
  transition: background var(--transition); cursor: pointer;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--bg); }
.item-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--green-light);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: var(--green);
  flex-shrink: 0; overflow: hidden;
}
.item-avatar img { width: 100%; height: 100%; object-fit: cover; }
.item-info { flex: 1; overflow: hidden; }
.item-name { font-size: 14px; font-weight: 600; }
.item-sub { font-size: 12px; color: var(--grey); }
.item-actions { display: flex; gap: 6px; }
.tag {
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600;
}
.tag-vip { background: #fff3e0; color: #e65100; }
.tag-premium { background: #f3e5f5; color: #7b1fa2; }
.tag-regular { background: var(--green-light); color: var(--green); }
.tag-new { background: #e3f2fd; color: #1565c0; }

/* ═══════════════════════════════════════════════════════════════
   CAMPAIGNS
═══════════════════════════════════════════════════════════════════ */
.campaign-card {
  background: var(--white); border-radius: var(--radius-lg); padding: 18px;
  box-shadow: var(--shadow-sm); margin-bottom: 12px; display: flex; gap: 14px; align-items: flex-start;
}
.campaign-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: var(--green-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.campaign-icon svg { width: 22px; height: 22px; color: var(--green); }
.campaign-info { flex: 1; }
.campaign-name { font-size: 15px; font-weight: 700; }
.campaign-meta { font-size: 12px; color: var(--grey); margin-top: 4px; }
.status-chip {
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; display: inline-block;
}
.status-active { background: var(--green-light); color: var(--green); }
.status-completed { background: #e3f2fd; color: #1565c0; }
.status-pending { background: #fff3e0; color: #e65100; }
.status-failed { background: #fce4ec; color: var(--error); }
.status-draft { background: var(--bg); color: var(--grey); }

/* ═══════════════════════════════════════════════════════════════
   TEMPLATES
═══════════════════════════════════════════════════════════════════ */
.template-card {
  background: var(--white); border-radius: var(--radius-lg); padding: 18px;
  box-shadow: var(--shadow-sm); margin-bottom: 12px;
}
.template-name { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.template-body {
  background: var(--bg); border-radius: var(--radius-md); padding: 12px;
  font-size: 13px; line-height: 1.6; color: var(--black); white-space: pre-wrap;
  border-left: 3px solid var(--green);
}
.template-footer { display: flex; align-items: center; gap: 8px; margin-top: 12px; }

/* ═══════════════════════════════════════════════════════════════
   BOT REPLIES
═══════════════════════════════════════════════════════════════════ */
.bot-rule-card {
  background: var(--white); border-radius: var(--radius-lg); padding: 18px;
  box-shadow: var(--shadow-sm); margin-bottom: 12px;
}
.bot-rule-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bot-rule-keyword {
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.match-type-chip {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: var(--radius-pill); background: var(--green-light); color: var(--green);
}
.bot-rule-reply { background: var(--bg); border-radius: var(--radius-md); padding: 10px 14px; font-size: 13px; }

/* ═══════════════════════════════════════════════════════════════
   AI AGENT
═══════════════════════════════════════════════════════════════════ */
.ai-agent-header {
  background: linear-gradient(135deg, var(--green) 0%, #0d8f80 100%);
  border-radius: var(--radius-lg); padding: 24px; color: var(--white); margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.ai-toggle { display: flex; align-items: center; gap: 10px; }
.toggle-switch { position: relative; width: 46px; height: 26px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: rgba(255,255,255,.3); border-radius: 13px; cursor: pointer;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 20px; height: 20px; border-radius: 50%; background: var(--white);
  left: 3px; top: 3px; transition: transform var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--green-accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

.faq-item {
  background: var(--white); border-radius: var(--radius-md); padding: 14px;
  box-shadow: var(--shadow-sm); margin-bottom: 10px;
}
.faq-question { font-size: 14px; font-weight: 600; color: var(--green); margin-bottom: 6px; }
.faq-answer { font-size: 13px; color: var(--grey); }

/* ═══════════════════════════════════════════════════════════════
   SUBSCRIPTIONS
═══════════════════════════════════════════════════════════════════ */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.plan-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow-sm);
  border: 2px solid transparent; transition: all var(--transition);
  display: flex; flex-direction: column; gap: 14px;
  position: relative; overflow: hidden;
}
.plan-card.popular { border-color: var(--green); }
.popular-badge {
  position: absolute; top: 14px; right: -22px;
  background: var(--green); color: var(--white);
  font-size: 10px; font-weight: 700; padding: 3px 28px;
  transform: rotate(45deg);
}
.plan-name { font-size: 16px; font-weight: 800; color: var(--black); }
.plan-price { font-size: 28px; font-weight: 900; color: var(--green); }
.plan-price span { font-size: 14px; font-weight: 500; color: var(--grey); }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.plan-features li { font-size: 13px; color: var(--grey); display: flex; align-items: center; gap: 8px; }
.plan-features li::before { content: '✓'; color: var(--green); font-weight: 700; }

/* Payment methods */
.payment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.payment-tile {
  background: var(--white); border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  align-items: center; gap: 10px; cursor: pointer; border: 2px solid transparent;
  transition: all var(--transition);
}
.payment-tile:hover { border-color: var(--green); }
.payment-tile img { height: 40px; object-fit: contain; }
.payment-tile-name { font-size: 12px; font-weight: 600; color: var(--grey); }

/* ═══════════════════════════════════════════════════════════════
   SETTINGS / PROFILE
═══════════════════════════════════════════════════════════════════ */
.settings-section { margin-bottom: 20px; }
.settings-section-title { font-size: 12px; font-weight: 700; color: var(--grey); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 10px; }
.settings-item {
  background: var(--white); border-radius: var(--radius-md);
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border-bottom: 1px solid var(--grey-border); cursor: pointer;
  transition: background var(--transition);
}
.settings-item:first-child { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.settings-item:last-child { border-radius: 0 0 var(--radius-md) var(--radius-md); border-bottom: none; }
.settings-item:only-child { border-radius: var(--radius-md); }
.settings-item:hover { background: var(--bg); }
.settings-item-icon {
  width: 38px; height: 38px; border-radius: var(--radius-md);
  background: var(--green-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.settings-item-icon svg { width: 20px; height: 20px; color: var(--green); }
.settings-item-info { flex: 1; }
.settings-item-name { font-size: 14px; font-weight: 600; }
.settings-item-sub { font-size: 12px; color: var(--grey); }
.settings-item-arrow { color: var(--grey-light); }

.profile-avatar-wrap { text-align: center; padding: 24px 0; }
.profile-avatar {
  width: 88px; height: 88px; border-radius: 50%; background: var(--green-light);
  margin: 0 auto 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700; color: var(--green);
  position: relative; cursor: pointer;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-edit-overlay {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--transition);
}
.profile-avatar:hover .avatar-edit-overlay { opacity: 1; }
.avatar-edit-overlay svg { width: 24px; height: 24px; color: var(--white); }
.profile-name { font-size: 18px; font-weight: 800; }
.profile-email { font-size: 13px; color: var(--grey); }
.profile-plan {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  padding: 4px 12px; border-radius: var(--radius-pill);
  background: var(--green-light); color: var(--green); font-size: 12px; font-weight: 700;
}

/* WhatsApp API */
.wa-status-card {
  background: var(--white); border-radius: var(--radius-lg); padding: 24px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 16px;
}
.wa-connected { display: flex; align-items: center; gap: 10px; }
.wa-connected-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green-accent); }
.wa-disconnected-dot { background: #ccc; }
.wa-num { font-size: 18px; font-weight: 800; }

/* ═══════════════════════════════════════════════════════════════
   NOTIFICATIONS
═══════════════════════════════════════════════════════════════════ */
.notif-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--grey-border); cursor: pointer;
  transition: background var(--transition);
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: #f0fdf4; }
.notif-icon {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--green-light); display: flex; align-items: center; justify-content: center;
}
.notif-icon svg { width: 18px; height: 18px; color: var(--green); }
.notif-body { flex: 1; }
.notif-title { font-size: 13px; font-weight: 600; }
.notif-msg { font-size: 12px; color: var(--grey); margin-top: 2px; }
.notif-time { font-size: 11px; color: var(--grey); margin-top: 4px; }
.notif-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-accent); flex-shrink: 0; margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modal-box {
  background: var(--white); border-radius: 24px;
  width: 100%; max-width: 480px; max-height: 90vh;
  overflow: hidden; display: flex; flex-direction: column;
  animation: slideUp .3s cubic-bezier(.22,.61,.36,1);
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--grey-border);
}
.modal-header h3 { font-size: 16px; font-weight: 800; }
.modal-close { width: 30px; height: 30px; border-radius: 50%; background: var(--bg); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--grey); }
.modal-body { padding: 24px; overflow-y: auto; }

/* ═══════════════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════════════════ */
#toast-container { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #323232; color: var(--white);
  padding: 10px 20px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 500;
  animation: fadeIn .25s ease; box-shadow: var(--shadow-md);
}
.toast.success { background: var(--green); }
.toast.error { background: var(--error); }

/* ═══════════════════════════════════════════════════════════════
   LOADING / SHIMMER
═══════════════════════════════════════════════════════════════════ */
.shimmer-box {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: var(--radius-md);
}
.page-loader { display: flex; align-items: center; justify-content: center; height: 200px; color: var(--grey); }
.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--grey-light);
  border-top-color: var(--green);
  animation: spin .7s linear infinite;
}
.boot-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
}
.boot-loader-logo { width: 56px; height: 56px; }

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--grey);
}
.empty-state svg { width: 64px; height: 64px; color: var(--grey-light); margin: 0 auto 16px; }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--black); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ═══════════════════════════════════════════════════════════════
   UTILITY
═══════════════════════════════════════════════════════════════════ */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-12 { margin-bottom: 12px; }
.mb-20 { margin-bottom: 20px; }
.text-green { color: var(--green); }
.text-grey { color: var(--grey); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.fw-700 { font-weight: 700; }
.w-full { width: 100%; }
textarea.form-control { height: auto; padding: 14px 16px; resize: vertical; min-height: 80px; }

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════════════════════════ */
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  #sidebar { position: fixed; top: 0; left: 0; bottom: 0; transform: translateX(-100%); z-index: 200; }
  #sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .mobile-header { display: flex; }
  .bottom-nav { display: flex; }
  .page-content { padding: 16px; padding-bottom: calc(var(--bn-h) + 16px); }
  .inbox-layout { flex-direction: column; height: auto; }
  .conversation-list { width: 100%; }
  .chat-area { margin-left: 0; margin-top: 14px; min-height: 500px; }
  .plan-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; border-radius: 20px; margin: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
}

/* FORM GROUP full width helper */
.textarea-auto { height: auto !important; min-height: 80px; padding: 12px 16px !important; }

/* ── form-control without icon (reset padding-left) ───────────────
   Only applies to inputs that are DIRECT children of .form-group
   (i.e. NOT wrapped in .input-wrap, which needs 44px for the icon) ── */
.form-group > input.form-control,
.form-group > select.form-control,
.form-group > textarea.form-control { padding-left: 16px; }

/* ═══════════════════════════════════════════════════════════════
   TABS
═══════════════════════════════════════════════════════════════════ */
.tabs { display: flex; gap: 4px; background: var(--white); border-radius: var(--radius-pill); padding: 4px; box-shadow: var(--shadow-sm); width: fit-content; }
.tab-btn {
  padding: 8px 18px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600; cursor: pointer;
  color: var(--grey); background: none; border: none;
  transition: all var(--transition);
}
.tab-btn.active { background: var(--green); color: var(--white); }
.tab-btn:hover:not(.active) { background: var(--bg); color: var(--black); }

/* ═══════════════════════════════════════════════════════════════
   BADGE VARIANTS
═══════════════════════════════════════════════════════════════════ */
.badge-green  { background: var(--green-light); color: var(--green); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-pill); display: inline-block; }
.badge-orange { background: #fff3e0; color: #e65100; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-pill); display: inline-block; }
.badge-red    { background: #fce4ec; color: var(--error); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-pill); display: inline-block; }
.badge-grey   { background: var(--bg); color: var(--grey); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-pill); display: inline-block; }

/* ═══════════════════════════════════════════════════════════════
   TEMPLATES
═══════════════════════════════════════════════════════════════════ */
.template-preview {
  background: var(--bg); border-radius: var(--radius-md); padding: 12px;
  font-size: 13px; line-height: 1.6; white-space: pre-wrap;
  border-left: 3px solid var(--green);
}

/* ═══════════════════════════════════════════════════════════════
   BOT REPLIES extras
═══════════════════════════════════════════════════════════════════ */
.tag-chip {
  display: inline-block; padding: 4px 12px; background: var(--green-light);
  color: var(--green); font-size: 12px; font-weight: 700;
  border-radius: var(--radius-pill);
}
.bot-reply-preview {
  background: var(--bg); border-radius: var(--radius-md); padding: 10px 14px;
  font-size: 13px; color: var(--grey); white-space: pre-wrap;
  border-left: 3px solid var(--green-accent);
}

/* ═══════════════════════════════════════════════════════════════
   NOTIFICATIONS extras
═══════════════════════════════════════════════════════════════════ */
.notif-item.notif-unread { background: #f0fdf4; }
.notif-info { flex: 1; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-accent); flex-shrink: 0; margin-top: 6px; }

/* ═══════════════════════════════════════════════════════════════
   NAV BADGES (dynamic sidebar)
═══════════════════════════════════════════════════════════════════ */
.nav-label { flex: 1; }
.nav-badge {
  background: var(--green-accent); color: var(--white);
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px;
}

/* ═══════════════════════════════════════════════════════════════
   BOTTOM NAV (dynamic tabs)
═══════════════════════════════════════════════════════════════════ */
.bottom-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 10px; font-weight: 500;
  color: var(--grey); cursor: pointer; position: relative;
  transition: color var(--transition);
}
.bottom-tab.active { color: var(--green); }
.bottom-tab-icon { position: relative; display: flex; align-items: center; justify-content: center; }
.bottom-tab-icon svg { width: 22px; height: 22px; }
.bottom-tab-label { font-size: 10px; }
.bottom-badge {
  position: absolute; top: -4px; right: -8px;
  background: var(--green-accent); color: var(--white);
  font-size: 9px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ═══════════════════════════════════════════════════════════════
   DATA TABLE
═══════════════════════════════════════════════════════════════════ */
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.data-table th {
  background: var(--bg); padding: 10px 14px; text-align: left;
  font-size: 11px; font-weight: 700; color: var(--grey);
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--grey-border);
}
.data-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--grey-border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }

/* ═══════════════════════════════════════════════════════════════
   PLAN CARDS GRID
═══════════════════════════════════════════════════════════════════ */
.plan-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.plan-card-popular { border: 2px solid var(--green) !important; }
.plan-popular-badge {
  display: inline-block; background: var(--green); color: var(--white);
  font-size: 10px; font-weight: 700; padding: 3px 12px;
  border-radius: var(--radius-pill); margin-bottom: 8px;
}
.plan-card-header {
  border-radius: var(--radius-md); padding: 16px; margin-bottom: 8px;
}
.plan-price-currency { font-size: 14px; font-weight: 600; vertical-align: top; line-height: 2; }
.plan-price-amount   { font-size: 32px; font-weight: 900; color: var(--green); }
.plan-price-period   { font-size: 13px; color: var(--grey); }

/* ═══════════════════════════════════════════════════════════════
   PAYMENT METHOD CARD
═══════════════════════════════════════════════════════════════════ */
.payment-method-card {
  background: var(--bg); border-radius: var(--radius-lg); padding: 16px;
  min-width: 140px; border: 1.5px solid var(--grey-border);
  transition: border-color var(--transition);
}
.payment-method-card:hover { border-color: var(--green); }

/* ═══════════════════════════════════════════════════════════════
   ADDITIONAL UTILITY CLASSES
═══════════════════════════════════════════════════════════════════ */
.text-red      { color: var(--error); }
.text-lg       { font-size: 17px; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.mt-4          { margin-top: 4px; }
.mt-12         { margin-top: 12px; }
.mb-4          { margin-bottom: 4px; }
.mb-8          { margin-bottom: 8px; }
.mb-16         { margin-bottom: 16px; }
.p-16          { padding: 16px; }
.flex-wrap     { flex-wrap: wrap; }
.gap-4         { gap: 4px; }
.gap-16        { gap: 16px; }
.gap-20        { gap: 20px; }

@media (max-width: 900px) {
  .plan-cards-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .plan-cards-grid { grid-template-columns: 1fr; }
  .tabs { flex-wrap: wrap; }
}

/* ── Rai Assistant floating chatbot ─────────────────────────── */
.rai-assist-fab {
  position: fixed;
  right: 24px;
  bottom: 80px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(7,94,84,.35);
  z-index: 900;
  transition: transform .2s, background .15s;
}
.rai-assist-fab:hover { background: var(--green-dark, #064e44); transform: scale(1.07); }
.rai-assist-fab--open { background: #e53935; }
.rai-assist-fab--open:hover { background: #c62828; }
.rai-assist-fab--hidden { display: none; }

@media (max-width: 768px) {
  .rai-assist-fab { bottom: 72px; right: 16px; }
}

.rai-assist-panel {
  position: fixed;
  right: 16px;
  bottom: 144px;
  width: 340px;
  max-height: 500px;
  border-radius: 18px;
  background: white;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  z-index: 900;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(.9) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), opacity .18s;
}
.rai-assist-panel--open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}
@media (max-width: 400px) {
  .rai-assist-panel { width: calc(100vw - 32px); right: 16px; bottom: 150px; }
}
.rai-assist-header {
  padding: 14px 16px;
  background: linear-gradient(135deg, #075E54, #1EBE5A);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.rai-assist-close {
  background: rgba(255,255,255,.15);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rai-assist-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f7f9f8;
}
.rai-msg { max-width: 85%; }
.rai-msg p { font-size: 13px; line-height: 1.5; padding: 10px 13px; border-radius: 16px; margin: 0; }
.rai-msg-user { align-self: flex-end; }
.rai-msg-user p { background: var(--green); color: white; border-bottom-right-radius: 4px; }
.rai-msg-bot { align-self: flex-start; }
.rai-msg-bot p { background: white; color: var(--text); border-bottom-left-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.rai-msg-error p { background: #fff3f3; color: #c62828; border: 1px solid #ffcdd2; }

.rai-thinking { display: flex; gap: 5px; align-items: center; padding: 14px 16px; background: white; border-radius: 16px; border-bottom-left-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.08); width: fit-content; }
.rai-thinking span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: raiDot 1.2s infinite; display: block; }
.rai-thinking span:nth-child(2) { animation-delay: .2s; }
.rai-thinking span:nth-child(3) { animation-delay: .4s; }
@keyframes raiDot { 0%,80%,100% { transform: scale(.8); opacity:.4; } 40% { transform: scale(1.1); opacity:1; } }

.rai-assist-footer {
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  background: white;
  border-top: 1px solid #eee;
  flex-shrink: 0;
}
.rai-assist-input {
  flex: 1;
  border: 1.5px solid #e0e0e0;
  border-radius: 24px;
  padding: 8px 14px;
  font-size: 13px;
  outline: none;
  transition: border .15s;
}
.rai-assist-input:focus { border-color: var(--green); }
.rai-assist-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.rai-assist-send:hover { background: var(--green-dark, #064e44); }


/* Interactive message card */
.msg-interactive-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(7,94,84,.06);
  border-left: 3px solid var(--green);
  border-radius: 8px;
  min-width: 160px;
}
.msg-interactive-icon { font-size: 16px; flex-shrink: 0; }
