/* =====================================================================
   JMDL Admin - Design System
   Framework-free. Light UI with a deep sidebar. Modern SaaS aesthetic.
   Edit tokens in :root; components below build on them.
   ===================================================================== */

:root {
    /* brand / accent */
    --primary:        #9489E2;
    --primary-600:    #8174D8;
    --primary-700:    #5F54C7;
    --primary-50:     #F8F7FF;
    --primary-100:    #F1EFFF;

    /* neutrals / lavender surfaces */
    --bg:             #F8F7FF;
    --surface:        #ffffff;
    --border:         #E4E0FA;
    --border-strong:  #C9C3F2;
    --text:           #17142A;
    --text-soft:      #403B5F;
    --text-muted:     #8A86A8;

    /* sidebar */
    --side-bg:        #ffffff;
    --side-bg-2:      #F8F7FF;
    --side-text:      #403B5F;
    --side-muted:     #8A86A8;
    --side-active:    #9489E2;

    /* status */
    --success:        #16a34a;
    --success-bg:     #dcfce7;
    --danger:         #dc2626;
    --danger-bg:      #fee2e2;
    --info:           #8174D8;
    --info-bg:        #F1EFFF;
    --warning:        #d97706;
    --warning-bg:     #fef3c7;

    /* shape */
    --radius:         10px;
    --radius-sm:      8px;
    --radius-lg:      18px;
    --shadow-sm:      0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.05);
    --shadow:         0 4px 12px rgba(15,23,42,.08);
    --shadow-lg:      0 18px 40px rgba(15,23,42,.16);

    --sidebar-w:      248px;
    --topbar-h:       64px;
    --font:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
/* Scroll + horizontal clip live on <html> only. Putting overflow-x:hidden on
   <body> too (with height:100%) forces overflow-y:auto on body, making it a
   second scroll container - that's the double-scrollbar bug. */
html { height: 100%; overflow-x: hidden; }
body { min-height: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .4em; font-weight: 650; letter-spacing: -.01em; color: var(--text); }
.icon {
    width: 20px; height: 20px; flex-shrink: 0;
    fill: none; stroke: currentColor; stroke-width: 1.9;
    stroke-linecap: round; stroke-linejoin: round;
}

