/* =========================================================
   Homes Module Styles
   ========================================================= */

/* ===== Common Styles ===== */
.homes-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-header-split {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 640px) {
    .page-header-split {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.page-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin: 4px 0 0 0;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: white;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-add svg {
    width: 20px;
    height: 20px;
}

/* ===== Alerts ===== */
.error-box {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    color: #b91c1c;
}

.error-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin: 0 0 0.5rem 0;
}

.error-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.875rem;
}

.error-list li {
    margin-bottom: 0.25rem;
}

.alert-success {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    color: #047857;
    font-size: 0.875rem;
}

.alert-success svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ===== Cards ===== */
.form-card,
.content-card {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* ===== Form Styles ===== */
.form-section {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 1rem 0;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .form-grid-3, .form-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.375rem;
}

.required-mark {
    color: #ef4444;
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: white;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-input::placeholder {
    color: #94a3b8;
}

.form-footer {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ===== Summary Cards ===== */
.summary-cards {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
    .summary-cards {
        grid-template-columns: repeat(4, 1fr);
    }
}

.summary-card {
    background: white;
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.card-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    margin: 0;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.card-icon svg {
    width: 20px;
    height: 20px;
}

.card-icon.indigo { background: #eef2ff; color: #6366f1; }
.card-icon.emerald { background: #ecfdf5; color: #10b981; }
.card-icon.red { background: #fef2f2; color: #ef4444; }
.card-icon.sky { background: #f0f9ff; color: #0ea5e9; }

.summary-card:hover .card-icon.indigo { background: #e0e7ff; }
.summary-card:hover .card-icon.emerald { background: #d1fae5; }
.summary-card:hover .card-icon.red { background: #fee2e2; }
.summary-card:hover .card-icon.sky { background: #e0f2fe; }

.card-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

.card-value.default { color: #1e293b; }
.card-value.emerald { color: #10b981; }
.card-value.red { color: #ef4444; }
.card-value.sky { color: #0ea5e9; }

/* ===== Filter Form ===== */
.filter-section {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: white;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.filter-select {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.btn-search {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-search:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-clear {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-clear:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* ===== Data Table ===== */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    color: #475569;
}

.data-table thead {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.data-table th {
    padding: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    text-align: center;
    letter-spacing: 0.05em;
}

.data-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: #fafbfc;
}

.data-table td {
    padding: 1rem;
    text-align: center;
}

.row-number {
    color: #94a3b8;
}

.home-number {
    font-weight: 600;
    color: #1e293b;
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
}

.badge-type {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    color: #4f46e5;
}

.badge-type svg {
    width: 10px;
    height: 10px;
}

.badge-status-normal {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #047857;
}

.badge-status-overdue {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #b91c1c;
}

.badge-status-default {
    background: #f1f5f9;
    color: #475569;
}

/* ===== Action Buttons ===== */
.actions-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn-pay {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #047857;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.action-btn-pay:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.action-btn-history {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #0369a1;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.15);
}

.action-btn-history:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}

.actions-divider {
    width: 1px;
    height: 20px;
    background: #e2e8f0;
    margin: 0 0.25rem;
}

.action-btn-edit,
.action-btn-delete {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #475569;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn-edit:hover {
    border-color: #6366f1;
    color: #4f46e5;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.action-btn-delete:hover {
    border-color: #ef4444;
    color: #dc2626;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

/* ===== Empty State ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 3rem 1rem;
    color: #94a3b8;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    color: #cbd5e1;
}

/* ===== Pagination ===== */
.pagination-section {
    padding: 1rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .pagination-section {
        flex-direction: row;
        justify-content: space-between;
    }
}

.pagination-info {
    color: #64748b;
    margin: 0;
}

.pagination-info strong {
    color: #1e293b;
    font-weight: 600;
}

.pagination-nav {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: white;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    border-right: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.page-link:last-child {
    border-right: none;
}

.page-link:hover:not(.disabled):not(.active) {
    background: #f8fafc;
}

.page-link.active {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
}

.page-link.disabled {
    color: #cbd5e1;
    cursor: not-allowed;
}

.page-ellipsis {
    padding: 0.5rem;
    color: #94a3b8;
    border-right: 1px solid #e2e8f0;
}
