/* ============================================================
   CITYCELL "ELITE" SALES HISTORY STYLES
   Description: Replicating the high-fidelity Sales Dashboard.
   ============================================================ */

:root {
    --cc-green: #22c55e;
    --cc-green-dark: #16a34a;
    --cc-text-dark: #1e293b;
    --cc-text-muted: #64748b;
    --cc-border: #e2e8f0;
    --cc-bg-light: #f8fafc;
}

/* Dashboard Container & Header */
#admin-tab-sales {
    padding: 24px;
}

.dashboard-header-elite {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.dashboard-title-elite {
    font-size: 1.75rem;
    font-weight: 850;
    color: var(--cc-text-dark);
    letter-spacing: -0.5px;
}

.icon-btn-pdf {
    width: 32px;
    height: 32px;
    background: transparent;
    color: var(--cc-text-muted);
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn-pdf:hover {
    color: #ef4444;
    transform: scale(1.1);
}

.btn-detailed-report {
    background: white;
    color: #64748b;
    border: 1.5px solid #e2e8f0;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.btn-detailed-report:hover {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-detailed-report i {
    font-size: 1rem;
    color: #6366f1;
}

.btn-detailed-report:hover i {
    color: white;
}

/* Controls (Filters & Search) */
.sales-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.search-box-elite {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box-elite>i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
    pointer-events: none;
}

.search-input-elite {
    width: 100%;
    box-sizing: border-box;
    height: 48px;
    padding: 0 45px 0 48px;
    background: white;
    border: 1px solid var(--cc-border);
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cc-text-dark);
    transition: all 0.3s;
}

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

.search-clear-elite {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.search-clear-elite:hover {
    color: #ef4444;
}

.filters-group-elite {
    display: flex;
    align-items: center;
    gap: 12px;
}

.preset-pills-elite {
    background: #edf2f7;
    padding: 4px;
    border-radius: 50px;
    display: flex;
    gap: 2px;
}

.preset-pill-btn {
    padding: 8px 18px;
    border-radius: 50px;
    border: none;
    background: transparent;
    color: #718096;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-pill-btn.active {
    background: white;
    color: #2b6cb0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.date-inputs-elite {
    background: white;
    padding: 4px 12px;
    border: 1px solid var(--cc-border);
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-date-elite {
    border: none;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--cc-text-dark);
    outline: none;
    background: transparent;
    cursor: pointer;
}

/* Hide native X clear buttons in mobile/desktop */
.search-input-elite::-webkit-search-cancel-button,
.input-date-elite::-webkit-clear-button,
.input-date-elite::-webkit-inner-spin-button {
    -webkit-appearance: none;
    display: none;
}

/* Analytics Cards Grid */
.analytics-grid-elite {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 35px;
}

.stat-card-main {
    grid-column: span 1;
    background: var(--cc-green);
    color: white;
    padding: 20px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 6px rgba(34, 197, 94, 0.2);
}

.stat-card-secondary {
    background: white;
    padding: 16px 20px;
    border: 1px solid var(--cc-border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.2s;
}

.stat-card-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.white-card {
    background: white !important;
}

.label-card-mini {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: inherit;
    opacity: 0.9;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.card-title-strong {
    font-size: 1.5rem;
    font-weight: 850;
    line-height: 1;
}

.card-subtitle-small {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 4px;
}

.white-card .label-card-mini {
    color: var(--cc-text-muted);
}

.white-card .card-title-strong {
    color: var(--cc-text-dark);
}

.white-card .unit-label {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-left: 4px;
    font-weight: 600;
}

/* Sales Table Elite */
.table-wrap-elite {
    background: white;
    border: 1px solid var(--cc-border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.sales-table-elite {
    width: 100%;
    border-collapse: collapse;
}

.sales-table-elite th {
    background: white;
    padding: 18px 20px;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 850;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--cc-border);
}

.sales-table-elite td {
    padding: 16px 20px;
    vertical-align: middle;
    border-bottom: 1px dotted #f1f5f9;
}

.sales-table-elite tr:last-child td {
    border-bottom: none;
}

.sales-table-elite tr:hover {
    background: #f8fafc;
}

/* Cell-Specific Styles */
.date-cell-elite {
    display: flex;
    flex-direction: column;
}

.date-main {
    font-weight: 800;
    color: var(--cc-text-dark);
    font-size: 0.95rem;
}

.time-sub {
    font-size: 0.75rem;
    color: var(--cc-text-muted);
    font-weight: 600;
    margin-top: 2px;
}

.order-badge-elite {
    display: inline-block;
    padding: 4px 10px;
    background: #f1f5f9;
    color: #64748b;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 8px;
}

.client-name-elite {
    font-weight: 800;
    color: var(--cc-text-dark);
    font-size: 0.95rem;
}

.total-amount-elite {
    font-weight: 850;
    color: var(--cc-text-dark);
    font-size: 1rem;
}

.profit-amount-elite {
    font-weight: 700;
    color: var(--cc-green);
    font-size: 1rem;
}

.profit-lost {
    color: #ef4444;
}

.profit-neutral {
    color: #94a3b8;
}

.status-capsule-elite {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.5px;
    white-space: nowrap;
    text-align: center;
}

.status-capsule-elite.success {
    background: #dcfce7;
    color: #166534;
}

.status-capsule-elite.warning {
    background: #fef9c3;
    color: #854d0e;
}

.status-capsule-elite.danger {
    background: #fee2e2;
    color: #991b1b;
}

.action-eye-btn-elite {
    width: 36px;
    height: 36px;
    background: #eff6ff;
    color: #3b82f6;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.action-eye-btn-elite:hover {
    background: #dbeafe;
    transform: scale(1.1);
}

/* Responsive Grid Adjustments */
@media (max-width: 1400px) {
    .analytics-grid-elite {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1100px) {
    .analytics-grid-elite {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .analytics-grid-elite {
        grid-template-columns: repeat(2, 1fr);
    }

    .sales-controls-row {
        flex-direction: column;
        align-items: stretch;
    }
}