/* ==========================================================================
   AI Instagram Admin - Neumorphic Design System (Reference: Dribbble IoT Dashboard)
   ========================================================================== */

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

:root {
  --primary-indigo: #25207c;
  --primary-indigo-dark: #1b1762;
  --primary-indigo-light: #4338ca;
  --accent-coral: #ff5c5c;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-blue: #38bdf8;
  
  --bg-canvas: #e7ecf8;
  --bg-card: #ffffff;
  --bg-body: #f8fafc;
  --bg-soft: #f1f5f9;
  
  --text-main: #1e1b4b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --font-family-base: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow-soft: 0 10px 30px rgba(37, 32, 124, 0.05);
  --shadow-card: 0 4px 18px rgba(0, 0, 0, 0.03);
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-main);
  direction: rtl;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-x: hidden;
  font-family: var(--font-family-base);
  font-feature-settings: "ss01" on, "cv01" on;
  -webkit-font-smoothing: antialiased;
}

/* Background Subtle Dot Pattern */
.bg-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: radial-gradient(#cbd5e1 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  opacity: 0.7;
  z-index: -1;
}

/* SVG Line Icons System (Feather / Lucide Style) */
.svg-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  transition: stroke 0.2s;
}

/* Main Floating Dashboard Window */
.app-window {
  width: 100%;
  max-width: 1420px;
  height: 92vh;
  background: var(--bg-body);
  border-radius: 36px;
  box-shadow: 0 25px 60px rgba(37, 32, 124, 0.12);
  display: flex;
  overflow: hidden;
  position: relative;
  border: 4px solid #ffffff;
}

/* ==========================================================================
   SIDEBAR & PIXEL-PERFECT INVERTED CONCAVE SCOOP (RTL)
   ========================================================================== */
.sidebar-curved {
  width: 230px;
  background: var(--primary-indigo);
  display: flex;
  flex-direction: column;
  padding: 28px 0;
  position: relative;
  z-index: 10;
  user-select: none;
}

.sidebar-logo {
  padding: 0 24px 28px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-box {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.2), 0 8px 20px rgba(0, 0, 0, 0.15);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  margin-right: 12px;
  margin-left: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  border: none;
  border-radius: 0 24px 24px 0;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--font-family-base);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-align: right;
}

.nav-btn:hover:not(.active) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* --- THE INVERTED CONCAVE SCOOP CURVE (RTL) --- */
.nav-btn.active {
  background: var(--bg-body);
  color: var(--primary-indigo);
  font-weight: 700;
  border-radius: 0 24px 24px 0;
  margin-right: 12px;
  margin-left: 0;
  z-index: 20;
}

/* Top Scoop Fillet */
.nav-btn.active::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 0;
  width: 20px;
  height: 20px;
  background: radial-gradient(circle at 100% 0%, transparent 19.5px, var(--bg-body) 20px);
  pointer-events: none;
}

/* Bottom Scoop Fillet */
.nav-btn.active::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 0;
  width: 20px;
  height: 20px;
  background: radial-gradient(circle at 100% 100%, transparent 19.5px, var(--bg-body) 20px);
  pointer-events: none;
}

.nav-btn.active .svg-icon {
  color: var(--accent-coral) !important;
  stroke: var(--accent-coral) !important;
}

.nav-badge {
  background: var(--accent-coral);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  margin-right: auto;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 0 16px;
}

.nav-btn-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  width: 100%;
  font-size: 13px;
  font-family: var(--font-family-base);
  font-weight: 600;
  transition: 0.2s;
}

.nav-btn-logout:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.main-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 28px 36px;
}

/* Top Navigation Bar */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  padding: 10px 20px;
  border-radius: 24px;
  width: 320px;
  box-shadow: var(--shadow-card);
}

.header-search input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 13px;
  color: var(--text-main);
  font-family: var(--font-family-base);
}

.header-center-date {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.header-user-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-actions {
  display: flex;
  gap: 8px;
}

.icon-circle-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: 0.2s;
}

.icon-circle-btn:hover {
  transform: translateY(-2px);
  color: var(--primary-indigo);
}

.profile-info {
  text-align: left;
}

.profile-greeting {
  font-size: 11px;
  color: var(--text-muted);
}

.profile-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.profile-avatar img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ede9fe;
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-card);
}

