* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.login-container h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.login-buttons {
    display: flex;
    gap: 2rem;
}

.login-form {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    max-width: 400px;
    margin: 2rem auto;
    transform: translateY(50px);
}

.login-form h2 {
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary { background: #667eea; color: white; }
.btn-success { background: #48bb78; color: white; }
.btn-danger { background: #f56565; color: white; }
.btn-info { background: #4299e1; color: white; font-size: 14px; padding: 8px 16px; }
.btn-secondary { background: #a0aec0; color: white; }
.btn-admin { background: #ed8936; color: white; }
.btn-client { background: #48bb78; color: white; }

.btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }

.dashboard {
    min-height: 100vh;
    background: #f7fafc;
}

.navbar {
    background: white;
    padding: 1.5rem 3rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar a { color: #4a5568; text-decoration: none; font-weight: 600; }

.navbar .btn { margin-left: 1rem; }

.stats-grid, .dashboard-grid, .meters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.stat-card:hover { transform: translateY(-5px); }

.stat-card h3 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.stat-card.unpaid h3 { color: #f56565; }
.stat-card.overdue h3 { color: #ed8936; }

.stat-card p { color: #718096; font-size: 1.1rem; }

.meter-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    border-left: 5px solid #667eea;
}

.meter-card h4 { color: #2d3748; margin-bottom: 0.5rem; }

.form-container {
    max-width: 800px;
    margin: 3rem auto;
    padding: 3rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.table-container {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 3rem 3rem;
}

table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-collapse: collapse;
}

th, td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background: #667eea;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

tr:hover { background: #f7fafc; }

.status {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-unpaid { background: #fed7d7; color: #c53030; }
.status-paid { background: #c6f6d5; color: #22543d; }
.status-overdue { background: #fed7aa; color: #c05621; }

.status-pending { background: #bee3f8; color: #2b6cb0; }

.overdue-date {
    color: #e53e3e;
    font-weight: bold;
}

.total-row {
    font-size: 1.1rem;
    font-weight: bold;
    background: #f7fafc;
}

.total-row td { border-top: 2px solid #e2e8f0; }

.card {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.card:hover { transform: translateY(-5px); }

.card h3 { color: #2d3748; margin-bottom: 1rem; }
.card a { color: #667eea; text-decoration: none; font-size: 1.2rem; }

.meters-section {
    padding: 0 3rem 3rem;
}

.meters-section h3 {
    margin-bottom: 1.5rem;
    color: #2d3748;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-error {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    z-index: 1001;
}

.close:hover { color: #000; }

.bill-details {
    padding: 2rem;
}

.bill-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.bill-breakdown {
    width: 100%;
    margin-bottom: 1.5rem;
}

.bill-breakdown td:first-child {
    font-weight: 600;
    padding-right: 2rem;
    width: 50%;
}

.bill-dates {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
}

.bill-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

@media print {
    .navbar, .bill-actions { display: none !important; }
    .bill-details { padding: 0; }
    body { background: white; }
}

@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
    .login-buttons { flex-direction: column; }
    .navbar { flex-direction: column; gap: 1rem; padding: 1rem; }
    .stats-grid, .dashboard-grid { grid-template-columns: 1fr; }
}