body {
    background: #f5f5f9;
}

.app-brand-text {
    letter-spacing: 0;
    line-height: 1.1;
}

.layout-page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #384551;
    margin: 0;
}

.metric-card .card-body {
    min-height: 118px;
}

.metric-label {
    color: #697a8d;
    font-size: .8125rem;
    font-weight: 600;
    margin-bottom: .4rem;
}

.metric-value {
    color: #384551;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.2;
    word-break: break-word;
}

.table th {
    color: #566a7f;
    font-size: .75rem;
    font-weight: 700;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

.table-responsive {
    min-height: .01%;
}

.action-buttons {
    display: flex;
    gap: .35rem;
    justify-content: center;
    flex-wrap: nowrap;
}

.customer-owner-tabs {
    display: flex;
    align-items: stretch;
    gap: .75rem;
    padding: 1.25rem 1.25rem 0;
    flex-wrap: wrap;
}

.customer-owner-tab {
    min-width: 10rem;
    min-height: 3.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem 1rem;
    border: 1px solid #e4e7ec;
    border-radius: .5rem;
    color: #566a7f;
    background: #fff;
    text-decoration: none;
    transition: all .2s ease;
}

.customer-owner-tab:hover {
    color: #696cff;
    border-color: #c7c9ff;
    background: #f7f7ff;
}

.customer-owner-tab.active {
    color: #fff;
    border-color: #696cff;
    background: #696cff;
    box-shadow: 0 .25rem .75rem rgba(105, 108, 255, .24);
}

.customer-owner-tab span {
    font-weight: 700;
}

.customer-owner-tab strong {
    min-width: 2rem;
    text-align: center;
    font-size: 1.15rem;
    line-height: 1;
}

.customer-duplicate-row {
    --bs-table-bg: #fff1f2;
    --bs-table-striped-bg: #ffe4e6;
    --bs-table-hover-bg: #fecdd3;
}

.customer-duplicate-row td {
    color: #9f1239;
    font-weight: 600;
}

.btn-icon {
    width: 2rem;
    height: 2rem;
}

.search-bar {
    max-width: 460px;
}

.contract-status-filter .form-select {
    min-width: 7.25rem;
    padding-right: 2.25rem;
}

.badge {
    font-weight: 600;
}

.reconciliation-result .amount {
    font-size: 1.25rem;
    font-weight: 700;
}

.form-hint {
    color: #697a8d;
    font-size: .8125rem;
}

.ajax-select {
    position: relative;
}

.ajax-select-menu {
    position: absolute;
    top: calc(100% + .25rem);
    left: 0;
    right: 0;
    z-index: 1080;
    max-height: 16rem;
    overflow-y: auto;
    border: 1px solid #d9dee3;
    border-radius: .375rem;
    background: #fff;
    box-shadow: 0 .25rem 1rem rgba(67, 89, 113, .12);
}

.ajax-select-option {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #f1f1f2;
    background: transparent;
    padding: .65rem .85rem;
    text-align: left;
}

.ajax-select-option:hover,
.ajax-select-option:focus {
    background: #f5f5f9;
}

.ajax-select-option:last-child {
    border-bottom: 0;
}

.ajax-select-option-title {
    display: block;
    color: #384551;
    font-weight: 600;
    line-height: 1.25;
}

.ajax-select-option-description {
    display: block;
    color: #697a8d;
    font-size: .8125rem;
    line-height: 1.25;
    margin-top: .15rem;
}

.quick-payment-page {
    color: #2f3a4a;
}

.quick-payment-toolbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.toolbar-control {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 2.75rem;
    padding: 0 .85rem;
    border: 1px solid #d9dee3;
    border-radius: .45rem;
    background: #fff;
    box-shadow: 0 .125rem .375rem rgba(67, 89, 113, .05);
}

.toolbar-control i {
    color: #697a8d;
    font-size: 1.1rem;
}

.toolbar-date {
    width: 12.5rem;
}

.toolbar-search {
    flex: 1 1 24rem;
    max-width: 34rem;
}

.toolbar-filter-group {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.quick-stat-card,
.quick-panel {
    border: 1px solid #e4e7ec;
    border-radius: .5rem;
    background: #fff;
    box-shadow: 0 .125rem .5rem rgba(67, 89, 113, .08);
}

.quick-stat-card {
    min-height: 7rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
}

.quick-stat-icon {
    width: 3.5rem;
    height: 3.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .75rem;
    font-size: 1.75rem;
}

.quick-stat-icon.purple {
    color: #696cff;
    background: #ebe9ff;
}

.quick-stat-icon.green {
    color: #1aa66a;
    background: #e3f7eb;
}

.quick-stat-icon.amber {
    color: #d99016;
    background: #fff2d6;
}

.quick-stat-label {
    color: #566a7f;
    font-weight: 600;
    margin-bottom: .35rem;
}

.quick-stat-value {
    font-size: 1.75rem;
    line-height: 1.1;
    font-weight: 800;
}

.quick-panel.card {
    border-radius: .5rem;
}

.quick-panel .card-header,
.quick-panel .card-footer {
    background: #fff;
    border-color: #e4e7ec;
}

.quick-table-wrap {
    overflow-x: visible;
}

.quick-table {
    width: 100%;
    table-layout: fixed;
}

.quick-table th,
.quick-table td {
    padding-right: .6rem;
    padding-left: .6rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-customer-col {
    width: 18%;
}

.quick-phone-col {
    width: 13%;
}

.quick-contract-col {
    width: 24%;
}

.quick-money-col {
    width: 15%;
}

.quick-debt-col {
    width: 14%;
}

.quick-action-col {
    width: 9rem;
}

.quick-table .quick-money-col,
.quick-table .quick-debt-col,
.quick-table .quick-action-col {
    white-space: nowrap;
}

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

.quick-table tbody tr {
    transition: background-color .15s ease;
}

.quick-table tbody tr.selected-row {
    background: #f4f2ff;
}

.quick-product-name {
    max-width: 100%;
}

.quick-actions {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    justify-content: flex-end;
    min-width: 7.25rem;
    white-space: nowrap;
}

.quick-actions .btn-sm {
    min-width: 3.2rem;
    padding-right: .5rem;
    padding-left: .5rem;
}

.quick-form-card {
    position: sticky;
    top: 5.5rem;
}

.quick-customer-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.quick-avatar {
    width: 3.75rem;
    height: 3.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #696cff;
    background: #ebe9ff;
    font-size: 2rem;
}

.quick-readonly-control {
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    background: #fff;
}

.quick-mini-stat {
    min-height: 5rem;
    padding: 1rem;
    border-radius: .45rem;
    background: #f8f9fb;
}

.quick-mini-stat span {
    display: block;
    color: #566a7f;
    font-size: .8125rem;
    font-weight: 600;
    margin-bottom: .5rem;
}

.quick-mini-stat strong {
    display: block;
    color: #2f3a4a;
    font-size: 1.1rem;
    line-height: 1.2;
}

/* ============================================================
   DAILY SHEET / THU TIỀN THEO NGÀY (Payment Page)
   ============================================================ */

.daily-sheet-page {
    color: #334155;
}

/* Header card styling */
.sheet-header.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    background: #fff;
    margin-bottom: 1.25rem;
    padding: 1.5rem;
    transition: box-shadow 0.2s ease;
}

.sheet-header.card:hover {
    box-shadow: 0 6px 32px rgba(0, 0, 0, 0.08);
}

.sheet-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.35rem;
}

.sheet-title-row h4 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1e293b;
    position: relative;
    display: inline-block;
    padding-bottom: 4px;
}

