/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    color: #1a1a2e;
    background: #fff;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

a { text-decoration: none; }
img { max-width: 100%; }

:root {
    --primary:       #2563eb;
    --primary-dark:  #1d4ed8;
    --primary-light: #eff6ff;
    --accent:        #f59e0b;
    --success:       #10b981;
    --danger:        #ef4444;
    --gray-50:       #f9fafb;
    --gray-100:      #f3f4f6;
    --gray-200:      #e5e7eb;
    --gray-400:      #9ca3af;
    --gray-600:      #4b5563;
    --gray-800:      #1f2937;
    --sidebar-w:     260px;
    --topbar-h:      64px;
    --radius:        12px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
    --shadow-md:     0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:     0 8px 32px rgba(0,0,0,.14);
}

/* Blazor error UI */
.blazor-error-boundary {
    background: #b32121 url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=") no-repeat 1rem/1.8rem;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error has occurred." }

#blazor-error-ui {
    display: none;
    background: #ffecec;
    border-top: 2px solid var(--danger);
    padding: .75rem 1.25rem;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 9999;
    font-size: .875rem;
}
#blazor-error-ui .dismiss { cursor: pointer; float: right; font-weight: 700; }

.valid.modified:not([type=checkbox]) { outline: 1px solid var(--success); }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger); font-size: .8rem; margin-top: .25rem; }

/* ============================================================
   LANDING LAYOUT WRAPPER
   ============================================================ */
.landing-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   LANDING NAVBAR
   ============================================================ */
.landing-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
}
.landing-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 68px;
    display: flex;
    align-items: center;
    gap: 2rem;
}
.landing-logo {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--gray-800);
    white-space: nowrap;
}
.logo-icon { font-size: 1.4rem; }
.logo-text { color: var(--primary); }

.landing-nav-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    margin-left: auto;
}
.landing-nav-links a {
    color: var(--gray-600);
    font-weight: 500;
    font-size: .95rem;
    transition: color .2s;
}
.landing-nav-links a:hover { color: var(--primary); }
.nav-signin-btn {
    color: var(--primary) !important;
    font-weight: 600 !important;
}
.nav-cta-btn {
    padding: .45rem 1.1rem !important;
    border-radius: 8px !important;
    font-size: .9rem !important;
}
.mobile-nav-toggle {
    display: none;
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-800);
}
.mobile-menu {
    display: none;
    flex-direction: column;
    gap: .5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    background: #fff;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
    color: var(--gray-600);
    font-weight: 500;
    padding: .5rem 0;
}

/* ============================================================
   HERO
   ============================================================ */
