:root {
    --sidebar-width: 260px;
    --primary-color: #4361ee;
    --danger-color: #dc3545;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f6fa;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    min-height: 100vh;
    transition: margin 0.25s ease;
}

.sidebar .list-group-item {
    border: none;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
}

.sidebar .list-group-item.active {
    background-color: var(--primary-color);
    color: #fff;
}

.sidebar .list-group-item:not(.active):hover {
    background-color: #f0f0f0;
}

.sidebar-divider {
    border-top: 1px solid #eee;
    margin: 0.25rem 0;
}

.sidebar-header h6 {
    font-weight: 600;
    color: var(--primary-color);
}

/* Toggle on mobile */
.sidebar.toggled {
    margin-left: calc(-1 * var(--sidebar-width));
}

#page-content-wrapper {
    min-width: 0;
}

/* Cards */
.card {
    border: none;
    border-radius: 0.5rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
}

/* Stat Cards */
.stat-card {
    border-left: 4px solid var(--primary-color);
}

.stat-card.water {
    border-left-color: #0dcaf0;
}

.stat-card.electricity {
    border-left-color: #ffc107;
}

.stat-card.paid {
    border-left-color: #198754;
}

.stat-card.unpaid {
    border-left-color: var(--danger-color);
}

/* Tables */
.table th {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
}

/* Badge */
.badge-paid {
    background-color: #198754;
    color: #fff;
}

.badge-unpaid {
    background-color: var(--danger-color);
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
        position: fixed;
        z-index: 1050;
        top: 0;
        left: 0;
    }

    .sidebar.show {
        margin-left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1040;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

@media (min-width: 769px) {
    .sidebar.toggled {
        margin-left: calc(-1 * var(--sidebar-width));
    }
}

/* Info box */
.info-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0.5rem;
    padding: 1rem;
}

/* Login page */
.min-vh-100 {
    min-height: 100vh;
}

/* Filter bar */
.filter-bar {
    background-color: #fff;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Form controls consistent sizing on mobile */
@media (max-width: 576px) {
    .table-responsive {
        font-size: 0.85rem;
    }

    .btn-sm {
        font-size: 0.75rem;
    }
}

/* Bootstrap modals above sidebar / overlay (iOS Safari stacking) */
.modal {
    z-index: 1080;
}

.modal-backdrop {
    z-index: 1075;
}

/* Fatura listesi: Ödeme Gir + Sil yan yana (iOS dahil) */
.bill-list-actions {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    max-width: 100%;
}

.bill-list-actions__form {
    display: inline-flex;
    flex-shrink: 0;
}

.table-bills-list th:last-child,
.table-bills-list td:last-child {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
}

/* Ödeme sayfası: Ödeme + Sayaç tek sütunda, arada boşluk yok */
.unit-bill-actions {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    max-width: 100%;
}

.table-unit-bills th:last-child,
.table-unit-bills td:last-child {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
}

.table-unit-bills td:nth-last-child(2) {
    width: 1%;
    white-space: nowrap;
}

.btn-unit-paid {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .btn-unit-paid {
        min-width: 0;
        padding-left: 0.45rem;
        padding-right: 0.45rem;
    }

    .unit-bill-actions .btn-sm {
        font-size: 0.7rem;
    }

    .bill-list-actions .btn-sm {
        font-size: 0.7rem;
        padding-left: 0.45rem;
        padding-right: 0.45rem;
    }
}
