/* =========================================
   FSS Communication Cloud — Design System
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Brand */
  --brand-primary: #4f46e5;
  --brand-primary-light: #6366f1;
  --brand-primary-dark: #3730a3;
  --brand-primary-bg: #eef2ff;

  /* Sidebar */
  --sidebar-bg: #ffffff;
  --sidebar-width: 200px;
  --sidebar-border: #e5e7eb;

  /* Header */
  --header-bg: #ffffff;
  --header-border: #e5e7eb;
  --header-height: 56px;

  /* Page */
  --page-bg: #f3f4f6;
  --card-bg: #ffffff;
  --card-border: #e5e7eb;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.12);
  --card-radius: 10px;

  /* Text */
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --text-light: #9ca3af;

  /* Status Colors */
  --color-success: #10b981;
  --color-success-bg: #d1fae5;
  --color-success-text: #065f46;
  --color-warning: #f59e0b;
  --color-warning-bg: #fef3c7;
  --color-warning-text: #92400e;
  --color-danger: #ef4444;
  --color-danger-bg: #fee2e2;
  --color-danger-text: #991b1b;
  --color-info: #3b82f6;
  --color-info-bg: #dbeafe;
  --color-info-text: #1e40af;
  --color-purple: #8b5cf6;
  --color-purple-bg: #ede9fe;
  --color-orange: #f97316;
  --color-orange-bg: #ffedd5;

  /* WhatsApp */
  --wa-green: #25d366;

  /* Inputs */
  --input-bg: #ffffff;
  --input-border: #d1d5db;
  --input-border-focus: #4f46e5;
  --input-radius: 8px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
}

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

html { font-size: 14px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-family);
  background: var(--page-bg);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: var(--brand-primary); text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: var(--font-family); border: none; background: none; }
input, select, textarea { font-family: var(--font-family); }

/* ── App Shell ── */
.app-shell {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: 220px;
  min-width: 220px;
  flex-shrink: 0;
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 2px; }

