* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f8ff;
    color: #172554;
}

.app {
    max-width: 900px;
    margin: auto;
    padding: 0 15px 30px;
}


/* =========================
   HERO
========================= */

.hero {
    height: 300px;
    position: relative;
    overflow: hidden;

    border-radius: 0 0 30px 30px;

    background:
        linear-gradient(
            180deg,
            #314a9b 0%,
            #7965b5 30%,
            #f39a78 55%,
            #f8c879 68%,
            #1498b4 69%,
            #087b9c 100%
        );

    box-shadow:
        0 15px 35px rgba(0,0,0,.25);
}

.sun {
    position: absolute;
    top: 35px;
    left: 48%;
    font-size: 55px;
    filter: drop-shadow(0 0 18px #ffe66d);
}

.cloud {
    position: absolute;
    font-size: 45px;
    opacity: .8;
}

.cloud1 {
    left: 15%;
    top: 25px;
}

.cloud2 {
    right: 15%;
    top: 55px;
}

.palm {
    position: absolute;
    font-size: 125px;
    z-index: 3;
    filter: drop-shadow(4px 7px 5px rgba(0,0,0,.3));
}

.palm-left {
    left: -30px;
    top: -20px;
    transform: rotate(-7deg);
}

.palm-right {
    right: -30px;
    top: -20px;
    transform: scaleX(-1) rotate(-7deg);
}

.travel {
    position: absolute;
    z-index: 5;
    font-size: 42px;
}

.travel1 {
    left: 70px;
    bottom: 20px;
}

.travel2 {
    right: 95px;
    bottom: 55px;
}

.travel3 {
    left: 45%;
    top: 25px;
}


/* =========================
   TITLE
========================= */

.hero-text {
    position: absolute;
    z-index: 10;

    top: 52%;
    left: 50%;

    transform:
        translate(-50%, -50%);

    width: 90%;

    text-align: center;

    background:
        rgba(20,25,55,.32);

    padding: 20px 15px 23px;

    border-radius: 22px;

    backdrop-filter: blur(3px);

    border:
        1px solid
        rgba(255,255,255,.22);

    box-shadow:
        0 10px 25px
        rgba(0,0,0,.28),
        inset 0 1px 0
        rgba(255,255,255,.18);
}

.hero h1 {
    margin: 0;

    font-size:
        clamp(52px,10vw,90px);

    font-weight: 1000;

    letter-spacing: 5px;

    color: white;

    text-shadow:
        3px 3px 0 #102b68,
        6px 6px 0 #0b1d4b,
        0 10px 18px
        rgba(0,0,0,.55);
}

.hero p {
    margin: 5px 0 0;

    color: white;

    font-size: 21px;

    font-weight: bold;

    font-style: italic;

    text-shadow:
        0 3px 7px
        rgba(0,0,0,.65);
}


/* =========================
   CARDS
========================= */

.card {
    margin-top: 20px;
    padding: 25px;

    background: white;

    border-radius: 20px;

    border:
        1px solid #dbe5f5;

    box-shadow:
        0 7px 20px
        rgba(35,65,120,.09);
}

.card h2 {
    margin-top: 0;
    font-size: 21px;
}


/* =========================
   INPUTS
========================= */

label {
    display: block;

    margin:
        15px 0 7px;

    font-weight: bold;
}

input,
select {
    width: 100%;

    padding: 14px;

    border:
        1px solid #b8c9e5;

    border-radius: 11px;

    font-size: 16px;

    outline: none;
}

input:focus,
select:focus {
    border-color: #3478d5;

    box-shadow:
        0 0 0 3px
        rgba(52,120,213,.1);
}


/* =========================
   BUTTONS
========================= */

button {
    border: none;

    border-radius: 11px;

    padding: 13px 20px;

    margin-top: 12px;

    font-size: 16px;

    font-weight: bold;

    color: white;

    background:
        linear-gradient(
            135deg,
            #087f55,
            #16a66d
        );

    cursor: pointer;

    transition: .2s;
}

button:hover {
    transform: translateY(-2px);

    box-shadow:
        0 6px 12px
        rgba(0,0,0,.18);
}

.input-row {
    display: grid;

    grid-template-columns:
        1fr auto;

    gap: 10px;
}

.input-row button {
    margin-top: 0;

    background:
        linear-gradient(
            135deg,
            #5b32c5,
            #7c4be8
        );
}

.new-bill-btn {
    background:
        linear-gradient(
            135deg,
            #e58b22,
            #f0b429
        );

    margin-left: 8px;
}


/* =========================
   PARTICIPANTS
========================= */

#participantList {
    display: flex;

    flex-wrap: wrap;

    gap: 10px;

    margin-top: 20px;
}

