/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    padding: 2rem 2.5rem;
    background: #f4f7fc;
    min-height: 100vh;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #0b1a33;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.page-header h2 i {
    color: #2563eb;
}

.btn-primary {
    background: #2563eb;
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
    color: white;
    text-decoration: none;
}

/* ===== STATS CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s;
    border: 1px solid #eef2f6;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0b1a33;
    margin-top: 0.1rem;
}

/* ===== SEARCH SECTION ===== */
.search-section {
    margin-bottom: 2rem;
}

.search-form {
    width: 100%;
}

.search-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    padding: 0.5rem;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1.5px solid #e2e8f0;
    transition: all 0.2s;
    flex-wrap: wrap;
}

.search-wrapper:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.search-icon {
    color: #94a3b8;
    padding-left: 0.5rem;
    font-size: 1rem;
}

.search-input {
    flex: 1;
    padding: 0.6rem 0.5rem;
    border: none;
    outline: none;
    font-size: 0.95rem;
    background: transparent;
    color: #0b1a33;
    min-width: 200px;
}

.search-input::placeholder {
    color: #94a3b8;
}

.filter-select,
.filter-date {
    padding: 0.6rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    font-size: 0.9rem;
    color: #0b1a33;
    outline: none;
    cursor: pointer;
    min-width: 140px;
    transition: all 0.2s;
}

.filter-select:focus,
.filter-date:focus {
    border-color: #2563eb;
}

.date-separator {
    color: #94a3b8;
    font-weight: 500;
    padding: 0 0.2rem;
}

.btn-search {
    background: #2563eb;
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-search:hover {
    background: #1d4ed8;
}

.btn-clear {
    background: #f1f5f9;
    color: #475569;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-clear:hover {
    background: #e2e8f0;
    color: #0b1a33;
    text-decoration: none;
}

/* ===== TABLE ===== */
.table-container {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    overflow-x: auto;
}

.table-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.record-count {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

.sort-info {
    font-size: 0.85rem;
    color: #2563eb;
    background: #eff6ff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.purchases-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.purchases-table thead {
    background: #f8fafc;
    border-radius: 12px;
}

.purchases-table th {
    text-align: left;
    padding: 0.9rem 1rem;
    font-weight: 600;
    color: #475569;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.purchases-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}

.purchases-table tbody tr {
    transition: all 0.15s;
}

.purchases-table tbody tr:hover {
    background: #f8fafc;
}

.purchases-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== BADGES ===== */
.purchase-name {
    font-weight: 600;
    color: #0b1a33;
}

.has-remarks {
    color: #94a3b8;
    margin-left: 0.3rem;
    cursor: help;
}

.company-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.company-nebg {
    background: #dcfce7;
    color: #166534;
}

.company-fa {
    background: #dbeafe;
    color: #1e40af;
}

.receipt-number {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #2563eb;
    background: #eff6ff;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.receipt-date {
    color: #94a3b8;
    font-size: 0.7rem;
}

.grand-total {
    font-weight: 700;
    color: #0b1a33;
    font-size: 1rem;
}

.text-muted {
    color: #94a3b8;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    font-size: 0.85rem;
}

.btn-view {
    background: #eff6ff;
    color: #2563eb;
}

.btn-view:hover {
    background: #2563eb;
    color: white;
}

.btn-edit {
    background: #fef3c7;
    color: #92400e;
}

.btn-edit:hover {
    background: #92400e;
    color: white;
}

.btn-delete {
    background: #fee2e2;
    color: #991b1b;
}

.btn-delete:hover {
    background: #991b1b;
    color: white;
}

/* ===== PAGINATION ===== */
.pagination-wrapper {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.pagination-wrapper nav {
    display: flex;
    justify-content: center;
}

.pagination-wrapper .pagination {
    display: flex;
    gap: 0.3rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination-wrapper .pagination li {
    display: inline-block;
}

.pagination-wrapper .pagination li a,
.pagination-wrapper .pagination li span {
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    color: #475569;
    text-decoration: none;
    transition: all 0.15s;
    border: 1px solid #e2e8f0;
    background: white;
}

.pagination-wrapper .pagination li a:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.pagination-wrapper .pagination li.active span {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.pagination-wrapper .pagination li.disabled span {
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #64748b;
}

.empty-state i {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.empty-subtext {
    font-size: 0.95rem;
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .search-wrapper {
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem;
    }

    .search-icon {
        display: none;
    }

    .search-input {
        min-width: auto;
        padding: 0.6rem;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background: #f9fafc;
    }

    .filter-select,
    .filter-date {
        width: 100%;
    }

    .date-separator {
        text-align: center;
        padding: 0.2rem 0;
    }

    .btn-search {
        width: 100%;
        justify-content: center;
    }

    .btn-clear {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1.2rem 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .table-container {
        padding: 0.8rem;
    }

    .purchases-table {
        font-size: 0.85rem;
    }

    .purchases-table th,
    .purchases-table td {
        padding: 0.6rem 0.5rem;
    }

    .action-buttons {
        flex-direction: row;
        gap: 0.2rem;
    }

    .btn-action {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .table-header-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    .purchases-table th:nth-child(3),
    .purchases-table td:nth-child(3),
    .purchases-table th:nth-child(5),
    .purchases-table td:nth-child(5) {
        display: none;
    }

    .stat-value {
        font-size: 1.1rem;
    }
}
.tooltip-card{
    position:relative;
    cursor:pointer;
}

.expense-tooltip{

    position:absolute;

    top:110%;
    left:50%;

    transform:translateX(-50%);

    width:260px;

    background:#fff;

    border-radius:10px;

    box-shadow:0 8px 25px rgba(0,0,0,.15);

    padding:15px;

    opacity:0;
    visibility:hidden;

    transition:.25s;

    z-index:100;
}

.tooltip-card:hover .expense-tooltip{

    opacity:1;
    visibility:visible;

}

.tooltip-title{

    font-weight:600;
    margin-bottom:10px;

}

.tooltip-row{

    display:flex;

    justify-content:space-between;

    margin:8px 0;

}

.tooltip-row.total{

    margin-top:10px;

    color:#2563eb;

}
.stat-double-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.stat-divider {
    color: #d1d5db;
    font-weight: 300;
}

.stat-amount {
    font-size: 0.9rem;
    font-weight: 600;
    color: #059669;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.modal-header {
    background: #f8fafc;
    border-bottom: 2px solid #e5e7eb;
    padding: 20px 24px;
}

.modal-header .modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.modal-header .modal-title i {
    color: #2563eb;
    margin-right: 10px;
}

.modal-body {
    padding: 0;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
}

.modal-footer .btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 500;
}

.modal-footer .btn-primary {
    background: #2563eb;
    border: none;
}

.modal-footer .btn-primary:hover {
    background: #1d4ed8;
}
.btn-action.btn-quickview {
    background: #e0e7ff;
    color: #4f46e5;
}

.btn-action.btn-quickview:hover {
    background: #c7d2fe;
    color: #4338ca;
}