.hero-section {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 50%, #fefce8 100%);
    padding: 5rem 0 4rem;
    flex: 1;
}
.hero-section .container,
.features-section .container,
.stats-section .container,
.howto-section .container,
.testimonials-section .container,
.pricing-section .container,
.cta-section .container,
.landing-footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}
.hero-section .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #fef9c3;
    color: #92400e;
    font-size: .82rem;
    font-weight: 600;
    padding: .35rem .9rem;
    border-radius: 99px;
    margin-bottom: 1.25rem;
    border: 1px solid #fde68a;
}
.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--gray-800);
    margin-bottom: 1.25rem;
}
.hero-highlight {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    font-size: 1.1rem;
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 520px;
}
.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.btn-hero-primary {
    background: var(--primary);
    color: #fff !important;
    padding: .85rem 2rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    box-shadow: 0 4px 14px rgba(37,99,235,.35);
    transition: background .2s, transform .15s, box-shadow .2s;
    display: inline-block;
}
.btn-hero-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37,99,235,.45);
    color: #fff !important;
}
.btn-hero-secondary {
    background: #fff;
    color: var(--primary) !important;
    padding: .85rem 1.75rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid var(--primary);
    transition: background .2s, color .2s;
    display: inline-block;
}
.btn-hero-secondary:hover {
    background: var(--primary-light);
}
.hero-meta {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    font-size: .85rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* Hero Mockup */
.hero-image { display: flex; justify-content: flex-end; }
.hero-mockup {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,.05);
    overflow: hidden;
    width: 100%;
    max-width: 500px;
}
.mockup-topbar {
    background: var(--gray-800);
    padding: .65rem 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.mockup-dot { width: 12px; height: 12px; border-radius: 50%; }
.mockup-dot.red    { background: #ff5f56; }
.mockup-dot.yellow { background: #ffbd2e; }
.mockup-dot.green  { background: #27c93f; }
.mockup-title {
    color: #9ca3af;
    font-size: .75rem;
    margin-left: .5rem;
    font-weight: 500;
}
.mockup-body { padding: 0; }
.mockup-row {
    display: grid;
    grid-template-columns: 2fr .5fr 1fr 1fr;
    padding: .65rem 1rem;
    font-size: .82rem;
    border-bottom: 1px solid var(--gray-100);
    transition: background .15s;
}
.mockup-row:hover:not(.header):not(.total) { background: var(--primary-light); }
.mockup-row.header {
    background: var(--gray-50);
    font-weight: 700;
    font-size: .75rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.mockup-row.total {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
}
.mockup-footer {
    padding: .75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

/* ============================================================
   TRUST BAR
   ============================================================ */
.trust-bar {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 0;
}
.trust-bar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 2.5rem;
    flex-wrap: wrap;
}
.trust-label {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--gray-400);
    white-space: nowrap;
}
.trust-logos {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
}
.trust-logo {
    font-size: .85rem;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ============================================================
   SECTION COMMON
   ============================================================ */
.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}
.section-tag {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    padding: .3rem .85rem;
    border-radius: 99px;
    margin-bottom: .85rem;
}
.section-header h2 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--gray-800);
    margin-bottom: .75rem;
}
.section-header p {
    color: var(--gray-600);
    font-size: 1.05rem;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.65;
}

/* ============================================================
   FEATURES
   ============================================================ */
.features-section { padding: 5rem 0; }
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.feature-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 2rem 1.75rem;
    position: relative;
    transition: box-shadow .25s, transform .25s;
}
.feature-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}
.feature-card.featured {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light), var(--shadow-md);
}
.feature-badge {
    position: absolute;
    top: -12px;
    left: 1.5rem;
    background: var(--primary);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    padding: .25rem .75rem;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.feature-icon { font-size: 2rem; margin-bottom: 1rem; }
.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: .6rem;
}
.feature-card p {
    color: var(--gray-600);
    font-size: .92rem;
    line-height: 1.65;
    margin: 0;
}

/* ============================================================
   STATS
   ============================================================ */
.stats-section {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    padding: 4rem 0;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    text-align: center;
}
.stat-card { padding: 1.5rem 1rem; }
.stat-number {
    font-size: 2.75rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    margin-bottom: .4rem;
}
.stat-label {
    color: rgba(255,255,255,.75);
    font-size: .9rem;
    font-weight: 500;
}

/* ============================================================
   HOW IT WORKS
   ============================================================ */
.howto-section { padding: 5rem 0; background: var(--gray-50); }
.howto-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.howto-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    flex: 1;
    min-width: 200px;
    max-width: 280px;
    box-shadow: var(--shadow-sm);
}
.step-number {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
}
.step-content h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0 0 .4rem;
}
.step-content p {
    color: var(--gray-600);
    font-size: .88rem;
    line-height: 1.55;
    margin: 0;
}
.howto-connector {
    font-size: 1.5rem;
    color: var(--gray-400);
    font-weight: 700;
}

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.testimonials-section { padding: 5rem 0; }
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.testimonial-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 2rem 1.75rem;
    transition: box-shadow .25s;
}
.testimonial-card:hover { box-shadow: var(--shadow-md); }
.testimonial-card.featured-testimonial {
    background: var(--primary-light);
    border-color: var(--primary);
}
.stars { color: var(--accent); font-size: 1rem; margin-bottom: .75rem; }
.testimonial-card > p {
    color: var(--gray-600);
    font-size: .95rem;
    line-height: 1.65;
    margin-bottom: 1.25rem;
    font-style: italic;
}
.testimonial-author { display: flex; align-items: center; gap: .75rem; }
.author-avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
}
.testimonial-author strong { display: block; font-size: .9rem; color: var(--gray-800); }
.testimonial-author span  { font-size: .8rem; color: var(--gray-400); }

/* ============================================================
   PRICING
   ============================================================ */