.participant {
    display: flex;

    align-items: center;

    gap: 8px;

    padding: 10px 13px;

    border-radius: 12px;

    background: #eee9ff;

    color: #3b218d;

    font-weight: bold;
}

.remove {
    background: transparent;

    color: #d22;

    padding: 0;

    margin: 0;

    font-size: 18px;

    box-shadow: none;
}


/* =========================
   EXPENSES
========================= */

.section-title {
    display: flex;

    justify-content:
        space-between;

    align-items: center;
}

.section-title h2 {
    margin: 0;
}

#expenseList {
    margin-top: 15px;
}

.expense {
    display: grid;

    grid-template-columns:
        1fr 120px 130px auto;

    gap: 10px;

    align-items: center;

    padding: 14px 5px;

    border-bottom:
        1px solid #e7ecf4;
}

.expense-name {
    font-weight: bold;
}

.expense-amount {
    font-weight: bold;

    color: #087a4b;
}

.expense-payer {
    color: #5b4b9a;

    font-size: 14px;
}

.edit,
.delete {
    padding: 7px 10px;

    margin: 0;

    font-size: 13px;
}

.edit {
    background: #397bd1;
}

.delete {
    background: #dc3c4b;
}


/* =========================
   CALCULATE
========================= */

.calculate-box {
    text-align: center;

    padding: 25px 0;
}

#calculateBtn {
    background:
        linear-gradient(
            135deg,
            #153c9a,
            #3479df
        );

    padding:
        16px 35px;

    font-size: 18px;

    box-shadow:
        0 8px 18px
        rgba(21,60,154,.3);
}


/* =========================
   SUMMARY
========================= */

.result {
    background:
        linear-gradient(
            135deg,
            #f8fbff,
            #eef8ff
        );
}

.summary {
    display: grid;

    grid-template-columns:
        repeat(3,1fr);

    gap: 12px;
}

.summary div {
    text-align: center;

    padding: 18px 10px;

    border-radius: 15px;

    background: white;

    border:
        1px solid #d8e5f5;

    box-shadow:
        0 5px 12px
        rgba(0,0,0,.06);
}

.summary span {
    display: block;

    font-size: 13px;

    color: #60708d;
}

.summary strong {
    display: block;

    margin-top: 7px;

    font-size: 23px;

    color: #123b87;
}

#settlement {
    background: white;

    border-radius: 14px;

    overflow: hidden;
}

.settlement-row {
    display: flex;

    justify-content:
        space-between;

    padding: 13px;

    border-bottom:
        1px solid #e5eaf2;

    font-weight: bold;
}

.settlement-row strong {
    color: #087b4c;
}


/* =========================
   RECEIPT BUTTON
========================= */

.receipt-button-area {
    text-align: center;

    margin-top: 25px;
}

#receiptBtn {
    background:
        linear-gradient(
            135deg,
            #7b32c7,
            #c0449e
        );

    padding:
        15px 30px;

    box-shadow:
        0 8px 18px
        rgba(123,50,199,.25);
}


/* =================================================
   PROFESSIONAL RECEIPT
================================================= */

.receipt-container {
    display: none;

    margin-top: 30px;
}

.receipt {
    max-width: 720px;

    margin: auto;

    background: #ffffff;

    border-radius: 26px;

    overflow: hidden;

    border:
        1px solid #d7e0f1;

    box-shadow:
        0 20px 55px
        rgba(24,49,103,.22);

    position: relative;
}


/* Decorative top */

.receipt-top-decoration {
    display: flex;

    height: 7px;
}

.receipt-top-decoration span {
    flex: 1;
}

.receipt-top-decoration span:nth-child(1) {
    background: #293d94;
}