/* Tabs */
.tab-pane {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.tab-pane.active {
  display: flex;
}

/* ==========================================================================
   TAB 1: ROOM-STYLE METRIC PILLS
   ========================================================================== */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.metric-pill {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s;
}

.metric-pill:hover {
  transform: translateY(-3px);
}

.metric-pill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pill-title {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.pill-dots {
  color: #cbd5e1;
  font-size: 12px;
}

.metric-pill-body {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Circular Gauge Ring */
.circular-ring {
  width: 52px;
  height: 52px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.circular-chart {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circle-bg {
  fill: none;
  stroke: #f1f5f9;
  stroke-width: 3.5;
}

.circle-fill {
  fill: none;
  stroke-width: 3.8;
  stroke-linecap: round;
}

.ring-blue .circle-fill { stroke: var(--primary-indigo); }
.ring-purple .circle-fill { stroke: #8b5cf6; }
.ring-green .circle-fill { stroke: var(--accent-green); }
.ring-white .circle-fill { stroke: #ffffff; }

.ring-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-value-box {
  display: flex;
  flex-direction: column;
}

.metric-number {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  font-feature-settings: "tnum" 1;
}

.metric-unit {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Highlighted Bedroom Style Card */
.pill-highlight {
  background: var(--primary-indigo);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(37, 32, 124, 0.25);
}

.pill-highlight .pill-title { color: rgba(255, 255, 255, 0.85); }
.pill-highlight .metric-number { color: #ffffff; }
.pill-highlight .metric-unit { color: rgba(255, 255, 255, 0.7); }
.pill-highlight .circle-bg { stroke: rgba(255, 255, 255, 0.2); }

/* ==========================================================================
   MIDDLE CONTROLS: SENSORS + ARC GAUGE + DEVICES
   ========================================================================== */
.middle-grid {
  display: grid;
  grid-template-columns: 240px 1fr 310px;
  gap: 18px;
}

.sensor-cards-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sensor-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 16px 20px;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
}

.sensor-icon-sq {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sensor-info {
  display: flex;
  flex-direction: column;
}

.sensor-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.sensor-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
}

.sensor-deg {
  font-size: 13px;
  font-weight: 600;
}

.sensor-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
}

.sensor-bars span {
  width: 4px;
  background: #cbd5e1;
  border-radius: 2px;
}
.sensor-bars span:nth-child(1) { height: 8px; }
.sensor-bars span:nth-child(2) { height: 16px; }
.sensor-bars span:nth-child(3) { height: 24px; background: var(--primary-indigo); }
.sensor-bars span:nth-child(4) { height: 18px; }
.sensor-bars span:nth-child(5) { height: 12px; }

.sensor-arrows {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Center Rainbow Arc Gauge */
.gauge-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}

.card-header-clean {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.gauge-circle-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.gauge-arc-wrapper {
  position: relative;
  width: 180px;
  height: 105px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.gauge-arc-bar {
  position: absolute;
  top: 0;
  width: 170px;
  height: 85px;
  border-top-left-radius: 85px;
  border-top-right-radius: 85px;
  border: 14px solid #f1f5f9;
  border-bottom: 0;
  box-sizing: border-box;
}

.gauge-arc-bar::after {
  content: '';
  position: absolute;
  top: -14px;
  left: -14px;
  width: 170px;
  height: 85px;
  border-top-left-radius: 85px;
  border-top-right-radius: 85px;
  border: 14px solid transparent;
  border-top-color: #f59e0b;
  border-right-color: #ec4899;
  border-bottom: 0;
  box-sizing: border-box;
  transform: rotate(calc((var(--percent) * 1.8deg) - 180deg));
  transform-origin: bottom center;
}

.gauge-center-text {
  text-align: center;
  margin-bottom: 10px;
}

.gauge-percent {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  display: block;
}

.gauge-sub {
  font-size: 10px;
  color: var(--text-muted);
}

.gauge-ticks {
  width: 180px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* My Channels Card */
.devices-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}

.devices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.device-box {
  background: var(--bg-soft);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: 0.2s;
}

.device-box:hover {
  transform: translateY(-2px);
  background: #e2e8f0;
}

.dev-icon-sq {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.bg-coral-pastel  { background: #fee2e2; color: var(--accent-coral); }
.bg-green-pastel  { background: #dcfce7; color: var(--accent-green); }
.bg-amber-pastel  { background: #fef3c7; color: var(--accent-amber); }
.bg-indigo-pastel { background: #e0e7ff; color: var(--primary-indigo-light); }

.dev-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
}

.dev-status {
  font-size: 9px;
  color: var(--accent-green);
  font-weight: 700;
  margin-top: 2px;
}

/* ==========================================================================
   BOTTOM ROW: CHART + RELAXED ILLUSTRATION
   ========================================================================== */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
}

.chart-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 22px 24px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  min-height: 220px;
}

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

.chart-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.chart-legend {
  display: flex;
  gap: 14px;
  font-size: 11px;
}

.leg {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.leg::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.leg-navy::before { background: var(--primary-indigo); }
.leg-red::before { background: var(--accent-coral); }
.leg-yellow::before { background: var(--accent-amber); }

.bars-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 120px;
  padding-top: 10px;
  border-bottom: 1.5px dashed #e2e8f0;
}

.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.bar-group {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 104px;
}

.bar {
  width: 6px;
  border-radius: 4px;
  transition: height 0.4s ease;
}

.b-navy { background: var(--primary-indigo); }
.b-red { background: var(--accent-coral); }
.b-yellow { background: var(--accent-amber); }

.bar-day {
  font-size: 11px;
  color: var(--text-muted);
}

/* Illustration Card */
.illustration-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 20px 24px;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ill-content {
  max-width: 170px;
}

.ill-badge {
  display: inline-block;
  background: #ede9fe;
  color: var(--primary-indigo);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  margin-bottom: 8px;
}

.ill-content h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary-indigo);
  margin-bottom: 6px;
}

.ill-content p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

.ill-graphics {
  margin-left: -10px;
}

/* ==========================================================================
   INBOX & CHAT (STREAMLINED FOR SHOP OWNER)
   ========================================================================== */
.inbox-layout {
  display: flex;
  gap: 20px;
  height: 72vh;
}

.inbox-sidebar {
  width: 320px;
  background: var(--bg-card);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.inbox-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
  padding: 10px 14px;
  border-radius: 16px;
}

.inbox-search input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 12px;
  outline: none;
  font-family: var(--font-family-base);
}

.inbox-convos-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.convo-item-soft {
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--bg-soft);
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.convo-item-soft:hover {
  background: #e2e8f0;
}

.convo-item-soft.active {
  background: var(--primary-indigo);
  color: #ffffff;
}

.convo-item-soft.active .convo-preview {
  color: rgba(255, 255, 255, 0.8);
}

.convo-header-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
}

.convo-preview {
  font-size: 11.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-chat-view {
  flex: 1;
  background: var(--bg-card);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.empty-chat-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--text-muted);
  gap: 12px;
}

.chat-view-header {
  padding: 16px 24px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fafbfe;
}

/* 3-Tier Message Recognition */
.chat-bubble {
  max-width: 65%;
  padding: 12px 18px;
  border-radius: 20px;
  font-size: 13px;
  line-height: 1.6;
}

.chat-bubble-user {
  align-self: flex-start;
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  border: 1px solid #f1f5f9;
  border-bottom-right-radius: 4px;
}

.chat-bubble-ai {
  align-self: flex-end;
  background: var(--primary-indigo);
  color: #ffffff;
  border-bottom-left-radius: 4px;
}

.chat-bubble-human {
  align-self: flex-end;
  background: var(--accent-green);
  color: #ffffff;
  border-bottom-left-radius: 4px;
}

/* AI Draft Card with Fast Approve Button */
.ai-draft-card-v2 {
  margin: 12px 24px;
  background: #fefce8;
  border: 1.5px dashed #facc15;
  border-radius: 20px;
  padding: 16px 20px;
}

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

.draft-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ca8a04;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
}

.draft-body {
  font-size: 13px;
  color: #713f12;
  margin-bottom: 12px;
  line-height: 1.5;
}

.btn-approve-fast {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  border-radius: 16px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.28);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-family-base);
}

.btn-approve-fast:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(16, 185, 129, 0.38);
}

.chat-input-bar {
  padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 10px;
}

.chat-input-bar input {
  flex: 1;
  padding: 12px 18px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: var(--bg-soft);
  font-size: 13px;
  outline: none;
  font-family: var(--font-family-base);
}

/* ==========================================================================
   KANBAN LEADS
   ========================================================================== */
.kanban-modern-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  height: 70vh;
}

.k-column {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}

.k-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1.5px solid #f1f5f9;
  margin-bottom: 12px;
}

.k-title {
  font-size: 13px;
  font-weight: 700;
}

.k-count {
  background: var(--bg-soft);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

.k-cards-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lead-tile {
  background: var(--bg-soft);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ==========================================================================
   BUTTONS, CARDS & UTILITIES
   ========================================================================== */
.btn-bubble {
  padding: 10px 22px;
  border-radius: 20px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-family-base);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-bubble-primary {
  background: var(--primary-indigo);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 32, 124, 0.2);
}

.btn-bubble-primary:hover {
  background: var(--primary-indigo-light);
  transform: translateY(-2px);
}

.btn-bubble-success {
  background: var(--accent-green);
  color: #ffffff;
}

.btn-bubble-outline {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: var(--text-main);
}

.soft-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-soft);
}

