/* --- Google Font Import (from water_usage) --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

/* Basic Reset & Body */
body, html {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f7f6;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header & Navigation */
header {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

nav .logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

nav ul li a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
}

nav ul li a.button {
    background-color: #3498db;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

/* Main Content & Sections */
main {
    margin: 2rem auto;
    padding: 0 2rem;
}

section {
    background: #fff;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

section h2 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.hero {
    background-color: #34495e;
    color: #fff;
    text-align: center;
    padding: 4rem 2rem;
    border-radius: 8px;
}

.hero h1 {
    margin: 0;
    font-size: 2.5rem;
}

/* Amenity Grid */
.amenity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.amenity-card {
    border: 1px solid #ddd;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
    color: #777;
    border-top: 1px solid #eee;
}


/* --- Styles from login.php --- */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.login-container h1 {
    text-align: center;
    color: #2c3e50;
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group label[for="description"] {
    width: 1000px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box; /* Important for padding to work */
}
.login-button {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 5px;
    background-color: #3498db;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
}
.error-msg {
    color: red;
    text-align: center;
    margin-bottom: 1rem;
}

/* --- Styles from dashboard.php (Admin) --- */
.admin-panel, .admin-create {
    background: #fdfdfd;
    border: 1px solid #ddd;
    padding: 1.5rem;
    margin-top: 2rem;
    border-radius: 8px;
}
.admin-panel table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
.admin-panel th, .admin-panel td {
    border: 1px solid #ddd;
    padding: 0.75rem;
    text-align: left;
}
.admin-panel th { background: #f9f9f9; }
.admin-panel td form {
    display: inline-block;
    margin-left: 5px;
}
.admin-panel .btn-delete {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}
.admin-panel .btn-reset {
    background: #f39c12;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}
.admin-create .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.admin-create .form-group { margin-bottom: 0; }
.admin-create .btn-create {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
}
.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
}
.btn-cancel {
    display: inline-block;
    text-decoration: none;
    color: #555;
    padding: 10px 15px;
    border-radius: 4px;
    background: #f1f1f1;
}
.msg-box {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    text-align: center;
}
.msg-success { background: #d4edda; color: #155724; }
.msg-error { background: #f8d7da; color: #721c24; }

/* --- Styles from finances.php --- */
.finance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.balance-box {
    background: #f4f7f6;
    border: 1px solid #ddd;
    padding: 1rem 1.5rem;
    border-radius: 8px;
}
.balance-box h3 {
    margin: 0;
    color: #555;
    font-size: 1rem;
    font-weight: 500;
}
.balance-box .amount {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}
.balance-box .amount.positive { color: #e74c3c; } /* Red if they owe */
.balance-box .amount.negative { color: #2ecc71; } /* Green if they have credit */

.finance-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
}
.finance-table th, .finance-table td {
    border: 1px solid #ddd;
    padding: 0.75rem;
    text-align: left;
}
.finance-table th { background: #f9f9f9; }
.finance-table .charge { color: #e74c3c; } /* Red */
.finance-table .credit { color: #2ecc71; } /* Green */

/* --- New Styles for water_usage.php (Replaces Tailwind) --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}
.water-header {
    margin-bottom: 2rem;
}
.water-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #111827;
}
.water-header p {
    color: #4B5563;
    margin-top: 0.5rem;
}
.water-main {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    padding: 1.5rem;
}
.chart-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.chart-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
}
.chart-selectors {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.chart-selectors label {
    margin-right: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4B5563;
}
.chart-selectors select {
    background: #F9FAFB;
    border: 1px solid #D1D5DB;
    color: #111827;
    font-size: 0.875rem;
    border-radius: 6px;
    padding: 0.5rem;
    font-family: inherit;
}
.chart-container {
    position: relative;
    height: 24rem; /* 384px */
}
.status-message {
    text-align: center;
    color: #6B7280;
    margin-top: 1rem;
    min-height: 20px;
}

main,
.container {
    flex-grow: 1;
}
/* --- Document Page Styles --- */
.doc-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}
.doc-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #111827;
}
.doc-header p {
    color: #4B5563;
    margin-top: 0.5rem;
    font-size: 1.1rem;
}

.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.doc-tile {
    display: block;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.2s ease-in-out;
}

.doc-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.doc-tile h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: #3498db;
}

.doc-tile p {
    margin: 0;
    color: #555;
    line-height: 1.5;
}

.doc-tile-container {
    position: relative;
}

.btn-edit {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: #f39c12; /* Admin orange */
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.8rem;
    transition: background-color 0.2s ease-in-out;
}
.btn-edit:hover {
    background: #e67e22; /* Darker orange on hover */
}
.btn-add:hover {
    background: #27ae60; /* Darker green on hover */
}

/* --- Water Dashboard Summary Cards --- */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.summary-card {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.summary-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 500;
    color: #4b5563;
}

.summary-card .summary-value {
    margin: 0;
    font-size: 2.25rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.summary-card .summary-unit {
    font-size: 0.875rem;
    color: #6b7280;
}