﻿
.invoice-container {
    position: fixed;
    top: 3.6rem;
    right: 0;
    left: 0;
    bottom: 3.6rem;
    overflow-x: auto;
    background: #e7e5e4;
}

.invoice-mode {
    position: absolute;
    width: 250px;
    height: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid #0078d4;
    border-radius: 4px;
    overflow: hidden;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.invoice-mode button {
    border: none;
    background: transparent;
    font-size: 14px;
    cursor: pointer;
    color: #0078d4;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* divider between tabs */
.invoice-mode button + button {
    border-left: 1px solid #0078d4;
}

/* active tab */
.invoice-mode button.active {
    background-color: #0078d4;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
}

/* hover */
.invoice-mode button:not(.active):hover {
    background-color: rgba(0, 120, 212, 0.01);
}

/*============================ Invoice Header =================================*/

.invoice-form-item {
    position: relative;
    display: flex;
    flex-direction: column;
}

.invoice-form-item select,
.invoice-form-item input {
    display: block;
    width: 100%;
    height: 30px;
    padding: 0px 12px;
    font-size: 12px;
    border: 1px solid #c8c6c4;
    border-radius: 4px;
    background-color: #ffffff;
    transition: border 0.2s, box-shadow 0.2s;
    font-weight: bold;
    color: #323130;
}

.invoice-form-item label {
    position: absolute;
    top: 12px;
    left: 15px;
    font-size: 10px;
    font-weight: bold;
    color: #605e5c;
    background: #fff;
    padding: 0 3px;
    pointer-events: none;
    transition: all 0.2s ease;
}

.invoice-form-item select:hover,
.invoice-form-item input:hover,
.invoice-form-item textarea:hover {
    border-color: #808080;
}

.invoice-form-item select:focus,
.invoice-form-item input:focus,
.invoice-form-item textarea:focus {
    outline: none;
    border-color: #0078d4;
    background: #fff;
}

.invoice-form-item:focus-within label {
    color: #0078d4;
}

.invoice-form-item select:focus + label,
.invoice-form-item select:not([value=""]) + label,
.invoice-form-item input:focus + label,
.invoice-form-item input:not([value=""]) + label,
.invoice-form-item textarea:focus + label,
.invoice-form-item textarea:not([value=""]) + label  {
    top: -8px;
    left: 10px;
    font-size: 10px;
}

.invoice-form-item input:disabled,
.invoice-form-item textarea:disabled{
    cursor: not-allowed;
    opacity: 0.5;
}

.invoice-form-item input:disabled + label,
.invoice-form-item textarea:disabled + label {
    color: rgba(0, 0, 0, 0.4);
    background-color: #fff;
    opacity: 1;
    top: -8px;
    left: 10px;
    font-size: 10px;
}

.form-input:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.form-input-none {
    cursor: not-allowed;
    opacity: 0.5;
}

.invoice-detail-header {
    color: #0078d4;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 14px;
}

.transaction-detail-header {
    margin-top: 10px;
    margin-bottom: 20px;
    margin-left: 10px;
    margin-right: 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(0,0,0,0.25);
    padding: 15px;
}

.transaction-detail-header-subcolumn1 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    column-gap: 10px;
}

.transaction-type-detail-header {
    margin-top: 10px;
    margin-bottom: 20px;
    margin-left: 10px;
    margin-right: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(0,0,0,0.25);
    padding: 15px;
}

.transaction-type-detail-header-subcolumn1 {
    display: flex;
    flex-direction: column;
}

.transaction-type-detail-header-subcolumn1-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-right: 15px;
}

.add-btn {
    color: #2563eb;
    border: none;
    font-weight: bold;
    font-size: 12px;
}

.add-btn-icon {
    fill: #2563eb;
    width: 20px;
    height: 20px;
}

