/* =========================================================================
   GreenliteNG Design System
   Single source of truth for tokens, reset, utilities, components.
   ========================================================================= */

:root {
    /* Green palette (preserved brand) */
    --green-900:#0f3d24;
    --green-800:#114d2c;
    --green-700:#14532d;
    --green-600:#166534;
    --green-500:#16a34a;
    --green-400:#22c55e;
    --green-300:#86efac;
    --green-200:#bbf7d0;
    --green-100:#dcfce7;
    --green-50:#f0fdf4;

    /* Neutral palette */
    --ink:#111827;
    --ink-2:#1f2937;
    --muted:#6b7280;
    --muted-2:#9ca3af;
    --line:#e5e7eb;
    --line-2:#f1f5f9;
    --surface:#ffffff;
    --bg:#f8fafc;
    --bg-2:#f1f5f9;

    /* Accent / state */
    --danger:#dc2626;
    --warning:#f59e0b;
    --info:#0ea5e9;

    /* Geometry */
    --radius-sm:8px;
    --radius:14px;
    --radius-lg:22px;
    --shadow-sm:0 1px 2px rgba(15,40,25,.05);
    --shadow:0 8px 24px rgba(15,40,25,.06);
    --shadow-lg:0 18px 48px rgba(15,40,25,.10);
    --max:1200px;

    /* Type */
    --font:'Inter','Plus Jakarta Sans',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
}

/* Reset */
*,*::before,*::after{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
    font-family:var(--font);
    color:var(--ink);
    background:var(--bg);
    line-height:1.55;
    -webkit-font-smoothing:antialiased;
    text-rendering:optimizeLegibility;
}
img{max-width:100%;display:block;}
a{color:var(--green-700);text-decoration:none;}
a:hover{color:var(--green-900);}
button{font-family:inherit;cursor:pointer;}
input,select,textarea,button{font:inherit;color:inherit;}
h1,h2,h3,h4,h5,h6{margin:0 0 .5em;color:var(--ink);font-weight:700;line-height:1.2;letter-spacing:-.01em;}
h1{font-size:clamp(2rem,4vw,3rem);}
h2{font-size:clamp(1.5rem,2.6vw,2.1rem);}
h3{font-size:clamp(1.2rem,2vw,1.4rem);}
p{margin:0 0 1em;color:var(--ink-2);}

/* Layout */
.container{
    width:100%;
    max-width:var(--max);
    margin:0 auto;
    padding:0 24px;
}
.section{padding:80px 0;}
.section--sm{padding:48px 0;}
.section--bg{background:var(--surface);}
.section--green{background:linear-gradient(180deg,var(--green-50),var(--surface));}

/* Header / Nav */
.site-header{
    position:sticky;
    top:0;
    z-index:50;
    background:rgba(255,255,255,.94);
    backdrop-filter:saturate(180%) blur(10px);
    border-bottom:1px solid var(--line);
}
.nav{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:32px;
    height:72px;
}
.nav__brand{display:flex;align-items:center;gap:10px;font-weight:800;color:var(--green-900);letter-spacing:.5px;}
.nav__brand img{height:34px;width:auto;}
.nav__brand-text{font-size:1.05rem;line-height:1;}
.nav__brand-text span{display:block;font-size:.65rem;font-weight:600;color:var(--muted);letter-spacing:2px;margin-top:4px;}

.nav__links{
    display:flex;
    align-items:center;
    gap:8px;
    list-style:none;
    margin:0;
    padding:0;
}
.nav__links a{
    display:inline-flex;
    align-items:center;
    height:36px;
    padding:0 14px;
    color:var(--ink);
    font-weight:500;
    border-radius:999px;
    line-height:1;
    transition:background .15s ease, color .15s ease;
}
.nav__links a:hover{background:var(--green-50);color:var(--green-800);}
.nav__links a.is-active{
    color:var(--green-800);
    background:var(--green-100);
    box-shadow:inset 0 0 0 1px var(--green-200);
}

.nav__actions{display:flex;align-items:center;gap:10px;}
.nav__icon{
    width:40px;height:40px;
    display:inline-flex;align-items:center;justify-content:center;
    border-radius:999px;
    background:transparent;color:var(--ink);
    transition:background .15s ease, color .15s ease;
    position:relative;
}
.nav__icon:hover{background:var(--green-50);color:var(--green-800);}
.nav__icon .badge{
    position:absolute;top:4px;right:4px;
    min-width:18px;height:18px;padding:0 5px;
    border-radius:999px;background:var(--green-600);color:#fff;
    font-size:.7rem;font-weight:700;
    display:inline-flex;align-items:center;justify-content:center;
}

