/* ============================================
   HOME PAGE - MODERN DESIGN
   ============================================ */

:root {
    --home-primary: #4f46e5;
    --home-primary-hover: #4338ca;
    --home-primary-light: #eef2ff;
    --home-success: #10b981;
    --home-success-light: #ecfdf5;
    --home-warning: #f59e0b;
    --home-warning-light: #fffbeb;
    --home-text: #1e293b;
    --home-text-muted: #64748b;
    --home-border: #e2e8f0;
}

body { font-family: 'DM Sans', -apple-system, sans-serif; }

.home-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* --- Hero / Welcome --- */
.home-hero {
    margin-bottom: 2rem;
}

.home-hero h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--home-text);
    margin: 0 0 0.5rem;
}

.home-hero p {
    font-size: 1rem;
    color: var(--home-text-muted);
    margin: 0;
}

/* --- Quick Actions --- */
.home-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.home-action-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--home-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.home-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.home-action-card.bills {
    border-left: 4px solid var(--home-primary);
}

.home-action-card.bills:hover {
    background: var(--home-primary-light);
}

.home-action-card.new-bill {
    border-left: 4px solid var(--home-success);
}

.home-action-card.new-bill:hover {
    background: var(--home-success-light);
}

.home-action-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.home-action-card.bills .home-action-icon {
    background: var(--home-primary-light);
    color: var(--home-primary);
}

.home-action-card.new-bill .home-action-icon {
    background: var(--home-success-light);
    color: var(--home-success);
}

.home-action-text h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--home-text);
    margin: 0 0 0.25rem;
}

.home-action-text p {
    font-size: 0.8125rem;
    color: var(--home-text-muted);
    margin: 0;
}

/* --- Products Card --- */
.home-products-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--home-border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.home-products-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--home-primary) 0%, #6366f1 100%);
    color: #fff;
}

.home-products-header .home-products-count {
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
}

.home-products-count strong {
    color: #fff;
}

.home-new-bill-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}

.home-new-bill-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.35rem;
}

.home-new-bill-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.home-new-bill-number {
    width: 4rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.home-new-bill-number:focus {
    outline: none;
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.home-new-bill-number::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.home-new-bill-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    background: #fff !important;
    color: var(--home-primary) !important;
    border: none;
    transition: all 0.2s;
}

.home-new-bill-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* --- Search --- */
.home-search-wrap {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--home-border);
}

.home-search {
    max-width: 320px;
    position: relative;
}

.home-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--home-text-muted);
    font-size: 0.875rem;
}

.UT-search-input {
    width: 100% !important;
    padding: 0.6rem 1rem 0.6rem 2.5rem !important;
    font-size: 0.9375rem;
    border: 1px solid var(--home-border);
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.UT-search-input:focus {
    outline: none;
    border-color: var(--home-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* --- Table --- */
.home-products-card .UT-table-section {
    max-height: 480px;
    overflow-y: auto;
}

.home-products-card .UT-table-section table {
    width: 100%;
    border-collapse: collapse;
}

.home-products-card .UT-table-section thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    padding: 0.875rem 1.25rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--home-text-muted);
    border-bottom: 2px solid var(--home-border);
}

.home-products-card .UT-table-section tbody td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--home-border);
    color: var(--home-text);
    font-size: 0.9375rem;
}

.home-products-card .UT-table-section tbody tr:hover {
    background: var(--home-primary-light);
}

.home-product-qty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 0.25rem 0.5rem;
    background: var(--home-primary-light);
    color: var(--home-primary);
    border-radius: 8px;
    font-weight: 600;
}

.home-product-qty.low {
    background: #fef2f2;
    color: #dc2626;
}

/* --- Pagination --- */
.home-pagination {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid var(--home-border);
    display: flex;
    justify-content: center;
}

.home-pagination .pagination {
    margin: 0;
    gap: 0.25rem;
}

.home-pagination .page-link {
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
    font-weight: 500;
}

/* --- Empty state --- */
.home-empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.home-empty-state i {
    font-size: 3rem;
    color: var(--home-text-muted);
    margin-bottom: 1rem;
}

.home-empty-state h3 {
    font-size: 1.125rem;
    color: var(--home-text);
    margin: 0 0 0.5rem;
}

.home-empty-state p {
    color: var(--home-text-muted);
    margin: 0;
}

/* --- Alerts --- */
.home-no-results {
    padding: 1.5rem;
    text-align: center;
    background: #eff6ff;
    color: #1e40af;
    border-radius: 10px;
    margin: 1rem 1.5rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .home-page { padding: 1rem; }
    .home-hero h1 { font-size: 1.5rem; }
    .home-actions { grid-template-columns: 1fr; }
    .home-products-header { flex-direction: column; align-items: stretch; }
    .home-new-bill-form { flex-direction: column; align-items: stretch; }
    .home-new-bill-inputs { width: 100%; }
    .home-new-bill-number { flex: 1; }
    .home-search { max-width: 100%; }
    .home-products-card .UT-table-section {
        max-height: 380px;
    }
}

@media (max-width: 576px) {
    .home-page {
        padding: 0.75rem;
    }
    .home-hero {
        margin-bottom: 1.25rem;
    }
    .home-hero h1 {
        font-size: 1.35rem;
    }
    .home-hero p {
        font-size: 0.9rem;
    }
    .home-action-card {
        padding: 1rem;
    }
    .home-action-text h3 {
        font-size: 0.95rem;
    }
    .home-action-text p {
        font-size: 0.8rem;
    }
    .home-products-card .UT-table-section {
        max-height: none;
        overflow-y: visible;
        overflow-x: auto;
    }
    .home-products-card .UT-table-section table {
        min-width: 480px;
    }
    .home-products-card .UT-table-section thead th,
    .home-products-card .UT-table-section tbody td {
        padding: 0.65rem 0.75rem;
        font-size: 0.85rem;
    }
    .home-pagination {
        padding: 0.75rem 1rem;
    }
}