.tab-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.tab-header-row h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-indigo);
}

.tab-header-row p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.catalog-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.tone-split-grid, .simulator-grid, .superadmin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-item {
  margin-bottom: 14px;
}

.form-item label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.input-soft {
  width: 100%;
  padding: 11px 16px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: var(--bg-soft);
  font-size: 13px;
  outline: none;
  font-family: var(--font-family-base);
}

/* Super Admin Provider Cards */
.provider-radio-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.provider-card-opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-soft);
  border-radius: 18px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: 0.2s;
}

.provider-card-opt:has(input:checked) {
  border-color: var(--primary-indigo);
  background: #ede9fe;
}

.opt-title { font-weight: 700; font-size: 13.5px; }
.opt-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ==========================================================================
   SUPER ADMIN & SUBSCRIPTION PLAN MANAGEMENT STYLES
   ========================================================================== */
.super-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.super-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.super-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.super-kpi-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(226, 232, 240, 0.6);
}

.super-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(37, 32, 124, 0.08);
}

.kpi-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon-box .svg-icon {
  width: 24px;
  height: 24px;
}

.kpi-info {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-indigo);
  line-height: 1.2;
  margin: 2px 0;
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-light);
}

.super-nav-pills {
  display: flex;
  gap: 8px;
  background: #e2e8f0;
  padding: 5px;
  border-radius: 16px;
  margin-bottom: 20px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.super-pill-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-family-base);
  white-space: nowrap;
}

