/* ==========================================================================
   Self-hosted fonts (Editorial Mono typography system)
   ========================================================================== */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/montserrat-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/montserrat-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Lora';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/lora-400-italic.woff2') format('woff2');
}
@font-face {
    font-family: 'Hind Madurai';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('../fonts/hind-madurai-300.woff2') format('woff2');
}

/* ==========================================================================
   Editorial Mono — shared restyle for /history /account /subscriptions /report
   Everything is scoped under .ek-page so it never leaks to the rest of the site.
   ========================================================================== */

.ek-page {
    --ek-ink: #111111;
    --ek-ink-soft: #6b6b6b;
    --ek-faint: #9a9a9a;
    --ek-line: #e5e5e5;
    --ek-rule: #111111;
    --ek-paper: #ffffff;
    --ek-surface: #fafafa;
    --ek-brand: #515459;
    --ek-ok: #28a745;
    --ek-danger: #dc3545;
    /* Typography system: title=Montserrat700, subtitle=Lora italic, body=Hind Madurai300, label=Montserrat600 */
    --ek-font-title: 'Montserrat', system-ui, sans-serif;
    --ek-font-subtitle: 'Lora', Georgia, serif;
    --ek-font-body: 'Hind Madurai', system-ui, sans-serif;
    --ek-serif: var(--ek-font-body);
    --ek-mono: 'Montserrat', system-ui, sans-serif;

    font-family: var(--ek-font-body);
    font-weight: 300;
    color: var(--ek-ink);
    background: var(--ek-paper);
}

/* ---- Typography primitives ---------------------------------------------- */
.ek-page .ek-eyebrow {
    font-family: var(--ek-mono);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: .10em;
    text-transform: uppercase;
    color: var(--ek-faint);
    margin: 0;
}

.ek-page .ek-title {
    font-family: var(--ek-font-title);
    font-weight: 700;
    font-size: 22px;
    color: var(--ek-ink);
    margin: 0 0 14px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--ek-rule);
}

.ek-page .ek-subtitle {
    font-family: var(--ek-font-subtitle);
    font-style: italic;
    color: var(--ek-ink-soft);
    font-size: 14px;
    margin: 2px 0 0 0;
}

/* ---- Stat tiles ---------------------------------------------------------- */
.ek-page .ek-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    border: 1px solid var(--ek-line);
    border-right: 0;
    border-bottom: 0;
    margin: 0 0 18px 0;
    background: var(--ek-paper);
}
@media (max-width: 640px) {
    .ek-page .ek-tile-grid { grid-template-columns: repeat(2, 1fr); }
}

.ek-page .ek-tile {
    border-right: 1px solid var(--ek-line);
    border-bottom: 1px solid var(--ek-line);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 76px;
}
.ek-page .ek-tile__label {
    font-family: var(--ek-mono);
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ek-faint);
}
.ek-page .ek-tile__value {
    font-family: var(--ek-font-title);
    font-size: 22px;
    font-weight: 700;
    color: var(--ek-ink);
    line-height: 1.1;
}
.ek-page .ek-tile__value--danger { color: var(--ek-danger); }

/* ---- Flat table skin (also used to skin SfGrid/RadzenDataGrid) ---------- */
.ek-page .ek-table { width: 100%; border-collapse: collapse; }
.ek-page .ek-table thead th {
    font-family: var(--ek-mono);
    font-size: 10px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ek-faint);
    text-align: left;
    padding: 8px 10px;
    border-bottom: 2px solid var(--ek-rule);
    background: var(--ek-paper);
}
.ek-page .ek-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--ek-line);
    font-size: 13px;
    color: var(--ek-ink);
}
.ek-page .ek-table tbody tr:hover { background: var(--ek-surface); }