.receipt-top-decoration span:nth-child(2) {
    background: #e79b49;
}

.receipt-top-decoration span:nth-child(3) {
    background: #1598a7;
}


/* Receipt header */

.receipt-header {
    padding: 25px;

    background:
        linear-gradient(
            135deg,
            #172c76,
            #543a9b,
            #148f9e
        );

    color: white;

    display: flex;

    justify-content:
        space-between;

    align-items: center;

    gap: 20px;
}

.receipt-brand {
    display: flex;

    align-items: center;

    gap: 13px;
}

.receipt-logo {
    width: 58px;
    height: 58px;

    display: grid;

    place-items: center;

    background:
        rgba(255,255,255,.16);

    border:
        1px solid
        rgba(255,255,255,.3);

    border-radius: 17px;

    font-size: 32px;
}

.receipt-header h1 {
    margin: 0;

    font-size: 34px;

    letter-spacing: 3px;

    text-shadow:
        2px 3px 0
        rgba(0,0,0,.25);
}

.receipt-header p {
    margin: 4px 0 0;

    opacity: .9;

    font-size: 13px;
}

.certificate-label {
    padding: 10px 13px;

    border:
        1px solid
        rgba(255,255,255,.4);

    border-radius: 10px;

    font-size: 10px;

    font-weight: bold;

    letter-spacing: 1px;

    text-align: center;

    line-height: 1.4;

    background:
        rgba(255,255,255,.1);
}


/* Number */

.receipt-number-box {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 20px;

    padding: 17px 24px;

    background: #f2f6fd;

    border-bottom:
        1px solid #dce5f2;
}

.receipt-number-box div {
    display: flex;

    flex-direction: column;

    gap: 4px;
}

.receipt-number-box small {
    color: #72809a;

    font-size: 10px;

    font-weight: bold;

    letter-spacing: .7px;
}

.receipt-number-box strong {
    color: #183675;

    font-size: 13px;
}


/* Bill title */

.receipt-title {
    text-align: center;

    padding: 22px 20px 15px;
}

.receipt-title small {
    color: #7a879e;

    font-size: 10px;

    font-weight: bold;

    letter-spacing: 1px;
}

.receipt-title h2 {
    margin: 5px 0 0;

    color: #253c8c;

    font-size: 26px;
}


/* Grand total */

.grand-total {
    margin: 0 24px 18px;

    padding: 20px;

    text-align: center;

    border-radius: 18px;

    background:
        linear-gradient(
            135deg,
            #eef7ff,
            #f5efff
        );

    border:
        1px solid #d8e5f7;
}

.grand-total span {
    display: block;

    color: #697791;

    font-size: 11px;

    font-weight: bold;

    letter-spacing: 1px;
}

.grand-total strong {
    display: block;

    margin: 5px 0;

    color: #162f78;

    font-size: 38px;
}

.grand-total small {
    color: #71809a;
}


/* Summary */

.receipt-summary {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 12px;

    padding: 0 24px 20px;
}

.receipt-summary div {
    padding: 14px;

    text-align: center;

    background: #fafcff;

    border:
        1px solid #e2e9f5;

    border-radius: 13px;
}

.receipt-summary span {
    display: block;

    color: #71809a;

    font-size: 11px;
}

.receipt-summary strong {
    display: block;

    margin-top: 4px;

    color: #193b8c;

    font-size: 19px;
}


/* Receipt sections */

.receipt-section {
    padding: 0 24px 18px;
}

.receipt-section-title {
    display: flex;

    justify-content:
        space-between;

    align-items: center;

    border-bottom:
        2px solid #e7ecf5;

    margin-bottom: 8px;
}

.receipt-section-title h3 {
    margin: 0 0 7px;

    color: #263c89;

    font-size: 15px;
}

.receipt-section-title span {
    color: #7b879b;

    font-size: 9px;

    font-weight: bold;
}


/* Expense */

.receipt-expense {
    display: grid;

    grid-template-columns:
        1fr 1fr auto;

    gap: 10px;

    align-items: center;

    padding: 8px 0;

    border-bottom:
        1px solid #edf1f6;

    font-size: 12px;
}

