/* =========================================================
   SAFAL AGENCY - CUSTOMER PORTAL THEME (Final)
   Clean • Modern • Mobile-first
   ========================================================= */

:root {
    --cp-blue: #0757b5;
    --cp-blue-dark: #06438c;
    --cp-blue-light: #0878c5;
    --cp-green: #16823b;
    --cp-red: #c62828;
    --cp-orange: #e67e22;
    --cp-bg: #f4f7fa;
    --cp-card: #ffffff;
    --cp-border: #dfe6ee;
    --cp-text: #172033;
    --cp-text-2: #334155;
    --cp-muted: #64748b;
    --cp-radius: 12px;
    --cp-shadow: 0 2px 10px rgba(15,23,42,.06);
    --cp-shadow-lg: 0 10px 30px rgba(15,23,42,.10);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    background: var(--cp-bg);
    color: var(--cp-text);
    -webkit-font-smoothing: antialiased;
}

/* =========================
   AUTH PAGES
   ========================= */
.cp-auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 14px;
    background: linear-gradient(135deg, #0757b5 0%, #0878c5 55%, #06438c 100%);
    position: relative;
    overflow: hidden;
}
.cp-auth-wrap::before,
.cp-auth-wrap::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    pointer-events: none;
    z-index: 0;
}
.cp-auth-wrap::before { width: 420px; height: 420px; top: -180px; right: -140px; }
.cp-auth-wrap::after  { width: 320px; height: 320px; bottom: -140px; left: -100px; }

.cp-auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 18px;
    padding: 32px 28px;
    box-shadow: 0 25px 60px rgba(0,0,0,.25);
    position: relative;
    z-index: 1;
    animation: cpFadeIn .45s ease;
}
.cp-auth-card.wide { max-width: 520px; }

@keyframes cpFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cp-brand { text-align: center; margin-bottom: 22px; }
.cp-brand-logo {
    width: 68px; height: 68px;
    border-radius: 18px;
    background: linear-gradient(135deg, #0757b5, #0878c5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 28px;
    box-shadow: 0 10px 24px rgba(7,87,181,.30);
}
.cp-brand h1 {
    margin: 0;
    color: #172033;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.3px;
}
.cp-brand p {
    margin: 6px 0 0;
    color: var(--cp-muted);
    font-size: 12.5px;
}

/* =========================
   FORM FIELDS
   ========================= */
.cp-field { margin-bottom: 14px; }

.cp-field label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.cp-field label .req { color: #dc2626; }

.cp-input-wrap {
    position: relative;
    width: 100%;
    display: block;
}
.cp-input-wrap .cp-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 15px;
    line-height: 1;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
}

.cp-input,
.cp-select,
.cp-textarea,
input[type=text],
input[type=password],
input[type=number],
input[type=email],
input[type=tel],
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1.5px solid #d4dce6;
    border-radius: 10px;
    background: #fff;
    font-size: 13.5px;
    color: var(--cp-text);
    font-family: inherit;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}
.cp-input-wrap .cp-input { padding-left: 46px; }

.cp-textarea,
textarea { min-height: 90px; resize: vertical; }

.cp-input:focus,
.cp-select:focus,
.cp-textarea:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--cp-blue);
    box-shadow: 0 0 0 4px rgba(7,87,181,.10);
}

input::-ms-reveal,
input::-ms-clear { display: none; }

/* =========================
   BUTTONS
   ========================= */
.cp-btn {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .3px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform .15s, box-shadow .15s, background .18s;
    text-decoration: none;
}
.cp-btn:active { transform: translateY(0); }

.cp-btn-primary {
    background: linear-gradient(135deg, var(--cp-blue), var(--cp-blue-light));
    color: #fff;
    box-shadow: 0 8px 20px rgba(7,87,181,.30);
}
.cp-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(7,87,181,.38);
}

.cp-btn-secondary {
    background: #f1f4f8;
    color: #334155;
    border: 1px solid #d9e0e8;
}
.cp-btn-secondary:hover { background: #e7edf4; }

/* =========================
   OPTIONS ROW
   ========================= */
.cp-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 6px 0 16px;
    font-size: 12px;
    color: var(--cp-text-2);
}
.cp-options a {
    color: var(--cp-blue);
    text-decoration: none;
    font-weight: 700;
}
.cp-options a:hover { text-decoration: underline; }

.cp-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    user-select: none;
}
.cp-checkbox input[type=checkbox] {
    width: 16px !important;
    height: 16px !important;
    min-height: 0 !important;
    accent-color: var(--cp-blue);
    cursor: pointer;
}

/* =========================
   MESSAGES
   ========================= */
.cp-message {
    display: block;
    margin-top: 14px;
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    text-align: center;
    border-left: 4px solid;
}
.cp-message.error {
    background: #fdecec;
    color: var(--cp-red);
    border-color: var(--cp-red);
}
.cp-message.success {
    background: #e7f5ed;
    color: var(--cp-green);
    border-color: var(--cp-green);
}
.cp-message:empty { display: none; }

/* =========================
   FOOTER LINKS
   ========================= */
.cp-register {
    text-align: center;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #eef2f7;
    font-size: 12.5px;
    color: var(--cp-muted);
}
.cp-register a {
    display: inline-block;
    color: var(--cp-blue);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    margin-top: 5px;
}
.cp-register a:hover { text-decoration: underline; }

.cp-auth-footer {
    text-align: center;
    margin-top: 20px;
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.6;
}
.cp-auth-footer strong {
    color: var(--cp-blue);
    font-weight: 800;
    letter-spacing: .4px;
}

/* =========================
   NOTE BOX
   ========================= */
.cp-note {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 11px 13px;
    font-size: 11.5px;
    color: var(--cp-muted);
    line-height: 1.55;
}

/* =========================
   REGISTRATION GRID
   ========================= */
.cp-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.cp-form-grid .full { grid-column: 1 / -1; }

@media (max-width: 520px) {
    .cp-form-grid { grid-template-columns: 1fr; }
    .cp-form-grid .full { grid-column: auto; }
    .cp-auth-card { padding: 26px 20px; }
    .cp-auth-card.wide { max-width: 100%; }
    .cp-brand-logo { width: 60px; height: 60px; font-size: 24px; }
    .cp-brand h1 { font-size: 19px; }
}

/* =========================================================
   PORTAL APP STYLES
   ========================================================= */
.cp-app {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    background: #f4f7fa;
     padding-bottom: 120px !important;
    position: relative;
}

/* =========================
   HEADER
   ========================= */