/* ------------------------------------------------------------------ */
/* App shell                                                           */
/* ------------------------------------------------------------------ */
.app-shell { display: flex; min-height: 100vh; width: 100%; overflow-x: hidden; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--side-bg);
    color: var(--side-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid #E4E0FA;
    box-shadow: 10px 0 28px rgba(15,23,42,.03);
}
.sidebar__brand {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 22px;
    color: #403B5F;
    font-weight: 700;
    border-bottom: 1px solid #E4E0FA;
}
.sidebar__brand .logo {
    width: 50px; height: 50px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-700) 100%);
    display: grid; place-items: center; color: #fff; box-shadow: 0 8px 20px rgba(148,137,226,.28);
}
.sidebar__brand strong { display: block; font-size: 33px; line-height: 1; letter-spacing: -.04em; color: #403B5F; }
.sidebar__brand small { display: block; margin-top: 4px; color: #8A86A8; font-size: 11px; font-weight: 600; letter-spacing: 0; }
.sidebar__nav { padding: 12px; overflow-y: auto; flex: 1; scrollbar-width: none; }
.sidebar__nav::-webkit-scrollbar { width: 0; height: 0; }
.sidebar__label {
    font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
    color: var(--side-muted); padding: 14px 12px 6px;
}
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; margin: 2px 0;
    border-radius: 13px;
    color: var(--side-text); font-weight: 500; font-size: 13.5px;
    transition: background .15s, color .15s;
    position: relative;
}
.nav-link:hover { background: #F8F7FF; color: #403B5F; }
.nav-link.is-active {
    background: #F1EFFF;
    color: #403B5F;
    box-shadow: none;
}
.nav-link.is-active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 0 999px 999px 0;
    background: var(--primary);
}
.nav-link.is-active .icon { stroke: var(--primary-700); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-x: hidden; }

.topbar {
    height: var(--topbar-h);
    position: sticky; top: 0; z-index: 30;
    background: #F8F7FF;
    border-bottom: 1px solid #E4E0FA;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px;
}
.topbar__title { font-size: 22px; font-weight: 800; color: #17142A; }
.topbar__right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar__search {
    width: min(348px, 32vw);
    height: 48px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #E4E0FA;
    border-radius: 999px;
    padding: 0 14px 0 22px;
    box-shadow: 0 8px 18px rgba(15,23,42,.03);
}
.topbar__search input {
    border: 0;
    outline: 0;
    min-width: 0;
    flex: 1;
    font: inherit;
    color: var(--text);
}
.topbar__search input::placeholder { color: #8A86A8; }
.topbar__search button,
.topbar__tool {
    border: 0;
    background: transparent;
    color: #8A86A8;
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    position: relative;
}
.topbar__search button { width: 32px; height: 32px; }
.topbar__tool { width: 30px; height: 30px; }
.topbar__tool:hover { color: var(--primary-700); }
.topbar__tool span {
    position: absolute;
    right: -8px;
    top: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    line-height: 18px;
    font-weight: 700;
}
.topbar__tool span.is-amber { background: #f59e0b; }
.icon-btn {
    display: none; background: transparent; border: 0; color: var(--text-soft);
    width: 40px; height: 40px; border-radius: 10px; cursor: pointer; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--bg); }

.content { padding: 32px; max-width: 100%; width: 100%; overflow-x: hidden; }
.page-head {
    margin-bottom: 28px;
    background: var(--surface);
    border: 1px solid #E4E0FA;
    border-radius: var(--radius);
    box-shadow: 0 8px 22px rgba(15,23,42,.04);
    padding: 18px 24px;
}
.page-head h2 { font-size: 22px; line-height: 1.25; }
.page-head .sub { color: var(--text-muted); margin: 0; }

/* ------------------------------------------------------------------ */
/* User menu (topbar dropdown)                                         */
/* ------------------------------------------------------------------ */
.usermenu { position: relative; }
.usermenu__btn {
    display: flex; align-items: center; gap: 10px;
    background: transparent; border: 1px solid transparent; cursor: pointer;
    padding: 6px 8px; border-radius: 10px; color: var(--text);
}
.usermenu__btn:hover { background: var(--bg); }
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #B4AAF0 100%);
    color: #fff; display: grid; place-items: center; font-weight: 650; font-size: 13px;
}
.usermenu__meta { text-align: left; line-height: 1.2; }
.usermenu__meta .name { font-size: 13.5px; font-weight: 600; }
.usermenu__meta .role { font-size: 11.5px; color: var(--text-muted); text-transform: capitalize; }
.usermenu__panel {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 50;
}
.usermenu.open .usermenu__panel { display: block; }
.usermenu__item {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px;
    border-radius: 8px; color: var(--text-soft); font-size: 13.5px; width: 100%;
}
.usermenu__item:hover { background: var(--bg); color: var(--text); }
.usermenu__item.danger { color: var(--danger); }
.usermenu__sep { height: 1px; background: var(--border); margin: 5px 4px; }

/* ------------------------------------------------------------------ */
/* Cards                                                               */
/* ------------------------------------------------------------------ */
.card {
    background: var(--surface);
    border: 1px solid #E4E0FA;
    border-radius: var(--radius);
    box-shadow: 0 10px 24px rgba(15,23,42,.045);
    padding: 26px 32px;
    margin-bottom: 28px;
}
.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: -26px -32px 26px;
    padding: 22px 32px;
    border-bottom: 1px solid var(--border);
}
.card__title { font-size: 22px; font-weight: 700; margin: 0; }
.card__hint { color: var(--text-soft); font-size: 13.5px; }

/* stat cards grid */
.grid { display: grid; gap: 16px; }
.grid--stats { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.stat {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: 18px 20px; display: flex; align-items: center; gap: 16px;
}
.stat__icon {
    width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
    background: var(--primary-50); color: var(--primary);
}
.stat__icon .icon { width: 22px; height: 22px; stroke: var(--primary); }
.stat__value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat__label { color: var(--text-muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
.stat--green .stat__icon { background: var(--success-bg); color: var(--success); }
.stat--green .stat__icon .icon { stroke: var(--success); }
.stat--amber .stat__icon { background: var(--warning-bg); color: var(--warning); }
.stat--amber .stat__icon .icon { stroke: var(--warning); }

/* ------------------------------------------------------------------ */
/* Envato-style dashboard                                              */
/* ------------------------------------------------------------------ */
.envato-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, .85fr);
    gap: 28px;
    max-width: 100%;
}
.dash-card,
.dash-stat-card {
    background: #fff;
    border: 1px solid #E4E0FA;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(15,23,42,.05);
}
.dash-metric-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(210px, 1fr));
    gap: 28px;
}
.dash-stat-card {
    min-height: 172px;
    padding: 28px 26px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.dash-stat-card h3 {
    margin: 0 0 18px;
    font-size: 22px;
    line-height: 1.25;
    color: #171717;
    font-weight: 800;
}
.dash-stat-card__body {
    display: flex;
    align-items: end;
    gap: 16px;
    flex-wrap: wrap;
}
.dash-stat-card__body strong {
    font-size: 40px;
    line-height: 1;
    color: #171717;
    font-weight: 800;
}
.dash-stat-card__body span {
    margin-bottom: 5px;
    color: #8A86A8;
    font-size: 15px;
    font-weight: 600;
}
.dash-stat-card__progress {
    width: min(238px, 100%);
    height: 8px;
    margin-bottom: 20px;
    border-radius: 999px;
    background: #f0f1f4;
    overflow: hidden;
}
.dash-stat-card__progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
}
.dash-hero__art {
    position: relative;
    min-height: 250px;
}
.dash-hero__art .screen {
    position: absolute;
    right: 18px;
    bottom: 12px;
    width: 180px;
    height: 165px;
    border-radius: 7px;
    background: rgba(255,255,255,.46);
    border: 7px solid rgba(255,255,255,.55);
}
.dash-hero__art .screen::after {
    content: '';
    position: absolute;
    left: 54px;
    right: 54px;
    bottom: -32px;
    height: 5px;
    background: rgba(15,23,42,.38);
}
.dash-hero__art svg {
    position: absolute;
    inset: 40px 8px 8px;
    width: calc(100% - 16px);
    height: 110px;
}
.dash-hero__art polyline,
.dash-hero__art path {
    fill: none;
    stroke: #0f4c81;
    stroke-width: 7;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .75;
}
.screen__bars {
    position: absolute;
    left: -38px;
    top: -32px;
    width: 116px;
    height: 66px;
    border-radius: 9px;
    background: rgba(148,137,226,.72);
    display: flex;
    align-items: end;
    gap: 6px;
    padding: 14px 16px;
}
.screen__bars i {
    display: block;
    width: 6px;
    border-radius: 999px;
    background: #fff;
}
.screen__bars i:nth-child(1) { height: 16px; }
.screen__bars i:nth-child(2) { height: 28px; }
.screen__bars i:nth-child(3) { height: 36px; }
.screen__bars i:nth-child(4) { height: 48px; }
.screen__bars i:nth-child(5) { height: 24px; }
.bubble { position: absolute; border-radius: 50%; }
.bubble--one { width: 31px; height: 31px; border: 6px solid #fef08a; right: 170px; top: 38px; }
.bubble--two { width: 48px; height: 48px; border: 10px solid rgba(148,137,226,.45); right: 52px; top: 22px; }
.bubble--three { width: 27px; height: 27px; background: #f472b6; right: 20px; top: 80px; }
.dash-change { color: #8A86A8; font-size: 15px; font-weight: 700; }
.dash-change.is-up { color: #22c55e; }
.dash-change.is-down { color: #ef4444; }
.mini-bars { display: flex; gap: 18px; align-items: center; height: 88px; }
.mini-bars i { width: 10px; height: 82px; background: #eef0f4; border-radius: 999px; position: relative; overflow: hidden; }
.mini-bars i::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 48%; background: var(--primary); }
.mini-bars i:nth-child(2)::after { height: 54%; }
.mini-bars i:nth-child(3)::after { height: 40%; }
.mini-bars i:nth-child(4)::after { height: 68%; }
.dash-progress { width: 238px; max-width: 100%; height: 8px; background: #f0f1f4; border-radius: 999px; overflow: hidden; }
.dash-progress span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.dash-metric--line svg { width: 140px; height: 82px; }
.dash-metric--line path {
    fill: none;
    stroke: var(--primary);
    stroke-width: 7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.dash-chart,
.dash-profile {
    min-height: 374px;
    padding: 38px 34px;
}
.dash-chart { grid-column: span 1; }
.dash-profile {
    grid-column: span 2;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 310px;
    align-items: center;
    gap: 30px;
}
.dash-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 34px;
}
.dash-card h3 {
    font-size: 25px;
    line-height: 1.35;
    margin: 0;
    color: #262626;
    font-weight: 800;
}
.dash-tabs {
    display: inline-flex;
    gap: 0;
    border-radius: 12px;
    padding: 4px;
    background: #f1eff8;
}
.dash-tabs span {
    min-width: 92px;
    text-align: center;
    padding: 10px 16px;
    border-radius: 10px;
    color: #8A86A8;
    font-weight: 700;
}
.dash-tabs span:first-child { background: var(--primary); color: #fff; }
.dash-summary {
    display: grid;
    grid-template-columns: 68px 1fr 1fr 1fr;
    align-items: center;
    gap: 18px;
    margin-bottom: 32px;
}
.dash-summary strong { display: block; font-size: 30px; line-height: 1; color: #171717; }
.dash-summary span { color: #8A86A8; font-size: 15px; }
.donut {
    --angle: calc(var(--pct) * 3.6deg);
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) var(--angle), #eef0f8 var(--angle));
    position: relative;
}
.donut::after {
    content: '';
    position: absolute;
    inset: 13px;
    border-radius: 50%;
    background: #fff;
}
.dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 14px;
}
.dot--amber { background: #facc15; }
.dot--pink { background: #f9a8d4; }
.bar-chart {
    height: 170px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 26px;
    align-items: end;
    border-top: 1px solid #eef0f4;
    padding-top: 18px;
}
.bar-chart div { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: end; gap: 8px; }
.bar-chart span { width: 22px; border-radius: 999px 999px 0 0; background: linear-gradient(180deg, #fb7185, #f9a8d4); }
.bar-chart div:nth-child(2n) span { background: linear-gradient(180deg, #9489E2, #C9C3F2); }
.bar-chart small { color: #8A86A8; font-size: 11px; font-weight: 700; }
.dash-profile p {
    max-width: 460px;
    color: #454545;
    font-size: 17px;
    line-height: 1.55;
    margin: 28px 0;
}
.dash-arrows { display: flex; gap: 18px; }
.dash-arrows button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 0;
    background: #d1d5db;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}
.progress-ring {
    --angle: calc(var(--pct) * 3.6deg);
    width: 235px;
    height: 235px;
    border-radius: 50%;
    margin: 0 auto;
    background: conic-gradient(#9489E2 var(--angle), #eef0ff var(--angle));
    display: grid;
    place-items: center;
    position: relative;
}
.progress-ring::before {
    content: '';
    position: absolute;
    inset: 38px;
    border-radius: 50%;
    background: #fff;
}
.progress-ring span {
    position: relative;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: #F1EFFF;
    display: grid;
    place-items: center;
    color: var(--primary-700);
    font-size: 24px;
    font-weight: 800;
}
.progress-ring strong {
    position: absolute;
    bottom: -36px;
    color: #8A86A8;
    font-size: 17px;
}
.dash-recent { grid-column: 1 / -1; }
.dash-recent .card { border-radius: 10px; box-shadow: 0 12px 30px rgba(15,23,42,.05); }
.dash-summary-card,
.dash-destinations {
    min-height: 240px;
    padding: 30px;
}
.dash-summary-card {
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(280px, 1fr);
    gap: 24px;
    align-items: center;
}
.dash-summary-card p { margin: 10px 0 0; color: #8A86A8; font-size: 15px; }
.dash-summary-list,
.dash-destination-list {
    display: grid;
    gap: 12px;
}
.dash-summary-list div,
.dash-destination-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    background: #F8F7FF;
    border: 1px solid #eef3f8;
    border-radius: 10px;
}
.dash-summary-list span,
.dash-destination-list span { color: #8A86A8; }
.dash-summary-list strong,
.dash-destination-list strong { font-size: 18px; color: #17142A; }
.dash-destinations h3 { margin-bottom: 16px; }

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    font: inherit; font-weight: 600; font-size: 13.5px;
    padding: 11px 18px; border-radius: 9px; border: 1px solid transparent;
    cursor: pointer; transition: background .15s, box-shadow .15s, border-color .15s;
    white-space: nowrap;
}
.btn--primary { background: var(--primary); color: #fff; box-shadow: 0 8px 18px rgba(148,137,226,.24); }
.btn--primary:hover { background: var(--primary-600); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--bg); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--block { width: 100%; justify-content: center; }
.btn--lg { padding: 12px 20px; font-size: 14.5px; }

/* ------------------------------------------------------------------ */
/* Forms                                                               */
/* ------------------------------------------------------------------ */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 8px; }
.form-control {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    font: inherit;
    font-size: 15px;
    background: var(--surface); color: var(--text);
    border: 1px solid #dfe3eb;
    border-radius: 10px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-control::placeholder { color: #a8b0bd; }
.form-control:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(148,137,226,.14);
}
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; }
textarea.form-control { min-height: 150px; resize: vertical; }
input[type="checkbox"],
input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--primary-600);
}

/* ------------------------------------------------------------------ */
/* Alerts                                                              */
/* ------------------------------------------------------------------ */
.alert {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 15px; border-radius: var(--radius-sm); font-size: 13.5px;
    margin-bottom: 16px; border: 1px solid transparent;
}
.alert .icon { width: 18px; height: 18px; }
.alert--info    { background: var(--info-bg);    color: #1e40af; border-color: #bfdbfe; }
.alert--error   { background: var(--danger-bg);  color: #991b1b; border-color: #fecaca; }
.alert--success { background: var(--success-bg); color: #166534; border-color: #bbf7d0; }

/* ------------------------------------------------------------------ */
/* Badges                                                              */
/* ------------------------------------------------------------------ */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
    background: var(--primary-50); color: var(--primary-700);
}
.badge--green { background: var(--success-bg); color: #166534; }

/* ------------------------------------------------------------------ */
/* Auth screen                                                         */
/* ------------------------------------------------------------------ */
.auth {
    --auth-primary: #9489E2;
    --auth-primary-dark: #8174D8;
    --auth-bg: #F8F7FF;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--auth-bg);
}
.auth__card {
    width: 100%;
    max-width: 490px;
    background: var(--surface);
    border: 1px solid rgba(226,232,240,.8);
    border-radius: 10px;
    box-shadow: 0 12px 34px rgba(15,23,42,.08);
    padding: 32px 32px 34px;
}
.auth__brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 18px;
}
.auth__brand .logo {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-primary-dark) 100%);
    display: grid;
    place-items: center;
    color: #fff;
    box-shadow: 0 10px 24px rgba(148,137,226,.28);
}
.auth__brand .logo .icon { width: 28px; height: 28px; }
.auth__brand h1 {
    font-size: 34px;
    line-height: 1;
    margin: 0;
    color: #403B5F;
    font-weight: 800;
}
.auth__brand span {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}
.auth__title {
    margin: 0 0 28px;
    text-align: center;
    font-size: 21px;
    font-weight: 700;
    color: #020617;
}
.auth .form-group { margin-bottom: 24px; }
.auth .form-label {
    margin-bottom: 10px;
    color: #17142A;
    font-size: 15px;
    font-weight: 500;
}
.auth .form-control {
    height: 52px;
    border-radius: 11px;
    border-color: #d9dee8;
    padding: 0 22px;
    font-size: 15px;
}
.auth .form-control:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px rgba(148,137,226,.16);
}
.auth__password { position: relative; }
.auth__password .form-control { padding-right: 54px; }
.auth__password-toggle {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #8A86A8;
    display: grid;
    place-items: center;
    cursor: pointer;
}
.auth__password-toggle:hover { background: #F8F7FF; color: #403B5F; }
.auth__password-toggle .icon { width: 18px; height: 18px; }
.auth__options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 6px 0 46px;
    color: #8A86A8;
    font-size: 15px;
}
.auth__remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.auth__remember input {
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: var(--auth-primary-dark);
}
.auth__muted-link {
    color: #8A86A8;
    white-space: nowrap;
}
.auth__submit {
    height: 52px;
    border-radius: 9px;
    background: var(--auth-primary);
    box-shadow: 0 10px 20px rgba(148,137,226,.24);
    font-size: 17px;
}
.auth__submit:hover { background: var(--auth-primary-dark); }
.auth__foot {
    margin: 20px 0 0;
    color: #8A86A8;
    font-size: 15px;
}
@media (max-width: 560px) {
    .auth { padding: 18px; }
    .auth__card { padding: 28px 22px; }
    .auth__brand h1 { font-size: 28px; }
    .auth__options { align-items: flex-start; flex-direction: column; margin-bottom: 30px; }
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */
.sidebar__backdrop { display: none; }
@media (max-width: 900px) {
    .icon-btn { display: inline-flex; }
    .sidebar {
        position: fixed; left: 0; top: 0; z-index: 60;
        transform: translateX(-100%); transition: transform .22s ease;
        box-shadow: var(--shadow-lg);
    }
    body.nav-open .sidebar { transform: translateX(0); }
    body.nav-open .sidebar__backdrop {
        display: block; position: fixed; inset: 0; z-index: 55;
        background: rgba(15,23,42,.45);
    }
    .content { padding: 18px 16px 32px; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .table-wrap { overflow-x: auto; }
    .topbar__search { display: none; }
    .topbar__tool { display: none; }
    .envato-dashboard { grid-template-columns: 1fr; gap: 18px; }
    .dash-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
    .dash-recent { grid-column: auto; }
    .dash-summary-card,
    .dash-destinations { grid-column: auto; }
    .dash-summary-card { grid-template-columns: 1fr; }
    .booking-form { grid-template-columns: 1fr; }
    .booking-preview { position: static; order: -1; }
}
@media (max-width: 640px) {
    .dash-metric-grid { grid-template-columns: 1fr; }
    .dash-stat-card { min-height: 150px; padding: 24px; }
    .dash-stat-card__body strong { font-size: 36px; }
    .dash-summary-list div,
    .dash-destination-list div,
    .booking-preview__rows div {
        align-items: flex-start;
        flex-direction: column;
    }
    .booking-preview__rows strong { text-align: left; }
}

/* ------------------------------------------------------------------ */
/* Toolbar (page actions / search)                                    */
/* ------------------------------------------------------------------ */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.toolbar__search { position: relative; flex: 1; max-width: 420px; }
.toolbar__search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.toolbar__search input { padding-left: 42px; }

/* ------------------------------------------------------------------ */
/* Tables                                                             */
/* ------------------------------------------------------------------ */
.table-wrap {
    background: var(--surface);
    border: 1px solid #E4E0FA;
    border-radius: var(--radius);
    box-shadow: 0 10px 24px rgba(15,23,42,.045);
    overflow-x: auto;
    padding: 30px 34px;
}
.table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: 16px 14px; vertical-align: middle; }
.table thead th {
    background: transparent; color: #020617; font-weight: 700; font-size: 15px;
    text-transform: none; letter-spacing: 0; border-bottom: 1px solid var(--border);
}
.table tbody tr { border-top: 1px solid var(--border); }
.table tbody tr:first-child { border-top: 0; }
.table tbody tr:hover { background: #F8F7FF; }
.table .muted { color: var(--text-muted); }
.table__actions { display: flex; gap: 8px; justify-content: flex-end; }

.cell-user { display: flex; align-items: center; gap: 11px; }
.cell-user .avatar { width: 34px; height: 34px; font-size: 12px; }
.cell-user .name { font-weight: 600; }
.cell-user .sub { color: var(--text-muted); font-size: 12.5px; }

/* status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill--active { background: #dcfce7; color: #16a34a; }
.pill--inactive { background: #F8F7FF; color: #403B5F; }

/* small icon action buttons */
.btn--icon { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 8px; }
.btn--sm { padding: 7px 12px; font-size: 12.5px; }

/* ------------------------------------------------------------------ */
/* Forms - select, switch, checkbox                                   */
/* ------------------------------------------------------------------ */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; row-gap: 4px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* Select2 follows the same input rhythm as form-control. */
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single {
    min-height: 48px;
    border: 1px solid #dfe3eb;
    border-radius: 10px;
    display: flex;
    align-items: center;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text);
    line-height: 48px;
    padding-left: 16px;
    padding-right: 36px;
    font-size: 15px;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: #a8b0bd; }
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 48px;
    right: 10px;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(148,137,226,.12);
}
.select2-dropdown {
    border: 1px solid #dfe3eb;
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(15,23,42,.12);
    overflow: hidden;
}
.select2-search--dropdown { padding: 10px; }
.select2-container--default .select2-search--dropdown .select2-search__field {
    min-height: 40px;
    border: 1px solid #dfe3eb !important;
    outline: none !important;
    border-radius: 8px;
    padding: 8px 10px;
    box-shadow: none !important;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(148,137,226,.12) !important;
}
.select2-results__option { padding: 10px 14px; }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: var(--primary);
}

/* Check mark on the currently selected option */
.select2-container--default .select2-results__option { position: relative; padding-right: 38px; }
.select2-container--default .select2-results__option[aria-selected="true"]:not(.select2-results__option--highlighted) {
    background: var(--primary-50);
    color: var(--primary-700);
    font-weight: 700;
}
.select2-container--default .select2-results__option[aria-selected="true"]::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    width: 11px;
    height: 6px;
    margin-top: -4px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
}

/* Booking form workspace */
.booking-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: start;
    max-width: 1320px;
}
.booking-form__main { min-width: 0; }
.booking-form .card {
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 8px 18px rgba(15,23,42,.04);
}
.booking-form .card__header {
    margin: -16px -20px 16px;
    padding: 14px 20px;
}
.booking-form .card__title {
    font-size: 19px;
}
.booking-form .card__hint {
    font-size: 12.5px;
}
.booking-form .form-row {
    column-gap: 20px;
    row-gap: 0;
}
.booking-form .form-group { margin-bottom: 12px; }
.booking-form .form-label {
    font-size: 13px;
    margin-bottom: 5px;
}
.booking-form .form-control {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 9px;
}
.booking-section { padding-top: 16px; }
.booking-section > .card__header { margin-bottom: 16px; }
.booking-party-row > .card { min-width: 0; }
.choice-row { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 1px; }
.choice-pill {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    border: 1px solid #dfe3eb;
    border-radius: 10px;
    background: #fff;
    color: var(--text-soft);
}
.booking-preview {
    position: sticky;
    top: calc(var(--topbar-h) + 18px);
    background: #fff;
    border: 1px solid #E4E0FA;
    border-radius: 12px;
    box-shadow: 0 16px 34px rgba(15,23,42,.07);
    padding: 16px;
}
.booking-preview__head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.booking-preview__head strong { font-size: 15px; line-height: 1.35; }
.booking-preview__total {
    margin: 14px 0;
    padding: 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, #9489E2, #C9C3F2);
    color: #fff;
}
.booking-preview__total span { display: block; font-weight: 700; opacity: .92; }
.booking-preview__total strong { display: block; margin-top: 6px; font-size: 26px; line-height: 1; }
.booking-preview__rows { display: grid; gap: 0; }
.booking-preview__rows div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.booking-preview__rows span { color: #8A86A8; font-size: 12.5px; }
.booking-preview__rows strong { text-align: right; color: #17142A; font-size: 13px; }
.booking-form .select2-container--default .select2-selection--single {
    min-height: 40px;
    border-radius: 9px;
}
.booking-form .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px;
    padding-left: 12px;
    font-size: 14px;
}
.booking-form .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
}

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { width: 42px; height: 24px; border-radius: 999px; background: var(--border-strong); transition: background .18s; position: relative; flex-shrink: 0; }
.switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .18s; }
.switch input:checked + .switch__track { background: var(--primary); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch__label { font-size: 13.5px; color: var(--text-soft); }

/* ------------------------------------------------------------------ */
/* Permission matrix                                                  */
/* ------------------------------------------------------------------ */
.matrix__module { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.matrix__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #F8F7FF; border-bottom: 1px solid var(--border); }
.matrix__head h4 { margin: 0; font-size: 13.5px; text-transform: capitalize; }
.matrix__perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px; padding: 12px 16px; }
.perm-check { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.perm-check:hover { background: #F8F7FF; }
.perm-check input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.perm-check .key { color: var(--text-muted); font-size: 11.5px; }
.link-muted { background: none; border: 0; color: var(--primary); font-size: 12.5px; cursor: pointer; padding: 0; font-weight: 600; }

/* ------------------------------------------------------------------ */
/* Pagination                                                         */
/* ------------------------------------------------------------------ */
.pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; font-size: 13px; color: var(--text-soft); }
.pagination__pages { display: flex; gap: 6px; }
.pagination a, .pagination span.cur {
    display: inline-flex; min-width: 34px; height: 34px; align-items: center; justify-content: center;
    padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-soft);
}
.pagination a:hover { background: var(--bg); }
.pagination span.cur { background: var(--primary); color: #fff; border-color: var(--primary); }

/* empty state */
.empty { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty .icon { width: 40px; height: 40px; margin-bottom: 10px; stroke: var(--border-strong); }

/* form error text */
.field-error { color: var(--danger); font-size: 12px; margin-top: 5px; }
.form-control.has-error { border-color: var(--danger); }
.section-divider { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }

/* ------------------------------------------------------------------ */
/* Modal (AJAX forms)                                                 */
/* ------------------------------------------------------------------ */
.modal {
    position: fixed; inset: 0; z-index: 200; display: none;
    align-items: flex-start; justify-content: center;
    padding: 48px 16px; overflow-y: auto; background: rgba(15,23,42,.5);
}
.modal.open { display: flex; }
.modal__dialog {
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); width: 100%; max-width: 640px;
    animation: modalIn .16s ease;
}
.modal--wide .modal__dialog { max-width: 880px; }
@keyframes modalIn { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 22px; border-bottom: 1px solid var(--border);
}
.modal__head h3 { margin: 0; font-size: 16px; }
.modal__close { background: none; border: 0; cursor: pointer; color: var(--text-muted); font-size: 24px; line-height: 1; padding: 0 4px; }
.modal__close:hover { color: var(--text); }
.modal__content { padding: 22px; }
.modal__loading { padding: 48px; text-align: center; color: var(--text-muted); }

/* spinner */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .6s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* toastr tweaks to match theme */
#toast-container > div { border-radius: 10px !important; box-shadow: var(--shadow-lg) !important; opacity: 1 !important; padding: 14px 18px 14px 46px !important; font-family: var(--font); }