.sheet-title-row h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, #696cff, #a29bfe);
    border-radius: 4px;
}

.sheet-toolbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.sheet-date-control {
    width: 13.5rem;
}

.sheet-date-control .form-control {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.sheet-date-control .form-control:focus {
    border-color: #696cff;
    box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.12);
    background: #fff;
}

.sheet-date-label {
    min-width: 11rem;
    color: #64748b;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Stat cards in header */
.sheet-stats {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.sheet-stat-card {
    min-width: 14rem;
    min-height: 4.5rem;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: .75rem;
    padding: .85rem 1.1rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    transition: all 0.2s ease;
}

.sheet-stat-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.sheet-stat-card span:not(.sheet-stat-icon) {
    color: #64748b;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sheet-stat-card strong {
    grid-column: 2;
    font-size: 1.25rem;
    line-height: 1.1;
}

.sheet-stat-icon {
    grid-row: 1 / span 2;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.15rem;
}

.sheet-stat-icon.success {
    color: #22c55e;
    background: #ecfdf3;
}

.sheet-stat-icon.warning {
    color: #f59e0b;
    background: #fff7ed;
}

/* Workspace card (main area) */
.sheet-workspace.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    background: #fff;
    margin-bottom: 1.25rem;
    padding: 1.5rem;
}

/* Tabs styling */
.sheet-tabs {
    border-bottom: 2px solid #e2e8f0;
    gap: 0.25rem;
}

.sheet-tabs .nav-item {
    margin-bottom: -2px;
}

.sheet-tabs .nav-link {
    min-width: 9.25rem;
    border: 2px solid transparent;
    border-bottom: none;
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.65rem 1rem;
    border-radius: 10px 10px 0 0;
    transition: all 0.2s ease;
    position: relative;
}

.sheet-tabs .nav-link:hover {
    color: #696cff;
    border-color: transparent;
    background: #f1f0ff;
}

.sheet-tabs .nav-link.active {
    color: #696cff;
    background: transparent;
    border-color: #696cff;
    border-bottom-color: #fff;
}

.sheet-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #fff;
}