.cp-header {
    height: 60px;
    background: linear-gradient(135deg, #0757b5, #0878c5);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(15,23,42,.15);
}
.cp-header-title {
    flex: 1;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: .3px;
    line-height: 1.15;
}
.cp-header-title small {
    display: block;
    font-size: 10px;
    font-weight: 500;
    opacity: .85;
    margin-top: 2px;
}
.cp-header-btn {
    width: 40px;
    height: 40px;
    border: 0;
    background: rgba(255,255,255,.10);
    color: #fff;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    position: relative;
}
.cp-header-btn:hover { background: rgba(255,255,255,.20); }

.cp-header-cart {
    position: relative;
    width: 40px;
    height: 40px;
    border: 0;
    background: rgba(255,255,255,.10);
    color: #fff;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.cp-header-cart:hover { background: rgba(255,255,255,.20); }

.cp-cart-badge {
    position: absolute;
    top: 4px; right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ef4444;
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid #0757b5;
}
.cp-cart-badge.show { display: flex; }

.cp-notif-dot {
    position: absolute;
    top: 8px; right: 8px;
    width: 8px; height: 8px;
    background: #ff5252;
    border-radius: 50%;
    border: 2px solid #0757b5;
}

/* =========================
   CUSTOMER BOX
   ========================= */
.cp-customer {
    background: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #e5eaf0;
}
.cp-customer-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: #e8f5ee;
    color: #16823b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.cp-customer-details { flex: 1; min-width: 0; }
.cp-customer-name {
    font-size: 14px;
    font-weight: 800;
    color: #172033;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cp-customer-category {
    font-size: 10.5px;
    color: #0757b5;
    font-weight: 700;
    margin-top: 3px;
}
.cp-customer-code {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
}
.cp-rate-date {
    background: #edf7ff;
    border: 1px solid #cfe8fa;
    border-radius: 9px;
    padding: 8px 10px;
    min-width: 88px;
    text-align: center;
    font-size: 9.5px;
    color: #475569;
    line-height: 1.2;
    flex-shrink: 0;
}
.cp-rate-date strong {
    display: block;
    color: #0757b5;
    font-size: 11.5px;
    font-weight: 800;
    margin-top: 3px;
}

/* =========================
   SEARCH
   ========================= */
.cp-search-bar {
    background: #fff;
    padding: 10px 12px;
    display: flex;
    gap: 8px;
}
.cp-search-wrap {
    flex: 1;
    position: relative;
    display: block;
}
.cp-search-input {
    width: 100% !important;
    height: 42px !important;
    border: 1px solid #d8e1e8 !important;
    border-radius: 22px !important;
    padding: 0 14px 0 42px !important;
    font-size: 12.5px !important;
    outline: none !important;
    background: #f8fafc !important;
    transition: all .2s !important;
    line-height: 42px !important;
    box-sizing: border-box !important;
    color: #172033 !important;
}
.cp-search-input::placeholder {
    color: #94a3b8 !important;
    font-size: 12.5px;
}
.cp-search-input:focus {
    border-color: #0757b5 !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(7,87,181,.08) !important;
}
.cp-search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 13px;
    pointer-events: none;
    z-index: 2;
    line-height: 1;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cp-filter-btn {
    width: 86px;
    height: 42px;
    border: 1px solid #d8e1e8;
    border-radius: 22px;
    background: #fff;
    color: #334155;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all .18s;
    flex-shrink: 0;
}
.cp-filter-btn:hover {
    background: #edf7ff;
    border-color: #0757b5;
    color: #0757b5;
}

/* =========================
   CATEGORY CAROUSEL
   ========================= */
.cp-categories {
    background: #fff;
    padding: 6px 12px 12px;
}
.cp-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.cp-section-title {
    font-size: 13px;
    font-weight: 800;
    color: #172033;
}
.cp-section-link {
    font-size: 10.5px;
    color: #0757b5;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.cp-section-link:hover { text-decoration: underline; }

.cp-cat-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.cp-cat-scroll::-webkit-scrollbar { display: none; }

.cp-cat-btn {
    flex: 0 0 78px;
    height: 82px;
    background: #fff;
    border: 1.5px solid #e1e7ed;
    border-radius: 12px;
    padding: 8px 4px;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,.04);
    cursor: pointer;
    transition: all .18s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
}
.cp-cat-btn:hover {
    border-color: #0757b5;
    background: #edf7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(7,87,181,.15);
}
.cp-cat-btn.active,
.cp-cat-btn-active {
    border-color: #0757b5 !important;
    border-width: 2px !important;
    background: #edf7ff !important;
    box-shadow: 0 4px 12px rgba(7,87,181,.20) !important;
}
.cp-cat-btn.active::after,
.cp-cat-btn-active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: #0757b5;
    border-radius: 3px 3px 0 0;
}

.cp-cat-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: #f2f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    color: #0757b5;
}
.cp-cat-name {
    display: block;
    color: #273444;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    padding: 0 3px;
}

/* =========================
   TABS (Rate / Most Ordered)
   ========================= */
.cp-tabs {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: #f4f7fa;
}

.cp-tabs > a {
    flex: 1;
    text-decoration: none !important;
    border: 0;
    outline: 0;
    padding: 0;
    background: transparent;
    display: block;
}
.cp-tabs > a:hover,
.cp-tabs > a:focus {
    text-decoration: none !important;
}

.cp-tab {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 11px 8px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 700;
    text-align: center;
    border: 1px solid transparent;
    transition: all .18s;
    cursor: pointer;
    line-height: 1.3;
    color: #334155;
    background: #fff;
    border-color: #dbe3ec;
}

.cp-tab-active {
    background: #0757b5 !important;
    color: #fff !important;
    border-color: #0757b5 !important;
    box-shadow: 0 3px 8px rgba(7,87,181,.25) !important;
}
.cp-tab-default {
    background: #fff !important;
    color: #334155 !important;
    border-color: #dbe3ec !important;
}
.cp-tab-default:hover {
    background: #edf7ff !important;
    border-color: #0757b5 !important;
    color: #0757b5 !important;
}
.cp-tab-most {
    background: #fff4dc !important;
    color: #a76500 !important;
    border-color: #ffe3ad !important;
}
.cp-tab-most:hover {
    background: #ffeab8 !important;
}

/* =========================
   SUBCATEGORY CHIPS
   ========================= */
.cp-subcats {
    padding: 6px 12px 12px;
    background: #f4f7fa;
}
.cp-subcats-title {
    font-size: 11px;
    font-weight: 800;
    color: #536273;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.cp-subcats-scroll {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.cp-subcats-scroll::-webkit-scrollbar { display: none; }

.cp-subcat-chip {
    flex: 0 0 auto;
    padding: 7px 14px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #d9e2e9;
    color: #536273;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
}
.cp-subcat-chip:hover,
.cp-subcat-chip.active {
    border-color: #0757b5;
    color: #0757b5;
    background: #edf7ff;
}

/* =========================
   PRODUCT LIST (CARD STYLE — same as Order page)
   ========================= */
.cp-products-list {
    padding: 6px 12px 12px;
}

.cp-products-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 2px 10px;
}
.cp-products-title h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: #172033;
}
.cp-products-title .cp-count {
    font-size: 10.5px;
    color: #64748b;
}

/* Product card */
.cp-product-card {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    margin-bottom: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
    transition: box-shadow .18s;
}
.cp-product-card:hover {
    box-shadow: 0 4px 12px rgba(7,87,181,.10);
}

.cp-product-card .cp-product-image {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 10px;
    background: #f7f9fb;
    border: 1px solid #edf0f3;
    flex-shrink: 0;
}

.cp-product-card .cp-product-details {
    flex: 1;
    min-width: 0;
}
.cp-product-card .cp-product-title {
    font-size: 13px;
    font-weight: 800;
    color: #172033;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cp-product-card .cp-product-code {
    font-size: 9.5px;
    color: #94a3b8;
    margin-top: 2px;
}
.cp-product-card .cp-product-packing {
    font-size: 10.5px;
    color: #64748b;
    margin-top: 4px;
}
.cp-product-card .cp-product-price {
    color: #0757b5;
    font-size: 14.5px;
    font-weight: 800;
    margin-top: 3px;
}

/* Most Ordered badge */
.cp-product-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #fff4dc;
    color: #a76500;
    font-size: 9px;
    font-weight: 800;
    margin-left: 6px;
    vertical-align: middle;
}