.pricing-section { padding: 5rem 0; background: var(--gray-50); }
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    align-items: start;
    max-width: 820px;
    margin: 0 auto;
}
.pricing-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 2.25rem 2rem;
    position: relative;
    transition: box-shadow .25s, transform .25s;
}
.pricing-card:hover { box-shadow: var(--shadow-md); }
.pricing-card.popular {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light), var(--shadow-md);
    transform: scale(1.03);
}
.popular-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    padding: .3rem 1rem;
    border-radius: 99px;
    white-space: nowrap;
}
.pricing-tier {
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--gray-400);
    margin-bottom: .5rem;
}
.pricing-price {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
    line-height: 1;
}
.pricing-price span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-400);
}
.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.75rem;
    display: flex;
    flex-direction: column;
    gap: .65rem;
}
.pricing-features li {
    font-size: .9rem;
    color: var(--gray-600);
}

.pricing-desc {
    font-size: .88rem;
    color: var(--gray-400);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

/* ============================================================
   FAQ
   ============================================================ */
.faq-section { padding: 5rem 0; background: var(--gray-50); }
.faq-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; max-width: 960px; margin: 0 auto; }
.faq-item { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.faq-item h4 { font-size: 1rem; font-weight: 700; color: var(--gray-800); margin: 0 0 .6rem; }
.faq-item p { font-size: .9rem; color: var(--gray-500); margin: 0; line-height: 1.65; }
@media (max-width: 640px) { .faq-grid { grid-template-columns: 1fr; } }

/* ============================================================
   CTA
   ============================================================ */
.cta-section {
    background: linear-gradient(135deg, var(--gray-800) 0%, #1e1b4b 100%);
    padding: 5rem 0;
    text-align: center;
}
.cta-section h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: .75rem;
}
.cta-section p {
    color: rgba(255,255,255,.7);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}
.cta-meta {
    margin-top: 1.25rem;
    color: rgba(255,255,255,.5);
    font-size: .85rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.landing-footer {
    background: var(--gray-800);
    padding: 4rem 0 2rem;
    color: rgba(255,255,255,.65);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}
.footer-brand .landing-logo { color: #fff; margin-bottom: 1rem; display: inline-flex; }
.footer-brand .logo-text { color: #93c5fd; }
.footer-brand p { font-size: .88rem; line-height: 1.65; max-width: 280px; }
.footer-links h5 {
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 1rem;
}
.footer-links {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.footer-links a {
    color: rgba(255,255,255,.55);
    font-size: .88rem;
    transition: color .2s;
}
.footer-links a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .82rem;
}
.footer-social { display: flex; gap: 1.25rem; }
.footer-social a {
    color: rgba(255,255,255,.5);
    font-size: .85rem;
    transition: color .2s;
}
.footer-social a:hover { color: #fff; }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
    padding: 2rem 1rem;
}
.auth-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 440px;
}
.auth-card-wide { max-width: 560px; }
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-logo { justify-content: center; margin-bottom: 1.25rem; }
.auth-header h1 {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--gray-800);
    margin-bottom: .4rem;
}
.auth-header p { color: var(--gray-400); font-size: .9rem; }
.auth-submit-btn {
    padding: .8rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 10px;
    margin-top: .25rem;
}
.auth-divider {
    text-align: center;
    position: relative;
    margin: 1.5rem 0;
    color: var(--gray-400);
    font-size: .85rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 38%;
    height: 1px;
    background: var(--gray-200);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }
.auth-footer-links {
    text-align: center;
    margin-top: 1.25rem;
}
.auth-footer-links a { color: var(--primary); font-size: .88rem; font-weight: 500; }
.auth-terms {
    font-size: .78rem;
    color: var(--gray-400);
    text-align: center;
    margin-top: .75rem;
}
.auth-terms a { color: var(--primary); }

/* ============================================================
   DASHBOARD LAYOUT — PROFESSIONAL TOP NAV
   ============================================================ */
.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--gray-50);
}

.app-topnav {
    position: sticky;
    top: 0;
    z-index: 200;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-bottom: 1px solid rgba(255,255,255,.055);
    box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 4px 24px rgba(0,0,0,.3);
}

.topnav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.75rem;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 0;
}

/* ── Brand ─────────────────────────────────────────────────── */
.topnav-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    text-decoration: none;
    flex-shrink: 0;
}
.topnav-brand:hover .topnav-brand-clear,
.topnav-brand:hover .topnav-brand-est { opacity: .85; }

.topnav-logo {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(37,99,235,.45);
}