/* Table wrapper */
.sheet-table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.sheet-collector-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .85rem;
}

.sheet-collector-label {
    margin: 0;
    color: #475569;
    font-size: .85rem;
    font-weight: 700;
    white-space: nowrap;
}

.sheet-collector-input {
    max-width: 22rem;
    min-height: 2.5rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #fafbfc;
    font-size: .9rem;
    transition: all .2s ease;
}

.sheet-collector-input:focus {
    border-color: #696cff;
    box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.12);
    background: #fff;
}

.sheet-table {
    table-layout: fixed;
    margin-bottom: 0;
    width: 100%;
}

.sheet-table thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    vertical-align: middle;
    padding: 0.85rem 0.75rem;
}

.sheet-table tbody td {
    vertical-align: middle;
    border-color: #e2e8f0;
    padding: 0.65rem 0.75rem;
}

.sheet-table tbody tr {
    transition: background 0.15s ease;
}

.sheet-table tbody tr:hover {
    background: #fafbff;
}

.sheet-table tbody tr.is-selected {
    background: #f0eeff !important;
    box-shadow: inset 3px 0 0 #696cff;
}

.sheet-table tbody tr.sheet-row-warning {
    background: #fff1f2;
}

.sheet-table tbody tr.sheet-row-warning:hover {
    background: #ffe4e6;
}

.sheet-stt-col {
    width: 4rem;
    text-align: center;
}

.sheet-customer-col {
    width: 32%;
}

.sheet-phone-col {
    width: 10rem;
}

.sheet-money-col {
    width: 16%;
    text-align: center;
}

.row-index {
    text-align: center;
    font-weight: 700;
    color: #94a3b8;
    font-size: 0.85rem;
}

.sheet-customer-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.9rem;
}

.sheet-table small {
    display: block;
    color: #94a3b8;
    margin-top: .15rem;
    font-size: 0.75rem;
}

.sheet-phone-display {
    color: #334155;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

/* Status badge inside table */
.sheet-status {
    margin-top: .4rem;
    display: inline-block;
}

/* Money input field */
.sheet-money-input {
    min-height: 2.6rem;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #fafbfc;
    transition: all 0.2s ease;
    padding: 0.35rem 0.5rem;
    width: 100%;
}

.sheet-money-input:focus {
    border-color: #696cff;
    box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.12);
    background: #fff;
}

.sheet-money-input::placeholder {
    color: #cbd5e1;
    font-weight: 400;
}

/* Table footer */
.sheet-table tfoot td {
    background: #f8fafc;
    font-weight: 700;
    padding: 0.75rem;
    border-top: 2px solid #e2e8f0;
}

.sheet-total {
    color: #696cff;
    font-size: 1.1rem;
    font-weight: 800;
}

/* Customer Detail Panel (sidebar) */
.customer-detail-panel {
    position: sticky;
    top: 5.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.2s ease;
}