.super-pill-btn:hover {
  color: var(--primary-indigo);
}

.super-pill-btn.active {
  background: #ffffff;
  color: var(--primary-indigo);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.super-pill-btn .svg-icon {
  width: 16px;
  height: 16px;
}

.subtab-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.subtab-header-flex h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-indigo);
}

.subtab-header-flex p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   AI CONTENT CALENDAR & CONTENT STUDIO STYLES
   ========================================================================== */
.calendar-feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.cal-item-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-card);
}

.cal-item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(37, 32, 124, 0.08);
  border-color: #cbd5e1;
}

.cal-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.cal-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.cal-type-reel {
  background: #ede9fe;
  color: #6d28d9;
}

.cal-type-story {
  background: #fce7f3;
  color: #db2777;
}

.cal-type-carousel {
  background: #e0f2fe;
  color: #0284c7;
}

.cal-type-post {
  background: #dcfce7;
  color: #15803d;
}

.cal-date-badge {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.cal-item-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 8px;
}

.cal-hook-box {
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  border-right: 3px solid var(--accent-coral);
  margin-bottom: 12px;
  color: #334155;
  line-height: 1.5;
}

.cal-item-brief {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  flex-grow: 1;
}

.cal-item-actions {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

/* Studio Scene Storyboard View */
.studio-scene-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}

.scene-num-badge {
  background: var(--primary-indigo);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 700;
}

.plans-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.plan-card {
  background: #ffffff;
  border-radius: 24px;
  border: 1.5px solid #e2e8f0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-card);
}

.plan-card:hover {
  border-color: var(--primary-indigo-light);
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(37, 32, 124, 0.08);
}

.plan-card.plan-featured {
  border-color: var(--primary-indigo);
  background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
}

.plan-badge-pill {
  position: absolute;
  top: -12px;
  left: 20px;
  background: var(--primary-indigo);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(37, 32, 124, 0.2);
}

.plan-name-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.plan-desc-text {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
  min-height: 34px;
  margin-bottom: 16px;
}

.plan-price-block {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px dashed #e2e8f0;
}

.plan-price-num {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary-indigo);
}

.plan-price-unit {
  font-size: 12px;
  color: var(--text-muted);
}

.plan-spec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-soft);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12px;
  margin-bottom: 8px;
}

