/* ==========================================================================
   PharmPro — Sales History Page Styles
   Professional Blue Theme, screen-fit, matches home.css system
   ========================================================================== */

/* --- Page Title Bar --- */
.page-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title-left h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title-left h2 i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.page-title-left .current-date {
    font-size: 0.82rem;
    color: #94a3b8;
    margin-top: 3px;
}

/* --- Report Controls Row --- */
.report-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: stretch;
}

/* --- Filter Card --- */
.filter-card {
    background: var(--white);
    padding: 20px 22px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    flex: 3;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border: 1px solid var(--border-color);
}

.date-inputs {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-field label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.input-field input {
    padding: 9px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    outline: none;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    color: var(--secondary-color);
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafbfc;
}

.input-field input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
    background: white;
}

/* Filter Buttons */
.filter-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding-bottom: 1px;
}

.btn-secondary-sm {
    padding: 9px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    background: white;
    color: #64748b;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary-sm:hover {
    background: var(--hover-bg);
    color: var(--secondary-color);
    border-color: #cbd5e1;
}

/* Search Row */
.search-wrap {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input-wrap {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 13px;
    pointer-events: none;
}

.search-input-wrap input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    outline: none;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    color: var(--secondary-color);
    background: #fafbfc;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input-wrap input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
    background: white;
}

.search-input-wrap input::placeholder {
    color: #b0bec5;
    font-size: 12.5px;
}

/* --- Revenue Summary Card --- */
.revenue-summary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 24px 28px;
    border-radius: var(--radius);
    flex: 1;
    min-width: 210px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
    text-align: center;
}

.rev-item span {
    font-size: 11px;
    opacity: 0.85;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.rev-item h2 {
    font-size: 2rem;
    margin-top: 10px;
    margin-bottom: 4px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.rev-sub {
    font-size: 11px;
    opacity: 0.6;
    font-weight: 400;
}

/* --- Export PDF Button (in title bar) --- */
.btn-pdf {
    background: #ef4444;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.btn-pdf:hover {
    background: #dc2626;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
    transform: translateY(-1px);
}

.btn-pdf:active {
    transform: translateY(0);
}

/* --- Sales Table --- */
.table-wrapper {
    background: var(--white);
    border-radius: var(--radius);
    overflow-x: auto;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

thead tr {
    background: #f8fafc;
}

th {
    padding: 15px 16px;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    color: #1e293b;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

th i {
    margin-right: 6px;
    color: var(--primary-color);
    font-size: 11px;
}

td {
    padding: 13px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
    font-size: 13.5px;
}

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

tbody tr:hover {
    background-color: var(--primary-light);
    cursor: default;
}

tbody tr td:nth-child(2) {
    color: var(--secondary-color);
    font-weight: 600;
}

tbody tr td:last-child {
    font-weight: 700;
    color: var(--primary-dark);
}

/* Empty state */
#salesTableBody:empty::after {
    content: "No records found. Adjust filters or date range.";
    display: block;
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    font-size: 13px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    .report-controls {
        flex-direction: column;
    }

    .filter-card,
    .revenue-summary {
        flex: none;
        width: 100%;
    }

    .revenue-summary {
        min-width: unset;
        padding: 20px;
    }

    .date-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-actions {
        padding-bottom: 0;
    }

    .page-title-bar {
        flex-direction: row;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .rev-item h2 {
        font-size: 1.6rem;
    }

    .page-title-left h2 {
        font-size: 1.15rem;
    }
}