.customer-detail-panel:hover {
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.07);
}

.customer-detail-panel h6 {
    padding: 1.25rem 1.25rem 0;
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.customer-detail-panel h5 {
    padding: 0.75rem 1.25rem 1rem;
    font-size: 1.05rem;
    font-weight: 800;
    color: #1e293b;
}

.detail-lines {
    padding: 1rem 1.25rem;
    border-top: 1px solid #f1f5f9;
    margin: 0;
}

.detail-lines div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .85rem;
}

.detail-lines div:last-child {
    margin-bottom: 0;
}

.detail-lines span {
    color: #64748b;
    font-weight: 600;
    font-size: 0.85rem;
}

.detail-lines strong {
    font-size: 0.9rem;
}

.detail-section-title {
    display: block;
    margin-bottom: .85rem;
    color: #1e293b !important;
    font-size: 0.85rem !important;
}

.detail-after {
    margin: 0 1.25rem 1rem;
    padding: 1rem;
    border: 1.5px solid #fde68a;
    border-radius: 10px;
    background: #fffbeb;
}

.detail-after span {
    color: #92400e;
    font-weight: 600;
    font-size: 0.85rem;
}

.detail-after strong {
    color: #b45309;
    font-size: 1rem;
}

.customer-detail-panel .detail-history-link {
    display: flex;
    justify-content: center;
    margin: 0 1.25rem 1.25rem;
    font-weight: 700;
    border-radius: 10px;
    padding: 0.55rem 1rem;
    transition: all 0.2s ease;
}

/* Buttons inside sheet */
.sheet-header .btn-outline-primary {
    border: 1.5px solid #696cff;
    color: #696cff;
    border-radius: 10px;
    font-weight: 600;
    padding: 0.45rem 1rem;
    transition: all 0.2s ease;
}

.sheet-header .btn-outline-primary:hover {
    background: #696cff;
    color: #fff;
    box-shadow: 0 4px 16px rgba(105, 108, 255, 0.25);
    transform: translateY(-1px);
}

.sheet-header .btn-icon {
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: #fff;
    color: #64748b;
}

.sheet-header .btn-icon:hover {
    border-color: #696cff;
    color: #696cff;
    background: #f1f0ff;
    transform: translateY(-1px);
}

.btn-outline-danger {
    border: 1.5px solid #fee2e2;
    color: #ef4444;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-outline-danger:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Footer bar */
.sheet-footer-bar.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    background: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.25rem;
}

.sheet-footer-bar span {
    font-weight: 700;
    margin-right: 1rem;
    color: #64748b;
}

.sheet-footer-bar strong {
    font-size: 1.25rem;
    color: #16a34a;
}

.sheet-footer-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.sheet-footer-actions .btn-outline-primary {
    border: 1.5px solid #696cff;
    color: #696cff;
    border-radius: 10px;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s ease;
}

.sheet-footer-actions .btn-outline-primary:hover {
    background: #696cff;
    color: #fff;
    box-shadow: 0 4px 16px rgba(105, 108, 255, 0.25);
    transform: translateY(-1px);
}

