/* ================= GLOBAL ================= */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background: #ffffff;
}

body {
    font-family: 'Noto Sans Devanagari', Arial, sans-serif;
    background-color: #ffffff;
    margin: 0px;
    letter-spacing: 0.2px;
    line-height: 1.5;
}

:root {
    --control-height: 30px;
    --control-radius: 8px;
    --control-padding-x: 6px;
}

/* ================= AUTH PAGES ================= */

body.auth-page {
    background: url("images/bg_login_new.jpg") no-repeat center top;
    background-size: cover;
    background-color: #f4f4f4;
}

.auth-center {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 50vh;   /* 🔥 only login pages shift */
}

body.auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(200, 230, 200, 0.05);
    z-index: -1;
}

/* Login / Register card */
.login-container {
    width: 360px;
    margin: 20px auto;
    padding: 4px 30px 30px 30px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.login-container a {
    font-size: 16px;
    font-weight: 500;
}

h2 {
    margin-bottom: 20px;
}

/* Global input appearance (NO margin here) */
input,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

/* Auth page spacing */
.login-container input,
.login-container select {
    margin-bottom: 14px;
}

/* Password eye */
.password-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.password-wrapper input {
    flex: 1;
}

.eye {
    cursor: pointer;
    font-size: 18px;
    user-select: none;
}

.eye-placeholder {
    width: 22px;
}


/* Buttons */
.button-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
}

button[type="submit"] {
    background-color: #8fd19e;
    color: #1f3d2b;
}

button[type="submit"]:hover {
    background-color: #7acb8d;
}

button[type="button"] {
    background-color: #9fd3f6;
    color: #0b3c5d;
}

button[type="button"]:hover {
    background-color: #88c6ef;
}
/* Flash messages */
.flash {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 6px;
    font-size: 14px;
}

.flash.success {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
}

.flash.success button {
    background: #28a745;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.flash.error {
    color: red;
    margin-top: 10px;
    padding-left: 18px;
}

.flash.error li {
    margin-bottom: 4px;
}

/* ================= DASHBOARD ================= */

.dashboard-container {
    width: 420px;
    margin: 100px auto;
    padding: 20px;
    padding-top: 8px;
    background: #D6D5F7;
    border-radius: 12px;
    text-align: center;
}

.dashboard-container h2 {
    margin-bottom: 25px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.dashboard-home-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 20;
}

.dashboard-home-container {
    width: min(72vw, 1100px);
    margin: 20px auto;
    padding: 20px 24px;
    background: #D6D5F7;
    border-radius: 14px;
    box-sizing: border-box;
}

/* 5 buttons (Admin) */
.dashboard-home-container .dashboard-grid:has(.dash-btn.admin) {

    grid-template-columns: repeat(5, 1fr);

}

/* 4 buttons (Normal User) */
.dashboard-home-container .dashboard-grid:not(:has(.dash-btn.admin)) {

    grid-template-columns: repeat(4, 1fr);

}

.dashboard-home-container .dash-btn{
    height:60px;
    font-size:16px;
}

.dash-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 70px;
    font-size: 18px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: bold;
    color: black;
    border: 1px solid #1f3d5c;

    /* The "Aesthetic" Magic: Shadows */
    /* A subtle shadow that mimics natural light */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
                0 2px 4px -1px rgba(0, 0, 0, 0.06);

    /* Smooth Transition for the hover effect */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

/* Icon Container Styling */
.dash-btn i, .dash-btn svg {
    font-size: 22px;
    opacity: 0.85;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hover Enhancements */
.dash-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(31, 61, 92, 0.4);
}

/* Icon Animation on Hover */
.dash-btn:hover i, .dash-btn:hover svg {
    transform: translateX(5px) rotate(-8deg);
    opacity: 1;
}

/* ============== ADMIN PANEL ======================= */

.admin-container {
    width: 520px;
    margin: 20px auto;
    background: #D6D5F7;
}

