/* Dynamic Page - Styling System (v3.7 Payment Success & Onboarding) */
:root {
  --bg-dark: #070a12;
  --bg-card: rgba(15, 23, 42, 0.78);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.35);
  
  --primary: #6366f1;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --accent-cyan: #38bdf8;
  --accent-green: #10b981;
  --accent-gold: #fbbf24;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --col-new: #3b82f6;
  --col-progress: #f59e0b;
  --col-closed: #10b981;
  --col-lost: #ef4444;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-sm: 0 4px 12px rgba(0,0,0,0.25);
  --shadow-glow: 0 10px 30px rgba(99, 102, 241, 0.25);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.12) 0px, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
}

.app-layout { display: flex; flex-direction: column; min-height: 100vh; }

/* Topbar */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 2rem; background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px); border-bottom: 1px solid var(--border-color);
  position: sticky; top: 0; z-index: 100;
}
.brand { display: flex; align-items: center; gap: 0.75rem; }
.logo-icon {
  width: 40px; height: 40px; background: var(--primary-gradient);
  border-radius: var(--radius-sm); display: grid; place-items: center;
  font-size: 1.2rem; box-shadow: var(--shadow-glow);
}
.brand-name {
  font-weight: 800; font-size: 1.25rem; letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.domain-tag { font-size: 0.75rem; color: var(--accent-cyan); display: block; font-family: 'JetBrains Mono', monospace; }
.nav-controls { display: flex; align-items: center; gap: 1rem; }

.badge { padding: 0.2rem 0.6rem; border-radius: 99px; font-size: 0.75rem; font-weight: 600; }
.saas-badge { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.3); }
.plan-badge { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.discount-badge { background: rgba(251, 191, 36, 0.2); color: var(--accent-gold); border: 1px solid rgba(251, 191, 36, 0.3); }

/* Buttons */
.btn {
  padding: 0.6rem 1.3rem; border-radius: var(--radius-sm); font-weight: 600;
  font-size: 0.875rem; cursor: pointer; border: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.btn-lg { padding: 0.85rem 1.8rem; font-size: 1rem; border-radius: var(--radius-md); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.78rem; }
.btn-primary { background: var(--primary-gradient); color: #fff; box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5); }
.btn-outline { background: transparent; color: var(--text-main); border: 1px solid var(--border-color); }
.btn-outline:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255,255,255,0.2); }

.main-workspace { padding: 2rem; max-width: 1600px; margin: 0 auto; width: 100%; flex: 1; }

/* Onboarding Hero */
.onboarding-card {
  background: var(--bg-card); border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg); padding: 4rem 2.5rem; text-align: center;
  max-width: 850px; margin: 3rem auto; backdrop-filter: blur(16px);
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}
.onboarding-content h2 { font-size: 2.4rem; font-weight: 800; margin: 1rem 0; }
.onboarding-content p { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 2.2rem; max-width: 650px; margin-left: auto; margin-right: auto; }
.onboarding-actions { display: flex; justify-content: center; gap: 1.25rem; }

/* Modals */
.modal-backdrop {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.82); backdrop-filter: blur(10px);
  display: none; place-items: center; z-index: 1000; padding: 1.5rem;
}
.modal-backdrop.active { display: grid; animation: fadeIn 0.2s ease-out; }
.modal-card {
  background: #0f172a; border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); width: 100%; max-width: 540px;
  padding: 1.75rem; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  max-height: 90vh; overflow-y: auto;
}
.modal-md { max-width: 580px; }
.modal-lg { max-width: 880px; }
.modal-xl { max-width: 1020px; }

/* PAYMENT SUCCESS MODAL ENHANCEMENTS */
.success-modal { border-color: var(--accent-green); box-shadow: 0 0 50px rgba(16, 185, 129, 0.2); }
.success-icon-wrap {
  width: 80px; height: 80px; background: rgba(16, 185, 129, 0.15);
  border: 2px solid var(--accent-green); border-radius: 50%; display: grid;
  place-items: center; margin: 0 auto 0.5rem auto; box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
}
.success-emoji { font-size: 2.5rem; animation: bounce 1s infinite alternate; }
@keyframes bounce { from { transform: scale(1); } to { transform: scale(1.15); } }