/* Qty stepper */
.cp-qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #0757b5;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.cp-qty-stepper button {
    width: 32px;
    height: 34px;
    border: 0;
    background: #0757b5;
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.cp-qty-stepper button:hover { background: #06438c; }
.cp-qty-stepper button:active { background: #052f66; }

.cp-qty-stepper .cp-qty-display {
    width: 34px;
    height: 34px;
    line-height: 34px;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    color: #0757b5;
    background: #fff;
}

/* Add button */
.cp-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 34px;
    padding: 0 14px;
    border: 1.5px solid #0757b5;
    background: #fff;
    color: #0757b5;
    border-radius: 22px;
    font-size: 11.5px;
    font-weight: 800;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.cp-add-btn:hover {
    background: #0757b5;
    color: #fff;
}
.cp-add-btn i { font-size: 11px; }

/* =========================
   EMPTY STATE
   ========================= */
.cp-empty {
    background: #fff;
    border-radius: 12px;
    padding: 42px 18px;
    text-align: center;
    color: #718096;
    font-size: 12.5px;
    line-height: 1.6;
}
.cp-empty i {
    font-size: 36px;
    color: #cbd5e1;
    display: block;
    margin-bottom: 14px;
}

/* =========================
   BOTTOM NAV
   ========================= */
.cp-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 72px;
    background: #fff;
    border-top: 1px solid #dce3e9;
    display: flex;
    z-index: 200;
    box-shadow: 0 -2px 12px rgba(0,0,0,.06);
}
.cp-nav-item {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: #7a8794;
    font-size: 9.5px;
    font-weight: 600;
    padding-top: 9px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    transition: color .18s;
    position: relative;
}
.cp-nav-item i,
.cp-nav-icon {
    font-size: 20px;
    line-height: 1;
    display: block;
}
.cp-nav-item:hover { color: #0757b5; }
.cp-nav-item.active {
    color: #0757b5;
    font-weight: 800;
}
.cp-nav-item.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: #0757b5;
    border-radius: 0 0 3px 3px;
}

.cp-nav-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translateX(20px);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #c62828;
    color: #fff;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 800;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    z-index: 2;
}
.cp-nav-badge.show { display: flex; }

/* =========================
   FLOATING CART BAR
   ========================= */
.cp-floating-cart {
    position: fixed;
    bottom: 84px;
    left: 50%;
    transform: translateX(-50%) translateY(200%);
    width: calc(100% - 24px);
    max-width: 456px;
    background: linear-gradient(135deg, #0757b5, #0878c5);
    color: #fff;
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 12px 32px rgba(7,87,181,.40);
    z-index: 199;
    transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
.cp-floating-cart.show {
    transform: translateX(-50%) translateY(0);
}

.cp-cart-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: rgba(255,255,255,.20);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    position: relative;
}

.cp-cart-count {
    position: absolute;
    top: -6px; right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: #f0a500;
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.cp-cart-info { flex: 1; min-width: 0; }
.cp-cart-items {
    font-size: 11px;
    font-weight: 600;
    opacity: .9;
}
.cp-cart-total {
    font-size: 15px;
    font-weight: 800;
    margin-top: 2px;
}

.cp-cart-view-btn {
    padding: 9px 16px;
    background: #fff;
    color: #0757b5;
    border: 0;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform .15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.cp-cart-view-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0,0,0,.15);
}

/* =========================
   TOAST
   ========================= */
.cp-toast {
    position: fixed;
    bottom: 160px;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    background: #172033;
    color: #fff;
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 320px;
}
.cp-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.cp-toast i { color: #4ade80; }

/* =========================
   FILTER PANEL
   ========================= */
.cp-filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    z-index: 490;
    display: none;
    opacity: 0;
    transition: opacity .25s;
}
.cp-filter-overlay.show {
    display: block;
    opacity: 1;
}

.cp-filter-panel {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 480px;
    background: #fff;
    z-index: 500;
    border-radius: 20px 20px 0 0;
    padding: 20px 18px 24px;
    box-shadow: 0 -8px 30px rgba(15,23,42,.20);
    transition: transform .28s ease;
}
.cp-filter-panel.show {
    transform: translateX(-50%) translateY(0);
}
.cp-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.cp-filter-title {
    font-size: 17px;
    font-weight: 800;
    color: #172033;
}
.cp-filter-close {
    width: 32px; height: 32px;
    border: 0;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 15px;
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .18s;
}
.cp-filter-close:hover { background: #e2e8f0; }

.cp-filter-label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.cp-filter-select {
    width: 100%;
    height: 46px;
    border: 1.5px solid #dce3e8;
    border-radius: 10px;
    padding: 0 14px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #172033;
    background: #fff;
    outline: none;
    transition: border-color .18s;
}
.cp-filter-select:focus {
    border-color: #0757b5;
    box-shadow: 0 0 0 4px rgba(7,87,181,.10);
}
.cp-filter-apply {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #0757b5, #0878c5);
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(7,87,181,.28);
    transition: transform .15s, box-shadow .15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.cp-filter-apply:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(7,87,181,.35);
}

/* =========================
   CART PANEL (bottom sheet)
   ========================= */
.cp-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    z-index: 490;
    display: none;
    opacity: 0;
    transition: opacity .25s;
}
.cp-cart-overlay.show {
    display: block;
    opacity: 1;
}

.cp-cart-panel {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 480px;
    height: 88vh;
    max-height: 720px;
    background: #fff;
    z-index: 500;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 30px rgba(15,23,42,.20);
    display: flex;
    flex-direction: column;
    transition: transform .3s ease;
}
.cp-cart-panel.show {
    transform: translateX(-50%) translateY(0);
}

.cp-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #edf1f5;
    flex-shrink: 0;
}
.cp-cart-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: #172033;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cp-cart-header h3 i { color: #0757b5; }

.cp-cart-close {
    width: 34px; height: 34px;
    border: 0;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 15px;
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .18s;
}
.cp-cart-close:hover { background: #e2e8f0; }

.cp-cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 18px;
}
.cp-cart-body::-webkit-scrollbar { width: 6px; }
.cp-cart-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.cp-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #eef2f7;
}
.cp-cart-item:last-child { border-bottom: 0; }

.cp-cart-item-info { flex: 1; min-width: 0; }
.cp-cart-item-name {
    font-size: 13px;
    font-weight: 700;
    color: #172033;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cp-cart-item-detail {
    font-size: 11px;
    color: #64748b;
    margin-top: 3px;
}
.cp-cart-item-total {
    font-size: 13.5px;
    font-weight: 800;
    color: #0757b5;
    white-space: nowrap;
}

.cp-cart-remove {
    width: 30px; height: 30px;
    border: 0;
    background: #fdecec;
    color: #c62828;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    flex-shrink: 0;
}
.cp-cart-remove:hover { background: #fee2e2; }

.cp-cart-empty {
    text-align: center;
    padding: 50px 20px;
    color: #94a3b8;
    font-size: 13px;
}
.cp-cart-empty i {
    font-size: 42px;
    color: #cbd5e1;
    display: block;
    margin-bottom: 14px;
}

.cp-cart-footer {
    flex-shrink: 0;
    padding: 14px 18px 20px;
    border-top: 1px solid #edf1f5;
    background: #fff;
    border-radius: 0 0 20px 20px;
}

.cp-cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.cp-cart-total-row span:first-child {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}
.cp-cart-total-value {
    font-size: 20px;
    font-weight: 800;
    color: #0757b5;
}

.cp-cart-checkout {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #16823b, #1a9e47);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(22,130,59,.30);
    transition: transform .15s, box-shadow .15s;
}
.cp-cart-checkout:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(22,130,59,.38);
}

/* =========================
   MOBILE TWEAKS
   ========================= */
@media (max-width: 400px) {
    .cp-product-card .cp-product-image { width: 56px; height: 56px; }
    .cp-product-card .cp-product-title { font-size: 12px; }
    .cp-product-card .cp-product-price { font-size: 13.5px; }
    .cp-cat-btn { flex-basis: 74px; height: 78px; }
    .cp-cat-icon { width: 36px; height: 36px; font-size: 20px; }
    .cp-tab { font-size: 10.5px; padding: 10px 6px; }
}

/* =========================
   PRINT
   ========================= */
@media print {
    .cp-header, .cp-bottom-nav, .cp-filter-btn,
    .cp-header-btn, .cp-section-link,
    .cp-floating-cart, .cp-cart-panel, .cp-cart-overlay {
        display: none !important;
    }
    .cp-app { padding-bottom: 0; }
}