.admin-title {
    text-align: center;
    margin: 15px 0 20px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.admin-card {
    height: 70px;
    background: #eef4ff;
}

.admin-card:hover {
    background: #dbe8ff;
}

.dash-btn.farmer { background-color: #a8d0ff; }
.dash-btn.vendor { background-color: #ffab91; }
.dash-btn.report { background-color: #fff59d; }
.dash-btn.logout { background-color: #f7b2d9; }
.dash-btn.admin { background-color: #d4b5ff; }
.dash-btn.farmer:hover { background-color: #7fb5f5; }/* Darker Blue */
.dash-btn.vendor:hover { background-color: #e58567; }/* Darker Peach */
.dash-btn.report:hover {background-color: #f2e161; } /* Darker Yellow */
.dash-btn.logout:hover { background-color: #e887ba; }/* Darker Pink */
.dash-btn.admin:hover { background-color: #b88ff5; }

/* ================= Farmer/Vendor/item List page ================ */
.farmer-list-container {
    width: 800px;
    margin: 10px auto;
    text-align: left;
}

.farmer-list-container h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 10px;
}

.vendor-list-container {
    width: 800px;
    margin: 10px auto;
    text-align: left;
}

.vendor-list-container h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 10px;
}

.item-list-container {
    margin: 10px auto;
}

.item-list-container h2 {
    margin: 0;
    margin-bottom: 10px;
}

.report-container {
    width: 95%;
    max-width: 1200px;
    margin: 10px auto !important;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 20px);
    box-sizing: border-box;
    background-color: #D6D5F7;
    border-radius: 12px;
    overflow: hidden;
}

/*            Vendor Bill Details Report                 */
/* ===================================================== */

.vendor-report-container {
    width: min(95vw, 1400px);
    margin: 10px auto;
    background: #D6D5F7;
    border-radius: 12px;
    padding: 16px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Everything above table */
.report-filter-row,
.report-heading,
.back-btn {
    flex-shrink: 0;
}

/* Scroll only table body */
.report-table-wrapper {
    overflow-y: auto;
    overflow-x: auto;
    margin-top: 10px;
    width: 100%;
    display: flex;
    justify-content: center;
    -webkit-overflow-scrolling: touch;
}

/* Sticky Table Header */
.report-table thead th {
    position: sticky;
    top: 0;
    background: #e6ecf5;
    z-index: 5;
    box-shadow: 0 2px 2px rgba(0,0,0,0.08);
}

/* ===== Vendor Wise Report – Single Row Layout ===== */

.report-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 10px 0 10px 0;
}

/* Date inputs smaller */
.date-input {
    width: 140px;
    padding: 6px;
    font-size: 14px;
}

/* Vendor dropdown wider */
.vendor-select {
    width: 280px;
    padding: 6px 10px;
    font-size: 16px;
    font-family: "Noto Sans Devanagari", "Mangal", Arial, sans-serif;
}

/* Improve Marathi readability */
.vendor-select option {
    font-size: 16px;
    font-family: "Noto Sans Devanagari", "Mangal", Arial, sans-serif;
}

.vendor-select {
    width: 300px;
}

.date-input {
    width: 120px;
}

.report-container .report-filter-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.vendor-report-container .report-filter-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: nowrap;
    margin-bottom: 12px;
}

/* Date inputs smaller */
.vendor-report-container .date-input {
    width: 140px;
}

/* Vendor dropdown wider */
.report-container .report-filter-row select {
    width: 360px !important;
    min-width: 360px;
    font-family: 'Noto Sans Devanagari', 'Mangal', Arial, sans-serif;
    font-size: 14px;
}

.vendor-report-container .vendor-select {
    width: 320px;
}

/* Show button fixed */
.report-container .report-filter-row .show-btn {
    width: 120px;
    min-width: 120px;
    padding: 6px 10px;
    font-size: 14px;
    white-space: nowrap;
}

.vendor-report-container .show-btn {
    width: auto;
    min-width: 120px;
}

/* Style the horizontal line below the filter row */
.report-divider {
    border: 0;
    border-top: 2px solid #d9534f; /* Red color as per your drawing */
    margin: 0 10px 10px 10px;
    width: auto;
}

.report-filter-row .field {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 🔥 Override global 100% width */
/* ===== Vendor Dropdown Fix ===== */
.report-filter-row input,
.report-filter-row select {
    width: 340px !important;     /* slightly wider */
    max-width: 340px;
}

/* If using Select2 */
.report-filter-row .select2-container {
    width: 340px !important;
}

.report-filter-row .select2-selection__rendered {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Date fields */
.report-filter-row input[type="date"] {
    width: 150px;
}

/* Vendor dropdown bigger */
.report-filter-row select {
    width: 300px;   /* enough for long names */
}

/* Show button */
.show-btn {
    padding: 10px 18px;     /* smaller horizontal padding */
    font-size: 15px;
    font-weight: 600;
    min-width: unset;
    white-space: nowrap;
}

/* ===== Force Report Table Layout ===== */
.report-table {
    width: 1040px !important;
    table-layout: fixed;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.vendor-wise-report-table-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
}

.vendor-wise-report-table {
    width: 100%;
    min-width: 1100px;
    table-layout: fixed;
    border-collapse: collapse;
}

.vendor-wise-report-table th,
.vendor-wise-report-table td {
    border: 1px solid #444;
    padding: 6px;
}

/* Bill No */
.vendor-report-container .vendor-wise-report-table th:nth-child(1),
.vendor-report-container .vendor-wise-report-table td:nth-child(1) {
    width: 5%;
    text-align: center;
}

/* Vendor Name */
.vendor-report-container .vendor-wise-report-table th:nth-child(2),
.vendor-report-container .vendor-wise-report-table td:nth-child(2) {
    width: 32%;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Open Bill */
.vendor-report-container .vendor-wise-report-table th:nth-child(3),
.vendor-report-container .vendor-wise-report-table td:nth-child(3) {
    width: 7%;
    text-align: center;
}

/* Date */
.vendor-report-container .vendor-wise-report-table th:nth-child(4),
.vendor-report-container .vendor-wise-report-table td:nth-child(4) {
    width: 9%;
    text-align: center;
}

/* Net Amount */
.vendor-report-container .vendor-wise-report-table th:nth-child(5),
.vendor-report-container .vendor-wise-report-table td:nth-child(5) {
    width: 11%;
    text-align: right;
}

/* Total Amount */
.vendor-report-container .vendor-wise-report-table th:nth-child(6),
.vendor-report-container .vendor-wise-report-table td:nth-child(6) {
    width: 11%;
    text-align: right;
}

/* Paid Amount */
.vendor-report-container .vendor-wise-report-table th:nth-child(7),
.vendor-report-container .vendor-wise-report-table td:nth-child(7) {
    width: 12%;
    text-align: right;
}

/* Pending Amount */
.vendor-report-container .vendor-wise-report-table th:nth-child(8),
.vendor-report-container .vendor-wise-report-table td:nth-child(8) {
    width: 13%;
    text-align: right;
}

@media (max-width: 768px) {

    .dashboard-container.vendor-report-container {
        width: calc(100% - 16px);
        max-width: none;
        padding: 12px;
        margin: 8px auto;
        border-radius: 10px;
        overflow: hidden;
    }

    .vendor-report-container .back-btn {
        display: inline-block;
        padding: 8px 12px;
        font-size: 14px;
    }

    .vendor-report-container .report-heading {
        margin: 12px 0 8px;
        font-size: 20px;
        line-height: 1.3;
    }

    .vendor-report-container .report-filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
        margin: 8px 0 12px;
    }

    .vendor-report-container .report-filter-row label {
        text-align: left;
        margin: 2px 0 -4px;
        font-weight: 600;
    }

    .vendor-report-container .report-filter-row .date-input,
    .vendor-report-container .report-filter-row .vendor-select {
        width: 100% !important;
        min-width: 0;
        max-width: none;
        height: 42px;
        padding: 8px 10px;
        box-sizing: border-box;
    }

    .vendor-report-container .report-filter-row .show-btn {
        width: 100%;
        min-width: 0;
        margin-top: 4px;
        padding: 10px 12px;
        box-sizing: border-box;
    }

    .vendor-report-container .report-divider {
        margin: 0 0 10px;
    }

    .vendor-report-container .vendor-wise-report-table-wrapper {
        width: 100%;
        max-height: 55svh;
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-gutter: stable;
    }

    .vendor-report-container .vendor-wise-report-table {
        width: 800px;
        min-width: 800px;
        font-size: 13px;
    }

    .vendor-report-container .vendor-wise-report-table th:nth-child(2),
    .vendor-report-container .vendor-wise-report-table td:nth-child(2) {
        width: 20%;
    }

    .vendor-report-container .vendor-wise-report-table th,
    .vendor-report-container .vendor-wise-report-table td {
        padding: 5px;
        white-space: nowrap;
    }

    .vendor-report-container .vendor-wise-report-table thead th {
        position: sticky;
        top: 0;
        z-index: 5;
        background: #e6ecf5;
        box-shadow: 0 2px 2px rgba(0, 0, 0, 0.12);
    }
}

/* ===================================================== */
/*        Pending Amount Report – Compact Panel         */
/* ===================================================== */

/* Center the inline-block */
body {
    text-align: center;
}

.pending-panel * {
    text-align: left;  /* reset inside */
}

/* ================= Sticky Header for List Pages ================= */
.list-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #D6D5F7;        /* same panel color */
    padding-top: 6px;
    padding-bottom: 10px;
}

.farmer-list-container th {
    position: static;
}

.vendor-list-container th {
    position: static;
}

/* Farmer/Vendor list table layout */
.dashboard-container table {
    table-layout: fixed;
    width: 100%;
}

/* Farmer/Vendor Name column */
.dashboard-container table th:nth-child(1),
.dashboard-container table td:nth-child(1) {
    width: 45%;               /* 🔥 BIGGER column */
}

/* Other columns tighter */
.dashboard-container table th:nth-child(2),
.dashboard-container table td:nth-child(2) {
    width: 15%;
}

.dashboard-container table th:nth-child(3),
.dashboard-container table td:nth-child(3) {
    width: 15%;
}

.dashboard-container table th:nth-child(4),
.dashboard-container table td:nth-child(4) {
    width: 10%;
}

.dashboard-container table th:nth-child(5),
.dashboard-container table td:nth-child(5) {
    width: 15%;
}

.dashboard-container table td:nth-child(1) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ================= Sticky Table Columns ================= */
.table-scroll {
    max-height: calc(100vh - 180px); /* header + search */
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    color: #FFFFFF;
    background: #7A7894;      /* MUST be solid */
    white-space: nowrap;
    box-shadow: 0 2px 0 #aaa; /* visual separation */
}

.table-scroll table {
    border-collapse: separate;
    border-spacing: 0;
}

/* ================= FARMER / VENDOR TRANSACTIONS ================= */
.farmer-main-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    height: 100vh;
    min-height: 100vh;
    gap: 10px;
    padding: 10px;
    background: #dbe9ff;
    box-sizing: border-box;
    margin: 0;
}

.vendor-main-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    height: 100vh;
    min-height: 100vh;
    gap: 10px;
    padding: 10px;
    background: #dbe9ff;
    box-sizing: border-box;
    margin: 0;
}

.lhs-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    grid-template-rows: auto 1fr;
    gap: 10px;
}

.lhs-top-grid {
    display: flex;
    grid-template-columns: 1.6fr 0.8fr;
    gap: 10px;
    width: 100%;
}

/* Panels */
.panel {
    background: #e6e6e6;
    padding: 10px;
    border-radius: 10px;
}

.panel h3 {
    margin-top: 0;
    padding: 6px 8px;
    margin-bottom: 6px;
    font-size: 15px;
    color: #0b3c5d;
    background: linear-gradient(to right, #eef5ff, #e0ecff);
    border-bottom: 1px solid #b6cff5;
    border-radius: 8px 8px 0 0;
}

.panel.panel-bordered {
    border: 2px solid #70BBD4;
}

.rhs-panel.panel-bordered {
    border-color: #1f3d5c;
}

.lhs-top-grid {
    display: flex;
    gap: 10px;
    width: 100%;
}

/* Desktop order */
.bill-section {
    order: 2;
    flex: 3;
}

.nond-section {
    order: 1;
    flex: 1.2;
}

.settings-panel{
    max-width:700px;
    margin:auto;
    padding:0px;
}

.charge-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:4px;
    justify-content:center;
    margin-top:16px;
}

.charge-option{
    display:flex;
    align-items:center;
    justify-content:flex-start;

    gap:8px;
    padding:4px 0px;
    width:fit-content;
    background:transparent;

    border:none;

    border-radius:0;

    font-size:14px;
    font-weight:600;

    cursor:pointer;
}

.charge-option input{
    transform:scale(1.4);
}

.save-settings-btn{
    margin-top:16px;
    padding:10px 30px;

    background:#2ecc71;
    color:white;
    border:none;

    border-radius:8px;
    font-size:16px;

    cursor:pointer;
}

.bill-settings-btn {
    display: block;
    width: 100%;

    margin-top: 10px;
    padding:6px 20px;
    background: #6c5ce7;
    color: white !important;

    text-align: center;
    text-decoration: none;

    border-radius: 8px;

    font-size: 16px;
    font-weight: 600;

    box-sizing: border-box;

    transition: all 0.2s ease;
}

.bill-settings-btn:hover {
    background: #5849d1;
    transform: translateY(-1px);
}

.bill-settings-btn:active {
    transform: translateY(0);
}

/* ===== Add to Bill Button ===== */
#addItemBtn {
    background-color: #2ecc71;      /* Green */
    color: white;
    border: none;
    padding: 8px 14px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
}

#addItemBtn:hover {
    background-color: #27ae60;
}

/* ===== Remove from Bill Button ===== */
#removeItemBtn {
    background-color: #e74c3c;      /* Red */
    color: white;
    border: none;
    padding: 8px 14px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
}

#removeItemBtn:disabled {
    background-color: #f5b7b1;      /* Light red (disabled) */
    cursor: not-allowed;
}

#removeItemBtn:hover:not(:disabled) {
    background-color: #c0392b;
}

.links-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;   /* 2 columns */
    gap: 8px;
    margin-top: 6px;
}

.links-grid a {
    font-size: 15px;
    font-weight: 500;
    padding: 6px 4px;
}
/* -------- BILL DETAILS (CRITICAL SECTION) -------- */

.bill-panel {
    font-size: 13px;
}

.bill-panel input,
.bill-panel select {
    margin-bottom: 0;        /* 🔥 IMPORTANT */
    padding: 5px;
    height: 30px;
    font-size: 13px;
    border-radius: 8px;
}

.bill-no {
    width: 90px;
    text-align: right;
}

/* Inline layout */
.inline-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.inline-row.two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.inline-pair {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.inline-pair label {
    white-space: nowrap;
    line-height: 1;
    font-size: 13px;
}

/* -------- ITEM DETAILS -------- */

.item-panel table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.item-panel th,
.item-panel td {
    border: 1px solid #aaa;
    padding: 4px;
    text-align: center;
}

.charges-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 8px;
    font-size: 13px;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

#qtyInput,
#rateInput,
#bagCountInput,
#paidAmount {
    text-align: right;
}

#grossAmount,
#netAmount {
    background-color: #f3f3f3;
    font-weight: bold;
    color: #2c3e50;
    cursor: not-allowed;
    text-align: right;
}

/* -------- RHS / PREVIEW -------- */

.rhs-panel {
    background: #ffffff;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== Bill Preview Header ===== */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.panel-header h3 {
     margin: 0;
     flex: 1;
}

/* ===== Icon Buttons Print and Send to Whatsapp ===== */
.preview-actions {
    display: flex;
    gap: 8px;
    margin-left: 10px;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #aaa;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: allowed 0.15s ease;
}

/* Hover */
.icon-btn:hover:not(:disabled) {
    background: #d7ddff;
    border-color: #4a6cf7;
    transform: scale(1.08);
}

.icon-btn:active:not(:disabled) {
    transform: scale(0.96);
}

/* Disabled */
.icon-btn:disabled,
.icon-btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #e0e0e0;
}

.icon-btn[title] {
    position: relative;
}

#printThermalBtn:not(:disabled),
#whatsappBtn:not(:disabled) {
    background: #d9f7df;
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.6);
    animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.5);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

.tooltip-wrapper {
    display: inline-flex;
}

.pdf-preview {
    flex: 1;
    border: 1px dashed #aaa;
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden;
}

/* ===== BILL PREVIEW IFRAME ===== */
#billPreviewFrame {
    width: 100%;
    height: 100%;
    border: none;
    overflow: auto;
}

/* ===== PREVIEW MODE (iframe & browser) ===== */
body {
    font-family: Arial, sans-serif;
    font-size: 12px;
    margin: 0;
    padding: 0;
}

.bill-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

/* ===== BILL HEADER STYLING ===== */

/* Normal text for entire bill header */
.bill-header,
.bill-header label,
.bill-header .header-line,
.bill-header .company-meta {
    font-weight: 400;
}

/* Only company name bold */
.bill-header .company-name {
    font-weight: 700;
}

/* ===== PRINT MODE ONLY ===== */
@media print {

    @page {
        size: auto;
        margin: 5mm;
    }

    body.paper-80 .bill-container {
        width: 80mm;
        font-size: 13px;
    }

    body.paper-58 .bill-container {
        width: 58mm;
        font-size: 11px;
    }
}

