/* --- GOOGLE FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --- MAIN WRAPPER (Compact Padding) --- */
.uv-sales-wrapper {
    font-family: 'Inter', sans-serif;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    padding: 15px; /* Reduced from 25px */
    margin-top: 10px;
    color: #333;
}

/* --- TOP BAR (Compact) --- */
.uv-top-bar {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    border-bottom: 1px solid #eee; /* Thinner border */
    padding-bottom: 10px; /* Reduced padding */
    margin-bottom: 15px; /* Reduced margin */
    flex-wrap: wrap; 
    gap: 10px;
}
.uv-title-box h2 { 
    margin: 0; 
    font-size: 20px; /* Slightly smaller title */
    color: #003D3F; 
    font-weight: 800; 
}
.uv-subtitle { 
    color: #888; 
    font-size: 12px; 
    font-weight: 500; 
}

.uv-btn-primary {
    background: #003D3F; 
    color: #fff; 
    border: none; 
    padding: 8px 16px; /* Compact Button */
    border-radius: 6px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.2s;
    font-size: 13px; 
    display: flex; 
    align-items: center; 
    gap: 6px;
}
.uv-btn-primary:hover { background: #002a2b; transform: translateY(-1px); }

/* --- STATS CARDS (Compact Row) --- */
.uv-stats-row {
    display: flex; 
    gap: 10px; 
    margin-bottom: 15px; /* Reduced gap */
}
.uv-stat-card {
    background: #f0fdf4; /* Light Green */
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 10px 15px; /* Compact Padding */
    flex: 1;
    min-width: 120px;
}
.uv-stat-card:nth-child(2) {
    background: #eff6ff; /* Light Blue */
    border-color: #bfdbfe;
}
.uv-stat-label {
    font-size: 11px; 
    font-weight: 600; 
    color: #555; 
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}
.uv-stat-card h3 {
    margin: 0; 
    font-size: 20px; /* Smaller Number */
    color: #003D3F; 
    font-weight: 800;
}

/* --- FILTERS (Inline & Compact) --- */
.uv-filters-bar {
    background: #f8f9fa; 
    padding: 10px; /* Reduced padding */
    border-radius: 6px;
    display: flex; 
    gap: 10px; 
    flex-wrap: wrap; 
    align-items: flex-end; /* Align inputs to bottom */
    margin-bottom: 15px; /* Reduced margin */
    border: 1px solid #eee;
}
.uv-filter-group { 
    display: flex; 
    flex-direction: column; 
    gap: 3px; 
    flex: 1; 
    min-width: 140px; 
}
.uv-filter-group.wide { flex: 3; } /* Give search more space */
.uv-filter-group.bottom { justify-content: flex-end; flex: 0; }

.uv-filters-bar label { 
    font-size: 11px; 
    font-weight: 700; 
    color: #666; 
    text-transform: uppercase; 
}
.uv-select, .uv-input {
    padding: 8px 10px; /* Smaller input padding */
    border: 1px solid #ddd; 
    border-radius: 4px; 
    font-size: 13px;
    background: #fff; 
    width: 100%; 
    box-sizing: border-box; 
    outline: none;
    height: 36px; /* Fixed Height */
}
.uv-select:focus, .uv-input:focus { border-color: #003D3F; }

.uv-btn-secondary {
    background: #fff; 
    border: 1px solid #003D3F; 
    color: #003D3F;
    padding: 0 15px; 
    border-radius: 4px; 
    font-weight: 600; 
    cursor: pointer;
    transition: 0.2s; 
    height: 36px; /* Match input height */
    font-size: 13px;
}
.uv-btn-secondary:hover { background: #003D3F; color: #fff; }

/* --- TABLE --- */
.uv-table-container { 
    overflow-x: auto; 
    border: 1px solid #eee; 
    border-radius: 6px; 
}
.uv-sales-table { width: 100%; border-collapse: collapse; min-width: 800px; }
.uv-sales-table th {
    background: #003D3F; 
    color: #fff; 
    padding: 10px 12px; /* Compact Header */
    text-align: left;
    font-size: 12px; 
    font-weight: 600; 
    text-transform: uppercase; 
    white-space: nowrap;
}
.uv-sales-table td {
    padding: 8px 12px; /* Compact Cells */
    border-bottom: 1px solid #f0f0f0; 
    font-size: 13px; 
    color: #444;
}
.uv-sales-table tr:hover { background: #f9fbfb; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* Action Icons */
.uv-action-btn {
    border: none; background: transparent; cursor: pointer; font-size: 15px;
    padding: 4px; color: #888; transition: 0.2s;
}
.uv-action-btn.edit:hover { color: #007bff; transform: scale(1.1); }
.uv-action-btn.delete:hover { color: #dc3545; transform: scale(1.1); }

/* --- MODAL (Fixed Z-Index & Centering) --- */
.uv-modal-overlay {
    display: none; 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); /* Darker Overlay */
    z-index: 9999999 !important; /* Extremely high Z-Index to stay on top of Header */
    align-items: center; 
    justify-content: center;
    backdrop-filter: blur(2px);
}
.uv-modal-content {
    background: #fff; 
    width: 95%; /* Mobile friendly */
    max-width: 600px; 
    border-radius: 8px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3); 
    overflow: hidden;
    animation: zoomIn 0.2s ease-out;
    display: flex; 
    flex-direction: column; 
    max-height: 85vh; /* Ensure it fits in viewport */
    margin: auto; /* Center Safe */
}
@keyframes zoomIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.uv-modal-header {
    background: #003D3F; color: #fff; padding: 15px 20px;
    display: flex; justify-content: space-between; align-items: center;
}
.uv-modal-header h3 { margin: 0; font-size: 16px; font-weight: 700; color: #fff; }
.uv-close-modal { font-size: 24px; cursor: pointer; opacity: 0.8; line-height: 1; }
.uv-close-modal:hover { opacity: 1; }

.uv-form-scroll { 
    padding: 20px; 
    overflow-y: auto; 
    flex: 1; 
}
.uv-form-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 12px; 
}
.uv-field { display: flex; flex-direction: column; gap: 4px; }
.uv-field.full-width { grid-column: 1 / -1; }
.uv-field.relative { position: relative; }

.uv-field label { font-size: 12px; font-weight: 600; color: #555; }

/* Modal Footer */
.uv-form-footer {
    padding: 12px 20px; 
    background: #f8f9fa; 
    border-top: 1px solid #eee;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}
.uv-btn-save {
    background: linear-gradient(135deg, #003D3F, #005a5e); color: #fff; border: none;
    padding: 10px 25px; border-radius: 4px; font-weight: 600; cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,61,63,0.2); font-size: 14px;
}
.uv-btn-save:hover { box-shadow: 0 6px 15px rgba(0,61,63,0.3); transform: translateY(-1px); }

/* Suggestions Dropdown */
#uv-client-suggestions {
    position: absolute; top: 100%; left: 0; width: 100%; background: #fff;
    border: 1px solid #ddd; border-radius: 0 0 6px 6px; max-height: 150px;
    overflow-y: auto; z-index: 100; /* High Z-index */
    display: none; box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.uv-suggestion-item { padding: 8px 12px; border-bottom: 1px solid #f0f0f0; cursor: pointer; font-size: 13px; }
.uv-suggestion-item:hover { background: #f5f5f5; color: #003D3F; }

/* Message */
#uv-form-msg { font-size: 13px; font-weight: 600; }
.msg-success { color: #28a745; }
.msg-error { color: #dc3545; }

/* Mobile Responsive Adjustments */
@media (max-width: 700px) {
    .uv-form-grid { grid-template-columns: 1fr; }
    .uv-filters-bar { flex-direction: column; gap: 8px; }
    .uv-filter-group { width: 100%; }
    .uv-btn-refresh { width: 100%; }
    .uv-sales-wrapper { padding: 10px; margin-top: 5px; }
}


    /* --- Member & Pagination Styles --- */
    
    .uv-member-cell strong { font-size: 14px; color: #333; display: block; }
    .uv-member-cell small { font-size: 11px; color: #888; font-family: monospace; letter-spacing: 0.5px; }
    
    .uv-pagination-container { 
        display: flex; 
        justify-content: space-between; 
        align-items: center; 
        margin-top: 20px; 
        padding-top: 15px; 
        border-top: 1px solid #eee; 
    }
    
    .uv-page-info { 
        font-size: 12px; 
        color: #666; 
        font-weight: 600; 
    }

    /* --- PAGINATION BUTTONS (UPDATED) --- */
    
    .uv-page-btns button { 
        padding: 6px 12px; 
        border: 1px solid #ccc; /* Thoda dark border taki button dikhe */
        background: #fff;       /* NORMAL: White BG */
        color: #003D3F;         /* NORMAL: Text Dark Green (Visible) */
        cursor: pointer; 
        border-radius: 4px; 
        font-size: 12px; 
        margin-left: 5px; 
        transition: all 0.2s;
        font-weight: 600;       /* Text thoda bold */
    }

    /* HOVER STATE: Teal BG + White Text */
    .uv-page-btns button:hover:not(:disabled) { 
        background: #008080 !important; 
        color: #fff !important; 
        border-color: #008080;
    }

    /* ACTIVE STATE: Dark Green BG + White Text */
    .uv-page-btns button.active { 
        background: #003D3F !important; 
        color: #fff !important; 
        border-color: #003D3F;
    }

    /* DISABLED STATE */
    .uv-page-btns button:disabled { 
        opacity: 0.6; 
        cursor: not-allowed; 
        background: #f9f9f9;
        color: #ccc;
    }