.plan-spec-label {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.plan-spec-value {
  font-weight: 700;
  color: var(--text-main);
}

.plan-features-ul {
  list-style: none;
  margin: 14px 0 20px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.plan-features-ul li {
  font-size: 12px;
  color: #334155;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}

.plan-features-ul li svg {
  width: 15px;
  height: 15px;
  color: var(--accent-green);
  flex-shrink: 0;
  margin-top: 1px;
}

.plan-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}

.super-users-table-wrapper {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
}

.super-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 12.5px;
}

.super-table th {
  background: #f8fafc;
  padding: 14px 18px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11.5px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.super-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.super-table tr:hover td {
  background: #fafbfe;
}

.user-cell-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.badge-role-super {
  background: #fee2e2;
  color: #dc2626;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 700;
}

.badge-role-user {
  background: #e0e7ff;
  color: #3730a3;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 700;
}

.badge-plan-tag {
  background: #ede9fe;
  color: var(--primary-indigo);
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 11.5px;
  display: inline-block;
}

.plan-pill-tag {
  background: #ede9fe;
  color: var(--primary-indigo);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
}

.modal-card-md {
  max-width: 620px;
}

.modal-card-lg {
  max-width: 860px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.webhook-endpoint-info {
  background: #f1f5f9;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
}

.webhook-endpoint-info code {
  color: var(--primary-indigo);
  direction: ltr;
  display: block;
  margin-top: 4px;
  font-weight: 700;
}

/* Auth Modal */
.auth-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(37, 32, 124, 0.4);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card-modern {
  background: #ffffff;
  border-radius: 32px;
  padding: 40px;
  width: 380px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
}

.auth-icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  background: #ede9fe;
  color: var(--primary-indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.input-pill input {
  width: 100%;
  padding: 13px 18px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  margin-bottom: 16px;
  font-size: 14px;
  text-align: center;
  outline: none;
  font-family: var(--font-family-base);
}

/* ==========================================================================
   ACCESSIBILITY & FOCUS MANAGEMENT (WCAG 2.2 AA)
   ========================================================================== */
.skip-to-content {
  position: absolute;
  top: -60px;
  right: 16px;
  background: var(--primary-indigo);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  z-index: 99999;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: top 0.2s ease;
}

.skip-to-content:focus {
  top: 16px;
  outline: 3px solid var(--accent-coral);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2.5px solid var(--primary-indigo-light);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   BUTTON STATES & DANGER VARIANTS
   ========================================================================== */
.btn-bubble-danger {
  background: #ef4444;
  color: #ffffff;
}

.btn-bubble-danger:hover {
  background: #dc2626;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.btn-bubble:disabled,
.btn-loading {
  opacity: 0.65;
  cursor: not-allowed !important;
  pointer-events: none;
  position: relative;
}

.btn-loading .btn-text {
  visibility: hidden;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  margin-left: -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: btnSpinner 0.6s linear infinite;
}

.btn-bubble-outline.btn-loading::after {
  border: 2px solid rgba(67, 56, 202, 0.2);
  border-top-color: var(--primary-indigo);
}

@keyframes btnSpinner {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   HEADER ENHANCEMENTS: SEARCH CLEAR, NOTIFICATIONS, MOBILE TRIGGER
   ========================================================================== */
.header-right-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 440px;
}

.mobile-menu-btn {
  display: none;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary-indigo);
  flex-shrink: 0;
  transition: all 0.2s;
}

.mobile-menu-btn:hover {
  background: #f1f5f9;
}

.header-search {
  position: relative;
  width: 100%;
}

.search-clear-btn {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s;
}

.search-clear-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.notif-wrapper {
  position: relative;
}

.notif-badge-dot {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-coral);
  box-shadow: 0 0 0 2px #ffffff;
}

.notifications-popover {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  width: 320px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.15);
  border: 1px solid #e2e8f0;
  z-index: 100;
  padding: 16px;
  animation: fadeInDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 12px;
}

.notif-header h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.notif-mark-read {
  background: transparent;
  border: none;
  font-size: 11px;
  color: var(--primary-indigo-light);
  cursor: pointer;
  font-family: var(--font-family-base);
  font-weight: 600;
}

.notif-mark-read:hover {
  text-decoration: underline;
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  background: var(--bg-body);
  transition: background 0.15s;
}

.notif-item:hover {
  background: #f1f5f9;
}

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.notif-dot.bg-amber { background: var(--accent-amber); }
.notif-dot.bg-green { background: var(--accent-green); }

.notif-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}

.notif-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   TOAST NOTIFICATION COMPONENT (WCAG COMPLIANT)
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  width: calc(100vw - 48px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  border: 1px solid #e2e8f0;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.25s ease;
}

.toast.toast-hiding {
  opacity: 0;
  transform: translateX(-24px);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-msg {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.toast-close:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.toast-success {
  border-right: 4px solid var(--accent-green);
}
.toast-success .toast-icon {
  color: var(--accent-green);
}

.toast-error {
  border-right: 4px solid var(--accent-coral);
}
.toast-error .toast-icon {
  color: var(--accent-coral);
}

.toast-warning {
  border-right: 4px solid var(--accent-amber);
}
.toast-warning .toast-icon {
  color: var(--accent-amber);
}

.toast-info {
  border-right: 4px solid var(--primary-indigo-light);
}
.toast-info .toast-icon {
  color: var(--primary-indigo-light);
}

/* ==========================================================================
   MODAL COMPONENT SYSTEM (ACCESSIBLE, TRAPS FOCUS, ESCAPE DISMISS)
   ========================================================================== */
.app-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.app-modal-card {
  background: #ffffff;
  border-radius: 28px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.25);
  padding: 28px 32px;
  position: relative;
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card-sm {
  max-width: 420px;
  text-align: center;
  padding: 32px 28px;
}

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

.app-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.modal-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-modal-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  flex: 1;
}

.modal-close-btn {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.modal-close-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-error {
  display: block;
  font-size: 11px;
  color: #ef4444;
  margin-top: 4px;
  font-weight: 600;
}

.input-error {
  border-color: #ef4444 !important;
  background-color: #fff5f5 !important;
}

.req-star {
  color: #ef4444;
  font-weight: 700;
  margin-right: 2px;
}

.app-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.confirm-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-card-sm h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.modal-card-sm p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.confirm-footer {
  justify-content: center;
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

/* ==========================================================================
   MOBILE DRAWER & RESPONSIVE CHAT NAVIGATION
   ========================================================================== */
.sidebar-brand-name {
  display: none;
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  margin-right: 10px;
  flex: 1;
}

.mobile-close-sidebar-btn {
  display: none;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #ffffff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 899;
}

.chat-back-btn {
  display: none;
  background: #f1f5f9;
  border: none;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  align-items: center;
  gap: 6px;
  font-family: var(--font-family-base);
  transition: all 0.15s;
}

.chat-back-btn:hover {
  background: #e2e8f0;
}

/* ==========================================================================
   EMPTY STATES
   ========================================================================== */
.catalog-empty-state,
.leads-empty-state {
  grid-column: 1 / -1;
  background: #ffffff;
  border-radius: 24px;
  padding: 48px 24px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.catalog-empty-state .empty-icon,
.leads-empty-state .empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: #ede9fe;
  color: var(--primary-indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.catalog-empty-state h3,
.leads-empty-state h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.catalog-empty-state p,
.leads-empty-state p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 400px;
  line-height: 1.5;
}

/* ==========================================================================
   COMPREHENSIVE RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Laptop & Medium Desktop (<= 1280px) */
@media (max-width: 1280px) {
  .app-window {
    height: 96vh;
    border-radius: 28px;
  }

  .main-body {
    padding: 24px 28px;
  }

  .middle-grid {
    grid-template-columns: 220px 1fr 280px;
    gap: 14px;
  }

  .bottom-grid {
    grid-template-columns: 1fr 300px;
    gap: 14px;
  }
}

/* Tablet Landscape & Small Laptops (<= 1024px) */
@media (max-width: 1024px) {
  body {
    padding: 12px;
  }

  .app-window {
    height: 98vh;
    border-radius: 24px;
    border-width: 2px;
  }

  .sidebar-curved {
    width: 200px;
  }

  .main-body {
    padding: 20px 22px;
  }

  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .middle-grid {
    grid-template-columns: 1fr 1fr;
  }

  .devices-card {
    grid-column: 1 / -1;
  }

  .devices-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .bottom-grid {
    grid-template-columns: 1fr;
  }

  .illustration-card {
    display: none;
  }

  .tone-split-grid,
  .simulator-grid,
  .superadmin-grid {
    grid-template-columns: 1fr;
  }

  .super-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kanban-modern-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet Portrait & Large Mobile (<= 768px) */
@media (max-width: 768px) {
  body {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }

  .app-window {
    width: 100vw;
    height: 100dvh;
    max-width: 100%;
    border-radius: 0;
    border: none;
    box-shadow: none;
    flex-direction: column;
  }

  /* Transform Sidebar into Off-Canvas Slide-In Drawer */
  .sidebar-curved {
    position: fixed;
    top: 0;
    right: -280px;
    width: 260px;
    height: 100dvh;
    z-index: 900;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
  }

  .sidebar-curved.mobile-open {
    right: 0;
  }

  .sidebar-logo {
    justify-content: space-between;
    padding: 0 18px 20px 18px;
  }

  .sidebar-brand-name,
  .mobile-close-sidebar-btn {
    display: flex;
  }

  /* Reset Scoop geometry on mobile drawer buttons */
  .nav-btn,
  .nav-btn.active {
    margin-right: 12px;
    margin-left: 12px;
    border-radius: 16px !important;
  }

  .nav-btn.active::before,
  .nav-btn.active::after {
    display: none !important;
  }

  .main-body {
    padding: 16px 14px;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .top-header {
    margin-bottom: 16px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .header-center-date {
    display: none;
  }

  .header-right-group {
    max-width: 100%;
    order: 1;
    width: 100%;
  }

  .header-user-profile {
    order: 0;
    width: 100%;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
  }

  .profile-greeting {
    display: none;
  }

  /* Inbox Layout Mobile Optimization (List vs Chat Detail) */
  .inbox-layout {
    grid-template-columns: 1fr;
    position: relative;
    height: calc(100dvh - 140px);
  }

  .inbox-sidebar {
    width: 100%;
    display: flex;
  }

  .inbox-chat-view {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 5;
    background: #ffffff;
    border-radius: 20px;
  }

  .inbox-layout.mobile-chat-active .inbox-sidebar {
    display: none;
  }

  .inbox-layout.mobile-chat-active .inbox-chat-view {
    display: flex;
  }

  .chat-back-btn {
    display: inline-flex;
  }

  /* Kanban Board Swipe Scrolling on Mobile */
  .kanban-modern-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 14px;
    padding-bottom: 12px;
    -webkit-overflow-scrolling: touch;
  }

  .k-column {
    min-width: 260px;
    flex-shrink: 0;
    scroll-snap-align: start;
  }

  .devices-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .super-kpi-grid {
    grid-template-columns: 1fr;
  }

  .form-row-3 {
    grid-template-columns: 1fr;
  }

  .super-header-flex {
    flex-direction: column;
    align-items: stretch;
  }

  .super-header-actions {
    width: 100%;
  }

  .super-header-actions .btn-bubble {
    flex: 1;
    justify-content: center;
  }
}

/* Mobile Devices (<= 480px) */
@media (max-width: 480px) {
  .main-body {
    padding: 12px 10px;
  }

  .metrics-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .metric-pill {
    padding: 14px 16px;
  }

  .middle-grid {
    grid-template-columns: 1fr;
  }

  .tab-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .tab-header-row button {
    width: 100%;
    justify-content: center;
  }

  .catalog-cards-grid {
    grid-template-columns: 1fr;
  }

  .form-row-2 {
    grid-template-columns: 1fr;
  }

  .app-modal-card {
    padding: 22px 18px;
    border-radius: 22px;
  }

  .notifications-popover {
    width: calc(100vw - 32px);
    left: -60px;
  }

  .chat-view-header {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .chat-view-header > div:first-child {
    flex: 1 1 auto;
    min-width: 140px;
  }

  .chat-view-header .btn-bubble {
    padding: 6px 10px;
    font-size: 11px;
  }

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

  /* Ensure inputs never trigger iOS zoom by maintaining at least 16px */
  input[type="text"],
  input[type="number"],
  input[type="password"],
  textarea {
    font-size: 16px !important;
  }
}

/* Extra Small Mobile (<= 360px - e.g. iPhone SE / Galaxy Fold Cover) */
@media (max-width: 360px) {
  .main-body {
    padding: 8px 6px;
  }

  .metric-number {
    font-size: 22px;
  }

  .chart-legend {
    flex-wrap: wrap;
    gap: 8px;
  }

  .devices-grid {
    grid-template-columns: 1fr;
  }

  .k-column {
    min-width: 220px;
  }
}