/* Bottom buttons */
.bottom-buttons {
    display: flex;
    justify-content: space-between;
}

.btn-success {
    background: #4caf50;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
}

.btn-danger {
    background: #e53935;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
}

.help-text {
    font-size: 12px;
    color: #666;
}

/* === Global Label & Input Uniformity === */
label {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;      /* Prevent label wrapping */
}

input,
select {
    font-size: 14px;
}

/* Inline layouts */
.inline-row label,
.inline-pair label {
    flex-shrink: 0;           /* Keep label on single line */
}

.wrap-label {
    white-space: normal;
}

/* === INLINE FORMS INSIDE login-container (Farmer / Vendor / Item Add) === */
/* Restore flex behavior */
.login-container .inline-row.two-cols {
    display: flex;          /* 🔥 override grid */
    gap: 12px;
}

/* Remove auth-page spacing for inline inputs */
.login-container .inline-row input,
.login-container .inline-row select {
    margin-bottom: 0;       /* 🔥 critical */
}

/* Ensure perfect vertical centering */
.login-container .inline-row,
.login-container .inline-pair {
    display: flex;
    align-items: center;
}

/* ===== ITEM DETAILS SECTION ===== */
.item-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.item-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.item-content {
    grid-template-columns: 3fr 1.2fr;
    gap: 12px;
    flex: 1;
    display: flex;
}

.item-table-wrapper {
    border: 1px solid #aaa;
    flex: 3;                 /* take full available height */
    min-height: 0;           /* critical for flex scrolling */
    overflow-y: auto;
    background: white;
}

.item-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.item-table th,
.item-table td {
    border-bottom: 1px solid #ddd;
    padding: 4px 6px;
    text-align: center;
}

.item-table th {
    position: sticky;
    top: 0;
    background: #f0f0f0;
}

.charges-panel {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    height: 100%;
}

.charges-panel hr {
    margin: 10px 0;
    border: none;
    border-top: 1px solid #ccc;
}

.farmer-charges-panel hr {
    margin: 4px 0;
}

.farmer-charges-panel {
    justify-content: flex-start;
}

/* ===== RIGHT CHARGES PANEL REFINEMENTS ===== */
.charges-panel .inline-row {
    justify-content: flex-end;
    margin-bottom: 8px;
}

.farmer-charges-panel .inline-row {
    margin-bottom: 0px;
}

.charges-panel label {
    text-align: right;
    width: 140px;           /* fixed label width */
}

.charges-panel input {
    width: 120px;           /* ~8 digits */
    text-align: right;
    padding: 4px 6px;
}

.farmer-charges-panel label {
    width: 105px;
    font-size: 12px;
}

.farmer-charges-panel input {
    width: 75px;
    height: 26px;
    padding: 2px 4px;
}

/* ===== ITEM LIST TABLE – FINAL COLUMN WIDTHS ===== */

/* Base width for Qty / Rate (fits "वजन / नग" in one line) */
:root {
    --small-col-width: 6ch;     /* वजन / नग / दर */
    --amount-col-width: 10ch;   /* किंमत */
}

.item-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

/* ===== HEADER ALIGNMENT (FORCED) ===== */
.item-table thead th {
    text-align: center !important;
    white-space: nowrap;
}

/* Sr No  */
.item-table th:nth-child(1),
.item-table td:nth-child(1) {
    width: 4ch;
    text-align: center;
}

/* Item Name – flexible */
.item-table th:nth-child(2),
.item-table td:nth-child(2) {
    width: auto;
    text-align: left;
}

/* Weight, Bags, Rate */
.item-table th:nth-child(3),
.item-table td:nth-child(3),
.item-table th:nth-child(4),
.item-table td:nth-child(4),
.item-table th:nth-child(5),
.item-table td:nth-child(5) {
    width: var(--small-col-width);
    text-align: right;
    white-space: nowrap;
}

/* Aadat column */
.item-table th:nth-child(6),
.item-table td:nth-child(6) {
    width: 7ch;
    text-align: right;
    white-space: nowrap;
}

/* Price column */
.item-table th:nth-child(7),
.item-table td:nth-child(7) {
    width: 9ch;
    text-align: right;
    white-space: nowrap;
}

.row-selected {
    background-color: #cce5ff;
}