/* ---- Buttons ------------------------------------------------------------- */
.ek-page .ek-btn,
.ek-page .ek-btn--outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--ek-mono);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 8px 14px;
    border-radius: 0;
    border: 1px solid var(--ek-ink);
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
}
.ek-page .ek-btn { background: var(--ek-ink); color: #fff; }
.ek-page .ek-btn:hover { background: var(--ek-brand); border-color: var(--ek-brand); }
.ek-page .ek-btn--outline { background: transparent; color: var(--ek-ink); }
.ek-page .ek-btn--outline:hover { background: var(--ek-surface); }

/* ---- Panel (square bordered container) ---------------------------------- */
.ek-page .ek-panel {
    border: 1px solid var(--ek-line);
    border-radius: 0;
    background: var(--ek-paper);
    box-shadow: none;
}

/* ==========================================================================
   Vendor overrides — all scoped under .ek-page
   ========================================================================== */

/* kill rounded/shadow chrome generally */
.ek-page .shadow,
.ek-page .shadow-sm,
.ek-page .shadow-md,
.ek-page .shadow-lg { box-shadow: none !important; }
.ek-page .rounded,
.ek-page .rounded-2,
.ek-page .rounded-3,
.ek-page .rounded-lg,
.ek-page .rounded-md { border-radius: 0 !important; }

/* ---- Syncfusion SfCard --------------------------------------------------- */
.ek-page .e-card {
    border-radius: 0 !important;
    box-shadow: none !important;
    border: 1px solid var(--ek-line) !important;
    background: var(--ek-paper) !important;
}
/* history card header was bg-primary blue + white text -> editorial title band */
.ek-page .e-card .e-card-header,
.ek-page .e-card .e-card-header-caption { background: var(--ek-paper) !important; }

/* ---- Syncfusion SfTab (history tabs) ------------------------------------- */
.ek-page .e-tab .e-tab-header { background: var(--ek-paper); border-bottom: 1px solid var(--ek-line); }
.ek-page .e-tab .e-tab-header .e-toolbar-item .e-tab-text {
    font-family: var(--ek-mono);
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ek-ink-soft);
}
.ek-page .e-tab .e-tab-header .e-toolbar-item.e-active .e-tab-text { color: var(--ek-ink); }
.ek-page .e-tab .e-tab-header .e-indicator { background: var(--ek-ink) !important; }

/* ---- Syncfusion SfGrid (history + account + branch grids) ---------------- */
.ek-page .e-grid { border: 1px solid var(--ek-line); border-radius: 0; }
.ek-page .e-grid .e-headercell {
    background: var(--ek-paper) !important;
    border-bottom: 2px solid var(--ek-rule) !important;
}
.ek-page .e-grid .e-headercelldiv,
.ek-page .e-grid .e-headertext {
    font-family: var(--ek-mono) !important;
    font-size: 10px !important;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ek-faint) !important;
}
.ek-page .e-grid .e-rowcell {
    border-bottom: 1px solid var(--ek-line) !important;
    color: var(--ek-ink);
}
.ek-page .e-grid .e-altrow { background: var(--ek-surface) !important; }
.ek-page .e-grid .e-row:hover .e-rowcell { background: var(--ek-surface) !important; }

/* ---- Syncfusion inputs / datepicker -------------------------------------- */
.ek-page .e-input-group,
.ek-page .e-input-group.e-control-wrapper {
    border-radius: 0 !important;
    border: 1px solid var(--ek-line) !important;
}
.ek-page .e-input-group::before,
.ek-page .e-input-group::after { display: none !important; }