.transportation-detail-header {
    margin-top: 10px;
    margin-bottom: 20px;
    margin-left: 10px;
    margin-right: 10px;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(0,0,0,0.25);
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.transportation-detail-header-subcolumn1 {
    margin-top: 15px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
}

.transportation-detail-header-subcolumn2 {
    margin-top: 15px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr ;
    gap: 10px;
}

.transportation-detail-header-subcolumn1-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-right: 15px;
}

.product-detail-header {
    margin-top: 10px;
    margin-bottom: 20px;
    margin-left: 10px;
    margin-right: 10px;
    box-shadow: 0 0 12px rgba(0,0,0,0.25);
    background: #ffffff;
    border-radius: 4px;
    padding: 15px;
}

/*==================================== Table ====================================*/

.add-product-btn {
    position: absolute;
    background-color: #0078d4;
    color: white;
    font-weight: bold;
    font-size: 12px;
    width: 150px;
    height: 30px;
    border-radius: 4px;
    left: 50%;
    transform: translateX(-50%);
}

.add-product-btn-icon {
    fill: white;
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

.table-container {
    max-height: 320px;
    overflow-y: auto;
    overflow-x: auto;
    border-radius: 4px;
    border: 1px solid #c8c6c4;
    background: #ffffff;
    width: 100%;
}

.modern-table {
    min-width: 1500px;
    width: max-content;
    border-collapse: separate;
    border-spacing: 0;
    text-align: center;
}

.modern-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #e5efff;
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid #c8c6c4;
    border-right: 1px solid #c8c6c4;
    white-space: nowrap;
    text-align: center;
    font-weight: bold;
    color: #1f2937;
    font-size: 11px;
}

.modern-table td {
    padding: 6px 8px; 
    border-bottom: 1px solid #c8c6c4;
    border-right: 1px solid #c8c6c4;
    vertical-align: top;
    white-space: nowrap; 
    word-break: break-word;
    font-size: 12px;
    font-weight: bold;
    color: #605e5c;
    white-space: wrap;
}

/* Sticky header + sticky columns (intersection cells) */
.modern-table thead th:nth-child(1),
.modern-table thead th:nth-child(2),
.modern-table thead th:nth-last-child(2),
.modern-table thead th:last-child {
    top: 0;
    z-index: 5; /* higher than body sticky cells */
    background: #e5efff;
}

.modern-table th:last-child,
.modern-table td:last-child {
    border-right: none;
}

.modern-table tbody tr:hover {
    background-color: #f1f5ff;
}

/* First column */
.modern-table th:nth-child(1),
.modern-table td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #ffffff;
    width: 60px;
    min-width: 60px;
    max-width: 60px;
}

/* Second column */
.modern-table th:nth-child(2),
.modern-table td:nth-child(2) {
    position: sticky;
    left: 60px;
    z-index: 3;
    background: #ffffff;
    width: 300px;
    min-width: 300px;
    max-width: 300px;
}