.topnav-brand-name { font-size: 1.05rem; font-weight: 800; letter-spacing: -.025em; line-height: 1; }
.topnav-brand-clear { color: rgba(255,255,255,.9); }
.topnav-brand-est   { color: #93c5fd; }

/* Vertical separator between brand and nav */
.topnav-brand-sep {
    width: 1px;
    height: 22px;
    background: rgba(255,255,255,.12);
    margin: 0 1.4rem;
    flex-shrink: 0;
}

/* ── Nav links ─────────────────────────────────────────────── */
.topnav-links {
    display: flex;
    align-items: stretch;
    gap: .05rem;
    flex: 1;
    height: var(--topbar-h);
}

.topnav-link {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    padding: 0 .9rem;
    color: rgba(255,255,255,.55);
    font-size: .855rem;
    font-weight: 500;
    text-decoration: none;
    letter-spacing: .01em;
    white-space: nowrap;
    position: relative;
    transition: color .18s;
}
/* Active bottom-border indicator */
.topnav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: .6rem;
    right: .6rem;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform .2s ease, opacity .2s;
    opacity: 0;
}
.topnav-link:hover  { color: rgba(255,255,255,.85); }
.topnav-link:hover::after  { transform: scaleX(.55); opacity: .45; }
.topnav-link.active { color: #fff; font-weight: 600; }
.topnav-link.active::after { transform: scaleX(1); opacity: 1; }
.topnav-link i { font-size: .9rem; opacity: .8; }
.topnav-link.active i { opacity: 1; }

/* ── Right side ────────────────────────────────────────────── */
.topnav-right {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-left: auto;
    flex-shrink: 0;
    padding-left: 1.2rem;
    border-left: 1px solid rgba(255,255,255,.08);
}

/* New Project CTA button */
.topnav-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .42rem 1rem;
    background: var(--primary);
    color: #fff !important;
    border-radius: 7px;
    font-size: .83rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: .01em;
    white-space: nowrap;
    transition: background .18s, box-shadow .18s, transform .12s;
    box-shadow: 0 2px 10px rgba(37,99,235,.4);
}
.topnav-cta-btn:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 16px rgba(37,99,235,.5);
    transform: translateY(-1px);
}
.topnav-cta-btn:active { transform: translateY(0); }

/* ── User button ───────────────────────────────────────────── */
.topnav-user-wrap { position: relative; }

.topnav-user-btn {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
    color: rgba(255,255,255,.88);
    border-radius: 9px;
    padding: .32rem .75rem .32rem .32rem;
    font-size: .845rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .18s, border-color .18s;
}
.topnav-user-btn:hover {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.18);
}

.topnav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: .03em;
}

.topnav-username {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topnav-chevron {
    font-size: .68rem;
    opacity: .55;
    transition: transform .22s ease;
    margin-left: .1rem;
}
.topnav-chevron.rotated { transform: rotate(180deg); opacity: .85; }

/* ── User dropdown ─────────────────────────────────────────── */
.topnav-user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0,0,0,.15), 0 2px 8px rgba(0,0,0,.07);
    min-width: 215px;
    z-index: 300;
    overflow: hidden;
    animation: dropdownIn .14s cubic-bezier(.16,1,.3,1);
}
@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-8px) scale(.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

.topnav-dropdown-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .9rem 1rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
}

.topnav-dropdown-avatar {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: #fff;
    font-size: .82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: .03em;
}

.topnav-dropdown-header-info { min-width: 0; }
.topnav-dropdown-name {
    font-size: .875rem;
    font-weight: 700;
    color: var(--gray-800);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topnav-dropdown-role {
    font-size: .75rem;
    color: var(--gray-400);
    margin-top: .1rem;
}

.topnav-dropdown-section { padding: .35rem 0; }

.topnav-dropdown-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .58rem 1rem;
    color: var(--gray-700);
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .12s, color .12s;
    cursor: pointer;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
}
.topnav-dropdown-item i { font-size: .9rem; opacity: .65; width: 16px; text-align: center; }
.topnav-dropdown-item:hover { background: var(--gray-50); color: var(--primary); }
.topnav-dropdown-item:hover i { opacity: 1; }
.topnav-dropdown-divider { border-top: 1px solid var(--gray-100); }
.topnav-signout-btn { color: var(--danger) !important; }
.topnav-signout-btn i { color: var(--danger) !important; }
.topnav-signout-btn:hover { background: #fef2f2 !important; }

/* ── Hamburger ─────────────────────────────────────────────── */
.topnav-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    color: #fff;
    border-radius: 7px;
    padding: .42rem .52rem;
    font-size: 1.15rem;
    cursor: pointer;
    transition: background .18s;
    line-height: 1;
}
.topnav-hamburger:hover { background: rgba(255,255,255,.14); }