/* ---- Syncfusion button group (report toggle) ----------------------------- */
.ek-page .e-btn-group .e-btn,
.ek-page .e-btn-group .e-btn.e-flat {
    border-radius: 0 !important;
    border: 1px solid var(--ek-line);
    background: var(--ek-paper);
    color: var(--ek-ink);
    font-family: var(--ek-mono);
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.ek-page .e-btn-group .e-btn.e-active,
.ek-page .e-btn-group .e-btn:active {
    background: var(--ek-ink) !important;
    color: #fff !important;
    border-color: var(--ek-ink) !important;
}

/* ---- Syncfusion dashboard panels (report) -------------------------------- */
.ek-page .e-dashboardlayout .e-panel {
    border: 1px solid var(--ek-line) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.ek-page .e-dashboardlayout .e-panel .e-panel-header {
    background: var(--ek-paper) !important;
    border-bottom: 1px solid var(--ek-line);
    font-family: var(--ek-mono);
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ek-ink);
}

/* ---- Radzen DataGrid (subscriptions) ------------------------------------- */
.ek-page .rz-data-grid,
.ek-page .rz-grid-table { border-radius: 0 !important; }
.ek-page .rz-grid-table thead th,
.ek-page .rz-data-grid .rz-column-title {
    font-family: var(--ek-mono) !important;
    font-size: 10px !important;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ek-faint) !important;
    border-bottom: 2px solid var(--ek-rule) !important;
    background: var(--ek-paper) !important;
}
.ek-page .rz-grid-table tbody td {
    border-bottom: 1px solid var(--ek-line) !important;
    color: var(--ek-ink);
}
.ek-page .rz-grid-table tbody tr:hover { background: var(--ek-surface) !important; }
.ek-page .rz-button {
    border-radius: 0 !important;
    font-family: var(--ek-mono);
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* ---- History progress bars (picking/packing) — scoped 2-tone recolor ----- */
.ek-page .progress { border-radius: 0 !important; background: var(--ek-line) !important; }
.ek-page .progress-bar { border-radius: 0 !important; }
.ek-page .progress-bar.bg-bar1,
.ek-page .progress-bar.picking { background-color: var(--ek-ink) !important; color: #fff !important; }
.ek-page .progress-bar.bg-bar2,
.ek-page .progress-bar.packing { background-color: var(--ek-faint) !important; color: #fff !important; }
.ek-page .progress-bar { font-family: var(--ek-mono) !important; }

/* ==========================================================================
   /admin — action tiles + Radzen admin-dialog skin
   ========================================================================== */

/* ---- Action tile (clickable admin action) -------------------------------- */
.ek-page .ek-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin: 14px 0 24px 0;
}

.ek-page .ek-action {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid var(--ek-ink);
    border-radius: 0;
    background: var(--ek-paper);
    padding: 16px 18px;
    cursor: pointer;
    text-align: left;
    min-height: 84px;
    transition: background .12s ease, color .12s ease;
}

    .ek-page .ek-action:hover {
        background: var(--ek-ink);
        color: #fff;
    }

.ek-page .ek-action__label {
    font-family: var(--ek-mono);
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: inherit;
}

.ek-page .ek-action__caption {
    font-family: var(--ek-font-subtitle);
    font-style: italic;
    font-size: 12px;
    color: var(--ek-ink-soft);
}

.ek-page .ek-action:hover .ek-action__caption {
    color: #d6d6d6;
}

.ek-page .ek-tab-section {
    padding: 8px 2px 0 2px;
}

    .ek-page .ek-tab-section .ek-eyebrow {
        margin-bottom: 6px;
    }

/* ---- Radzen admin-dialog skin (scoped to each admin dialog root) ---------- */
.ek-admin-dialog {
    --ek-ink: #111111;
    --ek-ink-soft: #6b6b6b;
    --ek-faint: #9a9a9a;
    --ek-line: #e5e5e5;
    --ek-brand: #515459;
    --ek-font-title: 'Montserrat', system-ui, sans-serif;
    --ek-font-subtitle: 'Lora', Georgia, serif;
    --ek-font-body: 'Hind Madurai', system-ui, sans-serif;
    --ek-serif: var(--ek-font-body);
    --ek-mono: 'Montserrat', system-ui, sans-serif;
    font-family: var(--ek-font-body);
    font-weight: 300;
    color: var(--ek-ink);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    height: 100%;
    width: 100%;
}

    /* search bar + its dropdown span full dialog width */
    .ek-admin-dialog .rz-autocomplete,
    .ek-admin-dialog .rz-autocomplete .rz-inputtext {
        width: 100% !important;
    }

    /* responsive image thumbnail grid — fit many without scrolling */
    .ek-admin-dialog .ek-img-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }

    .ek-admin-dialog .ek-img-card {
        position: relative;
        height: 140px;
        border: 1px solid var(--ek-line);
    }

        .ek-admin-dialog .ek-img-card img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            background: #f5f5f5;
        }

    /* cap preview images (product / clas dialogs) so they fit above the footer */
    .ek-admin-dialog .product-details img,
    .ek-admin-dialog .upload-section img {
        max-height: 240px;
        object-fit: contain;
    }

    /* scrollable middle region */
    .ek-admin-dialog .ek-dialog-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* pinned footer (uploader + action buttons) */
    .ek-admin-dialog .ek-dialog-footer {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        gap: 10px;
        border-top: 1px solid var(--ek-line);
        padding-top: 12px;
        margin-top: 12px;
    }

        /* actions row inside footer: drop its own divider, keep right-align */
        .ek-admin-dialog .ek-dialog-footer .ek-dialog-actions {
            margin-top: 0;
            padding-top: 0;
            border-top: 0;
        }

    .ek-admin-dialog .ek-eyebrow {
        font-family: var(--ek-mono);
        font-size: 11px;
        letter-spacing: .10em;
        text-transform: uppercase;
        color: var(--ek-faint);
        margin: 0 0 10px 0;
    }

    .ek-admin-dialog .ek-btn,
    .ek-admin-dialog .ek-btn--outline {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-family: var(--ek-mono);
        font-size: 11px;
        letter-spacing: .06em;
        text-transform: uppercase;
        padding: 8px 14px;
        border-radius: 0;
        border: 1px solid var(--ek-ink);
        cursor: pointer;
        line-height: 1;
    }

    .ek-admin-dialog .ek-btn {
        background: var(--ek-ink);
        color: #fff;
    }

        .ek-admin-dialog .ek-btn:hover {
            background: var(--ek-brand);
            border-color: var(--ek-brand);
        }

    .ek-admin-dialog .ek-btn--outline {
        background: transparent;
        color: var(--ek-ink);
    }

        .ek-admin-dialog .ek-btn--outline:hover {
            background: var(--ek-surface, #fafafa);
        }

    .ek-admin-dialog .ek-dialog-actions {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        margin-top: 16px;
        padding-top: 12px;
        border-top: 1px solid var(--ek-line);
    }
    /* square the Syncfusion uploader dropzone inside admin dialogs */
    .ek-admin-dialog .e-upload {
        border-radius: 0 !important;
        border: 1px dashed var(--ek-line) !important;
    }

    .ek-admin-dialog .e-input-group {
        border-radius: 0 !important;
        border: 1px solid var(--ek-line) !important;
    }

        .ek-admin-dialog .e-input-group::before,
        .ek-admin-dialog .e-input-group::after {
            display: none !important;
        }

/* ==========================================================================
   Brand-restriction side drawer (UsersPanel) — Editorial Mono
   ========================================================================== */
.brands-drawer {
    --ek-ink: #111111;
    --ek-line: #e5e5e5;
    --ek-faint: #9a9a9a;
    --ek-font-title: 'Montserrat', system-ui, sans-serif;
    --ek-font-body: 'Hind Madurai', system-ui, sans-serif;
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    height: 100vh;
    background: #ffffff;
    border-left: 1px solid var(--ek-ink);
    box-shadow: none;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    font-family: var(--ek-font-body);
    font-weight: 300;
    color: var(--ek-ink);
}

.brands-drawer--open {
    transform: translateX(0);
}

.brands-drawer__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, 0.35);
    z-index: 1040;
}

.brands-drawer__header {
    padding: 16px 20px;
    border-bottom: 2px solid var(--ek-ink);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--ek-font-title);
    font-weight: 700;
}

    .brands-drawer__header h5 {
        font-family: var(--ek-font-title);
        font-weight: 700;
        font-size: 14px;
        margin: 0;
    }

.brands-drawer__body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.brands-drawer__footer {
    padding: 0 20px 20px;
}

@media (max-width: 768px) {
    .brands-drawer {
        width: 100%;
    }
}
