/* ============================================================
   BONNIE ROSE — TELEGRAM POST STUDIO & AI CRM CHATTER CSS
   Ultra-modern dark aesthetic, glassmorphism, responsive
   ============================================================ */

:root {
  --bg-main: #0a0d14;
  --bg-card: rgba(18, 24, 38, 0.78);
  --bg-card-hover: rgba(26, 34, 52, 0.88);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(244, 63, 94, 0.6);
  --border-vip: rgba(251, 191, 36, 0.6);

  --accent-pink: #f43f5e;
  --accent-rose: #e11d48;
  --accent-gold: #fbbf24;
  --accent-gold-dark: #d97706;
  --accent-blue: #0284c7;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-purple: #a855f7;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --tg-bubble-in: #1e293b;
  --tg-bubble-out: #0284c7;
  --tg-chat-bg: #0b1120;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Outfit', var(--font-sans);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-glow: 0 0 25px rgba(244, 63, 94, 0.25);
  --shadow-cyan: 0 0 25px rgba(6, 182, 212, 0.25);
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(225, 29, 72, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 85%, rgba(6, 182, 212, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: var(--transition);
}

/* Top Navigation */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
  background: rgba(10, 13, 20, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 26px;
  filter: drop-shadow(0 0 10px rgba(244, 63, 94, 0.5));
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 30%, var(--accent-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.brand-subtitle {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* Main Navigation Tabs */
.nav-main-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  gap: 4px;
}

.nav-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.nav-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-rose));
  color: #fff;
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.4);
}

.nav-badge {
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  margin-left: 2px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.gemini-pill {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
  cursor: pointer;
  transition: var(--transition);
}

.gemini-pill:hover {
  background: rgba(6, 182, 212, 0.2);
  transform: scale(1.03);
}

.stars-pill {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(245, 158, 11, 0.22));
  border: 1px solid rgba(234, 179, 8, 0.45);
  color: #facc15;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 700;
}

.stars-pill:hover {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.25), rgba(245, 158, 11, 0.35));
  border-color: rgba(234, 179, 8, 0.7);
  box-shadow: 0 0 14px rgba(234, 179, 8, 0.35);
  transform: scale(1.03);
}

.stars-pill.refreshing .stars-icon {
  display: inline-block;
  animation: spinStar 0.8s linear infinite;
}

@keyframes spinStar {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

/* View Containers */
.view-container {
  display: none;
  animation: fadeIn 0.2s ease;
}

.view-container.active {
  display: block;
}

/* ============================================================
   CRM DIALOGS (PODIUM STYLE 3-COLUMN LAYOUT)
   ============================================================ */

.crm-layout {
  display: grid;
  grid-template-columns: 320px 1fr 340px;
  gap: 16px;
  height: calc(100vh - 72px);
  padding: 16px 20px;
  max-width: 1720px;
  margin: 0 auto;
}

@media (max-width: 1300px) {
  .crm-layout {
    grid-template-columns: 290px 1fr 300px;
  }
}

/* CRM Sidebar (Left) */
.crm-sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.crm-sidebar-header {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.crm-search {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  outline: none;
}
.crm-search:focus { border-color: var(--accent-pink); }

.crm-filter-tabs {
  display: flex;
  padding: 6px 10px;
  gap: 4px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.15);
}

.filter-tab-btn {
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
}

.filter-tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.crm-chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  position: relative;
}

.chat-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.chat-item.active {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.35);
}

.chat-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
  position: relative;
}

.chat-ai-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #0f172a;
}
.chat-ai-dot.on { background: var(--accent-green); }
.chat-ai-dot.off { background: #64748b; }

.chat-item-info {
  flex: 1;
  min-width: 0;
}

.chat-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.chat-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item-flag {
  font-size: 13px;
  margin-left: 4px;
}

.chat-bought-badge {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.22), rgba(245, 158, 11, 0.35));
  border: 1px solid rgba(234, 179, 8, 0.65);
  color: #fef08a;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 0 6px rgba(234, 179, 8, 0.3);
  vertical-align: middle;
}

.chat-item-time {
  font-size: 10px;
  color: var(--text-dim);
}

