@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;600;700;800&family=Noto+Sans+Khmer:wght@400;500;600;700&display=swap');

/* =========================================================
   Auth Theme
========================================================= */

:root {
    --auth-font-sans: "Noto Serif", "Noto Sans SC", "Noto Sans Khmer", ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
    --auth-font-display: "Noto Serif", "Noto Sans SC", "Noto Sans Khmer", ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
    --auth-bg: #f5f7fb;
    --auth-surface: #ffffff;
    --auth-surface-soft: #eef9f4;
    --auth-text: #10201b;
    --auth-muted: #718096;
    --auth-line: rgba(16, 32, 27, 0.08);
    --auth-primary: #12b886;
    --auth-primary-dark: #0ca678;
    --auth-primary-soft: rgba(18, 184, 134, 0.12);
    --auth-danger: #fa5252;
    --auth-danger-soft: #fff0f3;
    --auth-shadow: 0 24px 70px rgba(15, 23, 42, 0.10);
    --auth-shadow-soft: 0 12px 34px rgba(15, 23, 42, 0.07);
    --auth-ease: cubic-bezier(.2, .8, .2, 1);
}

.auth-page {
    box-sizing: border-box;
    min-height: 100vh;
    font-family: var(--auth-font-sans);
    color: var(--auth-text);
    background:
        radial-gradient(circle at top left, rgba(18, 184, 134, 0.16), transparent 28%),
        radial-gradient(circle at right 20%, rgba(77, 171, 247, 0.10), transparent 24%),
        linear-gradient(180deg, #f8fbfd 0%, var(--auth-bg) 100%);
    padding: 28px;
}

.auth-shell,
.auth-shell * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root[data-theme-mode="dark"] .auth-page {
    background:
        radial-gradient(circle at top left, rgba(24, 197, 143, 0.16), transparent 28%),
        radial-gradient(circle at right 20%, rgba(24, 197, 143, 0.10), transparent 24%),
        linear-gradient(180deg, #071511 0%, #0a1914 42%, #07130f 100%);
}

:root[data-theme-mode="light"] .auth-page {
    background:
        radial-gradient(circle at top left, rgba(18, 184, 134, 0.16), transparent 28%),
        radial-gradient(circle at right 20%, rgba(77, 171, 247, 0.10), transparent 24%),
        linear-gradient(180deg, #f8fbfd 0%, var(--auth-bg) 100%);
}

.auth-page a {
    color: inherit;
    text-decoration: none;
}

.auth-page button,
.auth-page input {
    font: inherit;
}

.auth-shell {
    width: min(1180px, 100%);
    min-height: calc(100vh - 56px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(320px, 1.05fr) minmax(420px, 0.95fr);
    gap: 26px;
    padding: 26px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 36px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(238, 249, 244, 0.74));
    box-shadow: var(--auth-shadow);
    backdrop-filter: blur(16px);
}

.auth-showcase {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    padding: 38px;
    border-radius: 30px;
    background: linear-gradient(160deg, #10201b 0%, #16362d 52%, #12b886 160%);
    color: #f8fbfd;
    box-shadow: var(--auth-shadow-soft);
}

.auth-showcase::before,
.auth-showcase::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.auth-showcase::before {
    width: 240px;
    height: 240px;
    top: -84px;
    right: -64px;
    background: rgba(255, 255, 255, 0.08);
}

.auth-showcase::after {
    width: 180px;
    height: 180px;
    bottom: -70px;
    left: -28px;
    background: rgba(255, 255, 255, 0.06);
}

.showcase-brand,
.showcase-metrics,
.showcase-points {
    position: relative;
    z-index: 1;
}

.showcase-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.showcase-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #ffffff, #e6fcf5);
    color: var(--auth-primary);
    font-size: 1.35rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.showcase-brand h1 {
    font-family: var(--auth-font-display);
    font-weight: 700;
    font-size: 1.8rem;
    line-height: 1;
    letter-spacing: -0.05em;
}

.showcase-brand p {
    margin-top: 6px;
    color: rgba(248, 251, 253, 0.72);
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-showcase h2 {
    max-width: 11ch;
    font-family: var(--auth-font-display);
    font-weight: 700;
    font-size: clamp(2.4rem, 4vw, 4.2rem);
    line-height: 0.96;
    letter-spacing: -0.07em;
}

.auth-showcase>p {
    max-width: 520px;
    color: rgba(248, 251, 253, 0.78);
    font-size: 1rem;
    line-height: 1.7;
}

.showcase-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.showcase-metric {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(10px);
}

.showcase-metric strong,
.showcase-metric span {
    display: block;
}

.showcase-metric strong {
    font-size: 1.15rem;
    margin-bottom: 6px;
}

.showcase-metric span {
    color: rgba(248, 251, 253, 0.72);
    font-size: 0.84rem;
    line-height: 1.45;
}

.showcase-points {
    list-style: none;
    display: grid;
    gap: 12px;
}

.showcase-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(248, 251, 253, 0.92);
}

.showcase-points i {
    width: 20px;
    text-align: center;
    color: #8cecc9;
}

.auth-panel {
    display: grid;
    align-items: center;
}

.auth-card {
    padding: 38px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.86);
    box-shadow: var(--auth-shadow-soft);
}

.auth-header {
    margin-bottom: 24px;
}

.auth-header h3 {
    font-family: var(--auth-font-display);
    font-weight: 700;
    font-size: clamp(1.9rem, 3vw, 2.5rem);
    line-height: 1;
    letter-spacing: -0.05em;
    margin-bottom: 10px;
}

.auth-header p {
    color: var(--auth-muted);
    font-size: 0.96rem;
    line-height: 1.65;
}

.alert {
    margin-bottom: 16px;
    padding: 13px 15px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    border: 1px solid transparent;
}

.alert.success {
    color: var(--auth-primary-dark);
    background: var(--auth-primary-soft);
    border-color: rgba(18, 184, 134, 0.18);
}

.alert.error {
    color: #c92a2a;
    background: var(--auth-danger-soft);
    border-color: rgba(250, 82, 82, 0.14);
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-form label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--auth-text);
}

.auth-form input {
    width: 100%;
    height: 54px;
    padding: 0 16px;
    border-radius: 16px;
    border: 1px solid var(--auth-line);
    background: #f8fafc;
    color: var(--auth-text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-password-field {
    position: relative;
}

.auth-password-field input {
    padding-right: 56px;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 0.2s ease, color 0.2s ease;
}

.auth-password-toggle:hover {
    background: rgba(18, 184, 134, 0.10);
    color: var(--auth-primary-dark);
}

.auth-password-toggle:focus-visible {
    outline: 3px solid rgba(18, 184, 134, 0.18);
    outline-offset: 2px;
}

.auth-form input::placeholder {
    color: #98a2b3;
}

.auth-form input:focus {
    border-color: rgba(18, 184, 134, 0.46);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(18, 184, 134, 0.12);
}

.auth-btn {
    height: 56px;
    margin-top: 10px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: 0 18px 34px rgba(18, 184, 134, 0.24);
    transition: transform 0.24s var(--auth-ease), box-shadow 0.24s var(--auth-ease);
    cursor: pointer;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 38px rgba(18, 184, 134, 0.28);
}

.google-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 56px;
    margin-bottom: 18px;
    border: 1px solid rgba(16, 24, 40, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    color: #101828;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.24s var(--auth-ease), box-shadow 0.24s var(--auth-ease), border-color 0.24s var(--auth-ease);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.google-auth-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(18, 184, 134, 0.22);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.1);
}

.google-auth-btn i {
    color: #ea4335;
    font-size: 1rem;
}

.auth-switch {
    margin-top: 20px;
    color: var(--auth-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.auth-switch a {
    color: var(--auth-primary-dark);
    font-weight: 800;
}

.auth-switch a:hover {
    text-decoration: underline;
}

@media (max-width: 980px) {
    body {
        padding: 18px;
    }

    .auth-shell {
        min-height: auto;
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .auth-showcase,
    .auth-card {
        padding: 30px;
    }

    .auth-showcase h2 {
        max-width: none;
    }
}

@media (max-width: 720px) {
    .showcase-brand {
        flex-wrap: wrap;
        gap: 12px;
    }

    .showcase-metrics {
        grid-template-columns: 1fr;
    }

    .showcase-points {
        grid-template-columns: 1fr;
    }

    .google-auth-btn,
    .auth-btn {
        width: 100%;
        justify-content: center;
    }

    .auth-switch {
        line-height: 1.7;
    }
}

@media (max-width: 640px) {
    .auth-page {
        padding: 0;
    }

    .auth-page .auth-shell {
        min-height: 100vh;
        gap: 14px;
        padding: 14px;
        border-radius: 0;
    }

    .auth-page .auth-showcase,
    .auth-page .auth-card {
        padding: 22px;
        border-radius: 24px;
    }

    .auth-page .auth-header h3 {
        font-size: 1.8rem;
    }

    .auth-page .showcase-brand header {
        min-width: 0;
    }

    .auth-page .showcase-brand h1,
    .auth-page .auth-showcase h2 {
        overflow-wrap: anywhere;
    }

    .auth-page .auth-btn {
        height: 52px;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .auth-page .auth-shell {
        padding: 12px;
        gap: 12px;
    }

    .auth-page .auth-showcase,
    .auth-page .auth-card {
        padding: 18px;
        border-radius: 20px;
    }

    .auth-page .showcase-icon {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .auth-page .showcase-brand {
        align-items: flex-start;
    }

    .auth-page .auth-form input,
    .auth-page .auth-password-field input {
        padding-left: 14px;
        padding-right: 48px;
    }
}

@media (max-width: 768px) {
    .auth-page .showcase-brand h1 {
        font-size: 1.45rem;
    }

    .auth-page .showcase-brand p {
        font-size: 0.82rem;
    }

    .auth-page .auth-showcase h2 {
        max-width: none;
        font-size: clamp(1.95rem, 8vw, 2.9rem);
        line-height: 1.02;
        overflow-wrap: anywhere;
    }

    .auth-page .auth-showcase > p,
    .auth-page .auth-header p,
    .auth-page .auth-switch {
        font-size: 0.94rem;
        line-height: 1.6;
    }

    .auth-page .showcase-metric strong {
        font-size: 1.02rem;
    }

    .auth-page .showcase-metric span,
    .auth-page .showcase-points li {
        font-size: 0.84rem;
        line-height: 1.45;
    }

    .auth-page .auth-header h3 {
        font-size: clamp(1.55rem, 6.2vw, 2rem);
        line-height: 1.06;
    }

    .auth-page .auth-form label {
        font-size: 0.88rem;
    }

    .auth-page .auth-form input,
    .auth-page .auth-password-field input,
    .auth-page .auth-btn,
    .auth-page .google-auth-btn {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .auth-page .showcase-brand h1 {
        font-size: 1.3rem;
    }

    .auth-page .auth-showcase h2 {
        font-size: clamp(1.75rem, 9vw, 2.2rem);
    }

    .auth-page .auth-header h3 {
        font-size: clamp(1.4rem, 7vw, 1.8rem);
    }

    .auth-page .auth-showcase > p,
    .auth-page .auth-header p,
    .auth-page .auth-switch,
    .auth-page .showcase-points li {
        font-size: 0.9rem;
        line-height: 1.55;
    }
}

/* =========================================================
   Merchant Dashboard
========================================================= */

:where(.merchant-dashboard-body, .merchant-dashboard-body *) {
    box-sizing: border-box;
}

.merchant-dashboard-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--auth-font-sans);
    background:
        radial-gradient(circle at top left, rgba(18, 184, 134, 0.16), transparent 28%),
        radial-gradient(circle at right 20%, rgba(77, 171, 247, 0.10), transparent 24%),
        linear-gradient(180deg, #f8fbfd 0%, var(--auth-bg) 100%);
    color: #10201b;
}

:root[data-theme-mode="dark"] .merchant-dashboard-body {
    background:
        radial-gradient(circle at top left, rgba(24, 197, 143, 0.14), transparent 28%),
        radial-gradient(circle at right 20%, rgba(24, 197, 143, 0.10), transparent 24%),
        linear-gradient(180deg, #071511 0%, #0a1914 42%, #07130f 100%);
}

:root[data-theme-mode="light"] .merchant-dashboard-body {
    background:
        radial-gradient(circle at top left, rgba(18, 184, 134, 0.16), transparent 28%),
        radial-gradient(circle at right 20%, rgba(77, 171, 247, 0.10), transparent 24%),
        linear-gradient(180deg, #f8fbfd 0%, var(--auth-bg) 100%);
}

.merchant-dashboard-body a {
    color: inherit;
    text-decoration: none;
}

.merchant-dashboard-body button,
.merchant-dashboard-body input,
.merchant-dashboard-body select {
    font: inherit;
}

.merchant-dashboard-body .lang-select {
    position: relative;
    flex-shrink: 0;
    z-index: 12;
}

.merchant-dashboard-body .lang-select summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 92px;
    height: 48px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid rgba(16, 32, 27, 0.08);
    border-radius: 999px;
    box-shadow: var(--auth-shadow-soft);
    color: #10201b;
    cursor: pointer;
}

.merchant-dashboard-body .lang-select summary::-webkit-details-marker {
    display: none;
}

.merchant-dashboard-body .lang-select i {
    color: var(--auth-primary-dark);
    font-size: 0.92rem;
    pointer-events: none;
}

.merchant-dashboard-body .lang-select .lang-current {
    min-width: 3ch;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.merchant-dashboard-body .lang-select summary::after {
    content: "\f107";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #718096;
    font-size: 0.78rem;
    pointer-events: none;
    margin-left: auto;
    transition: transform 220ms var(--auth-ease);
}

.merchant-dashboard-body .lang-select[open] summary::after {
    transform: rotate(180deg);
}

.merchant-dashboard-body .lang-select .lang-select-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    gap: 4px;
    min-width: 100%;
    padding: 8px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(16, 32, 27, 0.08);
    box-shadow: var(--auth-shadow-soft);
}

.merchant-dashboard-body .lang-select .lang-select-menu a {
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 12px;
    color: #718096;
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
}

.merchant-dashboard-body .lang-select .lang-select-menu a:hover,
.merchant-dashboard-body .lang-select .lang-select-menu a.active {
    background: var(--auth-primary-soft);
    color: var(--auth-primary-dark);
}

.merchant-dashboard-body .admin-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 24px;
    flex: 1 0 auto;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
}


.merchant-dashboard-body .admin-main {
    width: 100%;
    display: grid;
    gap: 24px;
    min-width: 0;
    padding: 24px;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.merchant-dashboard-body .dashboard-topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.merchant-dashboard-body .page-title h1 {
    margin: 0 0 10px;
    font-family: var(--auth-font-display);
    font-weight: 700;
    font-size: clamp(2.3rem, 4vw, 3.8rem);
    line-height: 0.95;
    letter-spacing: -0.07em;
}

.merchant-dashboard-body .page-title p {
    margin: 0;
    max-width: 680px;
    color: #718096;
    line-height: 1.7;
    font-size: 1rem;
}

.merchant-dashboard-body .topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.merchant-dashboard-body .search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: min(360px, 100%);
    min-height: 48px;
    padding: 0 16px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(16, 32, 27, 0.08);
    box-shadow: var(--auth-shadow-soft);
}

.merchant-dashboard-body .search-box i {
    color: #718096;
}

.merchant-dashboard-body .search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #10201b;
}

.merchant-dashboard-body .search-box input::placeholder {
    color: #98a2b3;
}

.merchant-dashboard-body .icon-btn {
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff;
    color: #10201b;
    box-shadow: var(--auth-shadow-soft);
    cursor: pointer;
}

.merchant-dashboard-body .admin-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 220px;
    padding: 10px 12px;
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--auth-shadow-soft);
}

.merchant-dashboard-body .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #10201b;
    color: #fff;
}

.merchant-dashboard-body .admin-profile strong,
.merchant-dashboard-body .admin-profile span {
    display: block;
}

.merchant-dashboard-body .admin-profile span {
    color: #718096;
    font-size: 0.9rem;
}

.merchant-dashboard-body .metric-grid,
.merchant-dashboard-body .analytics-grid,
.merchant-dashboard-body .bottom-grid {
    display: grid;
    gap: 20px;
}

.merchant-dashboard-body .metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.merchant-dashboard-body .analytics-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
}

.merchant-dashboard-body .analytics-grid.traffic-only {
    grid-template-columns: 1fr;
}

.merchant-dashboard-body .bottom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.merchant-dashboard-body .bottom-grid.compact-section {
    grid-template-columns: minmax(320px, 0.74fr) minmax(0, 1.26fr);
}

.merchant-dashboard-body .metric-card,
.merchant-dashboard-body .dashboard-panel {
    background: #fff;
    border: 1px solid rgba(16, 32, 27, 0.08);
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.08);
}

.merchant-dashboard-body .metric-card {
    position: relative;
    display: grid;
    gap: 24px;
    padding: 24px;
    border-radius: 28px;
}

.merchant-dashboard-body .metric-card.success {
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
    color: #fff;
    border-color: transparent;
}

.merchant-dashboard-body .metric-card.success .metric-icon,
.merchant-dashboard-body .metric-card.success .metric-arrow {
    background: rgba(255, 255, 255, 0.20);
    color: #fff;
}

.merchant-dashboard-body .metric-card.success p {
    color: rgba(255, 255, 255, 0.9);
}

.merchant-dashboard-body .metric-head,
.merchant-dashboard-body .metric-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.merchant-dashboard-body .metric-head span {
    font-weight: 800;
}

.merchant-dashboard-body .metric-icon,
.merchant-dashboard-body .metric-arrow {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #eef9f4;
    color: var(--auth-primary-dark);
    flex-shrink: 0;
}

.merchant-dashboard-body .metric-body {
    align-items: end;
}

.merchant-dashboard-body .metric-body h2 {
    margin: 0;
    font-size: 2.8rem;
    line-height: 1;
    letter-spacing: -0.06em;
}

.merchant-dashboard-body .metric-body p {
    margin: 8px 0 0;
    font-weight: 800;
}

.merchant-dashboard-body .metric-body .positive {
    color: var(--auth-primary);
}

.merchant-dashboard-body .metric-body .negative {
    color: var(--auth-danger);
}

.merchant-dashboard-body .dashboard-panel {
    padding: 26px;
    border-radius: 32px;
}

.merchant-dashboard-body .metric-card {
    opacity: 0;
    transform: translateY(24px);
    animation: merchantRise 720ms var(--auth-ease) forwards;
    animation-delay: var(--delay, 0ms);
}

.merchant-dashboard-body .motion-panel {
    opacity: 0;
    transform: translateY(26px);
    animation: merchantRise 760ms var(--auth-ease) forwards;
}

.merchant-dashboard-body .analytics-grid .motion-panel:nth-child(1) {
    animation-delay: 140ms;
}

.merchant-dashboard-body .analytics-grid .motion-panel:nth-child(2) {
    animation-delay: 240ms;
}

.merchant-dashboard-body .bottom-grid .motion-panel:nth-child(1) {
    animation-delay: 320ms;
}

.merchant-dashboard-body .bottom-grid .motion-panel:nth-child(2) {
    animation-delay: 420ms;
}

.merchant-dashboard-body .panel-header,
.merchant-dashboard-body .panel-value-row,
.merchant-dashboard-body .preference-item,
.merchant-dashboard-body .product-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.merchant-dashboard-body .panel-header {
    margin-bottom: 24px;
    align-items: flex-start;
}

.merchant-dashboard-body .panel-header h3 {
    margin: 0;
    font-family: var(--auth-font-display);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.05em;
}

.merchant-dashboard-body .panel-header select,
.merchant-dashboard-body .filter-btn,
.merchant-dashboard-body .plain-icon-btn {
    min-height: 42px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: #f8fafc;
    color: #475467;
}

.merchant-dashboard-body .plain-icon-btn {
    width: 42px;
    padding: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.merchant-dashboard-body .filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.merchant-dashboard-body .panel-value-row {
    justify-content: flex-start;
    margin-top: 12px;
}

.merchant-dashboard-body .panel-value-row strong {
    font-size: 2rem;
    letter-spacing: -0.05em;
}

.merchant-dashboard-body .panel-value-row span {
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--auth-primary-soft);
    color: var(--auth-primary-dark);
    font-weight: 800;
}

.merchant-dashboard-body .animated-line-chart svg {
    width: 100%;
    height: 290px;
}

.merchant-dashboard-body .chart-fill {
    fill: url(#lineFill);
    opacity: 0;
    transform: translateY(12px);
    transform-origin: center bottom;
    animation: merchantFadeUp 820ms var(--auth-ease) forwards;
    animation-delay: 260ms;
}

.merchant-dashboard-body .chart-line {
    fill: none;
    stroke: var(--auth-primary);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    animation: merchantDraw 1.4s var(--auth-ease) forwards;
    animation-delay: 220ms;
}

.merchant-dashboard-body .chart-dot {
    fill: var(--auth-primary);
    opacity: 0;
    transform-origin: center;
    animation: merchantDotIn 420ms var(--auth-ease) forwards, merchantPulse 2.6s ease-in-out infinite;
    animation-delay: 980ms, 1.35s;
}

.merchant-dashboard-body .chart-months {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-top: 12px;
    color: #718096;
    font-size: 0.84rem;
    font-weight: 800;
    text-align: center;
}

.merchant-dashboard-body .bar-chart {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    align-items: end;
}

.merchant-dashboard-body .bar-item {
    display: grid;
    gap: 12px;
    text-align: center;
}

.merchant-dashboard-body .bar-item span {
    color: #475467;
    font-weight: 700;
}

.merchant-dashboard-body .bar-track {
    height: 220px;
    padding: 14px;
    border-radius: 28px;
    background: linear-gradient(180deg, #ecfdf5, #f8fafc);
    display: flex;
    align-items: end;
}

.merchant-dashboard-body .bar-fill {
    width: 100%;
    height: var(--height);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(18, 184, 134, 0.75), rgba(18, 184, 134, 0.18));
    transform: scaleY(0);
    transform-origin: center bottom;
    animation: merchantBarGrow 900ms var(--auth-ease) forwards;
}

.merchant-dashboard-body .bar-item:nth-child(1) .bar-fill {
    animation-delay: 180ms;
}

.merchant-dashboard-body .bar-item:nth-child(2) .bar-fill {
    animation-delay: 260ms;
}

.merchant-dashboard-body .bar-item:nth-child(3) .bar-fill {
    animation-delay: 340ms;
}

.merchant-dashboard-body .bar-item:nth-child(4) .bar-fill {
    animation-delay: 420ms;
}

.merchant-dashboard-body .donut-wrap {
    display: grid;
    justify-items: center;
    gap: 16px;
}

.merchant-dashboard-body .donut-chart {
    position: relative;
    width: 220px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: conic-gradient(var(--auth-primary) 0 34%, #4dabf7 34% 61%, #ffd166 61% 81%, #10201b 81% 100%);
    display: grid;
    place-items: center;
    animation: merchantRotateIn 900ms var(--auth-ease) both;
    animation-delay: 280ms;
}

.merchant-dashboard-body .donut-chart::before {
    content: "";
    width: 132px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #fff;
}

.merchant-dashboard-body .donut-center {
    position: absolute;
    display: grid;
    gap: 6px;
    text-align: center;
    opacity: 0;
    transform: scale(0.9);
    animation: merchantScaleIn 560ms var(--auth-ease) forwards;
    animation-delay: 760ms;
}

.merchant-dashboard-body .donut-center span,
.merchant-dashboard-body .donut-wrap>p,
.merchant-dashboard-body .preference-item p,
.merchant-dashboard-body .product-row span {
    color: #718096;
}

.merchant-dashboard-body .preference-list,
.merchant-dashboard-body .product-list {
    display: grid;
    gap: 16px;
}

.merchant-dashboard-body .preference-bar {
    width: min(100%, 240px);
    height: 12px;
    border-radius: 999px;
    background: #edf4f8;
    overflow: hidden;
}

.merchant-dashboard-body .preference-bar span {
    display: block;
    width: var(--width);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
}

.merchant-dashboard-body .product-row {
    padding: 16px 0;
    border-bottom: 1px solid rgba(16, 32, 27, 0.08);
}

.merchant-dashboard-body .product-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.merchant-dashboard-body .product-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #eef9f4;
    color: var(--auth-primary-dark);
}

.merchant-dashboard-body .table-wrap {
    overflow-x: auto;
}

.merchant-dashboard-body table {
    width: 100%;
    border-collapse: collapse;
}

.merchant-dashboard-body th,
.merchant-dashboard-body td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(16, 32, 27, 0.08);
}

.merchant-dashboard-body th {
    color: #718096;
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.merchant-dashboard-body .status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--auth-primary-soft);
    color: var(--auth-primary-dark);
    font-weight: 800;
}

@keyframes merchantRise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes merchantFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes merchantDraw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes merchantDotIn {
    to {
        opacity: 1;
    }
}

@keyframes merchantPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

@keyframes merchantBarGrow {
    to {
        transform: scaleY(1);
    }
}

@keyframes merchantRotateIn {
    from {
        opacity: 0;
        transform: rotate(-120deg) scale(0.8);
    }

    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

@keyframes merchantScaleIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 1180px) {

    .merchant-dashboard-body .metric-grid,
    .merchant-dashboard-body .bottom-grid,
    .merchant-dashboard-body .bottom-grid.compact-section {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .merchant-dashboard-body .analytics-grid {
        grid-template-columns: 1fr;
    }

    .merchant-dashboard-body .dashboard-topbar {
        flex-direction: column;
    }

    .merchant-dashboard-body .topbar-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 1100px) {
    .merchant-dashboard-body .admin-shell {
        grid-template-columns: 1fr;
        width: min(100% - 24px, 1420px);
        margin: 12px auto;
    }
}

@media (max-width: 760px) {
    .merchant-dashboard-body .admin-main {
        padding: 18px;
        border-radius: 24px;
    }

    .merchant-dashboard-body .metric-grid,
    .merchant-dashboard-body .bottom-grid,
    .merchant-dashboard-body .bottom-grid.compact-section,
    .merchant-dashboard-body .bar-chart {
        grid-template-columns: 1fr;
    }

    .merchant-dashboard-body .search-box,
    .merchant-dashboard-body .lang-select,
    .merchant-dashboard-body .admin-profile {
        width: 100%;
        min-width: 0;
    }

    .merchant-dashboard-body .topbar-actions {
        align-items: stretch;
    }

    .merchant-dashboard-body .chart-months {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .merchant-dashboard-body .panel-header,
    .merchant-dashboard-body .preference-item,
    .merchant-dashboard-body .product-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .merchant-dashboard-body th,
    .merchant-dashboard-body td {
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {

    .merchant-dashboard-body .metric-card,
    .merchant-dashboard-body .motion-panel,
    .merchant-dashboard-body .chart-fill,
    .merchant-dashboard-body .chart-line,
    .merchant-dashboard-body .chart-dot,
    .merchant-dashboard-body .bar-fill,
    .merchant-dashboard-body .donut-chart,
    .merchant-dashboard-body .donut-center {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        stroke-dasharray: none !important;
        stroke-dashoffset: 0 !important;
    }
}

/* =========================================================
   Password Rules Indicator
========================================================= */

.password-rules-box {
    margin-top: 10px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.password-rules-title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.password-rules-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.password-rule {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
    font-size: 13px;
    color: #64748b;
    transition: 0.2s ease;
}

.rule-icon {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    background: #e2e8f0;
    color: #64748b;
    transition: 0.2s ease;
}

.password-rule.valid {
    color: #12b886;
    font-weight: 600;
}

.password-rule.valid .rule-icon {
    background: #12b886;
    color: #ffffff;
}

.password-rule.invalid {
    color: #64748b;
}

.confirm-rule {
    margin-top: -6px;
    margin-bottom: 16px;
}

.auth-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

:root[data-theme-mode="dark"] .auth-shell,
:root[data-theme-mode="dark"] .merchant-dashboard-body .dashboard-panel,
:root[data-theme-mode="dark"] .merchant-dashboard-body .metric-card {
    background: rgba(128, 136, 134, 0.50);
    border-color: rgba(189, 223, 208, 0.14);
    box-shadow: 0 28px 72px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(24px) saturate(1.02);
    -webkit-backdrop-filter: blur(24px) saturate(1.02);
}

:root[data-theme-mode="dark"] .merchant-dashboard-body .metric-card.success {
    background: rgba(128, 136, 134, 0.50);
    border-color: rgba(141, 232, 201, 0.18);
}

:root[data-theme-mode="dark"] .merchant-dashboard-body .admin-main {
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

:root[data-theme-mode="dark"] .merchant-dashboard-body {
    color: #eefaf4;
}

:root[data-theme-mode="dark"] .merchant-dashboard-body .page-title h1,
:root[data-theme-mode="dark"] .merchant-dashboard-body .metric-head span,
:root[data-theme-mode="dark"] .merchant-dashboard-body .metric-body h2,
:root[data-theme-mode="dark"] .merchant-dashboard-body .panel-header h3,
:root[data-theme-mode="dark"] .merchant-dashboard-body .panel-value-row strong,
:root[data-theme-mode="dark"] .merchant-dashboard-body td {
    color: #eefaf4;
}

:root[data-theme-mode="dark"] .merchant-dashboard-body .page-title p,
:root[data-theme-mode="dark"] .merchant-dashboard-body .chart-months,
:root[data-theme-mode="dark"] .merchant-dashboard-body .bar-item span,
:root[data-theme-mode="dark"] .merchant-dashboard-body .donut-wrap > p,
:root[data-theme-mode="dark"] .merchant-dashboard-body .preference-item p,
:root[data-theme-mode="dark"] .merchant-dashboard-body .product-row span,
:root[data-theme-mode="dark"] .merchant-dashboard-body th {
    color: rgba(221, 236, 229, 0.84);
}

:root[data-theme-mode="dark"] .merchant-dashboard-body .lang-select summary,
:root[data-theme-mode="dark"] .merchant-dashboard-body .lang-select .lang-select-menu,
:root[data-theme-mode="dark"] .merchant-dashboard-body .search-box,
:root[data-theme-mode="dark"] .merchant-dashboard-body .icon-btn,
:root[data-theme-mode="dark"] .merchant-dashboard-body .admin-profile,
:root[data-theme-mode="dark"] .merchant-dashboard-body .panel-header select,
:root[data-theme-mode="dark"] .merchant-dashboard-body .filter-btn,
:root[data-theme-mode="dark"] .merchant-dashboard-body .plain-icon-btn,
:root[data-theme-mode="dark"] .merchant-dashboard-body .bar-track,
:root[data-theme-mode="dark"] .merchant-dashboard-body .donut-chart::before {
    background: #ffffff;
    color: #10201b;
}

:root[data-theme-mode="dark"] .merchant-dashboard-body .admin-profile strong,
:root[data-theme-mode="dark"] .merchant-dashboard-body .donut-center {
    color: #10201b;
}

:root[data-theme-mode="dark"] .merchant-dashboard-body .admin-profile span,
:root[data-theme-mode="dark"] .merchant-dashboard-body .lang-select .lang-select-menu a {
    color: #5f746b;
}
