/* =============================================================================
   eCRACY Grassroots Democracy — admin panel design system (plain CSS, no build step)
   Civic, trustworthy, colourful: navy (state), green (growth), plus the four
   accent colours used across the mobile app (blue, green, orange, purple).

   Brand pieces, the sign-in hero and dashboard widgets. Loaded after base.css
   (admin/layouts/partials/head.blade.php); colour shades come from base.css tokens.
   ========================================================================== */

:root {
    --ec-navy-950: #061637;
    --ec-navy-900: #0a2463;
    --ec-navy-800: #0b3d91;
    --ec-navy-700: #1550b8;
    --ec-blue: #1e88e5;
    --ec-green: #16a34a;
    --ec-lime: #4ade80;

    --ec-text: #0f172a;
    --ec-text-muted: #64748b;

    --ec-radius: 1rem;
    --ec-card-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 10px 30px -14px rgb(15 23 42 / 0.18);
    --ec-card-shadow-hover: 0 2px 4px rgb(15 23 42 / 0.05), 0 18px 40px -16px rgb(11 61 145 / 0.28);
    --ec-sidebar-bg: linear-gradient(180deg, #071c4d 0%, #0a2463 40%, #0b3d91 100%);
    --ec-brand-gradient: linear-gradient(120deg, #0a2463 0%, #0b3d91 38%, #1e88e5 72%, #16a34a 100%);

    --ec-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --ec-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --ec-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --ec-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    --ec-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ec-transition: color, background-color, border-color, box-shadow, opacity, transform, translate, scale, filter;
}

/* ---------------------------------------------------------------- Tones ---- */
/* Colour pairs for icon chips and their soft glow. Set on the element (or an ancestor):
   .ec-tone--navy, --purple, --violet, --green, --orange, --teal, --rose, --blue. */

.ec-tone--navy { --ec-tone-from: #0b3d91; --ec-tone-to: #1e88e5; --ec-tone-rgb: 56 189 248; }
.ec-tone--purple { --ec-tone-from: #6d28d9; --ec-tone-to: #a78bfa; --ec-tone-rgb: 167 139 250; }
.ec-tone--violet { --ec-tone-from: #7c3aed; --ec-tone-to: #c084fc; --ec-tone-rgb: 167 139 250; }
.ec-tone--green { --ec-tone-from: #15803d; --ec-tone-to: #4ade80; --ec-tone-rgb: 52 211 153; }
.ec-tone--orange { --ec-tone-from: #c2410c; --ec-tone-to: #fb923c; --ec-tone-rgb: 251 146 60; }
.ec-tone--teal { --ec-tone-from: #0f766e; --ec-tone-to: #2dd4bf; --ec-tone-rgb: 45 212 191; }
.ec-tone--rose { --ec-tone-from: #be123c; --ec-tone-to: #fb7185; --ec-tone-rgb: 251 113 133; }
.ec-tone--blue { --ec-tone-from: #1d4ed8; --ec-tone-to: #60a5fa; --ec-tone-rgb: 96 165 250; }

/* ---------------------------------------------------------------- Base ---- */

::selection {
    background: rgb(30 136 229 / 0.25);
}

/* Absolutely positioned decoration (glows, dot patterns, watermarks). */
.ec-decor {
    position: absolute;
    pointer-events: none;
}

/* ---------------------------------------------------------- Logo mark ---- */

.ec-mark {
    display: inline-block;
    flex-shrink: 0;
}

.ec-mark > img {
    display: block;
    object-fit: contain;
}

/* ---------------------------------------------------------------- Brand ---- */

.ec-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1;
    white-space: nowrap;
}

.ec-brand__e {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    color: var(--ec-navy-800);
}

.ec-brand__e i {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 600;
}

.ec-brand__text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* "Grassroots Democracy" under the eCRACY wordmark. */
.ec-brand__tagline {
    font-size: 0.6875rem;
    line-height: 1;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ec-text-muted);
}

/* Letter-spacing breaks Bangla conjuncts. */
.ec-brand__tagline:lang(bn) {
    font-size: 0.75rem;
    letter-spacing: normal;
    text-transform: none;
}

/* Logo mark sits on a white tile so the rust-brown handprint keeps its contrast
   on navy, gradient and dark backgrounds. */
.ec-brand__tile {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    background-color: #fff;
    box-shadow: 0 0 0 1px rgb(15 23 42 / 0.1), var(--ec-shadow-sm);
}

/* Sign-in lockup: logo | eCRACY wordmark over the tagline (see brand-lockup.blade.php). */
.ec-lockup {
    --ec-lockup-size: 96px;
    display: inline-flex;
    align-items: center;
    gap: calc(var(--ec-lockup-size) * 0.2);
}

.ec-lockup--dark .ec-lockup__mark {
    filter: drop-shadow(0 6px 18px rgb(0 0 0 / 0.35));
}

.ec-lockup__divider {
    width: 1px;
    align-self: stretch;
    margin-block: calc(var(--ec-lockup-size) * 0.12);
    background: linear-gradient(to bottom, transparent, currentColor 20%, currentColor 80%, transparent);
    opacity: 0.25;
}

.ec-lockup__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: calc(var(--ec-lockup-size) * 0.09);
}

.ec-lockup__wordmark {
    font-weight: 800;
    white-space: nowrap;
    font-size: calc(var(--ec-lockup-size) * 0.36);
    line-height: 1;
    letter-spacing: 0.01em;
}

/* Serif "e", as in the top-bar wordmark. */
.ec-lockup__wordmark i {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    margin-inline-end: 0.02em;
}

.ec-lockup--light .ec-lockup__wordmark {
    background: linear-gradient(120deg, #0a2463 0%, #0b3d91 45%, #1e88e5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ec-lockup--dark .ec-lockup__wordmark {
    color: #fff;
    text-shadow: 0 6px 24px rgb(0 0 0 / 0.25);
}

.ec-lockup__tagline {
    font-weight: 600;
    letter-spacing: 0.18em;
    white-space: nowrap;
    text-transform: uppercase;
    /* Never smaller than ~11px so it stays legible on the compact card lockup. */
    font-size: max(0.7rem, calc(var(--ec-lockup-size) * 0.085));
}

.ec-lockup__tagline:lang(bn) {
    /* Letter-spacing breaks Bangla conjuncts; use normal spacing and a touch more size instead. */
    letter-spacing: normal;
    text-transform: none;
    font-size: max(1.05rem, calc(var(--ec-lockup-size) * 0.145));
}

.ec-lockup--light .ec-lockup__tagline {
    color: var(--ec-text-muted);
}

.ec-lockup--dark .ec-lockup__tagline {
    color: rgb(255 255 255 / 0.8);
}

.ec-lockup--light .ec-lockup__divider {
    color: #0f172a;
}

.ec-lockup--dark .ec-lockup__divider {
    color: #fff;
}

/* On the navy sidebar the wordmark is always white. */
.ec-sidebar .ec-brand__e {
    color: #fff;
}

.ec-sidebar .ec-brand__tagline {
    color: rgb(224 242 254 / 0.8);
}

/* -------------------------------------------------------------- Sidebar ---- */

/* Sidebar footer note (sidebar-footer.blade.php). */
.ec-sidebar-footer {
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.7rem;
    line-height: 1.625;
    color: rgb(186 230 253 / 0.6);
}

/* --------------------------------------------------------- Auth (login) ---- */
/* Brand hero beside the sign-in form on large screens (auth-hero.blade.php). */

.ec-auth-hero {
    display: none;
}

.ec-auth-hero__dots {
    inset: 0;
    opacity: 0.6;
}

.ec-auth-hero__glow {
    border-radius: 9999px;
    filter: blur(64px);
}

.ec-auth-hero__glow--sky {
    top: -6rem;
    inset-inline-end: -6rem;
    width: 24rem;
    height: 24rem;
    background-color: rgb(56 189 248 / 0.3);
}

.ec-auth-hero__glow--emerald {
    bottom: -8rem;
    inset-inline-start: -4rem;
    width: 28rem;
    height: 28rem;
    background-color: rgb(52 211 153 / 0.25);
}

/* Oversized watermark of the handprint. */
.ec-auth-hero__watermark {
    top: 6rem;
    inset-inline-end: 2.5rem;
    opacity: 0.08;
    filter: brightness(0) invert(1);
}

.ec-auth-hero__brand,
.ec-auth-hero__body,
.ec-auth-hero__footer {
    position: relative;
}

.ec-auth-hero__body {
    max-width: 36rem;
}

.ec-auth-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: rgb(255 255 255 / 0.15);
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.25);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.ec-auth-hero__badge-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background-color: #6ee7b7;
    box-shadow: 0 0 10px rgb(110 231 183);
}

.ec-auth-hero__title {
    margin-top: 1.5rem;
    font-size: 2.25rem;
    line-height: 1.25;
    font-weight: 700;
}

@media (min-width: 80rem) {
    .ec-auth-hero__title {
        font-size: 3rem;
    }
}

.ec-auth-hero__title-accent {
    background-image: linear-gradient(to right, #bae6fd, #fff, #a7f3d0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ec-auth-hero__description {
    margin-top: 1rem;
    max-width: 28rem;
    font-size: 1rem;
    line-height: 1.625;
    color: rgb(255 255 255 / 0.8);
}

.ec-auth-hero__features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    max-width: 32rem;
    margin-top: 2.5rem;
}

.ec-auth-hero__feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 1rem;
    background-color: rgb(255 255 255 / 0.1);
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.15);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.ec-auth-hero__feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background-color: rgb(var(--ec-tone-rgb) / 0.25);
}

.ec-auth-hero__feature-glyph {
    width: 1.25rem;
    height: 1.25rem;
    color: #fff;
}

.ec-auth-hero__feature-label {
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
}

.ec-auth-hero__footer {
    font-size: 0.75rem;
    line-height: 1rem;
    color: rgb(255 255 255 / 0.6);
}

/* ------------------------------------------------- Locale switch (pill) ---- */

.ec-locale-wrap--centered {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

.ec-locale {
    display: inline-flex;
    gap: 0.125rem;
    padding: 0.125rem;
    border-radius: 9999px;
    background-color: rgb(15 23 42 / 0.06);
}

.ec-locale button {
    cursor: pointer;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    line-height: 1.25;
    font-weight: 600;
    color: #475569;
    transition-property: var(--ec-transition);
    transition-duration: 150ms;
    transition-timing-function: var(--ec-ease);
}

.ec-locale button:hover:not([disabled]) {
    color: var(--primary-700);
}

.ec-locale button[aria-pressed='true'] {
    cursor: default;
    background-color: var(--primary-600);
    color: #fff;
    box-shadow: var(--ec-shadow-sm);
}

.ec-locale button:focus-visible {
    outline: 2px solid var(--ec-blue);
    outline-offset: 2px;
}

/* -------------------------------------------------- Shared widget pieces ---- */

.ec-card {
    border-radius: var(--ec-radius);
    background-color: #fff;
    box-shadow: 0 0 0 1px rgb(226 232 240 / 0.8);
}

/* Gradient icon chip; colours come from an .ec-tone--* class. */
.ec-chip-icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 1rem;
    color: #fff;
    background-image: linear-gradient(to bottom right, var(--ec-tone-from), var(--ec-tone-to));
    box-shadow: var(--ec-shadow-lg);
    transition-property: var(--ec-transition);
    transition-duration: 150ms;
    transition-timing-function: var(--ec-ease);
}

.ec-chip-icon__glyph {
    width: 1.25rem;
    height: 1.25rem;
}

.ec-chip-icon__glyph--lg {
    width: 1.5rem;
    height: 1.5rem;
}

.ec-dot-pattern {
    background-image: radial-gradient(rgb(255 255 255 / 0.18) 1px, transparent 1px);
    background-size: 18px 18px;
}

.ec-text-muted {
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: var(--ec-text-muted);
}

/* ------------------------------------------------------ Welcome banner ---- */

.ec-welcome {
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
    border-radius: 1.5rem;
    color: #fff;
    background: var(--ec-brand-gradient);
    box-shadow:
        0 20px 25px -5px color-mix(in oklab, var(--primary-900) 20%, transparent),
        0 8px 10px -6px color-mix(in oklab, var(--primary-900) 20%, transparent);
}

@media (min-width: 40rem) {
    .ec-welcome {
        padding: 2rem;
    }
}

.ec-welcome__dots {
    inset: 0;
    opacity: 0.5;
}

.ec-welcome__glow {
    width: 18rem;
    height: 18rem;
    border-radius: 9999px;
    filter: blur(64px);
}

.ec-welcome__glow--sky {
    top: -5rem;
    inset-inline-end: -4rem;
    background-color: rgb(125 211 252 / 0.3);
}

.ec-welcome__glow--emerald {
    bottom: -6rem;
    inset-inline-end: 33.333333%;
    background-color: rgb(110 231 183 / 0.3);
}

/* Decorative ballot / civic illustration, large screens only. */
.ec-welcome__art {
    display: none;
    bottom: 0;
    inset-inline-end: 1.5rem;
    height: 10rem;
    opacity: 0.9;
}

.ec-welcome__body {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

@media (min-width: 64rem) {
    .ec-welcome__art {
        display: block;
    }

    .ec-welcome__body {
        max-width: 70%;
    }
}

.ec-welcome__identity {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ec-welcome__avatar {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    box-shadow: 0 0 0 4px rgb(255 255 255 / 0.25), var(--ec-shadow-lg);
}

.ec-welcome__date {
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    color: rgb(255 255 255 / 0.75);
}

.ec-welcome__greeting {
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

@media (min-width: 40rem) {
    .ec-welcome__greeting {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }
}

.ec-welcome__subtitle {
    max-width: 42rem;
    font-size: 1rem;
    line-height: 1.5rem;
    color: rgb(255 255 255 / 0.85);
}

.ec-welcome__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.ec-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    line-height: 1rem;
}

.ec-pill--glass {
    font-weight: 600;
    background-color: rgb(255 255 255 / 0.15);
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.25);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.ec-pill--muted {
    font-weight: 500;
    background-color: rgb(0 0 0 / 0.15);
    color: rgb(255 255 255 / 0.85);
}

.ec-pill__icon {
    width: 0.875rem;
    height: 0.875rem;
}

.ec-pill__icon--success {
    color: #6ee7b7;
}

/* --------------------------------------------------------- Stat tiles ---- */

.ec-stat-heading {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    color: var(--ec-text-muted);
}

.ec-stat-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 40rem) {
    .ec-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 80rem) {
    .ec-stat-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.ec-stat {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow: hidden;
    padding: 1.25rem;
    transition-property: var(--ec-transition);
    transition-duration: 200ms;
    transition-timing-function: var(--ec-ease);
}

.ec-stat:hover {
    translate: 0 -0.125rem;
    box-shadow: 0 0 0 1px rgb(226 232 240 / 0.8), var(--ec-card-shadow-hover);
}

.ec-stat:focus-visible,
.ec-quick-action:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

.ec-stat__glow {
    top: -1.5rem;
    inset-inline-end: -1.5rem;
    width: 6rem;
    height: 6rem;
    border-radius: 9999px;
    background-color: rgb(var(--ec-tone-rgb) / 0.2);
    filter: blur(24px);
    transition-property: var(--ec-transition);
    transition-duration: 150ms;
    transition-timing-function: var(--ec-ease);
}

.ec-stat:hover .ec-stat__glow {
    scale: 1.25;
}

.ec-stat__body {
    position: relative;
    min-width: 0;
}

.ec-stat__label,
.ec-stat__value,
.ec-stat__hint {
    display: block;
}

.ec-stat__label {
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    color: var(--ec-text-muted);
}

.ec-stat__value {
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    font-variant-numeric: tabular-nums;
    color: var(--ec-text);
}

.ec-stat__hint {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.75rem;
    line-height: 1rem;
    color: var(--ec-text-muted);
}

.ec-stat__arrow {
    position: absolute;
    top: 1rem;
    inset-inline-end: 1rem;
    width: 1rem;
    height: 1rem;
    color: #cbd5e1;
    transition-property: var(--ec-transition);
    transition-duration: 150ms;
    transition-timing-function: var(--ec-ease);
}

.ec-stat:hover .ec-stat__arrow {
    color: var(--primary-500);
}

/* -------------------------------------------------------- Quick actions ---- */

.ec-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 40rem) {
    .ec-quick-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.ec-quick-action {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 1rem;
    background-color: #f8fafc;
    box-shadow: 0 0 0 1px rgb(226 232 240 / 0.7);
    transition-property: var(--ec-transition);
    transition-duration: 200ms;
    transition-timing-function: var(--ec-ease);
}

.ec-quick-action:hover {
    translate: 0 -0.125rem;
    background-color: #fff;
    box-shadow: 0 0 0 1px rgb(226 232 240 / 0.7), var(--ec-card-shadow-hover);
}

.ec-quick-action:hover .ec-chip-icon {
    scale: 1.05;
}

.ec-quick-action__label {
    display: block;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
    color: var(--ec-text);
}

.ec-quick-action__description {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.75rem;
    line-height: 1.375;
    color: var(--ec-text-muted);
}

/* ---------------------------------------------------------- Your access ---- */

.ec-access-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ec-access-count {
    margin-inline-start: 0.25rem;
    opacity: 0.6;
    font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------ Page-load progress bar ---- */
/* SPA navigation bar (navigation-progress.blade.php): brand gradient, grows from the left. */

.ec-progress {
    position: fixed;
    inset-inline: 0;
    top: 0;
    z-index: 9999;
    height: 3px;
    background: var(--ec-brand-gradient);
    box-shadow: 0 0 10px rgb(30 136 229 / 0.55);
    transform: scaleX(0);
    transform-origin: left;
    opacity: 0;
    pointer-events: none;
    transition:
        transform 0.25s ease-out,
        opacity 0.2s ease;
}

.ec-progress--active {
    opacity: 1;
}

.ec-progress--done {
    opacity: 0;
    transition:
        transform 0.2s ease-out,
        opacity 0.3s ease 0.2s;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}