.chat-item-snippet {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-unread-badge {
  background: var(--accent-pink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

/* CRM Chat View (Center) */
.crm-chat-view {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--tg-chat-bg);
  border-radius: var(--radius-md);
  position: relative;
}

.chat-placeholder-empty {
  margin: auto;
  text-align: center;
  color: var(--text-dim);
  padding: 40px;
}

.chat-placeholder-empty .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.chat-active-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.active-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid var(--border-color);
}

.active-user-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.active-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.active-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.active-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.active-flag {
  font-size: 15px;
}

.active-sub-meta {
  font-size: 11px;
  color: var(--text-dim);
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-toggle-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toggle-label-sm {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-refresh-chat {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-refresh-chat:hover { color: #fff; transform: rotate(90deg); }

/* Messages Stream */
.messages-stream {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg-row {
  display: flex;
  width: 100%;
}

.msg-row.incoming {
  justify-content: flex-start;
}

.msg-row.outgoing {
  justify-content: flex-end;
}

.msg-bubble {
  max-width: 65%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
  position: relative;
  word-break: break-word;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.msg-row.incoming .msg-bubble {
  background: var(--tg-bubble-in);
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
}

.msg-row.outgoing .msg-bubble {
  background: var(--tg-bubble-out);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
  text-align: right;
}

.msg-media-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  margin-bottom: 6px;
}
.msg-media-badge.vip {
  background: rgba(234, 179, 8, 0.2);
  border: 1px solid rgba(234, 179, 8, 0.6);
  color: #fde047;
}
.msg-media-badge.free {
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid rgba(244, 63, 94, 0.6);
  color: #fda4af;
}

/* Chat Composer Box */
.chat-composer-box {
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.85);
  border-top: 1px solid var(--border-color);
}

.composer-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.btn-tool-ai {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(2, 132, 199, 0.2));
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: var(--accent-cyan);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.btn-tool-ai:hover {
  background: rgba(6, 182, 212, 0.3);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}

.btn-tool-media {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(244, 63, 94, 0.2));
  border: 1px solid rgba(236, 72, 153, 0.4);
  color: #f43f5e;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.btn-tool-media:hover {
  background: rgba(236, 72, 153, 0.3);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.3);
}

.btn-tool-vip {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(245, 158, 11, 0.25));
  border: 1px solid rgba(234, 179, 8, 0.5);
  color: #eab308;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.btn-tool-vip:hover {
  background: rgba(234, 179, 8, 0.35);
  box-shadow: 0 0 14px rgba(234, 179, 8, 0.4);
}

.btn-tool-translate {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.btn-tool-translate.active {
  background: var(--accent-pink);
  color: #fff;
  border-color: var(--accent-pink);
}

.composer-input-row {
  display: flex;
  gap: 10px;
}

.composer-input-row textarea {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  resize: none;
  outline: none;
}
.composer-input-row textarea:focus { border-color: var(--accent-pink); }

.btn-send-message {
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-rose));
  color: #fff;
  border: none;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-send-message:hover {
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.4);
}

/* CRM Dossier (Right Panel) */
.crm-dossier-panel {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px;
  gap: 14px;
}

.status-badge-ai {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.dossier-box {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.dossier-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ppv-box {
  background: rgba(251, 191, 36, 0.04);
  border-color: rgba(251, 191, 36, 0.2);
}

.metric-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.metric-row strong {
  color: var(--accent-gold);
}

.badge-bought {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-bought.yes {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.55);
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.25);
}

.badge-bought.no {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border: 1px solid var(--border-color);
}

.dossier-code-id {
  font-family: monospace;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-weight: 600;
}

.badge-premium {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.badge-premium.yes {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(217, 70, 239, 0.3));
  border: 1px solid rgba(217, 70, 239, 0.55);
  color: #f0abfc;
  box-shadow: 0 0 8px rgba(217, 70, 239, 0.25);
}
.badge-premium.no {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  border: 1px solid var(--border-color);
}

.rules-box {
  background: rgba(14, 165, 233, 0.03);
  border-color: rgba(14, 165, 233, 0.22);
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-block-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.fetishes-section {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}

.fetishes-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.fetish-chip {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-pink);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 4px;
}

.chip-remove {
  cursor: pointer;
  font-size: 10px;
}

.add-fetish-row {
  display: flex;
  gap: 6px;
}

.input-dossier-sm {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  outline: none;
}

.btn-add-fetish {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0 10px;
  border-radius: 4px;
  cursor: pointer;
}

.input-rules {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 8px;
  border-radius: 4px;
  font-size: 11px;
  resize: vertical;
  outline: none;
}
.input-rules:focus { border-color: var(--accent-pink); }

.rules-hint {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
}

.btn-save-dossier {
  width: 100%;
  padding: 10px;
  font-size: 12px;
}

/* AI Settings Container */
.ai-settings-container {
  max-width: 800px;
  margin: 32px auto;
  padding: 28px;
}

.ai-config-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-hint {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

.input-with-button {
  display: flex;
  gap: 8px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-text {
  font-size: 13px;
  color: var(--text-main);
  font-weight: 500;
}

/* Switch Sizes */
.switch-sm {
  width: 36px;
  height: 20px;
}
.switch-sm .slider:before {
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
}
.switch-sm input:checked + .slider:before {
  transform: translateX(16px);
}

/* Inherited channel post styles */
.app-container {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  max-width: 1540px;
  margin: 28px auto;
  padding: 0 24px;
}
.composer-panel { padding: 28px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 14px; border-bottom: 1px solid var(--border-color); }
.panel-header h2 { font-size: 22px; font-weight: 700; color: #fff; }
.panel-header h3 { font-size: 16px; font-weight: 700; color: #fff; }
.header-hint { font-size: 12px; color: var(--text-dim); }
.form-section { margin-bottom: 24px; }
.section-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 10px; }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; background: var(--accent-pink); color: #fff; border-radius: 50%; font-size: 10px; font-weight: 700; }
.section-header-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.channels-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.channel-card { display: flex; align-items: center; gap: 12px; padding: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-color); border-radius: var(--radius-md); cursor: pointer; transition: var(--transition); position: relative; }
.channel-card.active { background: rgba(244, 63, 94, 0.08); border-color: var(--border-active); }
.channel-card[data-channel-id="-1004476465068"].active { background: rgba(251, 191, 36, 0.08); border-color: var(--border-vip); }
.channel-icon { width: 40px; height: 40px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.channel-icon.free { background: rgba(244, 63, 94, 0.2); }
.channel-icon.vip { background: rgba(251, 191, 36, 0.2); }
.channel-meta { flex: 1; }
.channel-title { font-weight: 600; font-size: 14px; }
.channel-desc { font-size: 11px; color: var(--text-muted); }
.channel-stars-balance {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.channel-stars-balance.gold {
  color: #facc15;
}
.channel-tag { font-size: 10px; font-weight: 700; padding: 3px 6px; border-radius: 4px; background: rgba(244, 63, 94, 0.15); color: var(--accent-pink); }
.channel-tag.gold { background: rgba(251, 191, 36, 0.15); color: var(--accent-gold); }
.channel-check { position: absolute; top: 8px; right: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-pink); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 9px; opacity: 0; }
.channel-card.active .channel-check { opacity: 1; }
.channel-quick-actions { display: flex; gap: 12px; margin-top: 4px; }
.btn-text-action { background: none; border: none; font-size: 11px; color: var(--text-dim); cursor: pointer; text-decoration: underline; }
.btn-text-action:hover { color: var(--accent-pink); }
.tab-pills { display: flex; background: rgba(255, 255, 255, 0.04); border-radius: var(--radius-full); padding: 3px; border: 1px solid var(--border-color); }
.tab-btn { background: none; border: none; padding: 5px 12px; border-radius: var(--radius-full); font-size: 11px; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.tab-btn.active { background: var(--accent-pink); color: #fff; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.dropzone { border: 2px dashed rgba(255, 255, 255, 0.15); border-radius: var(--radius-md); padding: 30px; text-align: center; cursor: pointer; position: relative; }
.file-input-hidden { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone-icon { font-size: 32px; margin-bottom: 8px; }
.dropzone-text strong { display: block; font-size: 13px; color: #fff; }
.dropzone-text span { font-size: 11px; color: var(--text-muted); }
.server-libraries-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.server-lib-card { padding: 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-color); border-radius: var(--radius-md); cursor: pointer; }
.server-lib-card:hover { border-color: var(--accent-pink); }
.lib-card-top { display: flex; align-items: center; gap: 8px; }
.lib-title { font-size: 12px; font-weight: 600; }
.lib-count { font-size: 10px; color: var(--accent-pink); font-weight: 600; margin-top: 4px; }
.lib-desc { font-size: 10px; color: var(--text-dim); }
.selected-media-container { margin-top: 12px; padding: 12px; background: rgba(0, 0, 0, 0.25); border-radius: var(--radius-md); border: 1px solid var(--border-color); }
.selected-media-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 11px; }
.media-previews-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
.preview-thumbnail-item { position: relative; width: 80px; height: 80px; border-radius: var(--radius-sm); overflow: hidden; background: #000; }
.preview-thumbnail-item img, .preview-thumbnail-item video { width: 100%; height: 100%; object-fit: cover; }
.thumb-remove-btn { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0, 0, 0, 0.7); color: #fff; border: none; font-size: 10px; cursor: pointer; }
.thumb-type-tag { position: absolute; bottom: 2px; left: 2px; background: rgba(0, 0, 0, 0.8); color: #fff; font-size: 8px; padding: 1px 3px; border-radius: 2px; }
.paid-section-box { padding: 16px; background: rgba(251, 191, 36, 0.04); border: 1px solid rgba(251, 191, 36, 0.25); border-radius: var(--radius-md); }
.paid-header-toggle { display: flex; justify-content: space-between; align-items: center; }
.paid-title-group { display: flex; align-items: center; gap: 10px; }
.star-icon { font-size: 24px; }
.paid-title { font-size: 13px; font-weight: 700; color: var(--accent-gold); }
.paid-subtitle { font-size: 11px; color: var(--text-muted); }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255, 255, 255, 0.15); transition: 0.3s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: 0.3s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent-gold); }
input:checked + .slider:before { transform: translateX(20px); background-color: #000; }
.paid-controls { margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(251, 191, 36, 0.2); }
.star-presets { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.star-preset-btn { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color); color: #fff; padding: 5px 12px; border-radius: var(--radius-full); font-size: 12px; font-weight: 600; cursor: pointer; }
.star-preset-btn.active { background: var(--accent-gold); color: #000; border-color: var(--accent-gold); }
.custom-stars-input-wrapper { display: flex; align-items: center; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color); border-radius: var(--radius-full); padding: 0 8px; }
.input-stars { width: 60px; background: none; border: none; color: var(--accent-gold); font-size: 12px; font-weight: 700; padding: 4px 0; outline: none; }
.template-selector-wrap { width: 240px; }
.template-dropdown { width: 100%; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color); color: #fff; padding: 6px 10px; border-radius: var(--radius-sm); font-size: 11px; outline: none; }
.formatting-toolbar { display: flex; justify-content: space-between; align-items: center; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-color); border-bottom: none; border-radius: var(--radius-md) var(--radius-md) 0 0; padding: 6px 10px; }
.btn-group { display: flex; gap: 3px; }
.fmt-btn { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color); color: #fff; padding: 3px 8px; border-radius: var(--radius-sm); font-size: 11px; cursor: pointer; }
.emoji-quick-bar { display: flex; gap: 3px; }
.emoji-btn { background: none; border: none; font-size: 15px; cursor: pointer; padding: 1px 3px; }
.caption-input-wrap { background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border-color); border-radius: 0 0 var(--radius-md) var(--radius-md); }
.caption-input-wrap textarea { width: 100%; background: transparent; border: none; color: #fff; padding: 12px; font-family: inherit; font-size: 13px; resize: vertical; outline: none; }
.caption-footer { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.caption-tools { display: flex; gap: 12px; }
.char-counter { font-size: 10px; color: var(--text-dim); font-weight: 600; }
.composer-actions { display: flex; gap: 12px; margin-top: 20px; }
.btn-primary { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(135deg, var(--accent-pink), var(--accent-rose)); color: #fff; border: none; padding: 12px 24px; border-radius: var(--radius-md); font-family: var(--font-heading); font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 18px rgba(244, 63, 94, 0.4); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(244, 63, 94, 0.55); }
.btn-secondary { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border-color); color: #fff; padding: 12px 20px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600; cursor: pointer; }
.sidebar-panel { display: flex; flex-direction: column; gap: 20px; }
.preview-card, .history-card { padding: 20px; }
.badge-live { font-size: 9px; font-weight: 800; padding: 1px 6px; border-radius: var(--radius-full); background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.4); }
.tg-mockup { background: var(--tg-chat-bg); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 14px; }
.tg-header { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); margin-bottom: 12px; }
.tg-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-pink), var(--accent-rose)); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.tg-channel-name { font-weight: 700; font-size: 13px; color: #fff; }
.tg-subscribers { font-size: 10px; color: var(--text-dim); }
.tg-post-bubble { background: var(--tg-bubble-in); border-radius: var(--radius-md); overflow: hidden; position: relative; }
.tg-media-wrap { position: relative; width: 100%; min-height: 180px; max-height: 340px; background: #090e17; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tg-placeholder-media { color: var(--text-dim); font-size: 12px; text-align: center; padding: 30px; }
.tg-media-wrap img, .tg-media-wrap video { width: 100%; max-height: 340px; object-fit: cover; }
.tg-paid-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; backdrop-filter: blur(16px); background: rgba(15, 23, 42, 0.75); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; text-align: center; }
.tg-paid-lock { font-size: 32px; margin-bottom: 6px; }
.tg-paid-stars-badge { font-size: 15px; font-weight: 800; color: var(--accent-gold); background: rgba(251, 191, 36, 0.15); border: 1px solid rgba(251, 191, 36, 0.4); padding: 3px 12px; border-radius: var(--radius-full); margin-bottom: 6px; }
.tg-paid-hint { font-size: 10px; color: var(--text-muted); margin-bottom: 10px; }
.tg-unlock-btn { background: var(--accent-gold); color: #000; border: none; font-weight: 700; font-size: 12px; padding: 6px 16px; border-radius: var(--radius-full); }
.tg-media-counter { position: absolute; top: 8px; right: 8px; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: var(--radius-full); }
.tg-caption-text { padding: 12px 14px 6px 14px; font-size: 13px; line-height: 1.5; color: #e2e8f0; white-space: pre-wrap; word-break: break-word; }
.tg-caption-text a { color: var(--accent-pink); text-decoration: underline; }
.tg-meta { display: flex; justify-content: flex-end; gap: 8px; padding: 0 14px 10px 14px; font-size: 10px; color: #64748b; }
.tg-reactions { display: flex; gap: 5px; padding: 6px 14px 10px 14px; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.tg-reaction-chip { background: rgba(255, 255, 255, 0.06); padding: 2px 7px; border-radius: var(--radius-full); font-size: 10px; }
.history-list { display: flex; flex-direction: column; gap: 10px; max-height: 400px; overflow-y: auto; }
.history-item { display: flex; gap: 10px; padding: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.history-thumb { width: 44px; height: 44px; border-radius: var(--radius-sm); background: #000; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.history-thumb img { width: 100%; height: 100%; object-fit: cover; }
.history-info { flex: 1; min-width: 0; }
.history-top { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 2px; }
.history-channel { font-weight: 700; color: var(--accent-pink); }
.history-caption { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.history-tags { display: flex; gap: 4px; font-size: 9px; }
.status-tag { padding: 1px 5px; border-radius: 3px; font-weight: 600; }
.status-tag.ok { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.status-tag.stars { background: rgba(251, 191, 36, 0.15); color: var(--accent-gold); }
.history-empty { text-align: center; color: var(--text-dim); font-size: 12px; padding: 20px; }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(12px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-content { width: 850px; max-width: 95vw; max-height: 85vh; display: flex; flex-direction: column; padding: 22px; border: 1px solid rgba(255, 255, 255, 0.15); background: #111726; border-radius: var(--radius-lg); }
.modal-small { width: 450px; }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border-color); }
.modal-close-btn { background: none; border: none; color: var(--text-dim); font-size: 18px; cursor: pointer; }
.modal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.modal-search { flex: 1; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color); color: #fff; padding: 7px 12px; border-radius: var(--radius-sm); font-size: 12px; outline: none; }
.modal-files-grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; overflow-y: auto; max-height: 440px; }
.modal-file-card { position: relative; border-radius: var(--radius-sm); border: 2px solid var(--border-color); overflow: hidden; background: #000; cursor: pointer; }
.modal-file-card.selected { border-color: var(--accent-pink); }
.modal-file-preview { width: 100%; height: 100px; object-fit: cover; }
.modal-file-check { position: absolute; top: 5px; right: 5px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0, 0, 0, 0.6); border: 1px solid #fff; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; }
.modal-file-card.selected .modal-file-check { background: var(--accent-pink); border-color: var(--accent-pink); }
.modal-file-name { padding: 4px; font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(0, 0, 0, 0.5); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border-color); }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; }
.modal-input { width: 100%; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color); color: #fff; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 12px; outline: none; }
.modal-input:focus { border-color: var(--accent-pink); }

/* Toast */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 10px 16px; border-radius: var(--radius-md); font-size: 12px; font-weight: 600; color: #fff; display: flex; align-items: center; gap: 8px; animation: slideIn 0.2s ease; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.toast.success { background: rgba(16, 185, 129, 0.9); }
.toast.error { background: rgba(239, 68, 68, 0.9); }
.toast.info { background: rgba(30, 41, 59, 0.95); border: 1px solid rgba(244, 63, 94, 0.5); }

/* ============================================================
   AUTHENTICATION & LOGIN OVERLAY
   ============================================================ */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: radial-gradient(circle at 50% 30%, rgba(244, 63, 94, 0.15) 0%, rgba(10, 13, 20, 0.96) 60%, #06080d 100%);
  backdrop-filter: blur(28px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 440px;
  max-width: 95vw;
  background: rgba(17, 24, 39, 0.82);
  border: 1px solid rgba(244, 63, 94, 0.35);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(244, 63, 94, 0.18);
  border-radius: var(--radius-lg);
  padding: 36px 32px 30px;
  animation: loginCardPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginCardPop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.login-brand-icon {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 16px rgba(244, 63, 94, 0.6));
}

.login-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  background: linear-gradient(135deg, #ffffff 40%, var(--accent-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

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

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

.login-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrap .input-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  pointer-events: none;
  opacity: 0.75;
}

.input-icon-wrap input {
  width: 100%;
  background: rgba(10, 14, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 14px;
  padding: 12px 42px 12px 42px;
  transition: all 0.2s ease;
  outline: none;
}

.input-icon-wrap input:focus {
  border-color: var(--accent-pink);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.22);
  background: rgba(15, 23, 42, 0.95);
}

.btn-toggle-pwd {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.btn-toggle-pwd:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-top: -4px;
}

.remember-me-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.remember-me-label input[type="checkbox"] {
  accent-color: var(--accent-pink);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.login-error {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: errorShake 0.3s ease;
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.btn-login {
  background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-rose) 100%);
  color: #fff;
  border: none;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(244, 63, 94, 0.35);
  transition: all 0.2s ease;
  margin-top: 6px;
}

.btn-login:hover {
  box-shadow: 0 6px 28px rgba(244, 63, 94, 0.55);
  transform: translateY(-1px);
}

.btn-login:active {
  transform: translateY(0);
}

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-login-arrow {
  transition: transform 0.2s ease;
}

.btn-login:hover .btn-login-arrow {
  transform: translateX(4px);
}

.login-footer-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

.login-footer-hint code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-pink);
  font-family: monospace;
}

/* User & Logout Header Buttons */
.user-pill {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.logout-pill {
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  color: #fca5a5 !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-pill:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

.security-card {
  border-color: rgba(244, 63, 94, 0.25);
}