/* ── Mobile menu ───────────────────────────────────────────── */
.topnav-mobile-menu {
    border-top: 1px solid rgba(255,255,255,.06);
    display: flex;
    flex-direction: column;
    padding: .6rem .85rem .9rem;
    gap: .1rem;
    animation: mobileMenuIn .18s ease;
}
@keyframes mobileMenuIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.topnav-mobile-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .65rem .85rem;
    border-radius: 8px;
    color: rgba(255,255,255,.65);
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, color .15s;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}
.topnav-mobile-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.topnav-mobile-link.active { color: #93c5fd; font-weight: 600; }
.topnav-mobile-cta {
    background: rgba(37,99,235,.25) !important;
    color: #93c5fd !important;
    border: 1px solid rgba(37,99,235,.35);
    font-weight: 600;
}
.topnav-mobile-cta:hover { background: var(--primary) !important; color: #fff !important; }
.topnav-mobile-divider { border-top: 1px solid rgba(255,255,255,.07); margin: .45rem 0; }
.topnav-mobile-signout { color: #fca5a5 !important; }
.topnav-mobile-signout:hover { background: rgba(239,68,68,.12) !important; }

/* ── Main content ──────────────────────────────────────────── */
.app-content {
    flex: 1;
    padding: 2rem 1.75rem;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
}


/* ============================================================
   DASHBOARD PAGE
   ============================================================ */
.dashboard-page { display: flex; flex-direction: column; gap: 2rem; }
.dashboard-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.dashboard-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-800);
    margin: 0 0 .25rem;
}
.dashboard-subtitle { color: var(--gray-400); font-size: .95rem; margin: 0; }

/* Summary cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}
.summary-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s;
}
.summary-card:hover { box-shadow: var(--shadow-md); }
.summary-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}
.summary-icon-blue   { background: #eff6ff; }
.summary-icon-yellow { background: #fffbeb; }
.summary-icon-green  { background: #f0fdf4; }
.summary-icon-purple { background: #f5f3ff; }
.summary-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1;
    margin-bottom: .2rem;
}
.summary-label { font-size: .8rem; color: var(--gray-400); font-weight: 500; }

/* Projects panel */
.projects-panel,
.quick-actions-panel {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}
.panel-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}
.quick-actions-panel { padding: 1.25rem 1.5rem; }
.quick-actions-panel .panel-title { margin-bottom: 1rem; }

/* Table */
.projects-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}
.projects-table th {
    background: var(--gray-50);
    color: var(--gray-400);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .75rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}
.projects-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-800);
    vertical-align: middle;
}
.projects-table tr:last-child td { border-bottom: none; }
.projects-table tbody tr:hover { background: var(--gray-50); }
.project-name { font-weight: 600; display: block; }
.project-address { font-size: .78rem; color: var(--gray-400); display: block; margin-top: .15rem; }
.client-email { font-size: .78rem; color: var(--gray-400); display: block; margin-top: .15rem; }
.total-cell { font-weight: 700; color: var(--gray-800); }
.date-cell { color: var(--gray-400); white-space: nowrap; }
.action-buttons { display: flex; gap: .5rem; }

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .75rem;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 600;
}
.status-draft      { background: var(--gray-100); color: var(--gray-600); }
.status-sent       { background: #eff6ff; color: var(--primary); }
.status-accepted   { background: #f0fdf4; color: #166534; }
.status-declined   { background: #fef2f2; color: #991b1b; }
.status-inprogress { background: #fffbeb; color: #92400e; }
.status-completed  { background: #f0fdf4; color: #166534; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-400);
}
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; color: var(--gray-600); margin-bottom: .5rem; }
.empty-state p  { font-size: .9rem; margin-bottom: 1.5rem; }

.loading-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-400);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Quick actions */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    padding: 1.25rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-600);
    font-size: .85rem;
    font-weight: 600;
    text-align: center;
    transition: background .2s, border-color .2s, color .2s, transform .2s;
}
.quick-action-card:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}
.qa-icon { font-size: 1.6rem; }

