body {
    margin-top: 70px;
    font-family: Arial, sans-serif;
    padding: 20px;
    background-color: #f9f9f9;
}

textarea {
    width: 100%;
    height: 200px;
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
}

.business-name {
    color: rgb(255, 249, 249);
    background-repeat: no-repeat;
    background-position: center;
    font-size: 4rem;
    padding: 20px;
}

button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
}

button:hover {
    background-color: #45a049;
}

#billOutput {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
    height: fit-content;
}

.estimate-bill {
    border: 1px solid #333;
    padding: 4px;
    background-color: white;
    width: 15cm;
    height: 5cm;
    position: relative;
    margin: 0 auto;
    font-size: 9px;
    page-break-inside: avoid;
    box-sizing: border-box;
}

.estimate-bill .header {
    display: inline;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.estimate-bill .header img {
    width: 20px;
    height: auto;
}

.estimate-bill .info {
    display: inline-block;
    font-weight: bold;
    font-size: 8px;
    margin-right: 10px;
    vertical-align: middle;
}

.table {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}

.table th,
.table td {
    border: 1px solid #000;
    text-align: center;
    padding: 1px;
    font-size: 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table th:nth-child(1),
.table td:nth-child(1) {
    width: 10%; /* S.N */
}

.table th:nth-child(2),
.table td:nth-child(2) {
    width: 30%; /* Particulars */
}

.table th:nth-child(3),
.table td:nth-child(3) {
    width: 20%; /* Quantity */
}

.table th:nth-child(4),
.table td:nth-child(4) {
    width: 20%; /* Rate */
}

.table th:nth-child(5),
.table td:nth-child(5) {
    width: 20%; /* Amount */
}

.table th {
    background-color: #f4f4f4;
}

.footer {
    margin-top: 2px;
    font-size: 7px;
    line-height: 1;
}

.footer .amount-in-words {
    font-style: italic;
    font-weight: bold;
}

@media print {
    body {
        padding: 0;
        margin: 0;
    }
    
    #billOutput {
        display: flex;
        flex-direction: column;
        gap: 0.5cm;
    }
    
    .estimate-bill {
        margin: 0 auto;
        height: 3cm;
        padding: 4px;
        font-size: 9px;
    }
    
    @page {
        size: A4;
        margin: 0;
    }
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 98%;
    z-index: 1000;
    background-color: #2c3e50;
    padding: 10px 20px;
}

.logo-container {
    flex: 1;
}

.circle-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
}

.nav-links {
    display: flex;
    list-style-type: none;
    margin: 0;
    padding: 0;
    flex: 2;
    justify-content: flex-end;
    gap: 10px;
    margin-right: 35px;
}

.nav-links li {
    padding: 0 10px;
}

.nav-links a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 18px;
}

.nav-links a:hover {
    color: #3498db;
}

.menu-icon {
    display: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1002;
}

.menu-icon .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: white;
    transition: all 0.3s ease-in-out;
}

@media screen and (max-width: 768px) {
    .menu-icon {
        display: block;
    }

    .menu-icon.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .menu-icon.active .bar:nth-child(2) {
        opacity: 0;
    }

    .menu-icon.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background-color: #2c3e50;
        padding: 20px;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }

    .nav-links.active {
        display: flex;
    }
}

#tapToTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #008cba;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, background-color 0.3s;
}

#tapToTop:hover {
    background-color: #005f75;
    transform: scale(1.1);
}

#tapToTop i {
    font-size: 24px;
}

.tooltip {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    pointer-events: none;
}

#tapToTop:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

.order-summary {
    margin-top: 30px;
    padding: 20px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.order-summary h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.summary-container {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.item-summary {
    flex: 1;
}

.item-row {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.item-name {
    font-weight: bold;
    flex: 1;
}

.item-quantity {
    flex: 2;
    text-align: center;
}

.item-calculation {
    flex: 2;
    text-align: right;
}

.total-amount {
    text-align: right;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.total-amount h3 {
    margin-bottom: 10px;
}

.summary-btn {
    background-color: #2196F3;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.summary-btn:hover {
    background-color: #1976D2;
}

.summary-btn i {
    font-size: 16px;
}

.summary-container-page {
    padding: 20px;
    margin-top: 80px;
}

.summary-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.action-btn {
    background-color: #2196F3;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.action-btn:hover {
    background-color: #1976D2;
}

@media print {
    .navbar, .summary-actions {
        display: none;
    }
}

.salesman-details {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: inline-block;
    width: 120px;
    font-weight: bold;
}

.form-group input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 250px;
    font-size: 14px;
}

@media print {
    .form-group input {
        border: none;
    }
}

.details-row {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

input[type="date"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 250px;
    font-size: 14px;
}

.summary-details .details-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.summary-details .details-row p {
    margin: 0;
    flex: 1;
}

@media print {
    body * {
        visibility: hidden;
    }
    
    #summaryOutput, #summaryOutput * {
        visibility: visible;
    }
    
    #summaryOutput {
        position: absolute;
        left: 0;
        top: 0;
    }
    
    .navbar, .summary-actions, #tapToTop {
        display: none !important;
    }
}

.order-summary {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.print-only {
    display: none;
}

@media print {
    .print-only {
        display: block;
    }
}

.button-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.button-container button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s, transform 0.2s;
    white-space: nowrap;
    display: inline-block;
}

.button-container button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.button-container button:active {
    transform: translateY(0);
}

.button-container .summary-btn {
    background-color: #2196F3;
}

.button-container .summary-btn:hover {
    background-color: #1976D2;
}

@media screen and (max-width: 768px) {
    .button-container {
        flex-direction: column;
        width: 100%;
    }

    .button-container button {
        width: 100%;
        margin: 5px 0;
    }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
    .button-container {
        flex-wrap: wrap;
        justify-content: center;
    }

    .button-container button {
        flex: 0 1 calc(33.333% - 20px);
        min-width: 150px;
    }
}

.equivalent {
    padding-left: 20px;
    font-size: 0.9em;
    color: #666;
    font-style: italic;
}

.container, .main-container, .summary-container {
    margin-top: 20px;
}