.sheet-footer-actions .btn-primary {
    background: linear-gradient(135deg, #696cff, #5a4bd1);
    border: none;
    border-radius: 10px;
    font-weight: 700;
    padding: 0.5rem 1.5rem;
    color: #fff;
    box-shadow: 0 4px 16px rgba(105, 108, 255, 0.3);
    transition: all 0.2s ease;
}

.sheet-footer-actions .btn-primary:hover {
    background: linear-gradient(135deg, #5a4bd1, #696cff);
    box-shadow: 0 6px 24px rgba(105, 108, 255, 0.4);
    transform: translateY(-2px);
}

/* Badge variants */
.bg-label-secondary {
    background: #f1f5f9 !important;
    color: #64748b !important;
}

.bg-label-success {
    background: #ecfdf5 !important;
    color: #16a34a !important;
}

.bg-label-warning {
    background: #fff7ed !important;
    color: #d97706 !important;
}

.bg-label-danger {
    background: #fef2f2 !important;
    color: #ef4444 !important;
}

.bg-info {
    background: #6366f1 !important;
}

.bg-success {
    background: #22c55e !important;
}

.bg-danger {
    background: #ef4444 !important;
}

.bg-warning {
    background: #f59e0b !important;
    color: #1e293b !important;
}

/* Card body for forms */
.card-body {
    padding: 1.5rem;
}

/* Form control general enhancements */
.form-control, .form-select {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.55rem 0.85rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #696cff;
    box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.12);
}

.form-label {
    font-weight: 600;
    font-size: 0.8125rem;
    color: #334155;
    margin-bottom: 0.4rem;
}

@media (max-width: 767.98px) {
    .content-wrapper > .container-xxl {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .layout-page-title {
        font-size: 1.1rem;
    }

    .metric-value {
        font-size: 1.2rem;
    }

    .search-bar {
        max-width: none;
        width: 100%;
    }

    .search-bar > .col,
    .search-bar > .col-auto,
    .contract-status-filter .form-select {
        width: 100%;
    }

    .mobile-stack {
        flex-direction: column;
        align-items: stretch !important;
    }

    .quick-payment-toolbar,
    .toolbar-filter-group {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar-date,
    .toolbar-search,
    .toolbar-filter-group .btn,
    .quick-payment-toolbar > .btn {
        width: 100%;
        max-width: none;
    }

    .quick-stat-card {
        min-height: 6rem;
    }

    .quick-form-card {
        position: static;
    }

    .sheet-header.card,
    .sheet-workspace.card,
    .sheet-footer-bar.card {
        padding: 1rem;
    }

    .sheet-date-control,
    .sheet-stats,
    .sheet-stat-card,
    .sheet-footer-actions,
    .sheet-footer-actions .btn {
        width: 100%;
    }

    .sheet-tabs .nav-link {
        min-width: 7.5rem;
    }

    .customer-detail-panel {
        position: static;
    }

    .card-body {
        padding: 1.25rem;
    }
}

/* Full-page payment sheet mode, matching the provided reference screen. */
body:has(.daily-sheet-page) {
    background: #f8fafc;
}

.layout-wrapper:has(.daily-sheet-page),
.layout-wrapper:has(.daily-sheet-page) .layout-container,
.layout-wrapper:has(.daily-sheet-page) .layout-page,
.layout-wrapper:has(.daily-sheet-page) .content-wrapper {
    min-height: 100vh;
    width: 100%;
    background: #f8fafc;
}

.layout-wrapper:has(.daily-sheet-page) main.container-xxl {
    max-width: 100%;
    width: 100%;
    padding: 1rem 1.5rem !important;
}

.layout-wrapper:has(.daily-sheet-page) .alert {
    max-width: 1400px;
    margin-right: auto;
    margin-left: auto;
}

/* Daily Sheet Page Container */
.daily-sheet-page {
    --sheet-primary: #4f46e5;
    --sheet-primary-light: #e0e7ff;
    --sheet-border: #e2e8f0;
    --sheet-text: #1e293b;
    --sheet-muted: #64748b;
    --sheet-bg-blue: #dbeafe;
    --sheet-bg-blue-dark: #1e40af;
    --sheet-success: #22c55e;
    --sheet-warning: #f97316;
    --sheet-danger: #ef4444;
    
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Header & Toolbar Styling */
.daily-sheet-page .sheet-header.card {
    padding: 1.5rem;
    border: 1px solid var(--sheet-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 0;
}

.daily-sheet-page .sheet-title-row {
    margin-bottom: 1.25rem;
}

.daily-sheet-page .sheet-title-row h4 {
    color: #0f172a;
    font-size: 1.5rem;
    font-weight: 700;
}

.daily-sheet-page .sheet-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.daily-sheet-page .sheet-date-control {
    width: 11rem;
}

.daily-sheet-page .sheet-date-control .form-control {
    height: 2.75rem;
    border: 1px solid var(--sheet-border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--sheet-text);
    padding: 0.5rem 0.75rem;
    text-align: center;
}

.daily-sheet-page .sheet-header .btn-icon {
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--sheet-border);
    border-radius: 8px;
    color: var(--sheet-muted);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1.25rem;
}

.daily-sheet-page .sheet-header .btn-icon:hover {
    color: var(--sheet-primary);
    border-color: var(--sheet-primary);
    background: #f5f3ff;
}

.daily-sheet-page .sheet-date-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--sheet-text);
    margin-left: 0.5rem;
    margin-right: auto;
}

.daily-sheet-page .sheet-stats {
    display: flex;
    gap: 0.75rem;
}

.daily-sheet-page .sheet-stat-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--sheet-border);
    border-radius: 10px;
    background: #fff;
    min-width: 12rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.daily-sheet-page .sheet-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 8px;
    font-size: 1.25rem;
    background: #f8fafc;
}

