/* ===================================================================
   FabricPOS – Products / Inventory / Reports CSS
=================================================================== */

/* ── Products Grid View ────────────────────────────────────────── */
.products-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.prod-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    position: relative;
}

.prod-card:hover {
    border-color: rgba(245, 158, 11, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.prod-card-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    color: var(--text-muted);
}

.prod-card-body {
    padding: 12px;
}

.prod-card-name {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prod-card-sku {
    font-size: 11px;
    color: var(--text-muted);
}

.prod-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.prod-card-price {
    font-size: 15px;
    font-weight: 800;
    color: var(--amber-400);
}

.prod-card-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity var(--transition);
}

.prod-card:hover .prod-card-actions {
    opacity: 1;
}

.prod-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
    backdrop-filter: blur(8px);
}

.prod-action-edit {
    background: rgba(245, 158, 11, 0.8);
    color: #fff;
}

.prod-action-del {
    background: rgba(239, 68, 68, 0.8);
    color: #fff;
}

/* ── Image Upload Area ─────────────────────────────────────────── */
.image-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-input);
}

.image-upload-area:hover,
.image-upload-area.drag-over {
    border-color: var(--amber-500);
    background: rgba(245, 158, 11, 0.05);
}

.image-upload-area .upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.6;
}

.image-upload-area .upload-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.image-upload-area .upload-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.image-preview {
    width: 100%;
    border-radius: var(--radius);
    max-height: 160px;
    object-fit: cover;
}

/* ── Inventory Stock Cards ─────────────────────────────────────── */
.stock-level-bar {
    height: 5px;
    background: var(--bg-hover);
    border-radius: 99px;
    margin-top: 4px;
    overflow: hidden;
}

.stock-level-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.4s ease;
}

.stock-fill-high {
    background: var(--success);
}

.stock-fill-medium {
    background: var(--warning);
}

.stock-fill-low {
    background: var(--danger);
}

/* ── Purchase Entry ────────────────────────────────────────────── */
.purchase-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

/* ── Reports ───────────────────────────────────────────────────── */
.report-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.report-card-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

/* Mini bar chart */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 160px;
    padding-top: 20px;
}

.bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.bar-fill {
    width: 100%;
    border-radius: 5px 5px 0 0;
    background: linear-gradient(to top, var(--amber-700), var(--amber-400));
    min-height: 4px;
    transition: height 0.5s ease;
}

.bar-label {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
}

.bar-val {
    font-size: 10px;
    font-weight: 600;
    color: var(--amber-400);
    position: absolute;
    top: 0;
}

/* Top products list */
.top-product-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}

.top-product-row:last-child {
    border-bottom: none;
}

.top-product-rank {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

.top-product-rank.gold {
    background: rgba(245, 158, 11, 0.2);
    color: var(--amber-400);
}

.top-product-rank.silver {
    background: rgba(163, 163, 163, 0.2);
    color: #a3a3a3;
}

.top-product-rank.bronze {
    background: rgba(180, 83, 9, 0.2);
    color: #b45309;
}

.top-product-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.top-product-qty {
    font-size: 12px;
    color: var(--text-secondary);
}

.top-product-rev {
    font-size: 13px;
    font-weight: 700;
    color: var(--amber-400);
    min-width: 72px;
    text-align: right;
}

/* ── Customer History ──────────────────────────────────────────── */
.customer-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color var(--transition);
    cursor: pointer;
}

.customer-card:hover {
    border-color: rgba(245, 158, 11, 0.35);
}

.customer-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--info), #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.customer-name {
    font-size: 14px;
    font-weight: 600;
}

.customer-phone {
    font-size: 12px;
    color: var(--text-muted);
}

.customer-stat {
    font-size: 12px;
    color: var(--amber-400);
    font-weight: 600;
}

.customers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

/* ── Print Invoice Styles (applied via print media) ───────────── */
@media print {
    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ── Dashboard Alerts ──────────────────────────────────────────── */
.low-stock-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.low-stock-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(239, 68, 68, 0.07);
    border: 1px solid rgba(239, 68, 68, 0.18);
    border-radius: var(--radius);
}

.low-stock-item .lsi-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.low-stock-item .lsi-sku {
    font-size: 11px;
    color: var(--text-muted);
}

.low-stock-item .lsi-qty {
    font-size: 12px;
    font-weight: 700;
    color: var(--danger);
}

/* ── Recent Invoices ───────────────────────────────────────────── */
.invoice-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
    cursor: pointer;
}

.invoice-row:hover {
    background: var(--bg-hover);
}

.invoice-row:last-child {
    border-bottom: none;
}

.invoice-no {
    font-size: 13px;
    font-weight: 600;
    color: var(--amber-400);
    min-width: 80px;
}

.invoice-cust {
    flex: 1;
    font-size: 13px;
}

.invoice-date {
    font-size: 11.5px;
    color: var(--text-muted);
    min-width: 90px;
    text-align: right;
}

.invoice-total {
    font-size: 14px;
    font-weight: 700;
    min-width: 80px;
    text-align: right;
}