/* ================= FINAL BILL BUTTONS ================= */
.btn-final {
    background: linear-gradient(135deg, #1b8f3b, #28c76f);
    color: white;
    font-weight: bold;
    padding: 12px 22px;
    font-size: 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-final:hover {
    background: linear-gradient(135deg, #148233, #22b35f);
    transform: scale(1.03);
}

/* Cancel button */
.btn-cancel {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: white;
    font-weight: bold;
    padding: 12px 22px;
    font-size: 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    margin-left: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-cancel:hover {
    background: linear-gradient(135deg, #a93226, #c0392b);
    transform: scale(1.03);
}

/* ===== Farmer / Vendor List – Name Column Handling ===== */
table {
    table-layout: fixed;   /* 🔥 critical for ellipsis */
}

.farmer-name {
    max-width: 220px;     /* adjust as you like */
    width: 100%;
    white-space: nowrap;   /* prevent wrapping */
    overflow: hidden;      /* hide overflow */
    text-overflow: ellipsis; /* show ... */
    vertical-align: middle;
}

.vendor-name {
    max-width: 220px;     /* adjust as you like */
    width: 100%;
    white-space: nowrap;   /* prevent wrapping */
    overflow: hidden;      /* hide overflow */
    text-overflow: ellipsis; /* show ... */
    vertical-align: middle;
}

table th:last-child,
table td:last-child {
    width: 80px;
    text-align: center;
    white-space: nowrap;
}

/* ========= SEARCH BOX ========== */
.search-box{
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.search-box input{
    flex: 1;
}

#clearSearch {
    cursor: pointer;
    font-size: 16px;
    opacity: 0.6;
}

#clearSearch:hover {
    opacity: 1;
}

.top-actions {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.top-actions a {
    font-weight: bold;
    font-size: 15px;
    text-decoration: none;
    color: #003366;
}

/* ================= SELECT2 – EXACT MATCH WITH INPUTS ================= */
.select2-container {
    width: 100% !important;
    font-size: 13px;
}

/* Main selection box */
.select2-container--default .select2-selection--single {
    height: var(--control-height);
    min-height: var(--control-height);

    border: 1px solid #ccc;
    border-radius: var(--control-radius);
    background-color: #fff;

    padding: 0 var(--control-padding-x);
    box-sizing: border-box;

    display: flex;
    align-items: center;
}

/* Selected text */
.select2-container--default
.select2-selection--single
.select2-selection__rendered {
    padding: 0;
    line-height: var(--control-height);
    font-size: 13px;
    color: #333;
}

/* Dropdown arrow */
.select2-container--default
.select2-selection--single
.select2-selection__arrow {
    height: var(--control-height);
    width: 24px;
    right: 4px;
}

/* Clear (×) button */
.select2-selection__clear {
    font-size: 16px;
    margin-right: 6px;
    line-height: var(--control-height);
    color: #999;
}

.select2-selection__clear:hover {
    color: #333;
}

/* Disabled state */
.select2-container--default.select2-container--disabled
.select2-selection--single {
    background-color: #f3f3f3;
    cursor: not-allowed;
}

/* ================= DROPDOWN ================= */

.select2-dropdown {
    border-radius: var(--control-radius);
    border: 1px solid #bbb;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

/* Search box inside dropdown */
.select2-container--default
.select2-search--dropdown
.select2-search__field {
    height: var(--control-height);
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 13px;
    box-sizing: border-box;
}

/* Options */
.select2-results__option {
    font-size: 13px;
    padding: 6px 8px;
}

.select2-results__option--highlighted {
    background-color: #cce5ff !important;
    color: #003366;
}

.select2-results__option--selected {
    background-color: #e6f0ff;
}

/* ===== FORCE PERFECT ROUNDING FOR SELECT2 ===== */

.select2-container--default .select2-selection--single {
    overflow: hidden; /* 🔥 THIS IS THE KEY */
}

/* Arrow must not affect curvature */
.select2-container--default
.select2-selection--single
.select2-selection__arrow {
    right: 6px;
    width: 22px;
}

/* Ensure inner text never changes shape */
.select2-container--default
.select2-selection--single
.select2-selection__rendered {
    padding-left: 4px;
    padding-right: 4px;
}

input,
select,
.select2-selection--single {
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.04);
}

/* ===== PERFECT CONTROL NORMALIZATION ===== */
input,
select,
.select2-selection--single {
    height: var(--control-height) !important;
    border-radius: var(--control-radius) !important;
    box-sizing: border-box !important;
}

/* Remove native number input styling differences */
input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.select2-results__option--highlighted {
    color: #1f2d3d !important;
}

.success-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.success-popup.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
}

/* ========== Common Action Button Size ================== */
.btn-action {
    height: 36px;
    min-height: 36px;
    padding: 0 18px;
    font-size: 15px;
    font-weight: bold;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

input[readonly] {
    background-color: #f3f3f3;
    cursor: not-allowed;
    color: #555
}

/* ----- Back Buttons on reporting pages --------- */
.back-btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 15px;
    font-weight: 500;
    background-color: #444;
    font-weight: 500;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: 0.2s ease;
}

.back-btn:hover {
    background-color: #222;
    transform: scale(1.04);
}

.print-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 18px;
    font-weight: 600;
    background-color: #90ee90;
    color: black;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s ease;
    text-decoration: none !important;
}

.print-btn:hover {
    background-color: #2e6f40;
    color: white;
    transform: scale(1.03);
    text-decoration: none !important;
}

.back-btn span,
.print-btn span {
    font-size: 16px;
}

.report-heading {
    font-size: 22px;      /* bigger heading */
    font-weight: 700;
    margin: 10px 0 10px 0;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 10px;
}

.report-table td.right {
    font-weight: 500;
}

.report-table th,
.report-table td {
    border: 1px solid #444;
    padding: 6px;
}

.report-table th {
    background-color: #e6ecf5;
    font-weight: 500;
}

.right {
    text-align: right;
}

.sort-container {
    margin-bottom: 18px;
}

.sort-btn {
    display: inline-block;
    padding: 6px 12px;
    margin-right: 8px;
    font-size: 12px;
    background-color: #ddd;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    transition: 0.2s ease;
}

.sort-btn:hover {
    background-color: #bbb;
}

.active-sort {
    background-color: #444;
    color: white;
}
/* ====================================================== */
/*      THERMAL PRINT Vendor Pending Amount Report       */
/* ====================================================== */

.thermal-print {
    display: none;
}

@media print {

    body {
        margin: 0;
        padding: 0;
        background: white !important;
    }

    /* Remove dashboard background & width */
    .dashboard-container {
        background: white !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Hide screen layout completely */
    .screen-layout {
        display: none !important;
    }

    /* Show thermal layout */
    .thermal-print {
        display: block !important;
        width: 72mm;
        margin: 0 auto;
        font-size: 14px;
        font-family: 'Noto Sans Devanagari', Arial, sans-serif;
        page-break-after: always;
    }

    .thermal-print table {
        width: 100%;
        border-collapse: collapse;
    }

    .thermal-print th,
    .thermal-print td {
        border: 1px solid black;
        padding: 3px;
        font-size: 14px;
    }

    .thermal-print .center {
        text-align: center;
    }

    .thermal-print .right {
        text-align: right;
    }

    .thermal-print .bold {
        font-weight: bold;
    }

    .thermal-print .line {
        border-bottom: 1px solid black;
        margin: 4px 0;
    }
}

@page {
    size: 80mm auto;
    margin: 0;
}

/* ===================================================== */
/*          CLEAN PENDING AMOUNT REPORT (ISOLATED)      */
/* ===================================================== */

/* Page isolation */
body.pending-page {
    background: #f2f6f3;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 40px;
}

/* Outer wrapper */
.pending-wrapper {
    display: flex;
    justify-content: center;
}

/* Card */
.pending-card {
    background: #D6D5F7;
    padding: 18px 22px;
    border-radius: 12px;
    width: auto;
    min-width: 320px;
    box-sizing: border-box;
}

/* Title */
.pending-title {
    margin: 0;
    margin-bottom: 4px;
    text-align: center;
    font-size: 18px;
}

.pending-date {
    text-align: center;
    margin-bottom: 12px;
    font-size: 14px;
}

/* Table reset */
.pending-table {
    border-collapse: collapse !important;
    table-layout: auto !important;
    width: auto !important;
    font-size: 14px;
}

/* Cells */
.pending-table th,
.pending-table td {
    border: 1px solid #444;
    padding: 6px 12px;
    white-space: nowrap;
}

/* Header */
.pending-table th {
    background: #e6ecf5;
}

/* Alignments */
.pending-table .right {
    text-align: right;
}

.pending-table .bold {
    font-weight: bold;
}

/* ============================= */
/* FINAL FORCE – Pending Layout */
/* ============================= */

body.pending-page {
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
    padding-top: 60px !important;
    text-align: initial !important;
}

/* Kill global table rule */
body.pending-page table {
    table-layout: auto !important;
    width: auto !important;
}

/* Prevent global table-layout: fixed */
body.pending-page .pending-table {
    table-layout: auto !important;
    width: auto !important;
}

/* ===================================================== */
/*         Pending Amount – WEB VIEW LAYOUT             */
/* ===================================================== */

.pending-web-container {
    width: min(100% - 24px, 680px) !important;
    max-width: 680px;
    min-width: 0;
    margin: 10px auto !important;
    background: #D6D5F7;
    padding: 18px clamp(12px, 3vw, 24px);
    border-radius: 12px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: min(calc(100vh - 20px), 760px);
    max-height: calc(100vh - 20px);
    overflow: hidden;
    text-align: left;
}

.pending-web-container .report-heading,
.pending-web-container .pending-report-date {
    text-align: center;
}

.pending-web-container .report-heading {
    margin: 8px 0 10px;
    line-height: 1.25;
}

.pending-web-container .pending-report-date {
    flex-shrink: 0;
    font-size: 14px;
    margin: 0 0 8px;
}

.pending-web-container .sort-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.pending-web-container .sort-btn {
    margin: 0;
    text-align: center;
    white-space: nowrap;
}

.pending-report-actions {
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.pending-web-container .report-table-wrapper {
    flex: 1;
    overflow: auto;
    width: 100%;
    min-height: 0;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
}

/* Narrow table */
.pending-web-container .report-table {
    width: 100% !important;
    min-width: 360px;
    margin: 0 auto;
    table-layout: auto !important;
}

/* Prevent global fixed layout */
.pending-web-container table {
    table-layout: auto !important;
}

.pending-web-container .report-table th,
.pending-web-container .report-table td {
    border: 1px solid #ccc;
    padding: 7px 10px;
    vertical-align: middle;
}

.pending-web-container .back-btn,
.pending-web-container .print-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
    text-align: center;
}

/* ===================================================== */
/* Pending Web View – Column Alignment & Width Fix      */
/* ===================================================== */

/* Right align + fixed width for pending column */
.pending-web-container .report-table th:last-child,
.pending-web-container .report-table td:last-child {
    text-align: right !important;
    width: 140px !important;
    min-width: 116px !important;
    white-space: nowrap;
}

.pending-web-container .report-table td:first-child {
    width: auto !important;
    max-width: 420px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.pending-web-container .report-table th:first-child {
    width: auto !important;
    text-align: left !important;
}

@media (max-width: 768px) {
    .pending-web-container {
        width: calc(100% - 16px) !important;
        margin: 8px auto !important;
        padding: 12px;
        border-radius: 10px;
        height: calc(100svh - 16px);
        max-height: calc(100svh - 16px);
    }

    .pending-web-container .report-heading {
        font-size: 19px;
        margin-top: 6px;
    }

    .pending-web-container .back-btn,
    .pending-web-container .print-btn {
        font-size: 14px;
        padding: 8px 12px;
    }

    .pending-web-container .sort-btn {
        flex: 1 1 132px;
        min-width: 0;
        padding: 7px 8px;
        white-space: normal;
    }

    .pending-web-container .report-table {
        min-width: 0;
        font-size: 13px;
    }

    .pending-web-container .report-table th,
    .pending-web-container .report-table td {
        padding: 7px 6px;
    }

    .pending-web-container .report-table th:last-child,
    .pending-web-container .report-table td:last-child {
        width: 112px !important;
        min-width: 100px !important;
    }
}

@media (max-width: 420px) {
    .pending-web-container {
        width: calc(100% - 10px) !important;
        padding: 10px 8px;
    }

    .pending-web-container .report-table {
        font-size: 12px;
    }

    .pending-web-container .report-table th,
    .pending-web-container .report-table td {
        padding: 6px 5px;
    }

    .pending-web-container .report-table th:last-child,
    .pending-web-container .report-table td:last-child {
        width: 96px !important;
        min-width: 88px !important;
    }
}

/* ---------------- PROFILE PAGE ---------------- */

.profile-panel{
    background:#E6E6FA;
    margin:10px auto;
    padding:10px 30px;
    border-radius:10px;
    max-width:700px;
}

.profile-title{
    text-align:center;
    margin-bottom:20px;
}

.profile-form{
    display: grid;
    grid-template-columns: 30% 70%;
    column-gap: 12px;
    row-gap: 12px;
    align-items: center;
    width: 100%;
}

.profile-form label{
    text-align:right;
    padding-right:10px;
    font-weight: 600;
    white-space: nowrap;
}

.profile-form input,
.profile-form select{
    width:100%;
    max-width:100%;
    box-sizing: border-box;
    padding:6px 8px;
    border:1px solid #ccc;
    border-radius:6px;
}

.profile-buttons{
    grid-column: 1 / span 2;   /* span across both grid columns */
    margin-top: 0;
    justify-content:center;
    gap:10px;
}

.profile-buttons button{
    padding:8px 16px;
    border-radius:6px;
    border:1px solid #999;
    cursor:pointer;
    gap:10px;
}

/* ================================================= */
/*              MOBILE LAYOUT SUPPORT                */
/* ================================================= */

@media (max-width: 768px) {

    html, body {
        overflow-y: auto;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Vendor / Farmer main layout becomes vertical */
    .vendor-main-grid,
    .farmer-main-grid {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
        display: flex;
        flex-direction: column;
        overflow: visible;
        gap: 12px;
    }

    .lhs-panel {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .lhs-top-grid {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .item-content {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .item-table-wrapper {
        height: auto;
        max-height: 260px;
    }

    .rhs-panel {
        height: auto;
    }

    .pdf-preview {
        height: 350px;
    }

    /* Dashboard */
    .dashboard-container {
        width: 95%;
        margin: 10px auto;
    }

    /* Reports */
    .report-container {
        width: 95%;
        height: auto;
    }

    .report-table-wrapper {
        overflow-x: auto;
    }

    /* Lists */
    .farmer-list-container,
    .vendor-list-container {
        width: 95%;
    }

}

/* ================================================= */
/*     MOBILE LANDSCAPE – USE DESKTOP GRID           */
/* ================================================= */

@media (max-width: 1024px) and (orientation: landscape) {

    .vendor-main-grid {
        grid-template-columns: 2.2fr 1fr;
        height: 100vh;
    }

}

/* ================================================= */
/*      MOBILE PORTRAIT – TRUE STACKED LAYOUT        */
/* ================================================= */

@media (max-width: 768px) and (orientation: portrait) {

    .vendor-main-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 10px;
    }

    .lhs-panel,
    .lhs-top-grid,
    .item-content {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .rhs-panel {
        height: auto;
        min-height: 420px;
    }

    .pdf-preview {
        height: 320px !important;
        min-height: 320px;
        overflow: auto;
    }

    #billPreviewFrame {
        height: 100% !important;
        min-height: 320px;
    }

    /* Bill details: stack every control into its own row */
    .bill-panel .inline-row,
    .bill-panel .inline-row.two-cols {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }

    /* Bill No row: keep label + textbox in same row */
    .bill-panel .inline-row:first-of-type {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .bill-panel .inline-row:first-of-type label {
        width: 20%;
        min-width: 20%;
        white-space: nowrap;
    }

    .bill-panel .inline-row:first-of-type input {
        width: 80% !important;
        flex: 0 0 78%;
        min-width: 0;
        text-align: right;
    }

    /* Other paired rows */
    .bill-panel .inline-pair {
        width: 100%;
        flex-direction: row;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .bill-panel .inline-pair label {
        width: 20%;
        min-width: 20%;
        white-space: nowrap;
    }

    /* Inputs / dropdowns wider */
    .bill-panel .inline-pair input,
    .bill-panel .inline-pair select,
    .bill-panel .inline-pair .select2-container {
        width: 80% !important;
        max-width: 80%;
        flex: 0 0 78%;
    }

    /* Keep Add / Remove buttons in one row */
    .bill-panel .bottom-buttons {
        display: flex;
        flex-direction: row;
        gap: 10px;
    }

    .bill-panel .bottom-buttons button {
        flex: 1;
    }

    /* Mobile */
    @media (max-width: 768px) {
        .bottom-buttons {
            display: flex;
            gap: 10px;
            justify-content: space-between;
        }

        .bottom-buttons .btn-action {
            flex: 1;
            margin: 0;
            padding: 0px 1px;
            font-size: 14px;
        }
    }

    /* ===== ITEM TABLE WIDTH FIX FOR MOBILE ===== */
    .bill-panel .item-panel table,
    .item-panel table {
        width: 100%;
        table-layout: fixed;
        font-size: 12px;
    }

    .bill-panel .item-panel th,
    .bill-panel .item-panel td,
    .item-panel th,
    .item-panel td {
        padding: 3px 4px;
    }

    /* Sr No */
    .item-panel th:nth-child(1),
    .item-panel td:nth-child(1) {
        width: 10%;
        text-align: center;
    }

    /* Item Name */
    .item-panel th:nth-child(2),
    .item-panel td:nth-child(2) {
        width: 40%;
        text-align: left;
        white-space: normal;
        word-break: break-word;
        overflow: visible;
    }

    /* Weight, Bags, Rate, Price */
    .item-panel th:nth-child(3),
    .item-panel td:nth-child(3),
    .item-panel th:nth-child(4),
    .item-panel td:nth-child(4),
    .item-panel th:nth-child(5),
    .item-panel td:nth-child(5) {
        width: 12%;
        text-align: right;
        white-space: nowrap;
    }

    .item-panel th:nth-child(6),
    .item-panel td:nth-child(6) {
        width: 14%;
        text-align: right;
        white-space: nowrap;
    }
}

.select2-container {
    z-index: 9999;
}

.select2-dropdown {
    z-index: 9999;
}

/* Profile Dropdown Styled like Vendor Form */
.profile-menu {
    position: absolute;
    right: 0;
    top: 50px;
    z-index: 100;
    background: white;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    min-width: 180px;
    overflow: hidden;
    font-family: inherit;
}

.profile-item {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    font-size: 15px;
    transition: background 0.2s;
}

.profile-item:hover {
    background: #f5f5f5;
}

.profile-item.logout {
    color: #e74c3c;
    font-weight: 600;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #2c7be5;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
}

.password-hint {
    position: relative;
    display: block;              /* full width */
    margin: 0px 0 14px 0;        /* space above & below */
    text-align: right;            /* right align */
}

.hint-text {
    font-size: 12px;
    color: #2f6b2f;
    cursor: pointer;
    text-decoration: underline dotted;
    display: inline-block;
}

.tooltip-box {
    visibility: hidden;
    width: 260px;
    background-color: #333;
    color: #fff;
    text-align: left;
    padding: 10px;
    border-radius: 6px;

    position: absolute;
    z-index: 10;

    top: 22px;                  /* appears BELOW hint */
    left: 0;

    font-size: 12px;
    line-height: 1.5;

    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

/* Show tooltip */
.password-hint:hover .tooltip-box {
    visibility: visible;
    opacity: 1;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 10px;
    width: 350px;
    text-align: center;
}

/* ===== DESKTOP LAYOUT ===== */
.profile-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 24px;
    margin: 20px auto;
    max-width: 900px;
}

/* Lavender form panel */
.profile-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 850px;   /* desktop max */
    box-sizing: border-box;
}

.profile-form {
    width: 100%;
}

/* Right-side preview */
.sample-preview {
    width: 520px;
    padding: 12px;
    margin-top: 10px;
    background: #fafafa;
    border-left: 2px solid #ddd;
}

/* Sample bill box */
.bill-sample {
    border: 1px solid #ccc;
    padding: 10px;
    background: white;
}

/* ===== PROFILE PAGE BILL HEADER PREVIEW ===== */

.bill-sample .bill-header {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    text-align: center;
}

.bill-sample .company-name {
    font-weight: 700;
    font-size: 15px;
}

.bill-sample .company-meta,
.bill-sample .preview-line {
    font-weight: 400;
}

/* ===== FINAL MOBILE STACK FIX FOR PROFILE PAGE ===== */

@media (max-width: 768px) {

    .profile-layout {
        display: flex;
        flex-direction: column;   /* force vertical */
        gap: 16px;
    }

    /* Ensure correct order */
    .profile-panel {
        width: 100%;
        max-width: 100%;
        padding: 12px 16px;   /* reduce side padding */
        box-sizing: border-box;
        margin: 0 auto;
        order: 1;
    }

    .sample-preview {
        order: 2;
        width: 100%;
        max-width: 100%;
        margin-top: 10px;
        border-left: none;
        border-top: 2px solid #ddd;
    }

    .dashboard-container.admin-container {
        width: calc(100% - 16px);
        margin: 8px auto;
        padding: 14px;
        box-sizing: border-box;
    }

    .admin-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .admin-card {
        width: 100%;
        height: 58px;
        font-size: 16px;
    }
}

.subscription-disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

input::placeholder {
    color: #9aa0a6;
    opacity: 1;
    font-size: 13px;
}

@media (max-width: 768px) and (orientation: portrait) {

    html,
    body {
        margin: 0;
        padding: 0;
        overflow-x: hidden !important;
        width: 100%;
        max-width: 100%;
    }

    .vendor-main-grid,
    .farmer-main-grid {
        width: 100%;
        max-width: 100%;
        padding: 8px;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .lhs-panel,
    .lhs-top-grid,
    .panel,
    .rhs-panel,
    .item-content {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .item-table-wrapper,
    .pdf-preview {
        max-width: 100%;
        overflow-x: auto;
    }
}

/* ------------ Make Add to Bill and Finalize Bill buttons disabled in Previous bill load ------ */
button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.readonly-banner {
    margin: 8px 0 10px 0;
    padding: 8px 12px;
    border-radius: 6px;
    background: #fff3cd;
    color: #7a5a00;
    font-weight: 600;
    border: 1px solid #ffe08a;
    text-align: center;
}

/* ------------ Subscription Panel Styles in Profile page ------ */
.subscription-panel {
    background: #fff;
    border-radius: 14px;
    padding: 10px 10px 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    margin-top: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    align-self: stretch;
}

.subscription-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 10px;
}

.subscription-title-icon {
    font-size: 15px;
    line-height: 1;
}

.subscription-title {
    font-size: 15px;
    font-weight: 700;
    color: #1f6f2f;
}

.subscription-panel-body {
    border: 2px solid #4caf50;
    border-radius: 12px;
    background: #edf7ed;
    padding: 10px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.subscription-status-icon {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: linear-gradient(180deg, #67d58a, #42b96a);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}

.subscription-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    padding: 0px 8px;
    flex: 1;
    min-width: 0;
}

.subscription-plan-line {
    font-size: 13px;
    font-weight: 700;
    color: #2d2d2d;
    margin-bottom: 4px;
    line-height: 1.4;
}

.subscription-date-line {
    font-size: 12px;
    color: #5f6b66;
}

.subscription-change-btn {
    background: #1f66c2;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 12px;
    border-radius: 8px;
    padding: 8px 14px;
    display: inline-block;
    white-space: nowrap;
}

.subscription-change-btn:hover {
    background: #1756a4;
    color: #fff;
    text-decoration: none;
}

/* ---------- Active (>15 days) ---------- */

.subscription-panel.active .subscription-title {
    color: #1f6f2f;
}

.subscription-panel.active .subscription-panel-body {
    background: #edf7ed;
    border-color: #4caf50;
}

.subscription-panel.active .subscription-status-icon {
    background: linear-gradient(180deg,#67d58a,#42b96a);
}

/* ---------- Expiring in 15 days ---------- */

.subscription-panel.exp15 .subscription-title {
    color: #9a7a00;
}

.subscription-panel.exp15 .subscription-panel-body {
    background: #fff8d8;
    border-color: #e5c100;
}

.subscription-panel.exp15 .subscription-status-icon {
    background: #e5c100;
}

/* ---------- Expiring in 7 days ---------- */

.subscription-panel.exp7 .subscription-title {
    color: #b85b00;
}

.subscription-panel.exp7 .subscription-panel-body {
    background: #ffe7cf;
    border-color: #ff9800;
}

.subscription-panel.exp7 .subscription-status-icon {
    background: #ff9800;
}

/* ---------- Expired ---------- */

.subscription-panel.expired .subscription-title {
    color: #b00020;
}

.subscription-panel.expired .subscription-panel-body {
    background: #ffe3e3;
    border-color: #dc3545;
}

.subscription-panel.expired .subscription-status-icon {
    background: #dc3545;
}

@media (max-width: 700px) {
    .subscription-panel-body {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .subscription-change-btn {
        width: 100%;
        text-align: center;
        padding: 10px 0px;
        font-size: 13px;
    }
}

/* ================= BILLING PAGE FORCE OVERRIDES ================= */
.billing-page {
    background: #f3f7f1;
    padding: 16px 12px 24px;
    display: flex;
    justify-content: center;
    box-sizing: border-box;
}

.billing-form {
    width: 100%;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.billing-page .fee-banner {
    background: #fff7d6;
    border: 1px solid #efda8d;
    color: #6d5300;
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
}

.billing-page .billing-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 16px;
    margin: 0;
}

.billing-page .billing-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #1f6f2f;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2efe2;
    margin-bottom: 14px;
}

.billing-page .plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.billing-page button.plan-card {
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid #bfe3bf;
    border-radius: 14px;
    background: #fff;
    padding: 14px 10px;
    min-height: 110px;
    width: 100%;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    text-align: center;
    color: #214b22;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: none;
    box-shadow: none;
}

.billing-page button.plan-card:hover {
    border-color: #4caf50;
    background: #f5fbf5;
    transform: translateY(-1px);
}

.billing-page button.plan-card.active {
    border-color: #2e7d32;
    background: #edf7ed;
    box-shadow: 0 0 0 1px rgba(46, 125, 50, 0.08) inset;
}

.billing-page .plan-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.billing-page .plan-days {
    font-size: 13px;
    color: #546054;
    margin-bottom: 8px;
}

.billing-page .plan-amount {
    font-size: 20px;
    font-weight: 800;
    color: #1f6f2f;
}

.billing-page .section-divider {
    height: 1px;
    background: #e2efe2;
    margin: 16px 0;
}

.billing-page .subsection-title {
    font-size: 14px;
    font-weight: 700;
    color: #444;
    margin-bottom: 12px;
}

.billing-page .summary-card .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 2px;
    font-size: 14px;
    color: #2b2b2b;
}

.billing-page .summary-card .total-row {
    font-size: 16px;
    font-weight: 800;
    color: #1f6f2f;
}

.billing-page .payment-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.billing-page .field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.billing-page .field-input {
    width: 100%;
    border: 1px solid #bdddbd;
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 14px;
    box-sizing: border-box;
}

.billing-page .submit-btn {
    width: 100%;
    background: #2e7d32;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.billing-page .submit-btn:hover {
    background: #256628;
}

@media (max-width: 768px) {
    .billing-page {
        padding-left: 10px;
        padding-right: 10px;
    }

    .billing-page .plan-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Billing Page Actions ===== */

.billing-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.billing-actions button {
    flex: 1;
}

.back-btn-billing {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 12px;
    font-size: 15px;
}

.back-btn-billing:hover {
    background: #5a6268;
}

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: inline-block !important;
    }
}

.profile-help-text {
    grid-column: 2;
    font-size: 13px;
    color: #666;
    margin-top: -6px;
    margin-bottom: 8px;
}

@media (max-width: 768px) {

    .report-filter-row {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .report-filter-row label {
        text-align: left;
        font-weight: 600;
        margin-top: 5px;
    }

    .date-input,
    .vendor-select,
    .show-btn {
        width: 100%;
        box-sizing: border-box;
    }
}

/* ===== Mobile: Dashboard, Farmer/Vendor Forms and Lists ===== */
@media (max-width: 768px) {

    .dashboard-container.dashboard-home-container {
        width: calc(100% - 16px);
        max-width: none;
        margin: 8px auto;
        padding: 14px;
        box-sizing: border-box;
    }

    .dashboard-home-container .dashboard-home-header {
        gap: 10px;
        margin-bottom: 14px;
        text-align: left;
    }

    .dashboard-home-container .dashboard-home-header h2 {
        min-width: 0;
        margin: 0;
        font-size: 20px;
        overflow-wrap: anywhere;
    }

    .dashboard-home-container .avatar {
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
    }

    .dashboard-home-container .profile-menu {
        right: 0;
        min-width: 160px;
    }

    .dashboard-home-container .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        position: relative;
        z-index: 1;
    }

    .dashboard-home-container .dash-btn {
        width: 100%;
        height: 58px;
        padding: 8px 12px;
        box-sizing: border-box;
        font-size: 16px;
        transform: scale(1);
        transition: transform 0.2s ease, box-shadow 0.2s ease,
                    background-color 0.2s ease;
    }

    .dashboard-home-container .dash-btn:active {
        transform: translateY(-3px) scale(1.03);
        box-shadow: 0 14px 20px -6px rgba(31, 61, 92, 0.45);
    }

    .dashboard-home-container .modal-content {
        width: calc(100% - 24px);
        max-width: 350px;
        padding: 18px;
        box-sizing: border-box;
    }

    body.entity-form-page {
        width: 100%;
        min-height: 100%;
        overflow-x: hidden;
        padding: 8px;
        box-sizing: border-box;
    }

    .entity-form-page .entity-form-container {
        width: 100%;
        max-width: 420px;
        margin: 8px auto;
        padding: 14px;
        box-sizing: border-box;
    }

    .entity-form-container h2 {
        margin: 4px 0 16px;
        font-size: 21px;
    }

    .entity-form-container .inline-row {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        margin-bottom: 10px;
        text-align: left;
    }

    .entity-form-container .inline-row label {
        width: 100%;
        white-space: normal;
        font-weight: 600;
    }

    .entity-form-container .inline-row input,
    .entity-form-container .inline-row select {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .entity-form-container .help-text {
        text-align: left;
        overflow-wrap: anywhere;
    }

    .entity-form-container .flash {
        max-width: 100%;
        box-sizing: border-box;
        overflow-wrap: anywhere;
    }

    .dashboard-container.farmer-list-container,
    .dashboard-container.vendor-list-container,
    .dashboard-container.item-list-container {
        width: calc(100% - 8px);
        max-width: none;
        height: calc(100svh - 8px);
        max-height: calc(100svh - 8px);
        margin: 4px auto;
        padding: 8px;
        box-sizing: border-box;
        overflow-x: hidden;
        overflow-y: hidden;
        display: flex;
        flex-direction: column;
    }

    .farmer-list-container .list-header,
    .vendor-list-container .list-header,
    .item-list-container .list-header {
        width: 100%;
        box-sizing: border-box;
        flex-shrink: 0;
    }

    .farmer-list-container .list-header h2,
    .vendor-list-container .list-header h2,
    .item-list-container .list-header h2 {
        margin-bottom: 8px;
        font-size: 20px;
    }

    .farmer-list-container .top-actions,
    .vendor-list-container .top-actions,
    .item-list-container .top-actions {
        align-items: center;
        gap: 8px;
    }

    .farmer-list-container .top-actions a,
    .vendor-list-container .top-actions a,
    .item-list-container .top-actions a {
        min-width: 0;
        font-size: 12px;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .farmer-list-container .top-actions a:last-child,
    .vendor-list-container .top-actions a:last-child,
    .item-list-container .top-actions a:last-child {
        text-align: right;
    }

    .farmer-list-container .search-box,
    .vendor-list-container .search-box,
    .item-list-container .search-box {
        width: 100%;
        box-sizing: border-box;
    }

    .farmer-list-container .search-box input,
    .vendor-list-container .search-box input,
    .item-list-container .search-box input {
        min-width: 0;
        padding: 9px;
        font-size: 14px;
    }

    .farmer-list-container .table-scroll,
    .vendor-list-container .table-scroll,
    .item-list-container .table-scroll {
        width: 100%;
        flex: 1;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-gutter: stable;
    }

    .farmer-list-container .table-scroll table,
    .vendor-list-container .table-scroll table,
    .item-list-container .table-scroll table {
        width: 100% !important;
        min-width: 0;
        margin-top: 8px !important;
        table-layout: fixed;
        font-size: 11px;
    }

    .farmer-list-container table th,
    .farmer-list-container table td,
    .vendor-list-container table th,
    .vendor-list-container table td,
    .item-list-container table th,
    .item-list-container table td {
        min-width: 0;
        padding: 5px 2px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .farmer-list-container table th:nth-child(1),
    .farmer-list-container table td:nth-child(1) {
        width: 32%;
    }

    .farmer-list-container table th:nth-child(2),
    .farmer-list-container table td:nth-child(2) {
        width: 28%;
    }

    .farmer-list-container table th:nth-child(3),
    .farmer-list-container table td:nth-child(3) {
        width: 22%;
    }

    .farmer-list-container table th:nth-child(4),
    .farmer-list-container table td:nth-child(4) {
        width: 18%;
    }

    .vendor-list-container table th:nth-child(1),
    .vendor-list-container table td:nth-child(1) {
        width: 25%;
    }

    .vendor-list-container table th:nth-child(2),
    .vendor-list-container table td:nth-child(2) {
        width: 24%;
    }

    .vendor-list-container table th:nth-child(3),
    .vendor-list-container table td:nth-child(3) {
        width: 16%;
    }

    .vendor-list-container table th:nth-child(4),
    .vendor-list-container table td:nth-child(4) {
        width: 22%;
    }

    .vendor-list-container table th:nth-child(5),
    .vendor-list-container table td:nth-child(5) {
        width: 13%;
    }

    .item-list-container table th:nth-child(1),
    .item-list-container table td:nth-child(1) {
        width: 58%;
        text-align: left;
    }

    .item-list-container table th:nth-child(2),
    .item-list-container table td:nth-child(2) {
        width: 22%;
        text-align: right;
    }

    .item-list-container table th:nth-child(3),
    .item-list-container table td:nth-child(3) {
        width: 20%;
    }

    .farmer-list-container table td:last-child,
    .vendor-list-container table td:last-child,
    .item-list-container table td:last-child {
        white-space: nowrap;
        overflow: visible;
    }

    .farmer-list-container table td:last-child a,
    .vendor-list-container table td:last-child a,
    .item-list-container table td:last-child a {
        display: inline-block;
        font-size: 14px;
        line-height: 1;
    }

    .farmer-list-container table td:last-child button,
    .vendor-list-container table td:last-child button,
    .item-list-container table td:last-child button {
        width: auto;
        min-width: 0;
        padding: 2px;
        font-size: 13px;
        line-height: 1;
    }
}

@media (max-width: 768px) and (hover: hover) {

    .dashboard-home-container .dash-btn:hover {
        transform: translateY(-4px) scale(1.03);
        box-shadow: 0 14px 20px -6px rgba(31, 61, 92, 0.45);
    }
}

/* ===== Mobile: Reporting Home ===== */
@media (max-width: 768px) {

    .dashboard-container.reporting-home-container {
        width: calc(100% - 16px);
        max-width: none;
        margin: 8px auto;
        padding: 14px;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .reporting-home-container h2 {
        margin: 4px 0 16px;
        font-size: 21px;
        overflow-wrap: anywhere;
    }

    .reporting-home-container .dashboard-grid {
        width: 100%;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .reporting-home-container .dash-btn {
        width: 100%;
        min-width: 0;
        height: 58px;
        padding: 8px 12px;
        box-sizing: border-box;
        font-size: 16px;
        overflow-wrap: anywhere;
    }

    .reporting-home-container .back-btn {
        max-width: 100%;
        padding: 8px 12px;
        box-sizing: border-box;
        font-size: 14px;
    }
}

/* ===== Mobile: Profile Page ===== */
@media (max-width: 768px) {

    body.profile-page {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 8px;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .profile-page .profile-layout {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding: 0;
        gap: 12px;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .profile-page .profile-panel {
        order: 1;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        margin: 0;
        padding: 12px;
        box-sizing: border-box;
    }

    .profile-page .profile-title {
        margin: 4px 0 16px;
        font-size: 21px;
    }

    .profile-page .profile-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 5px;
        width: 100%;
        min-width: 0;
    }

    .profile-page .profile-form label {
        width: 100%;
        margin-top: 5px;
        padding: 0;
        text-align: left;
        white-space: normal;
    }

    .profile-page .profile-form input,
    .profile-page .profile-form select {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .profile-page .profile-help-text,
    .profile-page .profile-buttons {
        grid-column: 1;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .profile-page .profile-help-text {
        margin: 0 0 6px;
        overflow-wrap: anywhere;
    }

    .profile-page .profile-buttons {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 10px;
    }

    .profile-page .profile-buttons a,
    .profile-page .profile-buttons button {
        width: 100%;
        margin: 0;
        box-sizing: border-box;
    }

    .profile-page .sample-preview {
        order: 2;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        margin: 0;
        padding: 12px;
        box-sizing: border-box;
        border: 0;
        border-radius: 10px;
        overflow-x: hidden;
    }

    .profile-page .sample-preview h3 {
        margin: 0 0 10px;
        font-size: 17px;
    }

    .profile-page .bill-sample {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        overflow-wrap: anywhere;
    }

    .profile-page .subscription-panel {
        order: 3;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        margin: 0;
        box-sizing: border-box;
    }

    .profile-page .subscription-panel-body,
    .profile-page .subscription-info {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .profile-page .subscription-plan-line,
    .profile-page .subscription-date-line {
        max-width: 100%;
        overflow-wrap: anywhere;
    }
}

/* ===== Mobile: Login, Register and Password Reset ===== */
@media (max-width: 768px) {

    body.auth-page {
        background-image: url("images/bg_login_mobile.jpg");
        background-repeat: no-repeat;
        background-position: center top;
        background-size: cover;

        width: 100%;
        max-width: 100%;
        min-height: 100svh;
        overflow-x: hidden;
        overflow-y: auto;
        box-sizing: border-box;
    }

    .auth-page .auth-center {
        width: 100%;
        min-height: 100svh;
        height: auto;
        padding: 38svh 8px 8px;
        box-sizing: border-box;
        align-items: flex-start;
    }

    .auth-page .login-container {
        width: 100%;
        min-width: 0;
        max-width: 420px;
        margin: 0 auto;
        padding: 12px 14px 18px;
        box-sizing: border-box;
    }

    .auth-page .login-container h1 {
        font-size: 24px;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .auth-page .login-container h2 {
        margin: 4px 0 16px;
        font-size: 22px;
    }

    .auth-page .password-wrapper {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .auth-page .password-wrapper input {
        min-width: 0;
    }

    .auth-page .flash,
    .auth-page #error-msg {
        max-width: 100%;
        box-sizing: border-box;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 380px) {

    .auth-page .button-row {
        flex-direction: column;
    }

    .auth-page .button-row button {
        width: 100%;
    }
}

/* ============ Billing ============= */
.upi-payment-box {
    text-align: center;
    padding: 10px 0;
}

.upi-instruction {
    font-size: 16px;
    margin-bottom: 12px;
    color: #444;
}

.upi-qr-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.upi-qr-image {
    width: 180px;
    height: 180px;
    object-fit: contain;
    border: 2px solid #d8ead8;
    border-radius: 10px;
    padding: 6px;
    background: white;
}

.upi-id-display {
    font-size: 16px;
    font-weight: 700;
    color: #1565c0;
}

.payment-ack-card .payment-body {
    gap: 12px;
    margin-top: 6px;
}

.payment-field small {
    color: #666;
    font-size: 12px;
}

.billing-actions {
    display: flex;
    gap: 12px;
    margin-top: 0;
}

.billing-actions button {
    flex: 1;
}

.billing-page .field-input {
    width: 100%;
    border: 1px solid #bdddbd;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    box-sizing: border-box;
}

.file-upload-input {
    width: 100%;
    height: 38px;              /* same visual height */
    padding: 6px 12px;
    box-sizing: border-box;
}

/* Billing buttons mobile layout */
@media (max-width: 768px) {

    .billing-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .billing-actions button {
        width: 100%;
        flex: none;
    }
}

/* Billing buttons mobile layout */
.admin-filters {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

/* =========================================
   PAYMENT REQUESTS
========================================= */
.payment-table-wrapper {
    max-width: 1400px;
    margin: 0 auto;
}

.payment-requests-container {
    width: calc(100% - 20px);
    max-width: 1800px;
    margin: 10px auto;
    padding: 20px;
    background: #d9d6f5;
    border-radius: 12px;
    box-sizing: border-box;
}

.payment-page-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.payment-page-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.payment-welcome {
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 700;
    color: #3d2e5c;
    text-align: center;
    padding: 8px 12px;
    background: rgba(255,255,255,0.45);
    border-radius: 8px;
}

.payment-table-responsive {
    width: 100%;
    overflow-x: auto;
}

.payment-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    table-layout: fixed;
}

.payment-table th {
    background: #5c4a7a;
    color: white;
    padding: 12px;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
}

.payment-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e5e5;
    text-align: center;
    vertical-align: middle;
}

.payment-table tbody tr:hover {
    background: #f8f9ff;
}

/* Column widths */
/* No */
.payment-table th:nth-child(1),
.payment-table td:nth-child(1) {
    width: 4%;
    text-align: center;
}

/* Username */
.payment-table th:nth-child(2),
.payment-table td:nth-child(2) {
    width: 10%;
}

/* Mobile */
.payment-table th:nth-child(3),
.payment-table td:nth-child(3) {
    width: 10%;
}

/* Market */
.payment-table th:nth-child(4),
.payment-table td:nth-child(4) {
    width: 8%;
}

/* Current Plan */
.payment-table th:nth-child(5),
.payment-table td:nth-child(5) {
    width: 10%;
}

/* Requested Plan */
.payment-table th:nth-child(6),
.payment-table td:nth-child(6) {
    width: 10%;
}

/* Amount */
.payment-table th:nth-child(7),
.payment-table td:nth-child(7) {
    width: 8%;
}

/* Date */
.payment-table th:nth-child(8),
.payment-table td:nth-child(8) {
    width: 14%;
}

/* Proof */
.payment-table th:nth-child(9),
.payment-table td:nth-child(9) {
    width: 6%;
    text-align: center;
}

/* Status */
.payment-table th:nth-child(10),
.payment-table td:nth-child(10) {
    width: 6%;
}

/* Action */
.payment-table th:nth-child(11),
.payment-table td:nth-child(11) {
    width: 14%;
}

.plan-badge {
    background: #eef3ff;
    color: #394b68;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.payment-table td:nth-child(4),
.payment-table td:nth-child(5) {
    white-space: nowrap;
}

/* Status */

.payment-status-approved {
    background: #d4edda;
    color: #155724;
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 600;
}

.payment-status-pending {
    background: #fff3cd;
    color: #856404;
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 600;
}

.payment-status-rejected {
    background: #f8d7da;
    color: #721c24;
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 600;
}

/* Proof Link */

.proof-link {
    color: #0066cc;
    font-weight: 600;
    text-decoration: none;
}

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

/* Buttons */

.payment-action-buttons {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.payment-action-buttons form {
    margin: 0;
}

.payment-approve-btn,
.payment-reject-btn {
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    color: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.payment-approve-btn {
    background: #28a745;
}

.payment-reject-btn {
    background: #dc3545 !important;
    color: #ffffff !important;
    border: none;
}

.payment-reject-btn:hover {
    background: #c82333 !important;
}

/* Mobile */

@media (max-width: 768px) {

    .payment-requests-container {
        width: calc(100% - 20px);
        margin: 10px;
        padding: 10px;
        border-radius: 12px;
    }

    .payment-page-header {
        text-align: center;
    }

    .payment-page-title {
        font-size: 24px;
    }

    .payment-welcome {
        font-size: 18px;
    }

    .admin-filters {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .filter-btn {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    .payment-table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .payment-table {
        min-width: 1200px;
    }

    .payment-table th,
    .payment-table td {
        padding: 8px;
        font-size: 12px;
        white-space: nowrap;
    }

    .payment-action-buttons {
        display: flex;
        gap: 4px;
        flex-wrap: nowrap;
    }

    .payment-approve-btn,
    .payment-reject-btn {
        padding: 6px 8px;
        font-size: 11px;
    }
}

/* ==========================
   Payment Request Filters
   ========================== */

.admin-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 10px 16px;
    background: #5c4a7a;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: 0.2s ease;
}

.filter-btn:hover {
    color: #3d2e5c;
}

.filter-btn.active {
    background: #28a745;
}

.filter-btn.active:hover {
    background: #218838;
}

.users-search-container {
    margin: 15px 0 20px 0;
}

.users-search-input {
    width: 320px;
    max-width: 100%;
    padding: 12px 14px;
    border: 1px solid #b9d8b9;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    box-sizing: border-box;
}

.users-search-input:focus {
    border-color: #4caf50;
    box-shadow: 0 0 4px rgba(76,175,80,.25);
}

/* =====================================
   USER MANAGEMENT
===================================== */

.users-search-container {
    margin-bottom: 20px;
}

.users-search-input {
    width: 320px;
    max-width: 100%;
    padding: 12px;
    border: 1px solid #c9c9c9;
    border-radius: 8px;
    font-size: 14px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.users-table th {
    background: #5c4a7a;
    color: white;
    padding: 12px;
    text-align: center;
}

.users-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #ececec;
}

.users-table tbody tr:hover {
    background: #f8f9ff;
}

.user-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {

    .user-management-container {
        width: calc(100% - 20px);
        margin: 10px;
        padding: 10px;
    }

    .users-search-input {
        width: 100%;
        box-sizing: border-box;
    }

    .users-table-wrapper {
        overflow-x: auto;
    }

    .users-table {
        min-width: 900px;
    }

    .users-table th,
    .users-table td {
        padding: 8px;
        font-size: 12px;
    }
}

/* Pending Amount Report Filter */
.pending-filter-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 8px 0 14px 0;
}

.pending-filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.pending-filter-label input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.pending-filter-label span {
    line-height: 1.2;
}

/* ==========================
   Pending Payment Card - On billing page
   ========================== */

.payment-pending-card {
    max-width: 900px;
    margin: 10px auto;
}

.pending-message {
    text-align: center;
    color: #394b68;
    font-size: 16px;
    line-height: 1.8;
}

.pending-details {
    margin: 10px auto;
    padding: 10px;
    background: #f5f3ff;
    border-radius: 10px;
    max-width: 500px;
}

.pending-details div {
    margin: 8px 0;
}

.pending-note {
    margin-top: 10px;
    margin-bottom: 10px;
    font-weight: 600;
    color: #28a745;
}

/* =========================================
   DASHBOARD KPI SECTION
========================================= */

.dashboard-kpi-section {
    margin-top: 20px;
}

.dashboard-kpi-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.kpi-filter-btn {
    padding: 8px 18px;
    border: 1px solid #d0d0d0;
    border-radius: 20px;
    background: #ffffff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.kpi-filter-btn:hover {
    background: #f5f5f5;
}

.kpi-filter-btn.active {
    background: #2d7ff9;
    color: white;
    border-color: #2d7ff9;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.dashboard-section-title{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:14px;
    margin:22px 0 18px;
    font-size:24px;
    font-weight:600;
    color:#222;
}

.dashboard-section-title::before,
.dashboard-section-title::after{
    content:"❖ ❖ ❖ ❖ ❖ ❖";
    color:#0b2d5b;
    font-size:14px;
    letter-spacing:2px;
    white-space:nowrap;
}

.dashboard-kpi-card {
    border-radius: 12px;
    border-top: 6px solid transparent;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    min-height: 90px;
}

.kpi-title {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: #222;
    margin-bottom: 4px;
}

.kpi-comparison {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns:
        repeat(3, 1fr);
    gap: 15px;
}

.dashboard-kpi-card.revenue {
    background: #ffffff;
    border-top-color: #1976d2;
    border-left: 6px solid #1976d2;
}

.dashboard-kpi-card.collected {
    background: #ffffff;
    border-top-color: #1e8e3e;
    border-left: 6px solid #1e8e3e;
}

.dashboard-kpi-card.pending {
    background: #ffffff;
    border-top-color: #f57c00;
    border-left: 6px solid #f57c00;
}

.kpi-comparison {
    font-size: 13px;
    font-weight: 600;
    min-height: 18px;
}

.kpi-comparison.positive {
    color: #198754;
}

.kpi-comparison.negative {
    color: #dc3545;
}

/* ==========================================
   KPI TOOLTIPS
========================================== */

.kpi-title{

    position:relative;

    display:flex;

    align-items:center;

    justify-content:center;

    gap:8px;

}

.kpi-info{

    position:relative;

    cursor:pointer;

    color:#1976d2;

    font-size:16px;

    font-weight:bold;

    user-select:none;

}

.kpi-tooltip{

    visibility:hidden;

    opacity:0;

    position:absolute;

    left:50%;

    top:30px;

    transform:translateX(-50%);

    width:240px;

    padding:12px;

    background:#fff;

    color:#222;

    border-radius:10px;

    border:1px solid #d0d0d0;

    box-shadow:
        0 4px 16px rgba(0,0,0,0.15);

    font-size:13px;

    line-height:1.5;

    font-weight:normal;

    text-align:left;

    z-index:9999;

    transition:0.2s;

}

.kpi-info:hover .kpi-tooltip,
.kpi-info.active .kpi-tooltip{

    visibility:visible;

    opacity:1;

}

/* =========================================
   MOBILE
========================================= */
@media (max-width: 768px) {
    /* ================= Dashboard Home Mobile ================= */
    .dashboard-home-container{
        width:95% !important;
        margin:10px auto;
        padding:16px;
    }

    /* Restore old mobile button layout */
    .dashboard-home-container .dashboard-grid{
        display:grid !important;
        grid-template-columns:1fr !important;
        gap:16px;
    }

    .dashboard-home-container .dash-btn{
        width:100%;
        height:58px;
        font-size:16px;
    }

    /* Subscription panel full width */
    .dashboard-home-container .subscription-panel{
        width:100% !important;
        margin-top:18px;
    }

    /* KPI cards */
    .dashboard-home-container .dashboard-kpi-grid{
        grid-template-columns:1fr;
    }

    /* KPI Filters */
    .dashboard-home-container .dashboard-kpi-filters{
        display:flex;
        flex-direction:column;
        gap:10px;
    }

    .dashboard-home-container .kpi-filter-btn{
        width:100%;
    }

    .dashboard-kpi-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-home-container .dashboard-grid{
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:14px;
    }

    .dashboard-section-title{
        font-size:20px;
    }

    .dashboard-section-title::before,
    .dashboard-section-title::after{
        content:"";
    }

    .dashboard-kpi-card {
        min-height: 85px;
    }

    .kpi-value {
        font-size: 26px;
    }

    .dashboard-kpi-filters {
        gap: 8px;
    }

    .kpi-filter-btn {
        flex: 1;
        min-width: 120px;
    }

    .dashboard-home-container .dashboard-kpi-filters{
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:10px;
    }

    .dashboard-home-container .dashboard-kpi-filters .kpi-filter-btn:last-child{
        grid-column:1 / span 2;
    }
}

@media (max-width:768px) {

    .vendor-item-table {
        font-size: 13px;
    }

    .vendor-item-table th,
    .vendor-item-table td {
        padding: 3px 4px;
    }

    .vendor-item-table th:first-child,
    .vendor-item-table td:first-child {
        display:none;   /* hide serial no */
    }

    .item-table th:last-child,
    .item-table td:last-child{
        width: 50px;
        text-align: right;
    }

    .kpi-tooltip{
        left:-225px;
        top:28px;
        transform:none;
        width:calc(100vw - 90px);
        max-width:280px;
    }
}

.aadat-hidden{
    display:none !important;
}

/* Vendor report Select2 width */
.vendor-report-container .select2-container {
    width: 320px !important;
}

@media (max-width:768px) {

    .vendor-report-container .select2-container {
        width: 100% !important;
    }

}

.bill-header-row{
    display:flex;
    align-items:center;
    width:100%;
}

.bill-date-wrapper{
    margin-left:auto;
    display:flex;
    align-items:center;
    gap:8px;
}

.bill-date{
    width:150px !important;
}

@media (max-width:768px){
    .bill-header-row{
        flex-direction:column;
        align-items:stretch;
    }

    .bill-date-wrapper{
        margin-left:0;
        width:100%;
    }

    .bill-date{
        width:100% !important;
    }
}

/* ---------- Farmer Charge Settings Mobile ---------- */
@media (max-width:768px){

    .settings-panel{
        width:auto !important;
        max-width:none !important;
        margin:10px !important;
        padding:0 10px !important;
        box-sizing:border-box;
        font-size:16px;
    }

    .charge-grid{
        display:flex !important;      /* kill desktop grid */
        flex-direction:column !important;
        align-items:flex-start !important;
        width:100%;
        margin-top:10px;
    }

    label.charge-option{
        all: unset;                  /* reset all inherited label styles */

        display:flex !important;
        flex-direction:row !important;
        align-items:center !important;
        justify-content:flex-start !important;

        width:100% !important;
        box-sizing:border-box;

        gap:12px;
        padding:8px 0;

        font-size:14px;
        font-weight:600;

        cursor:pointer;
    }

    label.charge-option input{
        all: revert;
        transform:scale(1);
        margin:0;
        flex-shrink:0;
    }

    .charge-option{
        display:flex !important;
        flex-direction:row !important;
        align-items:center !important;
        justify-content:flex-start !important;

        width:100% !important;
        margin:0 0 14px 0;
        padding:0;

        gap:12px;

        text-align:left !important;
        box-sizing:border-box;
    }

    .charge-option input{
        margin:0 !important;
        transform:scale(1);
        flex:0 0 auto;
    }

    .charge-option::after{
        display:none;
    }
}

.share-via-own-whatsapp-btn{
    width:50%;
    margin:4px auto 8px auto;
    display:block;
    background:#25D366;
    border:2px solid #1DA851;
}

.share-via-own-whatsapp-btn:hover{
    background:#20C85A;
    border-color:#188C43;
}

@media (max-width: 768px) {
    .share-via-own-whatsapp-btn{
        width:80%;
    }
}

.extend-btn{
    background:#198754;
    color:#fff;
    border:none;
    border-radius:5px;
    padding:6px 12px;
    font-size:13px;
    font-weight:600;
    cursor:pointer;
    transition:0.2s;
}

.extend-btn:hover{
    background:#157347;
}

.business-profiles-container {
    width: min(95vw, 1400px);
    margin: 20px auto;
    background: #D6D5F7;
    border-radius: 12px;
    padding: 20px;
    box-sizing: border-box;
}

/* ================= Business Profiles ================= */

#profilesTable {
    width: 100%;
    table-layout: fixed;
}

#profilesTable th,
#profilesTable td {
    padding: 8px;
    vertical-align: middle;
}

/* No */
#profilesTable th:nth-child(1),
#profilesTable td:nth-child(1) {
    width: 4%;
    text-align: center;
}

/* Username */
#profilesTable th:nth-child(2),
#profilesTable td:nth-child(2) {
    width: 10%;
}

/* Display Name */
#profilesTable th:nth-child(3),
#profilesTable td:nth-child(3) {
    width: 18%;
}

/* Company */
#profilesTable th:nth-child(4),
#profilesTable td:nth-child(4) {
    width: 18%;
}

/* Market */
#profilesTable th:nth-child(5),
#profilesTable td:nth-child(5) {
    width: 8%;
    text-align: center;
}

/* Website */
#profilesTable th:nth-child(6),
#profilesTable td:nth-child(6) {
    width: 22%;
}

/* Status */
#profilesTable th:nth-child(7),
#profilesTable td:nth-child(7) {
    width: 8%;
    text-align: center;
}

/* Action */
#profilesTable th:nth-child(8),
#profilesTable td:nth-child(8) {
    width: 8%;
    text-align: center;
}

.profile-url{
    color:#0b63ce;
    text-decoration:none;
    font-weight:600;
    white-space:nowrap;
}

.profile-url:hover{
    text-decoration:underline;
}

.not-created{
    color:#777;
}

/* ================= Edit Business Profile ================= */

.business-profile-container{

    width:min(1000px,95vw);
    margin:20px auto;

    background:#D6D5F7;

    border-radius:14px;

    padding:20px;

    box-sizing:border-box;

}

.profile-card{

    background:white;

    border-radius:10px;

    padding:20px;

    margin-bottom:18px;

}

.profile-summary-table{

    width:100%;

    border-collapse:collapse;

}

.profile-summary-table th{

    width:180px;

    text-align:left;

    padding:10px;

}

.profile-summary-table td{

    padding:10px;

}

.form-grid{

    display:grid;

    grid-template-columns:1fr 1fr;

    gap:18px;

    margin-top:15px;

}

.profile-card textarea{

    width:100%;

    box-sizing:border-box;

    resize:vertical;

}

.profile-card input[type=text]{

    width:100%;

    box-sizing:border-box;

}

.profile-card h3{

    margin-top:0;

}

.checkbox-row{
    display:flex;
    justify-content:center;
    gap:60px;
    margin-top:20px;
}

.checkbox-label{
    display:flex;
    align-items:center;
    gap:10px;
    font-weight:600;
    cursor:pointer;
}

.checkbox-label input{
    width:18px;
    height:18px;
}

/* ---------- Customer Information ---------- */

.profile-info-grid{

    display:grid;

    grid-template-columns:1fr 1fr;

    gap:16px 40px;

}

.info-item{

    display:flex;

    align-items:center;

    border-bottom:1px solid #ececec;

    padding:10px 0;

}

.info-label{

    width:150px;

    font-weight:700;

    color:#444;

}

.info-value{

    flex:1;

    color:#111;

    font-weight:500;

    word-break:break-word;

}

.generated-url-box{

    margin-top:20px;

    background:#f7f9fc;

    border:1px solid #d8e3f2;

    border-radius:8px;

    padding:12px 15px;

}

.generated-url-title{

    font-size:13px;

    color:#666;

    margin-bottom:6px;

    font-weight:600;

}

.generated-url{

    color:#0b63ce;

    font-weight:600;

    text-decoration:none;

    word-break:break-all;

}

.generated-url:hover{

    text-decoration:underline;

}