.daily-sheet-page .sheet-stat-icon.success {
    color: var(--sheet-success);
    background: #f0fdf4;
}

.daily-sheet-page .sheet-stat-icon.warning {
    color: var(--sheet-warning);
    background: #fff7ed;
}

.daily-sheet-page .sheet-stat-card .stat-info {
    display: flex;
    flex-direction: column;
}

.daily-sheet-page .sheet-stat-card span {
    font-size: 0.75rem;
    color: var(--sheet-muted);
    font-weight: 600;
}

.daily-sheet-page .sheet-stat-card strong {
    font-size: 1.15rem;
    font-weight: 700;
}

.daily-sheet-page .sheet-header .sheet-print-current {
    height: 2.75rem;
    padding: 0 1.25rem;
    border: 1px solid var(--sheet-primary);
    border-radius: 8px;
    color: var(--sheet-primary);
    background: #fff;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.daily-sheet-page .sheet-header .sheet-print-current:hover {
    background: var(--sheet-primary);
    color: #fff;
}

/* Workspace Styling */
.daily-sheet-page .sheet-workspace.card {
    padding: 1.5rem;
    border: 1px solid var(--sheet-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Tab Navigation Custom styling */
.daily-sheet-page .sheet-tabs {
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.daily-sheet-page .sheet-tabs .nav-item {
    margin-bottom: -2px;
}

.daily-sheet-page .sheet-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    background: #f8fafc;
    color: var(--sheet-muted);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.daily-sheet-page .sheet-tabs .nav-link.active {
    background: #fff;
    color: var(--sheet-primary);
    border-bottom: 2px solid var(--sheet-primary);
    font-weight: 700;
    box-shadow: none;
}

.daily-sheet-page .sheet-tabs .nav-link:hover:not(.active) {
    background: #f1f5f9;
    color: var(--sheet-text);
}

.daily-sheet-page .sheet-tabs #addSheetButton {
    background: transparent;
    border: 1px dashed var(--sheet-border);
    color: var(--sheet-muted);
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    height: calc(100% - 2px);
    align-self: center;
}

.daily-sheet-page .sheet-tabs #addSheetButton:hover {
    border-color: var(--sheet-primary);
    color: var(--sheet-primary);
    background: #f5f3ff;
}

/* Columns Grid */
.daily-sheet-page .sheet-workspace > .row {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem;
    margin: 0;
}

.daily-sheet-page .sheet-workspace > .row > [class*="col-"] {
    width: 100%;
    padding: 0;
    margin-top: 0 !important;
}

/* Table Design */
.daily-sheet-page .sheet-table-wrap {
    border: 1px solid var(--sheet-border);
    border-radius: 8px;
    overflow: hidden;
}

.daily-sheet-page .sheet-collector-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}

.daily-sheet-page .sheet-collector-label {
    margin: 0;
    color: var(--sheet-muted);
    font-size: .9rem;
    font-weight: 700;
    white-space: nowrap;
}

.daily-sheet-page .sheet-collector-input {
    width: min(100%, 22rem);
    height: 2.5rem;
    border: 1px solid var(--sheet-border);
    border-radius: 6px;
    color: var(--sheet-text);
    font-size: .95rem;
    padding: .375rem .75rem;
}