/* ============================================================
   CREATE PROJECT PAGE
   ============================================================ */
.page-back-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--gray-400);
    margin-bottom: .5rem;
    transition: color .2s;
}
.page-back-link:hover { color: var(--primary); }

.create-project-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    align-items: start;
}
.cp-col { display: flex; flex-direction: column; gap: 1.5rem; }

.cp-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}
.cp-card-header {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-100);
}
.cp-card-icon { font-size: 1.2rem; }
.cp-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.cp-textarea { resize: vertical; min-height: 100px; }

/* Summary preview card */
.cp-summary-card { background: var(--primary-light); border-color: #bfdbfe; }
.cp-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: .6rem 0;
    border-bottom: 1px solid rgba(37,99,235,.1);
    font-size: .88rem;
}
.cp-summary-row:last-child { border-bottom: none; }
.cp-summary-label { color: var(--gray-600); font-weight: 500; white-space: nowrap; }
.cp-summary-value {
    color: var(--gray-800);
    font-weight: 600;
    text-align: right;
    word-break: break-word;
    max-width: 200px;
}
.cp-summary-total { margin-top: .25rem; }
.cp-summary-total .cp-summary-label,
.cp-summary-total .cp-summary-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
}

/* Actions block */
.cp-actions { display: flex; flex-direction: column; }
.cp-submit-btn {
    padding: .8rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 10px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .hero-section .container { grid-template-columns: 1fr; }
    .hero-title { font-size: 2.25rem; }
    .hero-image { justify-content: center; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
    .pricing-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
    .pricing-card.popular { transform: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .summary-cards { grid-template-columns: repeat(2, 1fr); }
    .quick-actions-grid { grid-template-columns: repeat(2, 1fr); }
    .create-project-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .landing-nav-links { display: none; }
    .mobile-nav-toggle { display: block; }
    .hero-section { padding: 3rem 0 2.5rem; }
    .hero-title { font-size: 1.9rem; }
    .hero-actions { flex-direction: column; }
    .btn-hero-primary, .btn-hero-secondary { width: 100%; text-align: center; }
    .features-grid { grid-template-columns: 1fr; }
    .testimonials-grid { grid-template-columns: 1fr; }
    .howto-steps { flex-direction: column; align-items: stretch; }
    .howto-connector { display: none; }
    .howto-step { max-width: 100%; }
    .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
    .section-header h2 { font-size: 1.75rem; }
    .cta-section h2 { font-size: 1.9rem; }

    /* Dashboard responsive */
    .summary-cards { grid-template-columns: 1fr 1fr; }
    .quick-actions-grid { grid-template-columns: 1fr 1fr; }
    .action-buttons { flex-direction: column; }

    /* Top nav collapse */
    .topnav-links { display: none; }
    .topnav-hamburger { display: flex; }
    .topnav-username { display: none; }
    .app-content { padding: 1.5rem 1.25rem; }
}

@media (max-width: 480px) {
    .summary-cards { grid-template-columns: 1fr; }
    .quick-actions-grid { grid-template-columns: repeat(2, 1fr); }
    .auth-card { padding: 2rem 1.25rem; }
    .hero-title { font-size: 1.6rem; }
    .stat-number { font-size: 2rem; }
    .app-content { padding: 1.25rem 1rem; }
}

/* ============================================================
   PROJECT DETAIL & TEMPLATE EDITOR — SHARED PANEL
   ============================================================ */
.pd-panel {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.pd-panel .table-responsive {
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    overflow: hidden;
}
.pd-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
    gap: .75rem;
}

/* Stats row */
.pd-stats-row {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.pd-stat {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.1rem 1.5rem;
    box-shadow: var(--shadow-sm);
    min-width: 140px;
    flex: 1;
}

.pd-stat-markup {
    border-color: var(--accent);
    background: var(--gray-50);
}

.pd-stat-total {
    border-color: var(--primary);
    background: var(--primary-light);
}
.pd-stat-label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--gray-400);
    margin-bottom: .35rem;
}
.pd-stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1;
}
.pd-stat-total .pd-stat-value { color: var(--primary); }
.pd-stat-text { font-size: .95rem; font-weight: 600; }

/* Items table */
.pd-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}
.pd-items-table th {
    background: var(--gray-50);
    color: var(--gray-400);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .6rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}
