/* ==========================================================================
   CARD VALIDITY STYLES - FULL WIDTH WITH SIDEBAR & PERFECT MOBILE RESPONSIVE
   Supports Desktop Full Page & Mobile (320px, 375px, 425px, 768px+)
   ========================================================================== */

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: #eef4fb;
    color: #142b57;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Page Layout - Docked beside sidebar on desktop, full width */
.layout {
    display: flex !important;
    min-height: 100vh !important;
    width: 100% !important;
    background: #eef4fb !important;
}

.main {
    margin-left: 255px !important;
    width: calc(100% - 255px) !important;
    min-width: 0 !important;
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    transition: margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1), width 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: #eef4fb !important;
}

.main.expanded {
    margin-left: 0 !important;
    width: 100% !important;
}

/* Full Width Shell Container - NO GAPS ON LEFT/RIGHT */
.shell {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    background: #f7fbff;
    min-height: 100vh;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
}

/* Top Sticky Header */
.top {
    background: #08224a;
    color: #fff;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.mobile-menu-btn {
    display: none;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    font-size: 17px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.logo {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: #7542e8;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 19px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(117, 66, 232, 0.4);
}

.brand-info, .brand > div {
    min-width: 0;
}

.brand b {
    font-size: 15px;
    letter-spacing: -0.2px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand span {
    display: block;
    font-size: 9.5px;
    color: #b8c9e4;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topright {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.btn-back-dash {
    color: #b8c9e4;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.15s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-back-dash:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
}

.bell {
    font-size: 18px;
    cursor: default;
    user-select: none;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #703be6;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 12px;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
    user-select: none;
}

.lang {
    background: #fff;
    color: #17366a;
    border: 0;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    outline: none;
    font-family: inherit;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: background 0.15s ease;
}

.lang:hover {
    background: #f0f6fd;
}

/* Card Body Content Wrap - Full Width with Comfortable Padding */
.card-content-wrap {
    padding: 22px 28px 48px;
    width: 100%;
    flex: 1;
}

/* Hero Section */
.hero {
    margin-bottom: 16px;
}

.hero h1 {
    font-size: 26px;
    margin: 0 0 6px;
    letter-spacing: -0.5px;
    color: #0d234a;
    font-weight: 800;
}

.hero p {
    font-size: 12px;
    color: #63728a;
    margin: 0;
}

/* 5 Metrics Stats - Limited to content width, no extra space on right */
.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    align-items: stretch;
    width: 100%;
}

.stat {
    border-radius: 12px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #dce6f3;
    min-height: 94px;
    box-shadow: 0 2px 8px rgba(11, 33, 73, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    width: fit-content;
    max-width: fit-content;
    box-sizing: border-box;
    flex: 0 0 auto;
}

.stat .ico {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 8px;
}

.blue { background: #2878ed; }
.green { background: #16a36b; }
.orange { background: #f59e0b; }
.red { background: #e33f55; }
.purple { background: #7142e8; }

.stat label {
    font-size: 10px;
    color: #6b7890;
    font-weight: 700;
    display: block;
    line-height: 1.25;
}

.stat strong {
    display: block;
    font-size: 22px;
    margin-top: 3px;
    color: #142b57;
    font-weight: 800;
}

.stat small {
    font-size: 9px;
    color: #8490a3;
    display: block;
    margin-top: 2px;
}

/* Sections */
.section {
    background: #fff;
    border: 1px solid #dbe5f1;
    border-radius: 13px;
    margin-top: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(11, 33, 73, 0.03);
}

.section-head {
    padding: 14px 18px;
    border-bottom: 1px solid #e6edf5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.section-head h2 {
    font-size: 16px;
    margin: 0;
    color: #0e244b;
    font-weight: 800;
}

.section-head p {
    font-size: 10px;
    color: #718096;
    margin: 3px 0 0;
}

.link {
    font-size: 10px;
    color: #2166d1;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.link:hover {
    text-decoration: underline;
}

/* Purchase History Table */
.table-wrap {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.table-wrap::-webkit-scrollbar {
    height: 6px;
}

.table-wrap::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
    font-size: 10px;
}

.table th {
    background: #f0f6fd;
    color: #5e6d84;
    padding: 11px 14px;
    text-align: left;
    font-weight: 700;
    white-space: nowrap;
}

.table td {
    padding: 11px 14px;
    border-bottom: 1px solid #edf1f6;
    color: #1d335a;
    font-size: 10px;
}

.table tr:last-child td {
    border: 0;
}

.table tr:hover td {
    background: #fafcff;
}

.warn {
    background: #fff3d6;
    color: #9b6500;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 800;
    display: inline-block;
}

.ok {
    background: #def7eb;
    color: #08754e;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 800;
    display: inline-block;
}

.zero {
    background: #ffe5e9;
    color: #ad3043;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 800;
    display: inline-block;
}

/* Expiry Reminder Alert Box */
.alertbox {
    margin: 14px 18px;
    background: #fff5f7;
    border: 1px solid #f4d7de;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.alerticon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #e8435a;
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 14px;
    flex-shrink: 0;
}

.alertbox b {
    font-size: 11px;
    color: #8b1828;
    line-height: 1.35;
    display: block;
}

.alertbox p {
    font-size: 10px;
    color: #68768b;
    line-height: 1.45;
    margin: 4px 0 0;
}

/* Expiry Notifications */
.notifications {
    padding: 0 18px 14px;
}

.notice {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #edf1f5;
}

.notice:last-child {
    border: 0;
}

.nicon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 10.5px;
    font-weight: 900;
    flex-shrink: 0;
}

.notice b {
    font-size: 10.5px;
    color: #172d54;
    display: block;
}

.notice p {
    font-size: 9.5px;
    color: #7b8799;
    margin: 2px 0 0;
}

.date {
    font-size: 9.5px;
    color: #65748b;
    font-weight: 600;
    white-space: nowrap;
}

/* Design Section */
.design {
    padding: 18px 20px;
    background: linear-gradient(110deg, #f7fbff, #edf5ff);
}

.design-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 20px;
    align-items: center;
}

.design h2 {
    font-size: 18px;
    margin: 0 0 6px;
    color: #0b2248;
    font-weight: 800;
}

.design p {
    font-size: 10.5px;
    line-height: 1.45;
    color: #69778c;
    margin: 0 0 12px;
}

.samples {
    display: flex;
    gap: 10px;
}

.sample {
    width: 80px;
    height: 112px;
    border-radius: 10px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 8px;
    color: #fff;
    font-size: 8.5px;
    font-weight: 900;
    text-align: center;
    box-shadow: 0 7px 16px rgba(174, 189, 208, 0.6);
    line-height: 1.15;
    user-select: none;
    transition: transform 0.15s ease;
}

.sample:hover {
    transform: translateY(-2px);
}

.s1 { background: linear-gradient(145deg, #f02f2f, #ff9b00); }
.s2 { background: linear-gradient(145deg, #3110b8, #d82ef0); }
.s3 { background: linear-gradient(145deg, #ff8a00, #ffd52c, #13a96a); }

.availability {
    background: #e9f4ff;
    border: 1px solid #cde2fb;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.availability span {
    font-size: 9.5px;
    color: #64748a;
    font-weight: 600;
    display: block;
}

.availability strong {
    display: block;
    font-size: 25px;
    color: #1452a4;
    margin-top: 3px;
    font-weight: 800;
}

.rules {
    background: #eaf8f0;
    border: 1px solid #cdebd9;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 9.5px;
    color: #426052;
    line-height: 1.45;
    margin-bottom: 10px;
}

.cta {
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: #1769e8;
    color: #fff;
    padding: 11px;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(23, 105, 232, 0.3);
    transition: background 0.15s ease, transform 0.1s ease;
}

.cta:hover {
    background: #1358c2;
    transform: translateY(-1px);
}

.cta:active {
    transform: translateY(0);
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVENESS (320px, 375px, 425px, 768px, 991px)
   ========================================================================== */

/* Tablet & Mobile Screens (<= 991px) */
@media (max-width: 991px) {
    .main {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .card-content-wrap {
        padding: 16px 18px 36px;
    }

    .top {
        padding: 12px 16px;
    }

    .stats {
        gap: 10px;
    }

    .design-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .samples {
        justify-content: flex-start;
    }
}

/* Small Tablet & Large Mobile (<= 700px) */
@media (max-width: 700px) {
    .stats {
        gap: 10px;
    }

    .stat {
        width: fit-content;
        max-width: calc(50% - 5px);
    }

    .samples {
        justify-content: center;
    }
}

/* Mobile Screen - 425px */
@media (max-width: 425px) {
    .top {
        padding: 10px 12px;
        gap: 6px;
    }

    .brand {
        gap: 8px;
    }

    .logo {
        width: 32px;
        height: 32px;
        font-size: 16px;
        border-radius: 9px;
    }

    .brand b {
        font-size: 13.5px;
    }

    .brand span {
        font-size: 8.5px;
    }

    .topright {
        gap: 8px;
    }

    .topright .avatar {
        display: none !important;
    }

    .btn-back-dash {
        padding: 5px 8px;
        font-size: 10px;
    }

    .lang {
        padding: 6px 9px;
        font-size: 10px;
        border-radius: 7px;
    }

    .card-content-wrap {
        padding: 12px 12px 28px;
    }

    .hero h1 {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .hero p {
        font-size: 11px;
    }

    .stats {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 10px;
    }

    .stat {
        width: fit-content;
        max-width: calc(50% - 4px);
        padding: 9px 12px;
        min-height: 82px;
    }

    .stat .ico {
        width: 25px;
        height: 25px;
        font-size: 11px;
        margin-bottom: 5px;
    }

    .stat label {
        font-size: 8.5px;
    }

    .stat strong {
        font-size: 19px;
    }

    .stat small {
        font-size: 8px;
    }

    .section {
        margin-top: 10px;
        border-radius: 11px;
    }

    .section-head {
        padding: 10px 12px;
    }

    .section-head h2 {
        font-size: 14px;
    }

    .section-head p {
        font-size: 8.5px;
    }

    .link {
        font-size: 8.5px;
    }

    .table th, .table td {
        padding: 8px 10px;
        font-size: 9px;
    }

    .alertbox {
        margin: 10px 12px;
        padding: 10px;
        gap: 9px;
    }

    .alerticon {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }

    .alertbox b {
        font-size: 9.5px;
    }

    .alertbox p {
        font-size: 8.5px;
    }

    .notifications {
        padding: 0 12px 10px;
    }

    .notice {
        grid-template-columns: 26px 1fr auto;
        gap: 8px;
        padding: 8px 0;
    }

    .nicon {
        width: 25px;
        height: 25px;
        font-size: 9.5px;
    }

    .notice b {
        font-size: 9.5px;
    }

    .notice p {
        font-size: 8.5px;
    }

    .date {
        font-size: 8.5px;
    }

    .design {
        padding: 12px;
    }

    .design h2 {
        font-size: 15px;
    }

    .design p {
        font-size: 9.5px;
        margin-bottom: 8px;
    }

    .sample {
        width: 70px;
        height: 96px;
        font-size: 7.5px;
        padding: 6px;
    }

    .availability {
        padding: 9px 11px;
    }

    .availability strong {
        font-size: 21px;
    }

    .rules {
        font-size: 8.5px;
        padding: 8px 10px;
    }

    .cta {
        padding: 10px;
        font-size: 10px;
    }
}

/* Mobile Screen - 375px */
@media (max-width: 375px) {
    .top {
        padding: 9px 10px;
        gap: 4px;
    }

    .logo {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }

    .brand b {
        font-size: 12.5px;
    }

    .brand span {
        font-size: 8px;
    }

    .bell {
        display: none;
    }

    .btn-back-dash {
        padding: 4px 7px;
        font-size: 9.5px;
    }

    .lang {
        padding: 5px 8px;
        font-size: 9.5px;
    }

    .card-content-wrap {
        padding: 10px 10px 24px;
    }

    .hero h1 {
        font-size: 18px;
    }

    .hero p {
        font-size: 10.5px;
    }

    .stats {
        gap: 6px;
    }

    .stat {
        width: fit-content;
        max-width: calc(50% - 3px);
        padding: 8px 10px;
        min-height: 78px;
    }

    .stat .ico {
        width: 23px;
        height: 23px;
        font-size: 10px;
        margin-bottom: 4px;
    }

    .stat label {
        font-size: 8px;
    }

    .stat strong {
        font-size: 18px;
    }

    .stat small {
        font-size: 7.5px;
    }

    .sample {
        width: 64px;
        height: 88px;
        font-size: 7px;
    }

    .availability strong {
        font-size: 19px;
    }
}

/* Compact Mobile Screen - 320px */
@media (max-width: 320px) {
    .top {
        padding: 8px;
    }

    .mobile-menu-btn {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .logo {
        width: 28px;
        height: 28px;
        font-size: 14px;
        border-radius: 7px;
    }

    .brand b {
        font-size: 11.5px;
    }

    .brand span {
        font-size: 7.5px;
    }

    .topright {
        gap: 5px;
    }

    .btn-back-dash {
        padding: 4px 6px;
        font-size: 9px;
    }

    .lang {
        padding: 4px 6px;
        font-size: 9px;
    }

    .card-content-wrap {
        padding: 8px 8px 20px;
    }

    .hero h1 {
        font-size: 16px;
        letter-spacing: -0.3px;
    }

    .hero p {
        font-size: 9.5px;
    }

    .stats {
        gap: 5px;
    }

    .stat {
        width: fit-content;
        max-width: calc(50% - 3px);
        padding: 7px 8px;
        min-height: 72px;
    }

    .stat .ico {
        width: 22px;
        height: 22px;
        font-size: 9.5px;
    }

    .stat label {
        font-size: 7.5px;
        line-height: 1.15;
    }

    .stat strong {
        font-size: 16px;
    }

    .stat small {
        font-size: 7px;
    }

    .section-head h2 {
        font-size: 12.5px;
    }

    .section-head p {
        font-size: 7.5px;
    }

    .alertbox {
        margin: 8px;
        padding: 8px;
        gap: 7px;
    }

    .alerticon {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }

    .alertbox b {
        font-size: 8.5px;
    }

    .alertbox p {
        font-size: 7.5px;
    }

    .notice {
        grid-template-columns: 22px 1fr auto;
        gap: 6px;
        padding: 6px 0;
    }

    .nicon {
        width: 22px;
        height: 22px;
        font-size: 8.5px;
    }

    .notice b {
        font-size: 8.5px;
    }

    .notice p {
        font-size: 7.5px;
    }

    .date {
        font-size: 7.5px;
    }

    .sample {
        width: 58px;
        height: 80px;
        font-size: 6.5px;
        padding: 5px;
    }

    .availability strong {
        font-size: 17px;
    }

    .rules {
        font-size: 7.5px;
        padding: 7px;
    }

    .cta {
        padding: 8px;
        font-size: 9px;
    }
}
.sample{flex-direction:column;align-items:center;justify-content:space-between}.sample img{width:64px;height:70px;object-fit:contain}.sample span{display:block}

/* Merchant navigation on mobile and tablet. */
        .bottom-nav-bar {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            width: 100%;
            background: #ffffff;
            border-top: 1px solid rgba(16, 52, 120, 0.09);
            box-shadow: 0 -4px 18px rgba(11, 33, 73, 0.08);
            display: flex;
            align-items: center;
            justify-content: space-around;
            padding: 7px 6px 9px;
            z-index: 998;
        }

        .bottom-tab-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
            text-decoration: none;
            cursor: pointer;
            background: none;
            border: none;
            outline: none;
            position: relative;
            padding: 0 4px;
        }

        .tab-icon-circle {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #ffffff;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
            transition: transform 0.15s ease;
        }

        .bottom-tab-item:active .tab-icon-circle { transform: scale(0.92); }
        .tab-icon-circle.home { background: linear-gradient(135deg, #ff4d29 0%, #ff7a00 100%); }
        .tab-icon-circle.unscratched { background: linear-gradient(135deg, #0099ff 0%, #0066cc 100%); }
        .tab-icon-circle.scratched { background: linear-gradient(135deg, #ff7e1d 0%, #f74d1a 100%); }
        .tab-icon-circle.customers { background: linear-gradient(135deg, #0ca872 0%, #059669 100%); }
        .tab-icon-circle.profile { background: linear-gradient(135deg, #8327db 0%, #c026d3 100%); }

        .tab-icon-circle svg { width: 20px; height: 20px; }

        .tab-text-label {
            font-size: 10.5px;
            font-weight: 800;
            color: #0b2149;
            line-height: 1;
        }


.bottom-nav-bar { display: none; }
@media (max-width: 1023px) {
    .bottom-nav-bar { display: flex; padding-bottom: calc(9px + env(safe-area-inset-bottom, 0px)); }
    body { padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }
    .bottom-tab-item:focus-visible { outline: 2px solid #0b2149; outline-offset: 4px; border-radius: 6px; }
}

/* This page uses its Dashboard and language header. */
.card-validity-page #portal-header { display: none !important; }
.card-validity-page .top { justify-content: flex-end; }

/* Seven summary cards occupy two desktop rows and a readable mobile grid. */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stats .stat { width: 100%; max-width: none; min-width: 0; padding: 14px; }
.stats .stat label { font-size: 12px; line-height: 1.35; }
.stats .stat strong { font-size: 24px; }
.stats .stat small { font-size: 11px; line-height: 1.4; }
@media (max-width: 680px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stats .stat { min-height: 130px; padding: 12px; }
    .stats .stat .ico { width: 28px; height: 28px; font-size: 14px; }
}

.stats .stat { align-items: center; text-align: center; }