.daily-sheet-page .sheet-collector-input:focus {
    border-color: var(--sheet-primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
    outline: none;
}

.daily-sheet-page .sheet-table {
    margin-bottom: 0;
    border-collapse: collapse;
}

.daily-sheet-page .sheet-table thead th {
    background: var(--sheet-bg-blue);
    color: #1e3a8a;
    font-weight: 700;
    padding: 0.75rem;
    border: 1px solid #b9d6fe;
    text-align: center;
    vertical-align: middle;
    font-size: 0.95rem;
}

.daily-sheet-page .sheet-table tbody td {
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
    border: 1px solid var(--sheet-border);
    background: #fff;
}

.daily-sheet-page .sheet-table tbody tr.is-selected td {
    background: #f8fafc;
}

.daily-sheet-page .sheet-stt-col {
    width: 4rem;
}

.daily-sheet-page .sheet-customer-col {
    width: auto;
}

.daily-sheet-page .sheet-phone-col {
    width: 9.5rem;
}

.daily-sheet-page .sheet-money-col {
    width: 9rem;
}

.daily-sheet-page .row-index {
    text-align: center;
    font-weight: 600;
    color: var(--sheet-muted);
}

.daily-sheet-page .sheet-customer-name {
    font-weight: 600;
    color: var(--sheet-text);
    font-size: 0.95rem;
}

.daily-sheet-page .sheet-table small {
    color: var(--sheet-muted);
    font-size: 0.8rem;
    display: block;
    margin-top: 0.15rem;
}

.daily-sheet-page .sheet-phone-display {
    color: var(--sheet-text);
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.daily-sheet-page .sheet-money-input {
    height: 2.5rem;
    border: 1px solid var(--sheet-border);
    border-radius: 6px;
    font-size: 0.95rem;
    padding: 0.375rem 0.75rem;
    transition: all 0.2s;
}

.daily-sheet-page .sheet-money-input {
    text-align: center;
    font-weight: 600;
    color: var(--sheet-text);
}

.daily-sheet-page .sheet-money-input[readonly] {
    background: #eef6ff;
    border-color: #bfdbfe;
    color: #1e40af;
    cursor: default;
}

.daily-sheet-page .sheet-money-input:focus {
    border-color: var(--sheet-primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
    outline: none;
}

/* Footer of the table */
.daily-sheet-page .sheet-table tfoot td {
    padding: 0;
    border: none;
}

.daily-sheet-page .sheet-table .sheet-total-row-container {
    background: var(--sheet-bg-blue);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    border-top: 1px solid #b9d6fe;
}

.daily-sheet-page .sheet-table .sheet-total-label {
    font-weight: 700;
    color: #1e3a8a;
    font-size: 1rem;
}

.daily-sheet-page .sheet-table .sheet-total {
    font-weight: 800;
    color: #1d4ed8;
    font-size: 1.15rem;
    text-align: center;
}

/* Customer Detail Panel */
.daily-sheet-page .customer-detail-panel {
    position: relative !important;
    top: auto !important;
    margin-top: 0 !important;
    border: 1px solid var(--sheet-border);
    border-radius: 12px;
    background: #fff;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.daily-sheet-page .customer-detail-panel h6 {
    font-size: 0.85rem;
    color: var(--sheet-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.daily-sheet-page .customer-detail-panel .detail-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--sheet-text);
    margin: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.daily-sheet-page .customer-detail-panel .detail-lines {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.daily-sheet-page .customer-detail-panel .detail-lines div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.daily-sheet-page .customer-detail-panel .detail-lines span {
    color: var(--sheet-muted);
    font-weight: 500;
}

.daily-sheet-page .customer-detail-panel .detail-lines strong {
    color: var(--sheet-text);
    font-weight: 600;
}

.daily-sheet-page .customer-detail-panel .detail-lines .text-danger {
    color: var(--sheet-danger) !important;
}

.daily-sheet-page .customer-detail-panel .detail-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--sheet-text);
    text-transform: none;
    margin-bottom: 0.25rem;
}

.daily-sheet-page .customer-detail-panel .detail-session-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.daily-sheet-page .customer-detail-panel .detail-after {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
}

.daily-sheet-page .customer-detail-panel .detail-after span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #b45309;
}

.daily-sheet-page .customer-detail-panel .detail-after strong {
    font-size: 1.1rem;
    font-weight: 800;
    color: #d97706;
}

.daily-sheet-page .customer-detail-panel .detail-history-link {
    height: 2.5rem;
    border: 1.5px solid var(--sheet-primary) !important;
    border-radius: 8px !important;
    color: var(--sheet-primary) !important;
    background: #fff !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s !important;
    text-decoration: none !important;
    font-size: 0.9rem !important;
    padding: 0 !important;
    line-height: 1 !important;
    margin: 0 !important;
}

.daily-sheet-page .customer-detail-panel .detail-history-link:hover {
    background: var(--sheet-primary) !important;
    color: #fff !important;
}

/* Page Footer Bar Styling */
.daily-sheet-page .sheet-footer-bar.card {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border: 1px solid var(--sheet-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.02), 0 1px 3px rgba(0, 0, 0, 0.05);
}

.daily-sheet-page .sheet-footer-bar span {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--sheet-text);
}

.daily-sheet-page .sheet-footer-bar strong {
    color: var(--sheet-success);
    font-size: 1.25rem;
    font-weight: 800;
    margin-left: 0.5rem;
}

.daily-sheet-page .sheet-footer-actions {
    display: flex;
    gap: 0.75rem;
}

.daily-sheet-page .sheet-footer-actions .btn {
    height: 2.75rem;
    border-radius: 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    padding: 0 1.5rem;
    transition: all 0.2s;
}

.daily-sheet-page .sheet-footer-actions .btn-outline-primary {
    border: 1.5px solid var(--sheet-primary);
    color: var(--sheet-primary);
    background: #fff;
}

.daily-sheet-page .sheet-footer-actions .btn-outline-primary:hover {
    background: var(--sheet-primary);
    color: #fff;
}

.daily-sheet-page .sheet-footer-actions .btn-primary {
    background: var(--sheet-primary);
    border: none;
    color: #fff;
}

.daily-sheet-page .sheet-footer-actions .btn-primary:hover {
    background: #4338ca;
}

/* Responsiveness adjustments */
@media (max-width: 1199.98px) {
    .daily-sheet-page .sheet-workspace > .row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .daily-sheet-page .sheet-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .daily-sheet-page .sheet-date-control,
    .daily-sheet-page .sheet-date-label,
    .daily-sheet-page .sheet-header .sheet-print-current {
        width: 100%;
        margin-left: 0;
    }
    
    .daily-sheet-page .sheet-stats {
        flex-direction: column;
    }
    
    .daily-sheet-page .sheet-stat-card {
        width: 100%;
    }
    
    .daily-sheet-page .sheet-footer-bar.card {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .daily-sheet-page .sheet-footer-actions {
        flex-direction: column;
    }
    
    .daily-sheet-page .sheet-footer-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

.daily-sheet-page .sheet-status {
    display: none;
}

.daily-sheet-page .sheet-tabs .nav-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.daily-sheet-page .remove-sheet-tab-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 1.15rem !important;
    height: 1.15rem !important;
    border-radius: 50% !important;
    color: var(--sheet-muted) !important;
    font-size: 0.8rem !important;
    transition: all 0.2s !important;
    margin-left: 0.5rem !important;
}

.daily-sheet-page .remove-sheet-tab-btn:hover {
    background: #fee2e2 !important;
    color: var(--sheet-danger) !important;
}

/* Custom Modal Backdrop */
.custom-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(4px) !important;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999 !important;
    opacity: 0;
    transition: opacity 0.15s linear;
}

.custom-modal-backdrop.show {
    display: flex !important;
    opacity: 1 !important;
}

/* Custom Modal Card */
.custom-modal-card {
    background: #fff !important;
    border-radius: 12px !important;
    width: 90% !important;
    max-width: 440px !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    padding: 1.5rem !important;
    transform: scale(0.95);
    transition: transform 0.15s ease-out;
}

.custom-modal-backdrop.show .custom-modal-card {
    transform: scale(1) !important;
}

.custom-modal-header {
    margin-bottom: 0.75rem !important;
}

.custom-modal-title {
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 !important;
}

.custom-modal-body {
    margin-bottom: 1.5rem !important;
}

.custom-modal-body p {
    font-size: 0.95rem !important;
    color: #475569 !important;
    margin: 0 !important;
    line-height: 1.5 !important;
}

.custom-modal-footer {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 0.75rem !important;
}

.custom-modal-footer .btn {
    height: 2.5rem !important;
    padding: 0 1.25rem !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