/* =========================================================
   ORDER CONFIRMATION PAGE STYLES
   ========================================================= */

/* Success card */
.cp-success-card {
    background: #fff;
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(22,130,59,.10);
    border: 1px solid #d6f0dd;
    position: relative;
    overflow: hidden;
}
.cp-success-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #16823b, #1a9e47);
}

.cp-success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #16823b, #1a9e47);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 16px;
    box-shadow: 0 10px 24px rgba(22,130,59,.30);
    animation: cpSuccessPop .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes cpSuccessPop {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); }
}

.cp-success-card h2 {
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 800;
    color: #172033;
    letter-spacing: -.2px;
}
.cp-success-card p {
    margin: 0;
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.5;
}

/* Order summary */
.cp-order-summary {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
}

.cp-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f7;
    font-size: 12.5px;
}
.cp-summary-row:last-child { border-bottom: 0; }

.cp-summary-label {
    color: #64748b;
    font-weight: 600;
    flex-shrink: 0;
}
.cp-summary-value {
    color: #172033;
    font-weight: 700;
    text-align: right;
    word-break: break-word;
}
.cp-summary-value.cp-order-no {
    color: #0757b5;
    font-weight: 800;
}

.cp-summary-total {
    background: linear-gradient(135deg, #eaf3ff, #f6faff);
    padding: 14px;
}
.cp-summary-total .cp-summary-label {
    color: #0757b5;
    font-weight: 800;
    font-size: 13px;
}
.cp-summary-total .cp-summary-value {
    color: #0757b5;
    font-size: 17px;
    font-weight: 800;
}

/* =========================================================
   ORDER CONFIRMATION PAGE — FIXES
   ========================================================= */

/* Success card */
.cp-success-card {
    background: #fff;
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(22,130,59,.10);
    border: 1px solid #d6f0dd;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}
.cp-success-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #16823b, #1a9e47);
}

.cp-success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #16823b, #1a9e47);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 16px;
    box-shadow: 0 10px 24px rgba(22,130,59,.30);
    animation: cpSuccessPop .5s cubic-bezier(.34,1.56,.64,1);
}

@keyframes cpSuccessPop {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); }
}

.cp-success-card h2 {
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 800;
    color: #172033;
    letter-spacing: -.2px;
}
.cp-success-card p {
    margin: 0;
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.5;
}

/* Order summary block */
.cp-order-summary {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
    margin-bottom: 16px;
}

.cp-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f7;
    font-size: 12.5px;
}
.cp-summary-row:last-child { border-bottom: 0; }

.cp-summary-label {
    color: #64748b;
    font-weight: 600;
    flex-shrink: 0;
}
.cp-summary-value {
    color: #172033;
    font-weight: 700;
    text-align: right;
    word-break: break-word;
}
.cp-summary-value.cp-order-no {
    color: #0757b5;
    font-weight: 800;
}

.cp-summary-total {
    background: linear-gradient(135deg, #eaf3ff, #f6faff);
    padding: 14px;
}
.cp-summary-total .cp-summary-label {
    color: #0757b5;
    font-weight: 800;
    font-size: 13px;
}
.cp-summary-total .cp-summary-value {
    color: #0757b5;
    font-size: 17px;
    font-weight: 800;
}

/* Order items card */
.cp-order-items {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
    margin-bottom: 16px;
}

.cp-order-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f7;
}
.cp-order-item:last-child { border-bottom: 0; }

.cp-order-item-info { flex: 1; min-width: 0; }
.cp-order-item-name {
    font-size: 13px;
    font-weight: 800;
    color: #172033;
    line-height: 1.3;
    margin-bottom: 3px;
}
.cp-order-item-pack {
    font-size: 10.5px;
    color: #64748b;
    margin-bottom: 3px;
}
.cp-order-item-qty {
    font-size: 11px;
    color: #94a3b8;
}
.cp-order-item-total {
    font-size: 14px;
    font-weight: 800;
    color: #0757b5;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: right;
}

/* Extra bottom padding so bottom nav doesn't overlap */
.cp-app.cp-confirm-app {
    padding-bottom: 140px !important;
}

/* Section heading */
.cp-section-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 2px 12px;
}
.cp-section-title-bar h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: #172033;
}
.cp-section-title-bar .cp-count {
    font-size: 10.5px;
    color: #64748b;
}
/* =========================================================
   ORDER TIMELINE
   ========================================================= */
.cp-timeline {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
    margin-bottom: 16px;
}

.cp-tl-step {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    position: relative;
}
.cp-tl-step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 17px;
    top: 50px;
    width: 2px;
    height: calc(100% - 20px);
    background: #e2e8f0;
}
.cp-tl-step.done:not(:last-child)::after {
    background: #16823b;
}

.cp-tl-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: all .25s;
}
.cp-tl-step.done .cp-tl-icon {
    background: #16823b;
    color: #fff;
    box-shadow: 0 4px 12px rgba(22,130,59,.25);
}
.cp-tl-step.current .cp-tl-icon {
    background: #0757b5;
    color: #fff;
    box-shadow: 0 0 0 5px rgba(7,87,181,.15);
    animation: cpTlPulse 1.8s ease-in-out infinite;
}
@keyframes cpTlPulse {
    0%, 100% { box-shadow: 0 0 0 5px rgba(7,87,181,.15); }
    50%      { box-shadow: 0 0 0 9px rgba(7,87,181,.08); }
}