/* Second last column */
.modern-table th:nth-last-child(2),
.modern-table td:nth-last-child(2) {
    position: sticky;
    right: 90px;
    z-index: 3;
    background: #ffffff;
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

/* Last column */
.modern-table th:last-child,
.modern-table td:last-child {
    position: sticky;
    right: 0;
    z-index: 3;
    background: #ffffff;
    width: 90px;
    min-width: 90px;
    max-width: 90px;
}

/* Fixed column shadow (optional, looks modern) */
.modern-table th:nth-child(2),
.modern-table td:nth-child(2) {
    box-shadow: 2px 0 5px rgba(0,0,0,0.25);
}

.modern-table th:nth-last-child(2),
.modern-table td:nth-last-child(2) {
    box-shadow: -2px 0 5px rgba(0,0,0,0.25);
}

.hide-col {
    display: none;
}

.edit-icon,
.delete-icon {
    width: 18px;
    height: 18px;
    fill: #6b7280;
    cursor: pointer;
    margin: 0 4px;
}

.edit-icon:hover {
    fill: #2563eb;
}

.delete-icon:hover {
    fill: #dc2626;
}

/*==================== Bill To / Ship To / Bill From / Dispatch From =====================*/

.d-none {
    display: none !important;
}

.container {
    max-width: 540px;
}

/* Panel */
.panel {
    background: #fff;
    border-radius: 4px;
    margin-top: 12px;
    box-shadow: 0 0 12px rgba(0,0,0,0.25);
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s ease;
}

.panel.open {
    max-height: 450px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 16px;
    background: #fafafa;
    border-bottom: 1px solid #ccc;
    font-weight: bold;
}

.panel-header label{
    font-weight: bold;
    font-size: 14px;
}

.edit-btn {
    color: #2563eb;
    border: none;
    font-size: 14px;
}

.edit-btn-icon {
    fill: #2563eb;
    width: 18px;
    height: 18px;
}

/* Detail layout */
.panel-body {
    padding: 15px;
}

.detail-grid {
    display: grid;
    grid-template-columns: auto 30px 1fr;
    row-gap: 5px;
    font-size: 12px;
}

.detail-label {
    color: #605e5c;
    font-weight: bold;
}

.detail-colon {
    text-align: center;
    color: #605e5c;
    font-weight: bold;
}

.detail-value {
    color: #323130;
    font-weight: bold;
    white-space: pre-line;
}

.welcome-footer-invoice {
    position: absolute;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
    z-index:10;
}

.welcome-footer-invoice button{
    font-weight: bold;
}

/*=============================== Amount Details ===================================*/


.invoice-form-item textarea {
    resize: none;
    display: block;
    width: 100%;
    height: 110px;
    padding: 12px;
    font-size: 12px;
    border: 1px solid #c8c6c4;
    border-radius: 4px;
    background-color: #ffffff;
    transition: border 0.2s, box-shadow 0.2s;
    font-weight: bold;
    color: #323130;
}

.invoice-amount-detail-header {
    margin-top: 10px;
    margin-bottom: 20px;
    margin-left: 10px;
    margin-right: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(0,0,0,0.25);
    padding: 15px;
}

.other-and-tax-amount-container,
.remark-and-grand-total-container {
    display: grid;
    grid-template-rows: 1fr 1fr;
}

.other-details-container {
    display: grid;
    grid-template-rows: 1fr;
    gap: 10px;
}

.tax-detail-grid,
.grand-total-detail-grid {
    display: grid;
    grid-template-columns: max-content 30px 10px max-content;
    row-gap: 5px;
    font-size: 12px;
}

.detail-currency {
    color: #323130;
    font-weight: bold;
}

.tax-detail-grid .detail-value,
.grand-total-detail-grid .detail-value {
    text-align: right;
}

.panel-row {
    display: grid;
    grid-template-columns: 1fr auto 0.75fr 1fr;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
}

.col-name {
    font-size: 13px;
    font-weight: bold;
    color: #605e5c;
    display: flex;
    align-content: center;
}

.panel-row input,
.form-input {
    display: block;
    width: 100%;
    height: 30px;
    padding: 0px 12px;
    font-size: 12px;
    border: 1px solid #c8c6c4;
    border-radius: 4px;
    background-color: #ffffff;
    transition: border 0.2s, box-shadow 0.2s;
    font-weight: bold;
    color: #323130;
}

.panel-row input:focus {
    outline: none;
    border-color: #0078d4;
}

.expense-add-icon,
.expense-minus-icon {
    width: 20px;
    height: 20px;
    fill: #605e5c;
}

.invoice-header-fields-detail-header {
    margin-top: 10px;
    margin-bottom: 20px;
    margin-left: 10px;
    margin-right: 10px;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(0,0,0,0.25);
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.invoice-header-fields-detail-header-subcolumn1 {
    margin-top: 15px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
}

.sbdropdown-item {
    position: relative;
}

.sbdropdown-item label {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    color: #605e5c;
    background: white;
    padding: 0 3px;
    pointer-events: none;
    transition: all 0.2s ease;
    top: 0px;
    font-size: 10px;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type=number] {
    -moz-appearance: textfield;
}