.receipt-expense span:nth-child(2) {
    color: #66758f;
}

.receipt-expense strong {
    color: #087b4c;

    text-align: right;
}


/* Settlement */

.receipt-settlement {
    display: flex;

    justify-content:
        space-between;

    align-items: center;

    padding: 10px 12px;

    margin-bottom: 7px;

    border-radius: 10px;

    background: #f5f9ff;

    border:
        1px solid #e4ebf6;

    font-size: 12px;

    font-weight: bold;
}

.receipt-settlement strong {
    color: #087b4c;
}


/* Verification */

.verification {
    display: flex;

    align-items: center;

    gap: 13px;

    margin: 0 24px 20px;

    padding: 14px;

    border-radius: 14px;

    background: #edfbf4;

    border:
        1px solid #c9efdc;
}

.verification-icon {
    width: 40px;
    height: 40px;

    display: grid;

    place-items: center;

    border-radius: 50%;

    color: white;

    background: #0a965b;

    font-size: 20px;

    font-weight: bold;
}

.verification strong {
    color: #08784a;

    font-size: 13px;
}

.verification p {
    margin: 3px 0 0;

    color: #5f7c6d;

    font-size: 10px;
}


/* Receipt footer */

.receipt-footer {
    display: flex;

    justify-content:
        center;

    align-items: center;

    gap: 25px;

    padding: 20px 24px;

    background: #f6f8fc;

    border-top:
        1px dashed #bec9da;
}

.receipt-qr-placeholder {
    text-align: center;
}

.qr-grid {
    width: 55px;
    height: 55px;

    display: grid;

    place-items: center;

    border:
        4px solid #263b91;

    background: white;

    font-size: 35px;

    line-height: 1;
}

.receipt-qr-placeholder small {
    display: block;

    margin-top: 4px;

    color: #77839a;

    font-size: 8px;
}

.receipt-footer-text strong {
    color: #263b91;

    font-size: 15px;
}

.receipt-footer-text p {
    margin: 3px 0;

    color: #687690;

    font-size: 11px;
}

.receipt-footer-text small {
    color: #8792a4;

    font-size: 9px;
}

.receipt-bottom-line {
    height: 5px;

    background:
        linear-gradient(
            90deg,
            #293d94,
            #e79b49,
            #1598a7
        );
}


/* Receipt actions */

.receipt-actions {
    display: flex;

    justify-content:
        center;

    flex-wrap: wrap;

    gap: 10px;

    padding: 20px;
}

.receipt-actions button {
    margin: 0;
}

#downloadJpgBtn {
    background:
        linear-gradient(
            135deg,
            #d17b23,
            #efaa36
        );
}

#printReceiptBtn {
    background:
        linear-gradient(
            135deg,
            #263f9b,
            #3f73d4
        );
}

#closeReceiptBtn {
    background: #69758a;
}


/* =========================
   FOOTER
========================= */

footer {
    text-align: center;

    padding: 25px;

    color: #65738e;
}