.cp-tl-content { flex: 1; }
.cp-tl-content h4 {
    margin: 4px 0 0;
    font-size: 13.5px;
    font-weight: 800;
    color: #172033;
}
.cp-tl-content p {
    margin: 4px 0 0;
    font-size: 11px;
    color: #64748b;
    line-height: 1.5;
}
.cp-tl-step.done .cp-tl-content h4 { color: #16823b; }
.cp-tl-step.current .cp-tl-content h4 { color: #0757b5; }

/* =========================================================
   MY ORDERS PAGE STYLES
   ========================================================= */

/* Order card (list view) */
.cp-order-card {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
    transition: box-shadow .18s;
}
.cp-order-card:hover {
    box-shadow: 0 4px 14px rgba(7,87,181,.10);
}

.cp-order-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f7;
}

.cp-order-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #eaf6ff;
    color: #0757b5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.cp-order-info {
    flex: 1;
    min-width: 0;
}
.cp-order-no {
    font-size: 13.5px;
    font-weight: 800;
    color: #172033;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cp-order-date {
    font-size: 10.5px;
    color: #64748b;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.cp-order-date i { font-size: 10px; color: #94a3b8; }

.cp-order-body {
    padding: 12px 14px 14px;
}

/* Summary grid */
.cp-order-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.cp-summary-box {
    background: #f8fafc;
    border: 1px solid #edf1f4;
    border-radius: 9px;
    padding: 9px 6px;
    text-align: center;
}
.cp-summary-box-label {
    display: block;
    font-size: 9px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .3px;
    font-weight: 700;
}
.cp-summary-box-value {
    display: block;
    margin-top: 5px;
    font-size: 12.5px;
    font-weight: 800;
    color: #172033;
}

.cp-summary-box-total {
    background: linear-gradient(135deg, #eaf3ff, #f6faff);
    border-color: #d0e5fb;
}
.cp-summary-box-total .cp-summary-box-label { color: #0757b5; }
.cp-summary-box-total .cp-summary-box-value {
    color: #0757b5;
    font-size: 13.5px;
}

/* Action buttons */
.cp-order-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.cp-order-btn {
    flex: 1;
    min-width: 0;
    min-height: 36px;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all .15s;
    cursor: pointer;
    border: 0;
    white-space: nowrap;
}
.cp-order-btn i { font-size: 11px; }

.cp-btn-view {
    background: #eef5ff;
    color: #0757b5 !important;
    border: 1px solid #cfe0f7;
}
.cp-btn-view:hover { background: #e1efff; }

.cp-btn-track {
    background: #e0f2fe;
    color: #0369a1 !important;
    border: 1px solid #bae6fd;
}
.cp-btn-track:hover { background: #cbeafd; }

.cp-btn-invoice {
    background: #f3e8ff;
    color: #6420a8 !important;
    border: 1px solid #e2ccff;
}
.cp-btn-invoice:hover { background: #ead8ff; }

/* Back link */
.cp-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #0757b5 !important;
    text-decoration: none !important;
    margin-bottom: 8px;
    transition: gap .15s;
}
.cp-back-link:hover { gap: 9px; }
.cp-back-link i { font-size: 11px; }

/* Detail header card */
.cp-detail-head {
    background: linear-gradient(135deg, #0757b5, #0878c5);
    color: #fff;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 6px 20px rgba(7,87,181,.25);
}
.cp-detail-head-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.cp-detail-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: rgba(255,255,255,.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.cp-detail-info { flex: 1; min-width: 0; }
.cp-detail-no {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: .2px;
}
.cp-detail-date {
    font-size: 11px;
    opacity: .88;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.cp-detail-date i { font-size: 10px; }

.cp-detail-status .status-badge {
    background: rgba(255,255,255,.22) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.30);
    font-weight: 700;
    min-width: auto;
    padding: 5px 12px;
    font-size: 10.5px;
}

/* Grand total */
.cp-grand-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #eaf3ff, #f6faff);
    border: 1px solid #d0e5fb;
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 14px;
    font-size: 13px;
    font-weight: 800;
    color: #0757b5;
}
.cp-grand-total-value {
    font-size: 18px;
    font-weight: 800;
    color: #0757b5;
}

/* Mobile tweak */
@media (max-width: 400px) {
    .cp-order-no { font-size: 12.5px; }
    .cp-order-btn { font-size: 10px; padding: 7px 8px; }
    .cp-summary-box-value { font-size: 11.5px; }
    .cp-summary-box-total .cp-summary-box-value { font-size: 12.5px; }
    .cp-detail-no { font-size: 14.5px; }
}

/* =========================================================
   CUSTOMER INVOICE PAGE
   ========================================================= */
.cp-invoice-sheet {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(15,23,42,.08);
    border: 1px solid #e1e7ed;
}

.cp-inv-company {
    text-align: center;
    padding: 20px 14px 14px;
    border-bottom: 2px solid #0757b5;
    background: linear-gradient(180deg, #f6faff 0%, #fff 100%);
}
.cp-inv-company h1 {
    margin: 0;
    color: #0757b5;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
}
.cp-inv-company p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 11px;
}

.cp-inv-heading {
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    color: #172033;
    margin: 16px 0 12px;
    letter-spacing: 2px;
}

.cp-inv-boxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 12px 12px;
}

.cp-inv-box {
    border: 1px solid #e1e7ed;
    border-radius: 10px;
    padding: 11px 12px;
    background: #fafbfd;
}
.cp-inv-box h3 {
    margin: 0 0 8px;
    color: #0757b5;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.cp-inv-box .row {
    font-size: 10.5px;
    margin: 5px 0;
    color: #334155;
    line-height: 1.4;
    word-break: break-word;
}
.cp-inv-box .row b {
    color: #475569;
    font-weight: 700;
    margin-right: 3px;
}

.cp-inv-items-title {
    padding: 14px 14px 8px;
    font-size: 13px;
    font-weight: 800;
    color: #172033;
    border-top: 1px solid #edf1f5;
    background: #f8fafc;
}

.cp-inv-item-list {
    padding: 6px 12px 12px;
}

.cp-inv-item {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
}
.cp-inv-item:last-child { margin-bottom: 0; }

.cp-inv-item-top {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #eef2f7;
}

.cp-inv-item-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0757b5;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    flex-shrink: 0;
}

.cp-inv-item-name-box { flex: 1; min-width: 0; }
.cp-inv-item-name {
    font-size: 12.5px;
    font-weight: 800;
    color: #172033;
    line-height: 1.3;
}
.cp-inv-item-hsn {
    font-size: 10px;
    color: #64748b;
    margin-top: 3px;
}

.cp-inv-item-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 10px 12px;
}
.cp-inv-item-cell { min-width: 0; }
.cp-inv-item-label {
    display: block;
    font-size: 8.5px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-bottom: 3px;
    font-weight: 700;
}
.cp-inv-item-value {
    display: block;
    font-size: 11.5px;
    font-weight: 800;
    color: #172033;
    word-break: break-word;
}

.cp-inv-totals {
    padding: 12px 14px 8px;
    display: flex;
    justify-content: flex-end;
}
.cp-inv-total-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e1e7ed;
    border-radius: 10px;
    overflow: hidden;
}
.cp-inv-total-table td {
    padding: 9px 12px;
    font-size: 11.5px;
    border-bottom: 1px solid #eef2f7;
    color: #334155;
}
.cp-inv-total-table td:last-child {
    text-align: right;
    font-weight: 800;
    color: #172033;
}
.cp-inv-total-table tr:last-child td { border-bottom: 0; }

.cp-inv-total-table tr.grand td {
    background: linear-gradient(135deg, #eaf3ff, #f6faff);
    color: #0757b5;
    font-size: 14px;
    font-weight: 800;
    padding: 12px;
}

.cp-inv-footer {
    text-align: center;
    padding: 14px;
    font-size: 11px;
    color: #94a3b8;
    border-top: 1px solid #edf1f5;
    background: #f8fafc;
}

@media (max-width: 480px) {
    .cp-inv-company h1 { font-size: 21px; }
    .cp-inv-boxes { grid-template-columns: 1fr; }
    .cp-inv-item-grid { grid-template-columns: repeat(3, 1fr); gap: 5px; }
}

/* =========================================================
   CUSTOMER LEDGER PAGE
   ========================================================= */
.cp-ledger-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.cp-ledger-sum-card {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
    text-align: center;
}
.cp-ledger-sum-label {
    font-size: 10.5px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .3px;
    font-weight: 700;
    margin-bottom: 6px;
}
.cp-ledger-sum-value {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
}

/* Transaction cards */
.cp-txn {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-left: 4px solid #94a3b8;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
}
.cp-txn-sale { border-left-color: #c62828; background: #fffafa; }
.cp-txn-payment { border-left-color: #16823b; background: #f8fff9; }
.cp-txn-adjustment { border-left-color: #e67e22; background: #fffdf5; }

.cp-txn-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.cp-txn-date {
    font-size: 11px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
}
.cp-txn-date i { font-size: 10px; }
.cp-txn-type {
    font-size: 11px;
    font-weight: 800;
    color: #0757b5;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.cp-txn-sale .cp-txn-type { color: #c62828; }
.cp-txn-payment .cp-txn-type { color: #16823b; }

.cp-txn-title {
    font-size: 13.5px;
    font-weight: 800;
    color: #172033;
    margin-bottom: 5px;
    line-height: 1.3;
}
.cp-txn-detail {
    font-size: 11px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 5px;
}
.cp-txn-ref {
    font-size: 10.5px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.cp-txn-amount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid #eef2f7;
}
.cp-txn-debit {
    color: #c62828;
    font-weight: 800;
    font-size: 12.5px;
}
.cp-txn-credit {
    color: #16823b;
    font-weight: 800;
    font-size: 12.5px;
}
.cp-txn-balance {
    font-size: 12px;
    font-weight: 800;
    color: #0757b5;
    white-space: nowrap;
}

/* =========================================================
   CUSTOMER PROFILE PAGE
   ========================================================= */
.cp-profile-head {
    background: linear-gradient(135deg, #0757b5, #0878c5);
    color: #fff;
    padding: 24px 20px 20px;
    text-align: center;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 6px 20px rgba(7,87,181,.20);
}

.cp-profile-photo {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: rgba(255,255,255,.20);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 12px;
    border: 3px solid rgba(255,255,255,.35);
}

.cp-profile-name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .2px;
    margin-bottom: 5px;
}
.cp-profile-category {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.22);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 8px;
}
.cp-profile-code {
    font-size: 11px;
    opacity: .9;
}

.cp-profile-card {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
}

.cp-profile-card-head {
    background: linear-gradient(135deg, #eaf3ff, #f6faff);
    color: #0757b5;
    padding: 12px 14px;
    font-size: 12.5px;
    font-weight: 800;
    border-bottom: 1px solid #d0e5fb;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.cp-profile-row {
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f7;
}
.cp-profile-row:last-child { border-bottom: 0; }

.cp-profile-label {
    font-size: 10.5px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .3px;
    font-weight: 700;
    margin-bottom: 5px;
}
.cp-profile-value {
    display: block;
    font-size: 13px;
    color: #172033;
    font-weight: 700;
    word-break: break-word;
    line-height: 1.4;
}

.cp-profile-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Print styles for invoice */
@media print {
    .cp-header, .cp-bottom-nav {
        display: none !important;
    }
    .cp-app {
        padding-bottom: 0 !important;
        max-width: 100% !important;
    }
    .cp-invoice-sheet {
        box-shadow: none;
        border: 0;
    }
    body { background: #fff; }
}
/* =========================================================
   MORE PAGE
   ========================================================= */
.cp-more-stat {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
}
.cp-more-stat-icon {
    font-size: 20px;
    margin-bottom: 8px;
}
.cp-more-stat-label {
    font-size: 10.5px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .3px;
    font-weight: 700;
    margin-bottom: 6px;
}
.cp-more-stat-value {
    font-size: 15px;
    font-weight: 800;
}

.cp-more-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.cp-more-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    text-decoration: none;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
    transition: all .18s;
    min-height: 78px;
}
.cp-more-item:hover {
    border-color: #0757b5;
    background: #f8fbff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(7,87,181,.12);
}
.cp-more-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #eaf6ff;
    color: #0757b5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}
.cp-more-text { flex: 1; min-width: 0; }
.cp-more-title {
    font-size: 12.5px;
    font-weight: 800;
    color: #172033;
    line-height: 1.25;
}
.cp-more-desc {
    font-size: 10px;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.35;
}

/* Benefits */
.cp-benefits-card {
    background: #fff;
    border: 1px solid #d8dff0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
}
.cp-benefits-title {
    padding: 12px 14px;
    background: linear-gradient(135deg, #eaf3ff, #f6faff);
    color: #0757b5;
    font-size: 12.5px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .4px;
    border-bottom: 1px solid #d0e5fb;
}
.cp-benefits-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}
.cp-benefit {
    padding: 14px 6px;
    text-align: center;
    border-right: 1px solid #eef2f7;
}
.cp-benefit:last-child { border-right: 0; }
.cp-benefit-icon {
    font-size: 20px;
    color: #0757b5;
    margin-bottom: 6px;
}
.cp-benefit-text {
    font-size: 9.5px;
    color: #475569;
    line-height: 1.35;
    font-weight: 600;
}

/* Contact card */
.cp-contact-card {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
}
.cp-contact-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    text-decoration: none;
    border-bottom: 1px solid #eef2f7;
    transition: background .15s;
}
.cp-contact-row:last-child { border-bottom: 0; }
.cp-contact-row:hover { background: #f8fbff; }
.cp-contact-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.cp-contact-info { flex: 1; min-width: 0; }
.cp-contact-title {
    font-size: 13px;
    font-weight: 800;
    color: #172033;
}
.cp-contact-desc {
    font-size: 11px;
    color: #64748b;
    margin-top: 3px;
}
.cp-contact-arrow {
    color: #cbd5e1;
    font-size: 12px;
}

/* Logout button */
.cp-logout-btn {
    width: 100%;
    height: 48px;
    border: 1.5px solid #c62828;
    background: #fff;
    color: #c62828;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all .18s;
}
.cp-logout-btn:hover {
    background: #fdecec;
}

/* =========================================================
   PAYMENTS PAGE
   ========================================================= */
.cp-payment-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.cp-pay-stat {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    padding: 14px 6px;
    text-align: center;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
}
.cp-pay-stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 8px;
}
.cp-pay-stat-value {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    word-break: break-word;
}
.cp-pay-stat-label {
    font-size: 9.5px;
    color: #64748b;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: .3px;
    font-weight: 700;
}

/* Invoice card */
.cp-invoice-card {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
}
.cp-invoice-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.cp-invoice-no {
    font-size: 13.5px;
    font-weight: 800;
    color: #0757b5;
    line-height: 1.2;
}
.cp-invoice-date {
    font-size: 10.5px;
    color: #64748b;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.cp-invoice-date i { font-size: 10px; }

.cp-invoice-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 12px 0;
    border-top: 1px solid #eef2f7;
    border-bottom: 1px solid #eef2f7;
}
.cp-invoice-cell { min-width: 0; }
.cp-invoice-label {
    display: block;
    font-size: 9px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .3px;
    font-weight: 700;
    margin-bottom: 4px;
}
.cp-invoice-value {
    display: block;
    font-size: 12.5px;
    font-weight: 800;
    color: #172033;
}
.cp-invoice-card-foot {
    font-size: 10.5px;
    color: #64748b;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.cp-invoice-card-foot i { color: #94a3b8; }
.cp-invoice-card-foot b { color: #172033; }

/* Payment history card */
.cp-payment-history-card {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
}
.cp-payment-history-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}
.cp-payment-date {
    font-size: 12.5px;
    font-weight: 800;
    color: #172033;
    display: flex;
    align-items: center;
    gap: 5px;
}
.cp-payment-date i { font-size: 11px; color: #94a3b8; }
.cp-payment-mode {
    font-size: 10.5px;
    color: #64748b;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.cp-payment-amount {
    font-size: 15px;
    font-weight: 800;
    color: #16823b;
    white-space: nowrap;
}
.cp-payment-ref {
    font-size: 10.5px;
    color: #94a3b8;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eef2f7;
}

/* =========================================================
   HELP PAGE — FAQ
   ========================================================= */
.cp-info-box {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
}
.cp-info-box-title {
    font-size: 13px;
    font-weight: 800;
    color: #172033;
    margin-bottom: 8px;
}
.cp-info-box-text {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.65;
}

.cp-faq-card {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    margin-bottom: 8px;
    overflow: hidden;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
}
.cp-faq-question {
    width: 100%;
    border: 0;
    background: #fff;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s;
}
.cp-faq-question:hover { background: #f8fbff; }

.cp-faq-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #eaf6ff;
    color: #0757b5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.cp-faq-text {
    flex: 1;
    font-size: 12.5px;
    font-weight: 700;
    color: #172033;
    line-height: 1.35;
}
.cp-faq-arrow {
    color: #94a3b8;
    font-size: 12px;
    transition: transform .2s;
}

.cp-faq-answer {
    display: none;
    padding: 0 14px 14px 56px;
    font-size: 11.5px;
    color: #475569;
    line-height: 1.7;
}

.cp-faq-card.open .cp-faq-answer { display: block; }
.cp-faq-card.open .cp-faq-arrow { transform: rotate(180deg); color: #0757b5; }
.cp-faq-card.open { border-color: #cfe0f7; }

/* =========================================================
   SETTINGS PAGE
   ========================================================= */
.cp-settings-card {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
}
.cp-settings-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    text-decoration: none;
    border-bottom: 1px solid #eef2f7;
    transition: background .15s;
}
.cp-settings-row:last-child { border-bottom: 0; }
.cp-settings-row:hover { background: #f8fbff; }

.cp-settings-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.cp-settings-info { flex: 1; min-width: 0; }
.cp-settings-title {
    font-size: 13px;
    font-weight: 800;
    color: #172033;
}
.cp-settings-desc {
    font-size: 10.5px;
    color: #64748b;
    margin-top: 3px;
}
.cp-settings-arrow {
    color: #cbd5e1;
    font-size: 12px;
}

/* Status badges for invoices */
.status-badge.paid { background: #e7f5ed; color: #16823b; }
.status-badge.unpaid { background: #fdecec; color: #c62828; }
.status-badge.partial { background: #fff4d6; color: #946200; }

/* =========================================================
   MOBILE TWEAKS
   ========================================================= */
@media (max-width: 400px) {
    .cp-payment-summary { grid-template-columns: 1fr 1fr; }
    .cp-payment-summary > :last-child { grid-column: 1 / -1; }
    .cp-more-menu { grid-template-columns: 1fr; }
    .cp-benefits-grid { grid-template-columns: repeat(2, 1fr); }
    .cp-benefit:nth-child(2) { border-right: 0; }
    .cp-benefit:nth-child(1),
    .cp-benefit:nth-child(2) { border-bottom: 1px solid #eef2f7; }
    .cp-invoice-card-grid { grid-template-columns: 1fr 1fr; }
    .cp-invoice-cell:last-child { grid-column: 1 / -1; }
}

/* =========================================================
   SALESMAN MODULE — PRODUCT CARD STYLES
   (Used by ProductList, CreateOrder, CheckStock)
   ========================================================= */

/* Product Card */
.sl-product-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
    transition: box-shadow .18s;
    width: 100%;
    box-sizing: border-box;
}
.sl-product-card:hover {
    box-shadow: 0 4px 12px rgba(7,87,181,.10);
}

/* Product Image — FIXED SIZE */
.sl-product-img {
    width: 62px !important;
    height: 62px !important;
    min-width: 62px !important;
    max-width: 62px !important;
    min-height: 62px !important;
    max-height: 62px !important;
    object-fit: cover !important;
    border-radius: 10px !important;
    background: #f7f9fb !important;
    border: 1px solid #edf0f3 !important;
    flex-shrink: 0 !important;
    display: block !important;
}

/* Product Info */
.sl-product-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.sl-product-name {
    font-size: 13px;
    font-weight: 800;
    color: #172033;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sl-product-pack {
    font-size: 10.5px;
    color: #64748b;
    margin-top: 4px;
}
.sl-product-sub {
    font-size: 9.5px;
    color: #94a3b8;
    margin-top: 3px;
}
.sl-product-rate {
    color: #0757b5;
    font-size: 14px;
    font-weight: 800;
    margin-top: 3px;
    white-space: nowrap;
}

/* Price box (right side) */
.sl-product-price-box {
    flex-shrink: 0;
    text-align: right;
    min-width: 80px;
}

/* Qty Stepper */
.sl-qty-wrap {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #0757b5;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #fff;
    height: 42px;
}
.sl-qty-btn {
    width: 38px;
    height: 42px;
    border: 0;
    background: #0757b5;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: background .15s;
    user-select: none;
    -webkit-user-select: none;
}
.sl-qty-btn:hover { background: #06438c; }
.sl-qty-btn:active { background: #052f66; }

.sl-qty-input {
    width: 52px;
    height: 42px;
    border: 0;
    outline: none;
    text-align: center;
    font-size: 15px;
    font-weight: 800;
    color: #0757b5;
    background: #fff;
    padding: 0;
    -moz-appearance: textfield;
    font-family: inherit;
    cursor: text;
}
.sl-qty-input::-webkit-outer-spin-button,
.sl-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.sl-qty-input[type=number] {
    -moz-appearance: textfield;
}
.sl-qty-input:focus {
    background: #eaf3ff;
}

/* Stock items */
.stock-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.stock-sum-card {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    padding: 14px 8px;
    text-align: center;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
}
.stock-sum-label {
    font-size: 9.5px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .3px;
    font-weight: 700;
    margin-bottom: 6px;
}
.stock-sum-value {
    font-size: 18px;
    font-weight: 800;
}
.stock-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    margin-bottom: 8px;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
}
.stock-item-info { flex: 1; min-width: 0; }
.stock-item-name {
    font-size: 13px;
    font-weight: 800;
    color: #172033;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stock-item-pack {
    font-size: 10.5px;
    color: #64748b;
    margin-top: 4px;
}
.stock-item-right {
    text-align: right;
    flex-shrink: 0;
}
.stock-item-qty {
    font-size: 16px;
    font-weight: 800;
    color: #172033;
}
.stock-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 800;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.stock-badge.in { background: #e7f5ed; color: #16823b; }
.stock-badge.low { background: #fff4d6; color: #946200; }
.stock-badge.out { background: #fdecec; color: #c62828; }

/* Outstanding cards */
.out-total-box {
    background: linear-gradient(135deg, #fdecec, #fff1f1);
    border: 1px solid #fecdd3;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.out-total-label {
    font-size: 13px;
    font-weight: 800;
    color: #c62828;
}
.out-total-value {
    font-size: 20px;
    font-weight: 800;
    color: #c62828;
}
.out-customer-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    margin-bottom: 10px;
    text-decoration: none;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
    transition: all .18s;
}
.out-customer-card:hover {
    border-color: #0757b5;
    background: #f8fbff;
}
.out-customer-info { flex: 1; min-width: 0; }
.out-customer-name {
    font-size: 13.5px;
    font-weight: 800;
    color: #172033;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.out-customer-code {
    font-size: 10.5px;
    color: #64748b;
    margin-top: 4px;
}
.out-customer-cat {
    font-size: 10px;
    color: #0757b5;
    font-weight: 700;
    margin-top: 4px;
    display: inline-block;
    padding: 2px 8px;
    background: #eaf6ff;
    border-radius: 999px;
}
.out-customer-right {
    text-align: right;
    flex-shrink: 0;
}
.out-customer-amount {
    font-size: 14px;
    font-weight: 800;
    color: #c62828;
}
.out-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    margin-top: 4px;
    text-transform: uppercase;
}
.out-badge.high { background: #fdecec; color: #c62828; }
.out-badge.medium { background: #fff4d6; color: #946200; }
.out-badge.low { background: #e7f5ed; color: #16823b; }
.out-arrow { color: #cbd5e1; font-size: 12px; }

/* Today's orders */
.today-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.today-sum-card {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    padding: 16px 10px;
    text-align: center;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
}
.today-sum-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    margin-bottom: 10px;
}
.today-sum-value {
    font-size: 18px;
    font-weight: 800;
}
.today-sum-label {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .3px;
    font-weight: 700;
    margin-top: 4px;
}
.today-order-card {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
}
.today-order-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}
.today-order-no {
    font-size: 13.5px;
    font-weight: 800;
    color: #0757b5;
}
.today-order-date {
    font-size: 10.5px;
    color: #64748b;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.today-order-customer {
    font-size: 12px;
    color: #172033;
    font-weight: 700;
    padding: 8px 0;
    border-top: 1px solid #eef2f7;
    border-bottom: 1px solid #eef2f7;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.today-order-customer i { color: #0757b5; font-size: 11px; }
.today-order-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.today-order-cell { min-width: 0; }
.today-order-label {
    display: block;
    font-size: 9px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .3px;
    font-weight: 700;
    margin-bottom: 3px;
}
.today-order-value {
    display: block;
    font-size: 12.5px;
    font-weight: 800;
    color: #172033;
}

/* Profile */
.prof-card {
    background: linear-gradient(135deg, #0757b5, #0878c5);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    color: #fff;
    box-shadow: 0 6px 20px rgba(7,87,181,.25);
}
.prof-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: rgba(255,255,255,.20);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 14px;
    border: 3px solid rgba(255,255,255,.35);
}
.prof-name {
    font-size: 18px;
    font-weight: 800;
}
.prof-code {
    font-size: 11.5px;
    opacity: .85;
    margin-top: 5px;
}
.prof-section {
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
}
.prof-section-head {
    padding: 12px 14px;
    background: linear-gradient(135deg, #eaf3ff, #f6faff);
    color: #0757b5;
    font-size: 12.5px;
    font-weight: 800;
    border-bottom: 1px solid #d0e5fb;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.prof-row {
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f7;
}
.prof-row:last-child { border-bottom: 0; }
.prof-label {
    font-size: 10px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .3px;
    font-weight: 700;
    margin-bottom: 4px;
}
.prof-value {
    font-size: 13px;
    color: #172033;
    font-weight: 700;
    word-break: break-word;
}
.prof-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}
.prof-stat {
    padding: 16px 8px;
    text-align: center;
    border-right: 1px solid #eef2f7;
}
.prof-stat:last-child { border-right: 0; }
.prof-stat-label {
    font-size: 9.5px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .3px;
    font-weight: 700;
    margin-bottom: 6px;
}
.prof-stat-value {
    font-size: 18px;
    font-weight: 800;
}

/* Mobile responsive */
@media (max-width: 400px) {
    .sl-product-img { 
        width: 54px !important; 
        height: 54px !important; 
        min-width: 54px !important;
        max-width: 54px !important;
        min-height: 54px !important;
        max-height: 54px !important;
    }
    .sl-product-name { font-size: 12px; }
    .sl-qty-btn { width: 34px; height: 38px; font-size: 18px; }
    .sl-qty-input { width: 46px; height: 38px; font-size: 14px; }
    .sl-qty-wrap { height: 38px; }
}
/* ============================
   SALESMAN — Product Card
   ============================ */
.sl-product-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 7px rgba(20,40,60,.05);
    transition: box-shadow .18s;
    width: 100%;
    box-sizing: border-box;
}
.sl-product-card:hover {
    box-shadow: 0 4px 12px rgba(7,87,181,.10);
}

.sl-product-img {
    width: 62px !important;
    height: 62px !important;
    min-width: 62px !important;
    max-width: 62px !important;
    min-height: 62px !important;
    max-height: 62px !important;
    object-fit: cover !important;
    border-radius: 10px !important;
    background: #f7f9fb !important;
    border: 1px solid #edf0f3 !important;
    flex-shrink: 0 !important;
    display: block !important;
}

.sl-product-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.sl-product-name {
    font-size: 13px;
    font-weight: 800;
    color: #172033;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sl-product-pack {
    font-size: 10.5px;
    color: #64748b;
    margin-top: 4px;
}
.sl-product-rate {
    color: #0757b5;
    font-size: 14px;
    font-weight: 800;
    margin-top: 3px;
    white-space: nowrap;
}

/* Qty Stepper */
.sl-qty-wrap {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #0757b5;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #fff;
    height: 42px;
}
.sl-qty-btn {
    width: 38px;
    height: 42px;
    border: 0;
    background: #0757b5;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: background .15s;
    user-select: none;
    -webkit-user-select: none;
}
.sl-qty-btn:hover { background: #06438c; }
.sl-qty-btn:active { background: #052f66; }

.sl-qty-input {
    width: 52px;
    height: 42px;
    border: 0;
    outline: none;
    text-align: center;
    font-size: 15px;
    font-weight: 800;
    color: #0757b5;
    background: #fff;
    padding: 0;
    -moz-appearance: textfield;
    font-family: inherit;
    cursor: text;
}
.sl-qty-input::-webkit-outer-spin-button,
.sl-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.sl-qty-input[type=number] {
    -moz-appearance: textfield;
}
.sl-qty-input:focus {
    background: #eaf3ff;
}

/* Total Box */
.sl-total-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #eaf3ff, #f6faff);
    border: 1px solid #d0e5fb;
    border-radius: 12px;
    padding: 16px 18px;
}
.sl-total-label {
    font-size: 13px;
    font-weight: 800;
    color: #0757b5;
}
.sl-total-value {
    font-size: 20px;
    font-weight: 800;
    color: #0757b5;
}

@media (max-width: 400px) {
    .sl-product-img { 
        width: 54px !important; 
        height: 54px !important; 
        min-width: 54px !important;
        max-width: 54px !important;
        min-height: 54px !important;
        max-height: 54px !important;
    }
    .sl-product-name { font-size: 12px; }
    .sl-qty-btn { width: 34px; height: 38px; font-size: 18px; }
    .sl-qty-input { width: 46px; height: 38px; font-size: 14px; }
    .sl-qty-wrap { height: 38px; }
}

/* ============================
   SALESMAN — Filter Chips
   ============================ */
.sl-filter-chips {
    display: flex !important;
    gap: 7px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    padding: 2px 0 4px !important;
}
.sl-filter-chips::-webkit-scrollbar { display: none !important; }


/* ============================================================
   MASTER PAGE — Firm Switcher
   ============================================================ */
.firm-switcher {
    position: relative;
    flex-shrink: 0;
}

.firm-badge-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: rgba(255,255,255,.20);
    border: 1px solid rgba(255,255,255,.30);
    border-radius: 10px;
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-family: inherit;
    max-width: 160px;
}

.firm-badge-btn i { font-size: 12px; flex-shrink: 0; }

.firm-badge-name {
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.firm-chevron { font-size: 9px; flex-shrink: 0; }

.firm-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 260px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15,23,42,.20);
    z-index: 99999;
    overflow: hidden;
    border: 1px solid #e1e7ed;
}

.firm-dropdown-head {
    padding: 11px 14px;
    font-size: 10.5px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .4px;
    background: #f8fafc;
    border-bottom: 1px solid #eef2f7;
    display: flex;
    align-items: center;
    gap: 6px;
}

.firm-dropdown-head i { color: #0757b5; font-size: 11px; }

.firm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    text-decoration: none !important;
    color: #172033;
    border-bottom: 1px solid #f1f5f9;
    transition: background .15s;
}

.firm-item:last-child { border-bottom: 0; }
.firm-item:hover { background: #f8fafc; }
.firm-item.active { background: #eaf3ff; }

.firm-item-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, #0757b5, #0878c5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.firm-item-info { flex: 1; min-width: 0; }

.firm-item-name {
    font-size: 12.5px;
    font-weight: 800;
    color: #172033;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.firm-item-code {
    font-size: 10px;
    color: #64748b;
    font-family: "Courier New", monospace;
    margin-top: 2px;
}

.firm-check {
    color: #10b981;
    font-size: 13px;
    flex-shrink: 0;
}


/* ============================================================
   MASTER PAGE — Header (with back + title)
   ============================================================ */
.cp-header-back {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.22);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    text-decoration: none;
    flex-shrink: 0;
    transition: all .15s;
    margin-right: 10px;
}

.cp-header-back:hover {
    background: rgba(255,255,255,.28);
}


/* ============================================================
   MASTER PAGE — Customer Box (default)
   ============================================================ */
.cp-customer-box {
    margin: 14px 12px 0;
    padding: 14px 16px;
    background: linear-gradient(135deg, #eaf3ff 0%, #f6faff 100%);
    border: 1px solid #cfe0f7;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.cp-customer-box::before {
    content: "";
    position: absolute;
    top: -40px; right: -40px;
    width: 100px; height: 100px;
    border-radius: 50%;
    background: rgba(7,87,181,.05);
}

.cp-cust-avatar {
    width: 46px; height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0757b5, #0878c5);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(7,87,181,.25);
    position: relative;
    z-index: 2;
}

.cp-cust-info {
    flex: 1; min-width: 0;
    position: relative;
    z-index: 2;
}

.cp-cust-name {
    font-size: 14px;
    font-weight: 800;
    color: #172033;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cp-cust-cat {
    font-size: 11px;
    color: #0757b5;
    background: #fff;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
    margin-top: 3px;
    border: 1px solid #cfe0f7;
}