.pd-items-table td {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-800);
    vertical-align: middle;
}
.pd-items-table tr:last-child td { border-bottom: none; }
.pd-items-table tbody tr:hover:not(.pd-edit-row) { background: var(--gray-50); }
.pd-item-desc { font-size: .77rem; color: var(--gray-400); margin-top: .1rem; }

/* Inline edit row */
.pd-edit-row { background: #fffbeb !important; }
.pd-edit-row td { padding: .55rem .75rem; vertical-align: top; }
.pd-add-row { background: var(--primary-light) !important; }
.pd-add-row td { padding: .55rem .75rem; vertical-align: top; }

/* Total footer row */
.pd-total-row td {
    padding: .8rem 1rem;
    background: var(--gray-50);
    border-top: 2px solid var(--gray-200);
    font-size: .95rem;
    color: var(--gray-800);
}

/* Category badge */
.pd-category-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    font-size: .72rem;
    font-weight: 600;
    padding: .2rem .6rem;
    border-radius: 99px;
    border: 1px solid #bfdbfe;
    white-space: nowrap;
}

/* Empty items row */
.pd-empty-items {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--gray-400);
    font-size: .9rem;
}

/* Template dropdown */
.pd-template-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    min-width: 240px;
    z-index: 50;
    overflow: hidden;
}
.pd-template-option {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    width: 100%;
    padding: .75rem 1rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: background .15s;
    font-size: .88rem;
    color: var(--gray-800);
}
.pd-template-option:last-child { border-bottom: none; }
.pd-template-option:hover { background: var(--primary-light); color: var(--primary); }
.pd-template-desc { font-size: .77rem; color: var(--gray-400); }
.pd-template-count { font-size: .75rem; font-weight: 700; color: var(--gray-400); }
.pd-template-option:hover .pd-template-desc,
.pd-template-option:hover .pd-template-count { color: var(--primary); opacity: .8; }
.pd-template-search { position: relative; padding: .5rem .75rem; border-bottom: 1px solid var(--gray-100); }
.pd-template-search .form-control { padding-left: 1.75rem; }
.pd-template-search-icon { position: absolute; left: 1.25rem; top: 50%; transform: translateY(-50%); color: var(--gray-400); font-size: .8rem; pointer-events: none; }
.pd-template-empty { padding: .75rem 1rem; font-size: .85rem; color: var(--gray-400); margin: 0; }

/* ============================================================
   EDIT PROJECT PAGE
   ============================================================ */
.ep-meta {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: .75rem 1rem;
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}
.ep-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: .83rem;
}
.ep-meta-label {
    color: var(--gray-400);
    font-weight: 500;
    white-space: nowrap;
}
.ep-meta-value {
    color: var(--gray-600);
    font-weight: 600;
    text-align: right;
}

.ep-danger-zone {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.ep-delete-confirm {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem;
}

/* ============================================================
   PROJECTS INDEX PAGE
   ============================================================ */
.pi-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Search */
.pi-search-wrap {
    position: relative;
    flex: 1;
    min-width: 220px;
}
.pi-search-icon {
    position: absolute;
    left: .85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: .9rem;
    pointer-events: none;
}
.pi-search-input {
    padding-left: 2.2rem;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    font-size: .9rem;
}
.pi-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

/* Status filter pills */
.pi-filters {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}
.pi-filter-btn {
    padding: .3rem .85rem;
    border-radius: 99px;
    border: 1px solid var(--gray-200);
    background: #fff;
    color: var(--gray-600);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
}
.pi-filter-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}
.pi-filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Sort dropdown */
.pi-sort-select {
    min-width: 160px;
    border-radius: 8px;
    font-size: .85rem;
}

/* Sortable column headers */
.pi-sort-th {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--gray-400);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    transition: color .15s;
}
.pi-sort-th:hover { color: var(--gray-800); }
.pi-sort-th.pi-sort-active { color: var(--primary); }

/* Table footer total row */
.pi-table-footer td {
    padding: .75rem 1.25rem;
    background: var(--gray-50);
    border-top: 2px solid var(--gray-200);
    font-size: .88rem;
    color: var(--gray-800);
}

@media (max-width: 768px) {
    .pi-toolbar { flex-direction: column; align-items: stretch; }
    .pi-filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: .25rem; }
}