footer p {
    margin: 5px;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 650px) {

    .hero {
        height: 255px;
    }

    .hero h1 {
        font-size: 48px;
    }

    .hero p {
        font-size: 15px;
    }

    .palm {
        font-size: 80px;
    }

    .travel1 {
        left: 30px;
        bottom: 10px;
    }

    .travel2 {
        right: 50px;
    }

    .summary,
    .receipt-summary {
        grid-template-columns: 1fr;
    }

    .expense {
        grid-template-columns:
            1fr 1fr;
    }

    .expense-name {
        grid-column: span 2;
    }

    .expense-payer {
        grid-column: span 2;
    }

    .receipt-header {
        flex-direction: column;

        text-align: center;
    }

    .receipt-number-box {
        grid-template-columns: 1fr;
    }

    .receipt-expense {
        grid-template-columns:
            1fr auto;
    }

    .receipt-expense span:nth-child(2) {
        grid-column: 1;
    }

    .receipt-expense strong {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .input-row {
        grid-template-columns: 1fr;
    }

    .input-row button {
        margin-top: 0;
    }

    .hero-text {
        width: 94%;
    }

    .new-bill-btn {
        margin-left: 0;
    }

    .grand-total strong {
        font-size: 31px;
    }
}


/* =========================
   PRINT / PDF
========================= */

@media print {

    @page {
        size: A4;
        margin: 8mm;
    }

    html,
    body {
        margin: 0;
        padding: 0;
        background: white;
    }

    body * {
        visibility: hidden;
    }

    .receipt-container,
    .receipt-container * {
        visibility: visible;
    }

    .receipt-container {
        display: block !important;

        position: absolute;

        left: 0;
        top: 0;

        width: 100%;

        margin: 0;
        padding: 0;
    }

    .receipt {
        width: 100%;
        max-width: 190mm;

        margin: 0 auto;

        border: none;

        border-radius: 0;

        box-shadow: none;

        overflow: visible;

        font-size: 12px;
    }

    .receipt-header {
        padding: 14px 15px;
    }

    .receipt-logo {
        width: 45px;
        height: 45px;

        font-size: 25px;
    }

    .receipt-header h1 {
        font-size: 28px;
    }

    .receipt-title {
        padding: 10px;
    }

    .receipt-title h2 {
        font-size: 20px;
    }

    .grand-total {
        padding: 12px;
        margin-bottom: 10px;
    }

    .grand-total strong {
        font-size: 28px;
    }

    .receipt-summary {
        padding-bottom: 10px;
    }

    .receipt-summary div {
        padding: 8px;
    }

    .receipt-section {
        padding-bottom: 8px;
    }

    .receipt-section-title h3 {
        font-size: 13px;
    }

    .receipt-expense,
    .receipt-settlement {
        font-size: 10px;
    }

    .verification {
        margin-bottom: 10px;
        padding: 9px;
    }

    .receipt-footer {
        padding: 12px;
    }

    .receipt-actions {
        display: none !important;
    }

    .receipt-header,
    .receipt-number-box,
    .receipt-title,
    .grand-total,
    .receipt-summary,
    .receipt-section,
    .verification,
    .receipt-footer {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* =================================================
   BILL HISTORY
================================================= */

#billHistorySection {
    margin-top: 30px;
}


#billHistory {
    display: flex;
    flex-direction: column;
    gap: 15px;
}


.bill-history-item {

    background:
        linear-gradient(
            135deg,
            #ffffff,
            #f5fbff
        );

    border-radius: 18px;

    padding: 18px;

    border:
        1px solid rgba(
            0,
            0,
            0,
            0.08
        );

    box-shadow:
        0 8px 22px
        rgba(
            0,
            0,
            0,
            0.08
        );

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


.bill-history-item:hover {

    transform:
        translateY(-2px);

    box-shadow:
        0 12px 28px
        rgba(
            0,
            0,
            0,
            0.12
        );

}


.bill-history-item h3 {

    margin:
        0 0 8px;

    font-size:
        18px;

}


.bill-history-item p {

    margin:
        5px 0;

    color:
        #555;

}


.history-actions {

    display:
        flex;

    flex-wrap:
        wrap;

    gap:
        8px;

    margin-top:
        14px;

}


.history-actions button {

    border:
        none;

    border-radius:
        10px;

    padding:
        9px 14px;

    cursor:
        pointer;

    font-weight:
        600;

}


.history-actions button:hover {

    transform:
        translateY(-1px);

}


@media (
    max-width: 600px
) {

    .history-actions {

        flex-direction:
            column;

    }


    .history-actions button {

        width:
            100%;

    }

}
/* =================================================
   BILLSPLIT PROFESSIONAL DASHBOARD
================================================= */

.dashboard-card {

    margin-bottom: 24px;

    padding: 24px;

    border-radius: 24px;

    background:
        linear-gradient(
            135deg,
            #ffffff 0%,
            #f5f9ff 50%,
            #f8f4ff 100%
        );

    border:
        1px solid rgba(
            40,
            60,
            120,
            0.10
        );

    box-shadow:
        0 15px 40px
        rgba(
            35,
            55,
            100,
            0.10
        );

}


.dashboard-header {

    display: flex;

    justify-content:
        space-between;

    align-items:
        center;

    gap: 20px;

    margin-bottom: 22px;

}


.dashboard-kicker {

    display: inline-block;

    margin-bottom: 5px;

    font-size: 10px;

    font-weight: 800;

    letter-spacing: 1.5px;

    color: #5369b5;

}


.dashboard-header h2 {

    margin:
        0 0 5px;

    color: #182e72;

}


.dashboard-header p {

    margin: 0;

    color: #68758d;

    font-size: 14px;

}


.dashboard-icon {

    width: 64px;

    height: 64px;

    display: grid;

    place-items: center;

    flex-shrink: 0;

    border-radius: 20px;

    font-size: 30px;

    background:
        linear-gradient(
            135deg,
            #eaf2ff,
            #f3eaff
        );

    box-shadow:
        0 8px 20px
        rgba(
            50,
            70,
            150,
            0.12
        );

}


.dashboard-stats {

    display: grid;

    grid-template-columns:
        repeat(
            3,
            1fr
        );

    gap: 12px;

}


.dashboard-stat {

    padding: 17px;

    border-radius: 17px;

    background: #ffffff;

    border:
        1px solid #e6ebf5;

}


.dashboard-stat > span {

    display: block;

    margin-bottom: 7px;

    font-size: 20px;

}


.dashboard-stat small {

    display: block;

    color: #7a879d;

    font-size: 11px;

    font-weight: 600;

}


.dashboard-stat strong {

    display: block;

    margin-top: 5px;

    color: #19377f;

    font-size: 22px;

}


.dashboard-actions {

    display: flex;

    gap: 10px;

    margin-top: 16px;

}


.dashboard-actions button {

    flex: 1;

}


@media (
    max-width: 650px
) {

    .dashboard-card {

        padding: 18px;

        border-radius: 20px;

    }


    .dashboard-header {

        align-items:
            flex-start;

    }


    .dashboard-stats {

        grid-template-columns:
            1fr;

    }


    .dashboard-actions {

        flex-direction:
            column;

    }


    .dashboard-actions button {

        width: 100%;

    }

}
/* =================================================
   ADVANCED RECEIPT SHARING
================================================= */

.social-share-panel {

    display: none;

    margin-top: 16px;

    padding: 18px;

    border-radius: 20px;

    background:
        linear-gradient(
            135deg,
            #ffffff,
            #f5f8ff
        );

    border:
        1px solid #e3e8f5;

    box-shadow:
        0 10px 28px
        rgba(
            30,
            50,
            100,
            0.10
        );

}


.social-share-panel.show {

    display: block;

    animation:
        sharePanelIn
        0.25s
        ease;

}


@keyframes sharePanelIn {

    from {

        opacity: 0;

        transform:
            translateY(8px);

    }

    to {

        opacity: 1;

        transform:
            translateY(0);

    }

}


.social-share-title {

    display: flex;

    flex-direction: column;

    gap: 4px;

    margin-bottom: 14px;

}


.social-share-title strong {

    color: #19377f;

    font-size: 17px;

}


.social-share-title span {

    color: #77839a;

    font-size: 12px;

}


.social-share-grid {

    display: grid;

    grid-template-columns:
        repeat(
            4,
            1fr
        );

    gap: 10px;

}


.social-btn {

    border: none;

    border-radius: 14px;

    padding: 12px 8px;

    background: #ffffff;

    border:
        1px solid #e4e9f3;

    cursor: pointer;

    font-weight: 700;

    color: #29354c;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;

}


.social-btn span {

    display: block;

    font-size: 20px;

    margin-bottom: 5px;

}


.social-btn:hover {

    transform:
        translateY(-2px);

    box-shadow:
        0 7px 18px
        rgba(
            0,
            0,
            0,
            0.10
        );

}


.social-btn.whatsapp:hover {

    border-color:
        #25D366;

}


.social-btn.facebook:hover {

    border-color:
        #1877F2;

}


.social-btn.x:hover {

    border-color:
        #111111;

}


.social-btn.email:hover {

    border-color:
        #8b5cf6;

}


#copyReceiptBtn {

    background:
        linear-gradient(
            135deg,
            #f4f7ff,
            #ffffff
        );

}


@media (
    max-width: 650px
) {

    .social-share-grid {

        grid-template-columns:
            repeat(
                2,
                1fr
            );

    }

}