/* Dropdown */
.nav__dropdown{position:relative;}
.nav__dropdown-menu{
    position:absolute;
    top:calc(100% + 8px);
    right:0;
    min-width:220px;
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:var(--radius);
    box-shadow:var(--shadow-lg);
    padding:8px;
    opacity:0;
    transform:translateY(-4px);
    pointer-events:none;
    transition:opacity .15s ease, transform .15s ease;
}
.nav__dropdown:hover .nav__dropdown-menu,
.nav__dropdown:focus-within .nav__dropdown-menu{
    opacity:1;
    transform:translateY(0);
    pointer-events:auto;
}
.nav__dropdown-menu a{
    display:block;padding:10px 12px;border-radius:10px;color:var(--ink);
}
.nav__dropdown-menu a:hover{background:var(--green-50);color:var(--green-800);}

/* Mobile menu */
.nav__toggle{
    display:none;
    width:42px;height:42px;
    border:none;background:transparent;color:var(--ink);
    border-radius:10px;
}
.nav__toggle:hover{background:var(--green-50);color:var(--green-800);}

/* Buttons */
.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding:12px 22px;
    border-radius:999px;
    font-weight:600;
    line-height:1;
    border:1px solid transparent;
    transition:transform .12s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
    white-space:nowrap;
}
.btn:active{transform:translateY(1px);}
.btn--primary{background:var(--green-600);color:#fff;}
.btn--primary:hover{background:var(--green-700);color:#fff;box-shadow:0 8px 20px rgba(22,101,52,.25);}
.btn--secondary{background:var(--surface);color:var(--green-800);border-color:var(--line);}
.btn--secondary:hover{border-color:var(--green-600);color:var(--green-900);background:var(--green-50);}
.btn--ghost{background:transparent;color:var(--ink);}
.btn--ghost:hover{background:var(--green-50);color:var(--green-800);}
.btn--danger{background:var(--danger);color:#fff;}
.btn--block{width:100%;}
.btn--sm{padding:8px 14px;font-size:.9rem;}
.btn--lg{padding:16px 28px;font-size:1.05rem;}

/* Cards */
.card{
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:var(--radius);
    box-shadow:var(--shadow-sm);
    overflow:hidden;
    transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover{transform:translateY(-2px);box-shadow:var(--shadow);border-color:var(--green-200);}
.card__body{padding:22px;}
.card__title{margin-bottom:6px;}
.card__meta{color:var(--muted);font-size:.85rem;}

/* Forms */
.field{display:block;margin-bottom:14px;}
.field label{display:block;margin-bottom:6px;font-weight:600;font-size:.9rem;color:var(--ink-2);}
.input,.select,.textarea{
    width:100%;
    padding:12px 14px;
    border:1px solid var(--line);
    border-radius:12px;
    background:var(--surface);
    transition:border-color .15s ease, box-shadow .15s ease;
}
.input:focus,.select:focus,.textarea:focus{
    outline:none;
    border-color:var(--green-500);
    box-shadow:0 0 0 4px rgba(22,163,74,.12);
}
.textarea{min-height:120px;resize:vertical;}

/* Badges */
.badge{
    display:inline-flex;align-items:center;gap:6px;
    padding:4px 10px;
    border-radius:999px;
    background:var(--green-100);
    color:var(--green-800);
    font-size:.75rem;
    font-weight:600;
}
.badge--warning{background:#fef3c7;color:#92400e;}
.badge--danger{background:#fee2e2;color:#991b1b;}
.badge--info{background:#dbeafe;color:#1e40af;}
.badge--muted{background:var(--line-2);color:var(--muted);}

/* Hero */
.hero{
    background:linear-gradient(180deg,var(--green-50) 0%,var(--surface) 100%);
    padding:80px 0 96px;
}
.hero__grid{display:grid;grid-template-columns:1.1fr .9fr;gap:48px;align-items:center;}
.hero__eyebrow{
    display:inline-flex;align-items:center;gap:8px;
    background:var(--surface);
    border:1px solid var(--green-200);
    color:var(--green-800);
    padding:6px 14px;
    border-radius:999px;
    font-size:.85rem;
    font-weight:600;
    margin-bottom:20px;
}
.hero__title{font-size:clamp(2.2rem,4.6vw,3.4rem);margin-bottom:16px;}
.hero__title em{font-style:normal;color:var(--green-700);}
.hero__lead{font-size:1.1rem;color:var(--muted);max-width:560px;margin-bottom:28px;}
.hero__ctas{display:flex;gap:12px;flex-wrap:wrap;}
.hero__visual{
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:var(--radius-lg);
    overflow:hidden;
    box-shadow:var(--shadow);
    aspect-ratio:4/3;
    display:flex;align-items:center;justify-content:center;
}
.hero__visual img{width:100%;height:100%;object-fit:cover;}

/* Feature cards row */
.features{
    display:grid;grid-template-columns:repeat(3,1fr);gap:24px;
    margin-top:32px;
}
.feature{
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:24px;
}
.feature__icon{
    width:44px;height:44px;
    border-radius:12px;
    background:var(--green-100);
    color:var(--green-700);
    display:inline-flex;align-items:center;justify-content:center;
    margin-bottom:14px;
}
.feature__title{font-size:1.05rem;margin-bottom:6px;}
.feature__body{color:var(--muted);font-size:.95rem;}

/* Stat tiles */
.stat{
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:20px;
    display:flex;align-items:center;gap:16px;
}
.stat__icon{
    width:48px;height:48px;border-radius:12px;
    background:var(--green-100);color:var(--green-700);
    display:inline-flex;align-items:center;justify-content:center;
}
.stat__value{font-size:1.6rem;font-weight:800;color:var(--ink);line-height:1;}
.stat__label{color:var(--muted);font-size:.85rem;margin-top:4px;}
.stat--warning .stat__icon{background:#fef3c7;color:#92400e;}
.stat--info .stat__icon{background:#dbeafe;color:#1e40af;}
.stat--warning .stat__value{color:#b45309;}
.stat--info .stat__value{color:#1e40af;}

/* Footer */
.site-footer{
    background:var(--green-900);
    color:#d1fae5;
    padding:64px 0 24px;
    margin-top:80px;
}
.footer__grid{
    display:grid;grid-template-columns:1.5fr 1fr 1fr 1fr;gap:32px;align-items:start;
}
.footer__brand{display:flex;align-items:center;gap:10px;color:#fff;font-weight:800;font-size:1.05rem;}
.footer__brand img{height:36px;}
.footer__about{margin-top:14px;color:#a7f3d0;max-width:320px;font-size:.95rem;}
.footer__col h4{color:#fff;font-size:.95rem;margin-bottom:14px;letter-spacing:.04em;text-transform:uppercase;}
.footer__col ul{list-style:none;padding:0;margin:0;}
.footer__col li{margin-bottom:8px;}
.footer__col a{color:#a7f3d0;font-size:.92rem;}
.footer__col a:hover{color:#fff;}
.footer__social{display:flex;gap:10px;margin-top:14px;}
.footer__social a{
    width:36px;height:36px;border-radius:999px;
    display:inline-flex;align-items:center;justify-content:center;
    background:rgba(255,255,255,.08);color:#fff;
}
.footer__social a:hover{background:rgba(255,255,255,.16);}
.footer__bottom{
    margin-top:40px;padding-top:20px;border-top:1px solid rgba(255,255,255,.12);
    display:flex;justify-content:space-between;flex-wrap:wrap;gap:12px;
    color:#a7f3d0;font-size:.85rem;
}

/* Tables */
.table{width:100%;border-collapse:collapse;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;}
.table th,.table td{padding:12px 16px;text-align:left;border-bottom:1px solid var(--line-2);font-size:.92rem;}
.table th{background:var(--bg-2);font-weight:600;color:var(--ink-2);}
.table tr:last-child td{border-bottom:none;}
.table tr:hover td{background:var(--green-50);}

/* Grids */
.grid{display:grid;gap:24px;}
.grid--2{grid-template-columns:repeat(2,1fr);}
.grid--3{grid-template-columns:repeat(3,1fr);}
.grid--4{grid-template-columns:repeat(4,1fr);}

/* Utility */
.text-center{text-align:center;}
.text-muted{color:var(--muted);}
.flex{display:flex;}
.flex-wrap{flex-wrap:wrap;}
.items-center{align-items:center;}
.justify-between{justify-content:space-between;}
.gap-2{gap:8px;}
.gap-3{gap:12px;}
.gap-4{gap:16px;}
.mt-1{margin-top:8px;}
.mt-2{margin-top:16px;}
.mt-3{margin-top:24px;}
.mt-4{margin-top:32px;}
.mb-1{margin-bottom:8px;}
.mb-2{margin-bottom:16px;}
.mb-3{margin-bottom:24px;}
.mb-4{margin-bottom:32px;}
.hidden{display:none!important;}

/* Page hero (sub-pages) */
.page-hero{
    background:linear-gradient(180deg,var(--green-50) 0%,var(--surface) 100%);
    padding:56px 0 32px;
    border-bottom:1px solid var(--line);
}
.page-hero h1{margin-bottom:6px;}
.page-hero p{color:var(--muted);max-width:680px;}

/* Split auth layout */
.auth{
    display:grid;grid-template-columns:1.1fr .9fr;gap:32px;align-items:stretch;
    padding:48px 0;
}
.auth__panel{
    background:var(--surface);
    border:1px solid var(--line);
    border-radius:var(--radius-lg);
    padding:36px;
    box-shadow:var(--shadow);
}
.auth__visual{
    background:linear-gradient(135deg,var(--green-700),var(--green-500));
    color:#fff;
    border-radius:var(--radius-lg);
    padding:48px 36px;
    display:flex;flex-direction:column;justify-content:space-between;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,.12) 0, transparent 35%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,.10) 0, transparent 40%);
}
.auth__visual h2{color:#fff;font-size:clamp(1.5rem,3vw,2.2rem);margin-bottom:14px;}
.auth__visual p{color:#d1fae5;}
.auth__visual ul{list-style:none;padding:0;margin:24px 0 0;}
.auth__visual li{display:flex;align-items:flex-start;gap:12px;padding:10px 0;color:#ecfdf5;}
.auth__visual li svg{flex-shrink:0;margin-top:2px;color:#bbf7d0;}

/* Alerts */
.alert{
    padding:12px 16px;border-radius:12px;margin-bottom:14px;font-size:.92rem;
    border:1px solid var(--line);background:var(--surface);
}
.alert--success{background:var(--green-50);border-color:var(--green-200);color:var(--green-800);}
.alert--danger{background:#fef2f2;border-color:#fecaca;color:#991b1b;}
.alert--warning{background:#fffbeb;border-color:#fde68a;color:#92400e;}
.alert--info{background:#eff6ff;border-color:#bfdbfe;color:#1e40af;}

/* Responsive */
@media (max-width:1024px){
    .hero__grid{grid-template-columns:1fr;}
    .grid--3{grid-template-columns:repeat(2,1fr);}
    .grid--4{grid-template-columns:repeat(2,1fr);}
    .footer__grid{grid-template-columns:1.4fr 1fr 1fr;gap:28px;}
    .auth{grid-template-columns:1fr;}
    .auth__visual{order:-1;padding:32px;}
}
@media (max-width:860px){
    .nav__toggle{display:inline-flex;}
    .nav__links{
        position:fixed;
        inset:72px 0 auto 0;
        flex-direction:column;
        align-items:stretch;
        gap:0;
        padding:16px;
        background:var(--surface);
        border-bottom:1px solid var(--line);
        box-shadow:var(--shadow);
        transform:translateY(-12px);
        opacity:0;
        pointer-events:none;
        transition:transform .2s ease, opacity .2s ease;
    }
    .nav__links.is-open{transform:translateY(0);opacity:1;pointer-events:auto;}
    .nav__links a{height:48px;border-radius:12px;padding:0 16px;}
    .nav__links a.is-active{box-shadow:none;background:var(--green-50);}
    .nav__dropdown-menu{position:static;box-shadow:none;border:none;padding-left:16px;background:transparent;opacity:1;transform:none;pointer-events:auto;}
    .nav__actions .btn--primary{display:none;}
    .grid--3,.grid--4{grid-template-columns:1fr;}
    .footer__grid{grid-template-columns:1fr 1fr;}
    .footer__bottom{flex-direction:column;align-items:flex-start;}
}
@media (max-width:480px){
    .section{padding:56px 0;}
    .hero{padding:48px 0 64px;}
    .features{grid-template-columns:1fr;}
    .auth__panel{padding:24px;}
    .footer__grid{grid-template-columns:1fr;}
}
