* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #f0f2f5;
    padding: 15px;
    color: #1a1a1a;
}

/* કંટ્રોલ પેનલ સ્ટાઇલ (Desktop & Mobile Responsive) */
.control-panel {
    max-width: 210mm;
    width: 100%;
    margin: 0 auto 20px auto;
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    border-top: 5px solid #0B3B24;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.control-panel h2 {
    color: #0B3B24;
    font-size: 18px;
    margin-bottom: 15px;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group.full-width {
    grid-column: span 2;
}

.input-group label {
    font-size: 12px;
    font-weight: 600;
    color: #444;
    margin-bottom: 4px;
}

input, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}

.service-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.service-selector select {
    flex: 1;
}

.payment-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.btn-add {
    background-color: #0B3B24;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}

.btn-print {
    width: 100%;
    background-color: #C59B27;
    color: #0B3B24;
    border: none;
    padding: 13px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.btn-print:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-del {
    background: #ff4d4d;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 11px;
    margin-left: 5px;
}

.status-text {
    text-align: center;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #0B3B24;
}

/* ઇન્વોઇસ કન્ટેનર (મોબાઇલમાં આડો સ્ક્રોલ થશે જેથી 210x145mm સાઇઝ ન બગડે) */
.invoice-wrapper {
    width: 100%;
    overflow-x: auto;
    display: flex;
    justify-content: center;
    padding-bottom: 15px;
}

.invoice-box {
    width: 210mm;
    min-width: 210mm;
    height: 145mm;
    min-height: 145mm;
    background: #ffffff;
    padding: 8mm 10mm;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

/* હેડર */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.logo-section img {
    height: 58px;
    object-fit: contain;
}

.title-section {
    text-align: right;
}

.title-section h1 {
    color: #0B3B24;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 1px;
}

.gold-bar {
    height: 3px;
    width: 120px;
    background: #C59B27;
    margin: 4px 0 6px auto;
}

.title-section .meta {
    font-size: 11px;
    color: #0B3B24;
    line-height: 1.4;
}

.agency-info {
    font-size: 10px;
    color: #333;
    margin-top: 4px;
    line-height: 1.3;
}

/* બિલ ટુ ટેબલ */
.bill-to-table {
    width: 55%;
    border-collapse: collapse;
    margin-top: -12px;
    font-size: 11px;
}

.bill-to-table td {
    border: 1px solid #C59B27;
    padding: 3px 8px;
}

.label-cell {
    width: 75px;
    background-color: #C59B27;
    color: #0B3B24;
    font-weight: 700;
}

.label-cell.white-bg {
    background-color: #fff;
    color: #1a1a1a;
    font-weight: 600;
}

/* સર્વિસ ટેબલ */
.service-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 11px;
}

.service-table th {
    background-color: #0B3B24;
    color: #ffffff;
    padding: 6px 8px;
    border: 1px solid #C59B27;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.service-table td {
    border: 1px solid #C59B27;
    padding: 5px 8px;
    text-align: center;
}

.service-table td.desc-cell {
    text-align: left;
}

.editable-input {
    border: none;
    background: transparent;
    width: 100%;
    padding: 0;
    font-size: 11px;
    color: #000;
}

.editable-num {
    border: none;
    background: transparent;
    width: 50px;
    padding: 0;
    text-align: center;
    font-size: 11px;
}

/* ફૂટર અને પેમેન્ટ */
.footer-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 8px;
}

.payment-box {
    width: 58%;
}

.payment-header {
    font-size: 11px;
    font-weight: 700;
    color: #0B3B24;
    border-bottom: 1px solid #C59B27;
    padding-bottom: 2px;
    margin-bottom: 6px;
}

.bank-details {
    font-size: 10.5px;
    line-height: 1.5;
}

.advance-badge {
    display: inline-block;
    background-color: #0B3B24;
    color: #FFD700;
    font-weight: 700;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 3px;
    margin-bottom: 4px;
}

.thanks {
    font-weight: 700;
    color: #0B3B24;
    margin-top: 3px;
}

/* ટોટલ્સ બોક્સ */
.totals-box {
    width: 38%;
    font-size: 11.5px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 8px;
    font-weight: 600;
}

.grand-total-row {
    display: flex;
    justify-content: space-between;
    background-color: #C59B27;
    color: #0B3B24;
    font-weight: 700;
    font-size: 13px;
    padding: 6px 8px;
    margin-top: 3px;
}

/* મોબાઇલ રિસ્પોન્સિવ સેટિંગ્સ (768px થી નાની સ્ક્રીન માટે) */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }
    .control-panel {
        padding: 15px;
    }
    .control-panel h2 {
        font-size: 16px;
    }
    .controls-grid {
        grid-template-columns: 1fr;
    }
    .input-group.full-width {
        grid-column: span 1;
    }
    .service-selector {
        flex-direction: column;
    }
    .btn-add {
        width: 100%;
    }
    .payment-inputs {
        grid-template-columns: 1fr;
    }
    .invoice-wrapper {
        justify-content: flex-start;
    }
}

/* પ્રિન્ટ સેટિંગ્સ (210mm x 145mm) */
@media print {
    @page {
        size: 210mm 145mm;
        margin: 0;
    }
    body {
        background: none;
        padding: 0;
    }
    .no-print {
        display: none !important;
    }
    .invoice-wrapper {
        overflow: visible;
        padding: 0;
    }
    .invoice-box {
        box-shadow: none;
        width: 210mm;
        height: 145mm;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
