:root {
    --brand-1: #16a34a;         /* green (primary) */
    --brand-2: #22c55e;         /* lighter green */
    --brand-gradient: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    --brand-gradient-soft: linear-gradient(135deg, rgba(22,163,74,.10), rgba(34,197,94,.10));
    --accent: #f59e0b;          /* amber for highlights/new badges */
    --ink: #0f1222;
    --ink-soft: #4b5166;
    --muted: #8b91a7;
    --bg: #f3f8f5;
    --card: #ffffff;
    --border: #e5efe8;
    --success: #16a34a;
    --danger: #e11d48;
    --sidebar-bg: #0f1f16;
    --sidebar-bg-2: #14291c;
    --sidebar-border: #1f3a29;
    --sidebar-text: #a9c2b3;
    --sidebar-text-active: #ffffff;
    --sidebar-w: 264px;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-card: 0 1px 2px rgba(15,18,34,.04), 0 8px 24px -12px rgba(15,18,34,.08);
    --shadow-pop: 0 20px 50px -15px rgba(22,163,74,.35);
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'Plus Jakarta Sans', 'Hind Siliguri', 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -.01em; }

a { text-decoration: none; color: var(--brand-1); }
a:hover { color: var(--brand-2); }

/* ---------- Top bar ---------- */
.topbar {
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: .7rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 40;
}
.topbar .brand {
    font-weight: 800;
    font-size: 1.3rem;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: flex;
    align-items: center;
    gap: .45rem;
}
.topbar .brand i { -webkit-text-fill-color: var(--brand-1); }
.topbar .stat-pill {
    background: var(--brand-gradient-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .4rem .9rem;
    font-size: .82rem;
    color: var(--ink-soft);
    font-weight: 500;
}
.topbar .stat-pill b { color: var(--ink); }
.topbar .btn-brand {
    padding: .4rem .85rem;
    font-size: .82rem;
    box-shadow: 0 3px 10px -4px rgba(22,163,74,.5);
}
.topbar .btn-brand:hover { box-shadow: 0 5px 14px -4px rgba(22,163,74,.55); }

/* ---------- Buttons ---------- */
.btn { border-radius: var(--radius-sm); font-weight: 600; }
.btn-brand {
    background: var(--brand-gradient);
    border: none;
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(22,163,74,.5);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn-brand:hover { color: #fff; filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 10px 22px -6px rgba(22,163,74,.55); }
.btn-brand:active { transform: translateY(0); }
.btn-accent {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border: none;
    color: #1a1300;
    font-weight: 700;
}
.btn-outline-secondary { border-color: var(--border); color: var(--ink-soft); }
.btn-outline-secondary:hover { background: var(--bg); color: var(--ink); border-color: var(--border); }
.btn-light { border-radius: var(--radius-sm); }
.btn-success { background: var(--brand-1); border-color: var(--brand-1); }
.btn-success:hover { background: #15803d; border-color: #15803d; }
.alert-info { background: var(--brand-gradient-soft); border-color: rgba(22,163,74,.25); color: #14532d; }
.alert-info a { color: #15803d; font-weight: 600; }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    border-right: 1px solid var(--sidebar-border);
    padding: 1.3rem 0;
    flex-shrink: 0;
    transition: transform .25s ease;
}
.sidebar .side-user {
    text-align: center;
    padding: 0 1rem 1.1rem;
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: .6rem;
}
.sidebar .side-user .avatar {
    width: 60px; height: 60px; border-radius: 50%;
    background: var(--brand-gradient);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 700; margin: 0 auto .6rem;
    box-shadow: 0 8px 20px -6px rgba(22,163,74,.6);
}
.sidebar .side-user .fw-semibold { color: #fff; }
.sidebar .side-user .text-muted { color: var(--sidebar-text) !important; }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .62rem 1.2rem;
    margin: .1rem .6rem;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: .92rem;
}
.sidebar nav a i { width: 18px; text-align: center; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active {
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(22,163,74,.6);
}
.sidebar nav .divider { margin: .7rem 1.2rem; border-top: 1px solid var(--sidebar-border); }
.sidebar nav a.text-danger { color: #fca5b5 !important; }
.sidebar nav a.text-danger:hover { background: rgba(225,29,72,.12); color: #fecdd6 !important; }

.main-content { flex-grow: 1; padding: 1.5rem; max-width: 1120px; margin: 0 auto; width: 100%; }

/* ---------- Cards ---------- */
.card-flat {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.3rem;
    margin-bottom: 1.1rem;
    box-shadow: var(--shadow-card);
}
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .9rem;
}
.stat-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.3rem;
    display: flex;
    align-items: center;
    gap: .9rem;
    box-shadow: var(--shadow-card);
    transition: transform .15s ease;
}
.stat-box:hover { transform: translateY(-2px); }
.stat-box .icon {
    width: 46px; height: 46px; border-radius: 12px;
    background: var(--brand-gradient);
    color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
    box-shadow: 0 6px 16px -6px rgba(22,163,74,.5);
}
.stat-box .label { font-size: .78rem; color: var(--muted); font-weight: 500; }
.stat-box .value { font-weight: 700; font-size: 1.08rem; color: var(--ink); }

/* ---------- Promo banner ---------- */
.promo-banner {
    background: var(--brand-gradient);
    color: #fff;
    border-radius: var(--radius);
    padding: 1.5rem 1.7rem;
    margin-bottom: 1.1rem;
    box-shadow: var(--shadow-pop);
    position: relative;
    overflow: hidden;
}
.promo-banner::after {
    content: '';
    position: absolute; right: -40px; top: -40px;
    width: 160px; height: 160px; border-radius: 50%;
    background: rgba(255,255,255,.08);
}
.promo-banner h3 { font-weight: 800; margin-bottom: .3rem; }
.promo-banner .btn-light { border-radius: var(--radius-sm); font-weight: 700; color: var(--brand-1); }

/* ---------- Platform grid ---------- */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .6rem;
    margin-bottom: 1rem;
}
.platform-chip {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .75rem;
    text-align: center;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    font-size: .88rem;
    transition: all .15s ease;
}
.platform-chip.active, .platform-chip:hover {
    border-color: transparent;
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(22,163,74,.5);
}
.platform-chip i { display: block; font-size: 1.35rem; margin-bottom: .35rem; }

/* ---------- Tabs ---------- */
.tab-pill-group { display: flex; border: 2px solid var(--brand-1); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 1rem; }
.tab-pill-group button { flex: 1; border: none; background: #fff; padding: .6rem; font-weight: 700; color: var(--brand-1); }
.tab-pill-group button.active { background: var(--brand-gradient); color: #fff; }

.nav-tabs { border-bottom: 1px solid var(--border); }
.nav-tabs .nav-link { border: none; color: var(--muted); font-weight: 600; border-radius: 0; padding: .6rem 1.1rem; }
.nav-tabs .nav-link.active { color: var(--brand-1); border-bottom: 2px solid var(--brand-1); background: transparent; }

/* ---------- Service table ---------- */
.table-services th { font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); border-bottom: 2px solid var(--border); font-weight: 700; }
.table-services td { vertical-align: middle; font-size: .89rem; border-color: var(--border); }
.badge-new { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1a1300; font-size: .62rem; font-weight: 700; }
.service-id { color: var(--muted); font-size: .8rem; }

/* ---------- Forms ---------- */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: .62rem .85rem;
    font-size: .92rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand-1);
    box-shadow: 0 0 0 .2rem rgba(22,163,74,.12);
}
label.form-label { font-weight: 600; font-size: .86rem; color: var(--ink-soft); }
.form-check-input:checked { background-color: var(--brand-1); border-color: var(--brand-1); }
.form-check-input:focus { border-color: var(--brand-1); box-shadow: 0 0 0 .2rem rgba(22,163,74,.15); }
.form-switch .form-check-input:checked { background-color: var(--brand-1); }
.accordion-button:not(.collapsed) {
    background: var(--brand-gradient-soft);
    color: var(--brand-1);
    box-shadow: none;
}
.accordion-button:focus { border-color: var(--brand-1); box-shadow: 0 0 0 .2rem rgba(22,163,74,.15); }
.accordion-button::after { filter: hue-rotate(70deg) saturate(1.5); }

/* ---------- Status badges ---------- */
.badge-status { padding: .35rem .65rem; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-in_progress, .badge-processing { background: #dbeafe; color: #1e40af; }
.badge-completed { background: #dcfce7; color: #166534; }
.badge-partial { background: #fee2e2; color: #991b1b; }
.badge-canceled, .badge-refunded { background: #f1f5f9; color: #475569; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-banned { background: #fee2e2; color: #991b1b; }

/* ---------- Auth pages ---------- */
.auth-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 20% 20%, #16a34a 0%, transparent 45%),
                radial-gradient(circle at 80% 80%, #22c55e 0%, transparent 45%),
                #12132a;
    padding: 1rem;
}
.auth-card {
    background: #fff; border-radius: 22px; padding: 2.3rem; width: 100%; max-width: 420px;
    box-shadow: 0 30px 70px rgba(0,0,0,.4);
}
.auth-card .brand {
    text-align: center; font-weight: 800; font-size: 1.55rem; margin-bottom: .3rem;
    background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-card .brand i { -webkit-text-fill-color: var(--brand-1); }
.auth-card .subtitle { text-align: center; color: var(--muted); margin-bottom: 1.6rem; font-size: .9rem; }

/* ---------- Landing page ---------- */
.hero {
    background: radial-gradient(circle at 15% 25%, #16a34a 0%, transparent 45%),
                radial-gradient(circle at 85% 75%, #22c55e 0%, transparent 45%),
                #12132a;
    color: #fff;
    padding: 4.5rem 1.5rem;
    text-align: center;
}
.hero h1 { font-weight: 800; font-size: 2.6rem; }
.hero p { color: #c7c9e6; max-width: 620px; margin: .9rem auto 1.7rem; font-size: 1.05rem; }
.hero-stats {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 2.2rem;
    max-width: 700px; margin: 2.5rem auto 0; padding-top: 1.8rem;
    border-top: 1px solid rgba(255,255,255,.12);
}
.hero-stats div { display: flex; flex-direction: column; align-items: center; }
.hero-stats b { font-size: 1.5rem; font-weight: 800; color: #fff; }
.hero-stats span { font-size: .8rem; color: #a9b0d6; margin-top: .2rem; }
.feature-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 1rem; padding: 2.7rem 1.5rem; max-width: 1120px; margin: 0 auto; }
.feature-strip .f-card { text-align: center; padding: 1.3rem; background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-card); }
.feature-strip .f-card i {
    font-size: 1.7rem; margin-bottom: .7rem; width: 54px; height: 54px; border-radius: 14px;
    background: var(--brand-gradient-soft); color: var(--brand-1);
    display: flex; align-items: center; justify-content: center; margin-inline: auto;
}

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; z-index: 50;
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0,0,0,.3);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 45; }
    .sidebar-backdrop.open { display: block; }
    .main-content { padding: 1rem .8rem; }
    .hero h1 { font-size: 1.8rem; }
}

.footer-bar {
    background: var(--sidebar-bg);
    color: #9497bf;
    padding: 2rem 1.5rem 1.2rem;
    margin-top: 2rem;
    font-size: .87rem;
}
.footer-cols {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 1.5rem;
    max-width: 1120px;
    margin: 0 auto 1.2rem;
}
.footer-brand { color: #fff; font-weight: 800; font-size: 1.1rem; display: flex; align-items: center; gap: .4rem; margin-bottom: .5rem; }
.footer-tagline { color: #8b91a7; font-size: .85rem; }
.footer-col h6 { color: #fff; font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .8rem; }
.footer-col a { display: block; color: #a9b0d6; margin-bottom: .55rem; font-size: .87rem; }
.footer-col a:hover { color: #6ee7b7; }
.footer-bottom {
    text-align: center; border-top: 1px solid var(--sidebar-border); padding-top: 1.1rem;
    max-width: 1120px; margin: 0 auto; color: #767a9e; font-size: .82rem;
}
@media (max-width: 700px) {
    .footer-cols { grid-template-columns: 1fr; text-align: center; }
}

/* ---------- Floating support button ---------- */
.fab-support {
    position: fixed;
    right: 20px;
    bottom: 24px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: 0 10px 24px -8px rgba(22,163,74,.6);
    z-index: 60;
    transition: transform .15s ease;
}
.fab-support:hover { color: #fff; transform: translateY(-3px) scale(1.04); }
.fab-badge {
    position: absolute;
    top: -4px; right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    min-width: 20px; height: 20px;
    border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--card);
}
@media (max-width: 900px) {
    .fab-support { right: 14px; bottom: 18px; width: 48px; height: 48px; font-size: 1.15rem; }
}