.sidebar-logo {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-logo-text .brand-fss { font-size: 1.1rem; font-weight: 800; color: #1e40af; }
.sidebar-logo-text .brand-sub { font-size: 0.6rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.sidebar-dashboard-btn {
  margin: 8px 10px;
  padding: 7px 10px;
  background: var(--brand-primary-bg);
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  display: flex; align-items: center; gap: 7px;
  font-size: 0.8rem; font-weight: 600; color: var(--brand-primary);
  cursor: pointer; transition: all var(--transition-fast);
  width: calc(100% - 20px);
}
.sidebar-dashboard-btn:hover { background: #e0e7ff; }

.sidebar-section { padding: 6px 0; }
.sidebar-section-label { padding: 6px 14px 3px; font-size: 0.62rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.8px; }

.sidebar-item {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 14px; font-size: 0.8rem; font-weight: 500;
  color: var(--text-secondary); cursor: pointer;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
}
.sidebar-item:hover { background: #f9fafb; color: var(--text-primary); }
.sidebar-item.active { background: var(--brand-primary-bg); color: var(--brand-primary); border-left-color: var(--brand-primary); font-weight: 600; }
.sidebar-item-icon { width: 15px; height: 15px; flex-shrink: 0; display: flex; align-items: center; }

.sidebar-badge {
  margin-left: auto; padding: 1px 6px;
  background: var(--color-success); color: white;
  font-size: 0.58rem; font-weight: 700; border-radius: 10px; text-transform: uppercase;
}

.sidebar-help {
  margin: auto 10px 10px;
  padding: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
}
.sidebar-help-title { font-size: 0.76rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.sidebar-help-sub { font-size: 0.68rem; color: var(--text-muted); margin-bottom: 7px; line-height: 1.4; }
.sidebar-help-btn {
  display: flex; align-items: center; gap: 4px; justify-content: center;
  padding: 5px; background: white; border: 1px solid #bfdbfe;
  border-radius: 6px; font-size: 0.7rem; font-weight: 600; color: var(--brand-primary);
  cursor: pointer; transition: all var(--transition-fast); width: 100%;
}
.sidebar-help-btn:hover { background: var(--brand-primary-bg); }

/* ── Main Content ── */
.main-content {
    flex: 1;
    min-width: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Top Header ── */
.top-header {
    width: 100%;
    height: 64px;
    min-height: 64px;
    flex-shrink: 0;

    display: flex;
    align-items: center;

    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;

    padding: 0 20px;
    gap: 16px;

    position: relative;
    z-index: 100;
}

.top-header,
.top-header * {
    box-sizing: border-box;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;

    flex: 1 1 0;
    min-width: 0;
}

.header-menu-btn {
    flex-shrink: 0;
    padding: 6px; 
    border-radius: 6px; 
    color: var(--text-muted); 
    transition: all var(--transition-fast);
}
.header-menu-btn:hover { background: #f3f4f6; color: var(--text-primary); }

.header-search {
    width: min(360px, 100%);
    max-width: 360px;
    flex-shrink: 1;
    position: relative;
}
.header-search-icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-light); pointer-events: none; }
.header-search input {
  width: 100%; padding: 6px 10px 6px 32px;
  border: 1px solid var(--input-border); border-radius: 8px;
  font-size: 0.8rem; color: var(--text-primary); background: #f9fafb;
  outline: none; transition: all var(--transition-fast);
}
.header-search input:focus { background: white; border-color: var(--input-border-focus); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 1 auto;
    min-width: 0;
}

.header-wallet {
    display: flex;
    align-items: center;

    white-space: nowrap;
    flex-shrink: 0;
    
    gap: 7px; padding: 5px 10px;
    background: #f9fafb; border: 1px solid var(--card-border); border-radius: 8px;
    cursor: pointer; transition: all var(--transition-fast);
}
.header-wallet:hover { background: #f3f4f6; }
.header-wallet-label { color: var(--text-muted); font-size: 0.68rem; line-height: 1; }
.header-wallet-amount { font-weight: 700; color: var(--text-primary); font-size: 0.82rem; }
.header-wallet-add { color: var(--brand-primary); font-size: 0.7rem; font-weight: 600; }

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 10px;

    flex: 1 1 0;
    min-width: 0;

    white-space: nowrap;
}

.header-icon-btn { flex-shrink: 0; padding: 6px; border-radius: 8px; color: var(--text-muted); transition: all var(--transition-fast); }
.header-icon-btn:hover { background: #f3f4f6; color: var(--text-secondary); }

.header-profile {
    display: flex;
    align-items: center;
    gap: 8px;

    flex-shrink: 0;
    white-space: nowrap;

    cursor: pointer;
    position: relative;
}

.header-profile-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;

    min-width: 0;
    white-space: nowrap;
}

.header-profile-name {
    font-size: 0.8rem; font-weight: 600; color: var(--text-primary);
    white-space: nowrap;
}
.header-profile-role {
    font-size: 0.68rem; color: var(--text-muted);
    white-space: nowrap;
}

.header-profile-avatar {
    flex-shrink: 0;
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-light) 100%);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0.75rem; font-weight: 700;
}

/* ── Page Scroll Area ── */
.page-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}
.page-scroll::-webkit-scrollbar { width: 6px; }
.page-scroll::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* ── Page Footer ── */
.page-footer {
    flex-shrink: 0;
    min-height: 42px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 10px 22px;

    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    
    font-size: 0.7rem;
    color: var(--text-light);
}

.page-footer-links {
    display: flex;
    gap: 16px;
}
.page-footer-links a {
    color: var(--text-light);
    text-decoration: none;
}
.page-footer-links a:hover {
    color: var(--brand-primary);
}

/* ── Page Header ── */
.page-header {
  padding: 18px 22px 14px;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.page-title { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.page-subtitle { font-size: 0.8rem; color: var(--text-muted); }

/* ── Cards ── */
.card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--card-radius); box-shadow: var(--card-shadow); }
.card-padding { padding: 16px; }

/* ── Stat Cards ── */
.stats-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 0 22px 14px; }

.stat-card { background: white; border: 1px solid var(--card-border); border-radius: var(--card-radius); padding: 12px 14px; }
.stat-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.stat-card-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }
.stat-card-menu { color: var(--text-light); padding: 2px; border-radius: 4px; cursor: pointer; }
.stat-card-menu:hover { background: #f3f4f6; }
.stat-card-icon { width: 30px; height: 30px; border-radius: 7px; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.stat-card-value { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.5px; margin-bottom: 3px; }
.stat-card-trend { font-size: 0.7rem; font-weight: 500; display: flex; align-items: center; gap: 2px; }
.stat-card-trend.up { color: var(--color-success); }
.stat-card-trend.down { color: var(--color-danger); }
.stat-card-sub { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 14px; border-radius: 8px; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition-fast);
  border: 1px solid transparent; white-space: nowrap;
  font-family: var(--font-family); line-height: 1;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--brand-primary); color: white; border-color: var(--brand-primary); }
.btn-primary:hover:not(:disabled) { background: var(--brand-primary-dark); border-color: var(--brand-primary-dark); }
.btn-secondary { background: white; color: var(--text-secondary); border-color: var(--card-border); }
.btn-secondary:hover:not(:disabled) { background: #f9fafb; border-color: #9ca3af; }
.btn-success { background: var(--color-success); color: white; border-color: var(--color-success); }
.btn-success:hover:not(:disabled) { background: #059669; }
.btn-outline-primary { background: transparent; color: var(--brand-primary); border-color: var(--brand-primary); }
.btn-outline-primary:hover:not(:disabled) { background: var(--brand-primary-bg); }
.btn-sm { padding: 4px 10px; font-size: 0.72rem; }
.btn-lg { padding: 10px 22px; font-size: 0.88rem; border-radius: 10px; }
.btn-icon { padding: 6px; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 0.66rem; font-weight: 600; gap: 3px; }
.badge-success { background: var(--color-success-bg); color: var(--color-success-text); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger-text); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-info { background: var(--color-info-bg); color: var(--color-info-text); }
.badge-purple { background: var(--color-purple-bg); color: var(--color-purple); }
.badge-gray { background: #f3f4f6; color: var(--text-muted); }
.badge-sms { background: #dbeafe; color: #1d4ed8; }
.badge-whatsapp { background: #dcfce7; color: #15803d; }
.badge-rcs { background: #ede9fe; color: #7c3aed; }
.badge-email { background: #ffedd5; color: #c2410c; }

/* ── Tables ── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid #f3f4f6; }
thead th { padding: 7px 12px; font-size: 0.7rem; font-weight: 600; color: var(--text-muted); text-align: left; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.4px; }
tbody tr { border-bottom: 1px solid #f9fafb; transition: background var(--transition-fast); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #fafafa; }
tbody td { padding: 9px 12px; font-size: 0.78rem; color: var(--text-secondary); vertical-align: middle; }

/* ── Inputs ── */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); }
.form-label .required { color: var(--color-danger); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  padding: 7px 11px; border: 1px solid var(--input-border); border-radius: var(--input-radius);
  font-size: 0.8rem; color: var(--text-primary); background: var(--input-bg);
  transition: all var(--transition-fast); outline: none; font-family: var(--font-family); width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--input-border-focus); box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-light); }
.form-textarea { resize: vertical; min-height: 90px; line-height: 1.5; border-radius: 0 0 8px 8px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; padding-right: 30px; }
.form-hint { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.char-count { font-size: 0.68rem; color: var(--text-light); text-align: right; }

/* ── Tabs ── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid #f3f4f6; }
.tab-btn { padding: 7px 14px; font-size: 0.8rem; font-weight: 500; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--transition-fast); white-space: nowrap; }
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--brand-primary); border-bottom-color: var(--brand-primary); font-weight: 600; }

/* ── Wizard Steps ── */
.wizard-steps { display: flex; background: white; border: 1px solid var(--card-border); border-radius: 10px; padding: 3px; }
.wizard-step { flex: 1; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 7px; cursor: default; transition: all var(--transition-fast); }
.wizard-step.active { background: var(--brand-primary); }
.wizard-step-num { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; flex-shrink: 0; }
.wizard-step.active .wizard-step-num { background: rgba(255,255,255,0.25); color: white; }
.wizard-step.completed .wizard-step-num { background: var(--color-success); color: white; }
.wizard-step.pending .wizard-step-num { background: #f3f4f6; color: var(--text-muted); }
.wizard-step-title { font-size: 0.76rem; font-weight: 600; }
.wizard-step.active .wizard-step-title { color: white; }
.wizard-step.completed .wizard-step-title { color: var(--text-primary); }
.wizard-step.pending .wizard-step-title { color: var(--text-muted); }
.wizard-step-sub { font-size: 0.65rem; }
.wizard-step.active .wizard-step-sub { color: rgba(255,255,255,0.8); }
.wizard-step.completed .wizard-step-sub, .wizard-step.pending .wizard-step-sub { color: var(--text-light); }

/* ── WhatsApp Preview ── */
.wa-preview { background: #e5ddd5; border-radius: 10px; min-height: 140px; overflow: hidden; }
.wa-preview-header { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: #075e54; }
.wa-preview-name { font-size: 0.78rem; font-weight: 600; color: white; }
.wa-preview-body { padding: 10px; }
.wa-preview-bubble { background: white; border-radius: 0 8px 8px 8px; padding: 8px 10px; max-width: 88%; box-shadow: 0 1px 2px rgba(0,0,0,0.1); position: relative; display: inline-block; }
.wa-preview-bubble::before { content: ''; position: absolute; left: -5px; top: 0; border-right: 5px solid white; border-top: 5px solid transparent; }
.wa-preview-text { font-size: 0.76rem; color: #303030; line-height: 1.5; white-space: pre-wrap; }
.wa-preview-time { font-size: 0.62rem; color: var(--text-light); text-align: right; margin-top: 3px; }

/* ── Overview Grid ── */
.overview-grid { display: grid; grid-template-columns: 1fr 272px; gap: 14px; padding: 0 22px 14px; }

/* ── Quick Actions ── */
.quick-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.quick-action-item {
  display: flex; align-items: center; gap: 7px; padding: 7px 9px;
  border: 1px solid var(--card-border); border-radius: 7px; cursor: pointer;
  font-size: 0.72rem; font-weight: 500; color: var(--text-secondary);
  transition: all var(--transition-fast); background: white;
}
.quick-action-item:hover { background: var(--brand-primary-bg); border-color: #c7d2fe; color: var(--brand-primary); }

/* ── Breadcrumb ── */
.breadcrumb { display: flex; align-items: center; gap: 5px; font-size: 0.76rem; color: var(--text-muted); margin-bottom: 3px; }
.breadcrumb-sep { color: var(--text-light); }
.breadcrumb-link { color: var(--text-muted); cursor: pointer; }
.breadcrumb-link:hover { color: var(--brand-primary); }
.breadcrumb-current { color: var(--brand-primary); font-weight: 500; }

/* ── Search / Filter ── */
.search-input-wrapper { position: relative; }
.search-input-wrapper svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-light); pointer-events: none; }
.search-input-wrapper input { width: 100%; padding: 6px 10px 6px 30px; border: 1px solid var(--input-border); border-radius: 8px; font-size: 0.78rem; color: var(--text-primary); background: white; outline: none; transition: all var(--transition-fast); }
.search-input-wrapper input:focus { border-color: var(--input-border-focus); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.date-picker-btn { display: flex; align-items: center; gap: 5px; padding: 6px 10px; border: 1px solid var(--input-border); border-radius: 8px; font-size: 0.76rem; color: var(--text-secondary); background: white; cursor: pointer; transition: all var(--transition-fast); white-space: nowrap; }
.date-picker-btn:hover { border-color: #9ca3af; background: #f9fafb; }
.filter-btn { display: flex; align-items: center; gap: 5px; padding: 6px 10px; border: 1px solid var(--input-border); border-radius: 8px; font-size: 0.76rem; color: var(--text-secondary); background: white; cursor: pointer; transition: all var(--transition-fast); }
.filter-btn:hover { border-color: #9ca3af; background: #f9fafb; }

/* ── Coming Soon ── */
.coming-soon-overlay { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; gap: 10px; text-align: center; }
.coming-soon-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #f3f4f6; margin-bottom: 4px; }
.coming-soon-title { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.coming-soon-sub { font-size: 0.78rem; color: var(--text-muted); max-width: 240px; line-height: 1.5; }

/* ── Spinner ── */
.spinner { width: 20px; height: 20px; border: 2px solid #e5e7eb; border-top-color: var(--brand-primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
.spinner-sm { width: 14px; height: 14px; border-width: 2px; }
.spinner-lg { width: 34px; height: 34px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Recipient Type Cards ── */
.recipient-type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.recipient-type-card { border: 2px solid var(--input-border); border-radius: 10px; padding: 12px 8px; text-align: center; cursor: pointer; transition: all var(--transition-fast); background: white; }
.recipient-type-card:hover, .recipient-type-card.selected { border-color: var(--brand-primary); background: var(--brand-primary-bg); }
.recipient-type-card-icon { width: 34px; height: 34px; border-radius: 7px; background: #f3f4f6; display: flex; align-items: center; justify-content: center; margin: 0 auto 7px; }
.recipient-type-card.selected .recipient-type-card-icon { background: #c7d2fe; }
.recipient-type-card-label { font-size: 0.78rem; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.recipient-type-card-sub { font-size: 0.65rem; color: var(--text-muted); line-height: 1.3; }

/* ── Recipients Summary ── */
.recipients-summary { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); border: 1px solid #bbf7d0; border-radius: 10px; padding: 14px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; text-align: center; }
.recipients-summary-item .rs-num { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.recipients-summary-item .rs-label { font-size: 0.68rem; color: var(--text-muted); }

/* ── Editor Toolbar ── */
.editor-toolbar { display: flex; align-items: center; gap: 2px; padding: 5px 8px; border: 1px solid var(--input-border); border-bottom: none; background: #f9fafb; border-radius: 8px 8px 0 0; flex-wrap: wrap; }
.toolbar-btn { padding: 4px 6px; border-radius: 5px; color: var(--text-muted); font-size: 0.78rem; font-weight: 700; cursor: pointer; transition: all var(--transition-fast); }
.toolbar-btn:hover { background: #e5e7eb; color: var(--text-primary); }
.toolbar-sep { width: 1px; height: 16px; background: var(--input-border); margin: 0 4px; }

/* ── Donut Legend ── */
.donut-legend-item { display: flex; align-items: center; gap: 7px; padding: 3px 0; }
.donut-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.donut-legend-label { font-size: 0.72rem; color: var(--text-secondary); flex: 1; }
.donut-legend-value { font-size: 0.72rem; font-weight: 600; color: var(--text-primary); }
.donut-legend-pct { font-size: 0.68rem; color: var(--text-muted); }

/* ── Account Row ── */
.account-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid #f3f4f6; font-size: 0.76rem; }
.account-row:last-child { border-bottom: none; }
.account-row-label { color: var(--text-muted); }
.account-row-value { font-weight: 600; color: var(--text-primary); }

/* ── Page Footer ── */
.page-footer { border-top: 1px solid var(--card-border); padding: 10px 22px; display: flex; align-items: center; justify-content: space-between; font-size: 0.7rem; color: var(--text-light); background: white; flex-shrink: 0; }
.page-footer-links { display: flex; gap: 14px; }
.page-footer-links a { color: var(--text-muted); }
.page-footer-links a:hover { color: var(--brand-primary); text-decoration: none; }

/* ── Status Badges for WhatsApp ── */
.not-connected-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; background: #fee2e2; color: #991b1b; border-radius: 20px; font-size: 0.68rem; font-weight: 600; }
.connected-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; background: #d1fae5; color: #065f46; border-radius: 20px; font-size: 0.68rem; font-weight: 600; }

/* ── Login ── */
.login-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 40%, #2563eb 70%, #4f46e5 100%); padding: 20px; }
.login-card { background: white; border-radius: 16px; padding: 38px; width: 100%; max-width: 410px; box-shadow: 0 25px 50px rgba(0,0,0,0.25); }
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.login-logo-icon { width: 42px; height: 42px; background: linear-gradient(135deg, #1e40af, #3b82f6); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.login-logo-text .brand-name { font-size: 1.15rem; font-weight: 800; color: #1e3a8a; line-height: 1.2; }
.login-logo-text .brand-tagline { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.login-title { font-size: 1.45rem; font-weight: 700; color: var(--text-primary); margin-bottom: 5px; }
.login-subtitle { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 26px; }
.login-form { display: flex; flex-direction: column; gap: 15px; }
.login-input-group { display: flex; flex-direction: column; gap: 5px; }
.login-input-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
.login-input { padding: 10px 13px; border: 1.5px solid var(--input-border); border-radius: 10px; font-size: 0.88rem; color: var(--text-primary); outline: none; transition: all var(--transition-fast); font-family: var(--font-family); width: 100%; }
.login-input:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.12); }
.login-btn { padding: 11px; background: var(--brand-primary); color: white; border: none; border-radius: 10px; font-size: 0.88rem; font-weight: 700; cursor: pointer; transition: all var(--transition-fast); margin-top: 3px; font-family: var(--font-family); display: flex; align-items: center; justify-content: center; gap: 7px; }
.login-btn:hover:not(:disabled) { background: var(--brand-primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,0.3); }
.login-btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }
.login-error { padding: 9px 13px; background: var(--color-danger-bg); border: 1px solid #fca5a5; border-radius: 8px; font-size: 0.8rem; color: var(--color-danger-text); }

/* ── Animations ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
.animate-fade-in { animation: fadeIn 0.22s ease forwards; }
.animate-slide-in { animation: slideInLeft 0.18s ease forwards; }

/* ── Utilities ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.ml-auto { margin-left: auto; }
.text-sm { font-size: 0.78rem; }
.text-xs { font-size: 0.7rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-muted { color: var(--text-muted); }
.text-primary-color { color: var(--brand-primary); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-right { text-align: right; }
.w-full { width: 100%; }
.p-4 { padding: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-auto { margin-top: auto; }
.rounded { border-radius: 8px; }
.divider { height: 1px; background: var(--card-border); margin: 14px 0; }

/* ── Login Page ── */
.login-page {
    display: flex;
    min-height: 100vh;
}

.login-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
    background: #ffffff;
    overflow-y: auto;
}

.login-form-container {
    max-width: 440px;
    margin: 0 auto;
    width: 100%;
}

.login-logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.login-logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.login-brand-fss {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1e3a8a;
    line-height: 1.2;
}

.login-brand-sub {
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 0.9rem;
    color: #4b5563;
    margin-bottom: 32px;
    line-height: 1.5;
}

.login-error-msg {
    display: none;
    padding: 12px;
    background: #fee2e2;
    border: 1px solid #f87171;
    border-radius: 8px;
    color: #991b1b;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
}

.login-input {
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}
.login-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.login-forgot {
    font-size: 0.8rem;
    color: #4f46e5;
    font-weight: 500;
    text-decoration: none;
}

.login-btn {
    padding: 14px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}
.login-btn:hover:not(:disabled) {
    background: #3730a3;
}
.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-success-msg {
    display: none;
    padding: 12px;
    background: #dcfce7;
    border: 1px solid #86efac;
    border-radius: 8px;
    color: #166534;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.login-register-prompt {
    margin-top: 20px;
    text-align: center;
    font-size: 0.88rem;
    color: #4b5563;
}

.login-register-link {
    color: #4f46e5;
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
    transition: color 0.2s;
}

.login-register-link:hover {
    color: #3730a3;
    text-decoration: underline;
}

.login-right {
    flex: 1;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: white;
    text-align: center;
}

.login-hero-container {
    max-width: 400px;
}

.login-hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1.2;
}

.login-hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 32px;
    line-height: 1.6;
}

.login-pill-container {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.login-pill {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 24px;
    border-radius: 100px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ── WhatsApp Campaigns Page ── */
.whatsapp-page {
    padding: 24px;
}

.whatsapp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.whatsapp-header-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.whatsapp-header-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.whatsapp-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
}

.whatsapp-header-actions {
    display: flex;
    gap: 12px;
}

.btn-templates {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--brand-primary);
    color: var(--brand-primary);
    background: white;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-templates:hover {
    background: var(--brand-primary-bg);
}

.btn-create-campaign {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--brand-primary);
    color: white;
    background: var(--brand-primary);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-create-campaign:hover {
    background: var(--brand-primary-dark);
}

.whatsapp-stats-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.whatsapp-stat-card {
    background: white;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.whatsapp-stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.whatsapp-stat-icon.green { background: #dcfce7; color: #16a34a; }
.whatsapp-stat-icon.blue { background: #dbeafe; color: #2563eb; }
.whatsapp-stat-icon.red { background: #fee2e2; color: #dc2626; }
.whatsapp-stat-icon.orange { background: #ffedd5; color: #ea580c; }

.whatsapp-stat-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.whatsapp-stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.whatsapp-stat-trend {
    font-size: 0.65rem;
    font-weight: 500;
}
.whatsapp-stat-trend.up { color: #16a34a; }
.whatsapp-stat-trend.down { color: #dc2626; }
.whatsapp-stat-trend.neutral { color: var(--text-muted); }

.whatsapp-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 7.5fr) minmax(0, 2.5fr);
    gap: 20px;
}

.whatsapp-card {
    background: white;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 20px;
}

.campaign-tabs {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 16px;
}

.campaign-tab {
    padding: 0 0 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition-fast);
}

.campaign-tab:hover {
    color: var(--text-primary);
}

.campaign-tab.active {
    color: #a855f7;
    border-bottom-color: #a855f7;
    font-weight: 600;
}

.campaign-filter-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.campaign-search {
    flex: 1;
    position: relative;
}

.campaign-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.campaign-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font-size: 0.8rem;
    outline: none;
}

.campaign-date-btn, .campaign-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: white;
    cursor: pointer;
}

.campaign-table {
    width: 100%;
    border-collapse: collapse;
}

.campaign-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}

.campaign-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #f9fafb;
    vertical-align: middle;
}

.campaign-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.campaign-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.campaign-icon.green { background: #dcfce7; color: #16a34a; }
.campaign-icon.orange { background: #ffedd5; color: #ea580c; }
.campaign-icon.purple { background: #f3e8ff; color: #9333ea; }
.campaign-icon.red { background: #fee2e2; color: #dc2626; }

.campaign-name-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.campaign-name-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.campaign-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    margin-top: 4px;
}
.campaign-tag.marketing { background: #f3e8ff; color: #9333ea; }
.campaign-tag.transactional { background: #dbeafe; color: #2563eb; }

.campaign-type {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.campaign-badge {
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: capitalize;
}
.campaign-badge.completed { background: #dcfce7; color: #16a34a; }
.campaign-badge.ongoing { background: #dbeafe; color: #2563eb; }
.campaign-badge.sending { background: #dbeafe; color: #1d4ed8; }
.campaign-badge.scheduled { background: #f3e8ff; color: #9333ea; }
.campaign-badge.failed { background: #fee2e2; color: #dc2626; }
.campaign-badge.partially_completed { background: #ffedd5; color: #c2410c; }
.campaign-badge.draft { background: #f1f5f9; color: #475569; }
.campaign-badge.cancelled { background: #f3f4f6; color: #6b7280; }

.campaign-stat-primary {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}
.campaign-stat-secondary {
    font-size: 0.65rem;
    font-weight: 500;
    color: #16a34a;
}
.campaign-stat-secondary.blue { color: #2563eb; }

.campaign-date {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
}
.campaign-time {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.campaign-action-btn {
    padding: 4px;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
}
.campaign-action-btn:hover {
    background: #f3f4f6;
    color: var(--text-primary);
}

.right-panel-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.right-panel-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.wa-account-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.wa-account-icon {
    width: 32px;
    height: 32px;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wa-account-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.wa-account-phone {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 8px;
}

.btn-manage-account {
    width: 100%;
    padding: 8px;
    border: 1px solid #c084fc;
    color: #9333ea;
    background: white;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.qa-list {
    display: flex;
    flex-direction: column;
}

.qa-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f9fafb;
    cursor: pointer;
}
.qa-item:last-child { border-bottom: none; }
.qa-item:hover .qa-text { color: var(--brand-primary); }
.qa-item:hover .qa-arrow { color: var(--brand-primary); transform: translateX(2px); }

.qa-content {
    display: flex;
    align-items: center;
    gap: 12px;
}
.qa-icon {
    color: #a855f7;
}
.qa-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}
.qa-arrow {
    color: var(--text-light);
    transition: all var(--transition-fast);
}