.success-title { font-size: 2rem; font-weight: 800; margin: 0.5rem 0; }
.success-subtitle { font-size: 1.05rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 1.5rem auto; }
.text-cyan { color: var(--accent-cyan); }

/* RECEIPT SUMMARY BOX */
.receipt-summary-box {
  background: rgba(15, 23, 42, 0.8); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); padding: 1.25rem; margin-bottom: 1.75rem;
  display: flex; flex-direction: column; gap: 0.6rem; text-align: left;
}
.receipt-row { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--text-muted); }
.receipt-row strong { color: #fff; }
.receipt-row code { font-family: 'JetBrains Mono', monospace; color: var(--accent-cyan); }
.receipt-forfettario-note {
  font-size: 0.72rem; color: #94a3b8; border-top: 1px solid var(--border-color);
  padding-top: 0.6rem; margin-top: 0.4rem; line-height: 1.35;
}

/* 3-STEP QUICK START GRID */
.quick-start-steps { margin-bottom: 2rem; text-align: left; }
.qs-header { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; color: #fff; text-align: center; }
.qs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.qs-step-card {
  background: rgba(30, 41, 59, 0.6); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); padding: 1.1rem 0.9rem; text-align: center; position: relative;
}
.qs-num {
  width: 28px; height: 28px; background: var(--primary-gradient); color: #fff;
  font-weight: 800; border-radius: 50%; display: grid; place-items: center;
  font-size: 0.85rem; margin: 0 auto 0.6rem auto;
}
.qs-step-card h5 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.3rem; }
.qs-step-card p { font-size: 0.75rem; color: var(--text-muted); line-height: 1.35; }

.modal-actions-footer { display: flex; justify-content: center; gap: 1rem; }

/* PRICING & STRIPE MODAL */
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.25rem; }
.header-left { display: flex; align-items: center; gap: 0.8rem; }
.alert-icon { font-size: 1.5rem; }
.modal-header h3 { font-size: 1.3rem; font-weight: 800; }
.modal-header .subhead { font-size: 0.82rem; color: var(--text-muted); font-weight: 400; }
.close-btn { background: transparent; border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; }

/* AUTH MODAL */
.auth-tabs { display: flex; border-bottom: 1px solid var(--border-color); margin-bottom: 1.5rem; }
.auth-tab-btn {
  flex: 1; padding: 0.75rem; background: transparent; border: none;
  color: var(--text-muted); font-weight: 700; font-size: 0.9rem; cursor: pointer;
  border-bottom: 2px solid transparent; transition: all 0.2s;
}
.auth-tab-btn.active { color: #fff; border-bottom-color: var(--primary); background: rgba(255,255,255,0.03); }

.social-login-group { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.25rem; }
.google-btn, .apple-btn {
  width: 100%; padding: 0.8rem; border-radius: var(--radius-sm); font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  cursor: pointer; border: 1px solid rgba(255,255,255,0.15); transition: all 0.2s; font-size: 0.9rem;
}
.google-btn { background: #ffffff; color: #1e293b; }
.google-btn:hover { background: #f1f5f9; }
.apple-btn { background: #000000; color: #ffffff; border-color: rgba(255,255,255,0.2); }
.apple-btn:hover { background: #111; }

.divider { display: flex; align-items: center; color: var(--text-dim); font-size: 0.78rem; margin: 1.25rem 0; }
.divider::before, .divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--border-color); }
.divider span { padding: 0 0.6rem; }

.styled-input {
  width: 100%; padding: 0.75rem 1rem; background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  color: #fff; outline: none; font-size: 0.9rem; transition: all 0.2s;
}
.styled-input::placeholder { color: #475569; }
.styled-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); }

/* Billing toggle */
.billing-toggle-container {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  margin-bottom: 2rem; background: rgba(15, 23, 42, 0.6); padding: 0.6rem;
  border-radius: 99px; border: 1px solid var(--border-color); width: fit-content; margin-left: auto; margin-right: auto;
}
.billing-label { font-size: 0.88rem; font-weight: 600; color: var(--text-muted); }
.billing-label.active { color: #fff; }

.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: #334155; transition: .3s; border-radius: 99px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

.pricing-plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-bottom: 1.5rem; }
.pricing-plan-card {
  background: rgba(15, 23, 42, 0.7); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); padding: 1.6rem 1.25rem; text-align: center;
  display: flex; flex-direction: column; gap: 0.75rem; position: relative; transition: all 0.2s;
}
.pricing-plan-card:hover { border-color: var(--border-glow); transform: translateY(-3px); }
.pricing-plan-card.featured { border-color: var(--primary); background: rgba(99, 102, 241, 0.08); }
.plan-pop-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; font-size: 0.65rem; }
.pricing-plan-card h4 { font-size: 1.25rem; font-weight: 800; }
.plan-desc { font-size: 0.75rem; color: var(--text-muted); }
.pricing-plan-card .price { font-size: 2.4rem; font-weight: 800; color: #fff; margin: 0.4rem 0; }
.pricing-plan-card .price .currency { font-size: 1.4rem; vertical-align: super; }
.pricing-plan-card .price .period { font-size: 0.85rem; color: var(--text-muted); font-weight: 400; }
.plan-features { list-style: none; text-align: left; font-size: 0.82rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 0.45rem; margin: 0.5rem 0 1rem 0; }

/* STRIPE EMBEDDED LAYOUT */
.stripe-box {
  background: rgba(15, 23, 42, 0.95); border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-md); padding: 1.75rem; margin-top: 1.5rem;
}
.stripe-grid-layout { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 2rem; }
.stripe-box-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }

/* CREDIT CARD VISUALIZER */
.credit-card-preview {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  border-radius: 16px; padding: 1.25rem; color: #fff; margin-bottom: 1.25rem;
  box-shadow: 0 12px 24px rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.15);
  position: relative; overflow: hidden;
}
.card-chip { width: 36px; height: 26px; background: #f59e0b; border-radius: 6px; margin-bottom: 1rem; }
.card-type-icon { position: absolute; top: 1.25rem; right: 1.25rem; font-weight: 900; font-size: 1.1rem; color: #fff; font-family: sans-serif; letter-spacing: 1px; }
.card-number-display { font-family: 'JetBrains Mono', monospace; font-size: 1.1rem; letter-spacing: 2px; margin-bottom: 1.25rem; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.card-bottom-row { display: flex; justify-content: space-between; font-size: 0.75rem; }
.card-label { color: #a5b4fc; text-transform: uppercase; font-size: 0.65rem; display: block; }
.card-val { font-weight: 700; font-family: 'JetBrains Mono', monospace; }

/* ORDER SUMMARY SIDEBAR */
.stripe-summary-side {
  background: rgba(30, 41, 59, 0.6); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem;
}
.summary-title { font-size: 1rem; font-weight: 700; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; }
.summary-plan-details { background: rgba(15,23,42,0.6); padding: 0.75rem; border-radius: 6px; }
.plan-row { display: flex; justify-content: space-between; font-weight: 700; font-size: 0.95rem; }
.coupon-input-group { display: flex; gap: 0.5rem; }
.summary-totals { font-size: 0.85rem; display: flex; flex-direction: column; gap: 0.5rem; }
.total-row { display: flex; justify-content: space-between; color: var(--text-muted); }
.discount-row { color: var(--accent-green); }
.tax-forfettario-notice {
  font-size: 0.72rem; color: #94a3b8; background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255,255,255,0.06); padding: 0.6rem; border-radius: 6px;
  line-height: 1.35; margin-top: 0.5rem;
}
.summary-hr { border: none; border-top: 1px solid var(--border-color); margin: 0.25rem 0; }
.final-total { color: #fff; font-size: 1.1rem; }
.highlight-price { color: var(--accent-cyan); font-size: 1.2rem; }
.trust-guarantees { font-size: 0.75rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.5rem; }

/* Toast */
.toast {
  position: fixed; bottom: 2rem; right: 2rem; background: var(--accent-green);
  color: #fff; padding: 0.8rem 1.4rem; border-radius: var(--radius-md);
  font-weight: 700; font-size: 0.9rem; box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  display: none; z-index: 2000; animation: slideUp 0.3s ease-out;
}
.toast.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ------------------------------------- */
/* PUBLIC LANDING PAGE V2 STYLES         */
/* ------------------------------------- */

.public-landing {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 1rem;
}

.landing-hero {
  text-align: center;
  padding: 6rem 1rem;
  position: relative;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0,0,0,0) 70%);
  z-index: -1;
}

.pulse-badge {
  display: inline-block;
  margin-bottom: 1.5rem;
  animation: pulse 2s infinite;
  border: 1px solid var(--primary);
  background: rgba(99, 102, 241, 0.1);
  color: #a5b4fc;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: #fff;
}

.text-gradient {
  background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 3rem auto;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
}

.btn-xl {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.landing-features {
  padding: 6rem 1rem;
}

.section-heading {
  margin-bottom: 4rem;
}

.section-heading h2 {
  font-size: 2.5rem;
  color: #fff;
  margin-bottom: 1rem;
}

.section-heading p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-card {
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(12px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border-color: rgba(99, 102, 241, 0.3);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

.feature-card h3 {
  color: #fff;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.feature-card p {
  color: var(--text-muted);
  line-height: 1.6;
}

.landing-steps {
  padding: 6rem 1rem;
  background: rgba(15, 23, 42, 0.3);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.steps-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.step-box {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 2;
}

.step-num {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 auto 1.5rem auto;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.step-box h4 {
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.step-box p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 200px;
  margin: 0 auto;
}

.step-connector {
  flex: 0 0 100px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary) 0%, rgba(99,102,241,0) 100%);
  margin-top: 25px;
  position: relative;
  opacity: 0.5;
}

.landing-cta {
  text-align: center;
  padding: 5rem 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: rgba(99, 102, 241, 0.05);
  margin: 6rem auto;
  max-width: 800px;
}

.landing-cta h2 {
  font-size: 2rem;
  color: #fff;
  margin-bottom: 1rem;
}

.landing-cta p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 768px) {
  .hero-title { font-size: 2.5rem; }
  .hero-actions { flex-direction: column; }
  .steps-container { flex-direction: column; align-items: center; gap: 3rem; }
  .step-connector { display: none; }
}

/* ------------------------------------- */
/* DASHBOARD UI v3 — PREMIUM OVERHAUL    */
/* ------------------------------------- */

.dashboard-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

/* ---- SIDEBAR ---- */
.dashboard-sidebar {
  width: 260px;
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(16px);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.75rem;
  flex-shrink: 0;
  gap: 0.25rem;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
}

.sidebar-avatar {
  width: 40px;
  height: 40px;
  background: var(--primary-gradient);
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
  flex-shrink: 0;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-user-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-plan-badge {
  font-size: 0.7rem;
  color: var(--accent-cyan);
  font-family: 'JetBrains Mono', monospace;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 0.5rem 0.75rem;
}

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

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 0.65rem 0.75rem;
  font-size: 0.88rem;
  text-align: left;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  width: 100%;
  position: relative;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.04);
  color: #e2e8f0;
}

.sidebar-link.active {
  background: rgba(99, 102, 241, 0.12);
  color: #fff;
  font-weight: 600;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}

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

.sidebar-link-text {
  flex-grow: 1;
}

.sidebar-link-count {
  background: rgba(99,102,241,0.2);
  color: #a5b4fc;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  min-width: 22px;
  text-align: center;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logout-link {
  color: #ef4444 !important;
  opacity: 0.7;
}
.logout-link:hover {
  opacity: 1;
  background: rgba(239,68,68,0.08) !important;
}

/* ---- MAIN CONTENT AREA ---- */
.dashboard-main {
  flex-grow: 1;
  padding: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ---- INTERNAL TOP BAR ---- */
.dash-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(15,23,42,0.4);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.dash-page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
}

.dash-topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dash-plan-widget {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(30,41,59,0.5);
  padding: 0.4rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.dash-plan-name strong {
  color: #fff;
}

.dash-progress-bar {
  width: 80px;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}

.dash-progress-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.dash-plan-count {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-cyan);
  font-size: 0.78rem;
  font-weight: 600;
}

/* ---- TAB CONTENT AREA ---- */
.tab-content {
  display: none;
  padding: 2rem;
  animation: fadeInTab 0.25s ease-out;
}

.tab-content.active {
  display: block;
}

@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.dash-section-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

/* ---- KANBAN ---- */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.kanban-column {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 300px;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.column-header h3 {
  font-size: 0.85rem;
  font-weight: 700;
  flex-grow: 1;
}

.column-header .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.col-new .dot { background: var(--col-new); box-shadow: 0 0 8px var(--col-new); }
.col-progress .dot { background: var(--col-progress); box-shadow: 0 0 8px var(--col-progress); }
.col-closed .dot { background: var(--col-closed); box-shadow: 0 0 8px var(--col-closed); }
.col-lost .dot { background: var(--col-lost); box-shadow: 0 0 8px var(--col-lost); }

.count-badge {
  background: rgba(255,255,255,0.08);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  color: var(--text-muted);
}

/* ---- SETTINGS TAB ---- */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.settings-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 1.75rem;
}

.settings-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.settings-card-icon {
  font-size: 1.5rem;
}

.settings-card-header h3 {
  font-size: 1.1rem;
  color: #fff;
  font-weight: 700;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-weight: 600;
}

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

.plan-display-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.plan-display-badge {
  display: inline-block;
  background: rgba(99,102,241,0.2);
  color: #a5b4fc;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plan-display-box h2 {
  font-size: 2rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.plan-display-box p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 992px) {
  .dashboard-layout {
    flex-direction: column;
  }
  .dashboard-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-direction: row;
    overflow-x: auto;
    padding: 0.5rem;
    gap: 0;
  }
  .sidebar-profile, .sidebar-divider, .sidebar-bottom { display: none; }
  .sidebar-nav { flex-direction: row; gap: 0; }
  .sidebar-link { white-space: nowrap; border-radius: 8px; padding: 0.5rem 0.75rem; font-size: 0.8rem; }
  .sidebar-link-count { display: none; }
  .sidebar-link.active::before { display: none; }
  .dash-topbar { padding: 1rem; }
  .dash-topbar-right { flex-wrap: wrap; gap: 0.5rem; }
  .settings-grid { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: 1fr 1fr; }
}

/* ------------------------------------- */
/* PAGES TAB UI ENHANCEMENTS             */
/* ------------------------------------- */

.empty-state-glass {
  grid-column: 1/-1;
  text-align: center;
  padding: 4rem 2rem;
  background: rgba(30, 41, 59, 0.4);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
}

.empty-state-glass h3 {
  color: #fff;
  margin-bottom: 0.5rem;
}

.glass-card {
  background: rgba(30, 41, 59, 0.4) !important;
  border-radius: var(--radius-lg) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  backdrop-filter: blur(10px);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  border-color: rgba(99,102,241,0.4) !important;
}

.page-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.header-titles h3 {
  color: #fff;
  font-size: 1.25rem;
  margin-bottom: 0.4rem;
}

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.status-indicator-live {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-dot {
  width: 6px;
  height: 6px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: blink 1.5s infinite alternate;
}

@keyframes blink {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

.icon-btn-danger {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  font-size: 1.1rem;
}
.icon-btn-danger:hover {
  opacity: 1;
}

.link-copy-box {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.3rem 0.3rem 0.3rem 0.8rem;
}

.link-input {
  flex-grow: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: monospace;
  font-size: 0.85rem;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-card-footer {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 1rem;
}

/* ---- UTILITY CLASSES ---- */
.mb-2 { margin-bottom: 0.75rem; }
.w-full { width: 100%; }
.mt-2 { margin-top: 0.75rem; }
.text-center { text-align: center; }

/* ---- PAGES GRID ---- */
.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}

/* ---- STYLED SELECT ---- */
.styled-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  outline: none;
  font-size: 0.9rem;
  transition: all 0.2s;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.styled-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.styled-select option {
  background: #0f172a;
  color: #fff;
}

@media (max-width: 768px) {
  .pages-grid { grid-template-columns: 1fr; }
}
