/* ========================= */
/* CSS Variables / Theme      */
/* ========================= */
:root {
    --color-primary: #2e7d32;
    --color-primary-dark: #1b5e20;
    --color-accent: #2ecc71;
    --color-bg: #f4fdf5;
    --color-card-bg: #ffffff;
    --color-text: #333;
    --color-text-on-primary: #ffffff;
    --color-shadow: rgba(46, 125, 50, 0.15);
    --color-card-border: #2e7d32;
    --color-error-bg: #ffe5e5;
    --color-error-text: #d32f2f;
    --color-badge: red;
}

/* ========================= */
/* Global Styles             */
/* ========================= */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: var(--color-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ========================= */
/* Buttons                   */
/* ========================= */
.button {
    background: var(--color-primary);
    color: var(--color-text-on-primary);
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    text-align: center;
    width: auto;
    font-weight: bold;
    transition: background 0.3s ease;
    display: inline-block;
    text-decoration: none;
}

.button:hover {
    background: var(--color-primary-dark);
}

.login-button {
    background: var(--color-primary-dark);
    color: var(--color-text-on-primary);
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    text-align: center;
    width: auto;
    font-weight: bold;
    transition: background 0.3s ease;
    display: inline-block;
    text-decoration: none;
}

.login-button:hover {
    background: var(--color-primary);
}

/* ========================= */
/* Login Page                */
/* ========================= */
.login-container {
    width: 90%;
    max-width: 500px;
    background: var(--color-card-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px var(--color-shadow);
    border-left: 5px solid var(--color-primary);
    text-align: center;
    margin: auto;
    margin-top: 5%;
}

.login-container h2 {
    margin-bottom: 20px;
    color: var(--color-primary);
    font-size: 1.6em;
}

.login-container form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
}

.login-container label {
    font-weight: bold;
    color: var(--color-text);
    font-size: 0.95em;
}

.login-container input[type="text"],
.login-container input[type="password"] {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    width: 100%;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    flex: 1;
}

.toggle-password {
    position: absolute;
    right: 10px;
    cursor: pointer;
    font-size: 1.2em;
    color: #555;
}

.error {
    background: var(--color-error-bg);
    color: var(--color-error-text);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: bold;
    text-align: center;
}

/* ========================= */
/* Sidebar                   */
/* ========================= */
.sidebar {
    width: 220px;
    background-color: var(--color-primary);
    color: var(--color-text-on-primary);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 20px;
    transition: width 0.3s ease;
}

.sidebar h2 {
    font-size: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.sidebar a {
    display: block;
    color: var(--color-text-on-primary);
    text-decoration: none;
    padding: 10px 5px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-weight: 500;
    position: relative;
}

.sidebar a:hover {
    background-color: var(--color-primary-dark);
}

.sidebar a.active {
    background-color: var(--color-accent);
    font-weight: bold;
    border-left: 5px solid var(--color-accent);
}

.logout-link {
    margin-top: 30px;
    display: inline-block;
    color: #ffccbc;
    text-decoration: underline;
}

.badge {
    background: var(--color-badge);
    color: var(--color-text-on-primary);
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 0.8em;
    margin-left: 5px;
}

/* Sidebar header + toggle */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

#sidebar-toggle {
    background: none;
    border: none;
    color: var(--color-text-on-primary);
    font-size: 1.5em;
    cursor: pointer;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed h2,
.sidebar.collapsed .label {
    display: none;
}

.sidebar.collapsed a {
    text-align: center;
}

.sidebar.collapsed .badge {
    font-size: 0.7em;
    padding: 2px 4px;
    position: absolute;
    right: 8px;
}

/* ========================= */
/* Main Content / Container  */
/* ========================= */
.container {
    margin-left: 240px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .container {
    margin-left: 60px;
}

/* ========================= */
/* Dashboard Cards           */
/* ========================= */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
    background: var(--color-card-bg);
    border-left: 6px solid var(--color-primary);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    font-size: 1.1em;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 10px rgba(0,0,0,0.1);
}

.card strong {
    font-size: 1.6em;
    color: var(--color-accent);
    display: block;
    margin-top: 5px;
}

/* Summary Box */
.summary-box {
    background: #e5f9e7;
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid var(--color-accent);
    margin-top: 30px;
}

/* ========================= */
/* Footer                    */
/* ========================= */
.footer {
    background: var(--color-primary);
    color: var(--color-text-on-primary);
    padding: 15px 20px;
    font-size: 0.9em;
    margin-top: auto;
    text-align: center;
}

.footer-links {
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--color-text-on-primary);
    margin: 0 10px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--color-accent);
}

.footer-copy a {
    color: var(--color-text-on-primary);
    font-weight: bold;
    text-decoration: none;
}

.footer-copy a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

/* ========================= */
/* Flash / Logout Messages   */
/* ========================= */
.success {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #e5f9e7;
    color: var(--color-primary);
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* ========================= */
/* Responsive Adjustments     */
/* ========================= */
@media (max-width: 768px) {
    .login-container { max-width: 400px; padding: 25px; }
    .login-container h2 { font-size: 1.4em; }
    .login-container input { font-size: 0.95em; padding: 10px; }

    .sidebar { width: 180px; }
    .container { margin-left: 200px; }
}

@media (max-width: 480px) {
    .login-container { max-width: 320px; padding: 20px; }
    .login-container h2 { font-size: 1.2em; }
    .login-container input { font-size: 0.9em; padding: 8px; }

    .sidebar { width: 100%; height: auto; position: relative; }
    .container { margin-left: 0; }
}

/* ========================= */
/* Payments Table            */
/* ========================= */
.table-container {
    margin-top: 20px;
    overflow-x: auto;
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.95em;
    background: var(--color-card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.styled-table thead {
    background: var(--color-primary);
    color: white;
}

.styled-table th,
.styled-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.styled-table tbody tr:hover {
    background-color: #f1f8f4;
}

.sort-button {
    background: none;
    border: none;
    color: white;
    font-size: 0.95em;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.sort-button.active {
    text-decoration: underline;
}

.button {
    background-color: var(--color-accent);
    color: white;
    padding: 6px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9em;
    transition: background 0.3s;
}

.button:hover {
    background-color: var(--color-primary-dark);
}

/* ========================= */
/* Tenant Profile Card Styling */
/* ========================= */
.profile-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 700px;
    margin-bottom: 20px;
}

.profile-card .profile-pic img {
    border-radius: 50%;
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 2px solid #2e7d32; /* green accent border */
}

.profile-card .profile-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 1em;
    color: #333;
}

.profile-card .profile-info p strong {
    color: #2e7d32;
    width: 100px;
    display: inline-block;
}

.btn {
    display: inline-block;
    text-decoration: none;
    padding: 10px 20px;
    background: #2e7d32;
    color: #fff;
    border-radius: 12px;
    font-weight: bold;
    transition: background 0.2s ease;
}

.btn:hover {
    background: #1b5e20;
}

/* ========================= */
/* Tenant Profile Edit Form   */
/* ========================= */
.profile-edit-form {
    max-width: 500px;
    margin: 20px auto;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.profile-edit-form .profile-pic {
    text-align: center;
    margin-bottom: 15px;
}

.profile-edit-form .profile-pic img {
    border-radius: 50%;
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 2px solid #075e54;
}

.profile-edit-form label {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

.profile-edit-form input[type="text"],
.profile-edit-form input[type="email"],
.profile-edit-form input[type="password"],
.profile-edit-form input[type="file"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 0.95em;
    box-sizing: border-box;
}

.profile-edit-form input[type="file"] {
    padding: 5px;
}

.profile-edit-form button {
    padding: 10px 16px;
    background: #075e54;
    color: #fff;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.profile-edit-form button:hover {
    background: #064d46;
}

/* Optional: spacing for smaller screens */
@media (max-width: 600px) {
    .profile-edit-form {
        margin: 15px;
        padding: 15px;
    }
}

.profile-avatar.fallback {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #ccc; /* light gray background */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px; /* icon size */
    color: #fff; /* icon color */
}
.fa-avatar {
    width: 120px;
    height: 120px;
    background: #ddd; /* light gray circle */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555; /* icon color */
}

.button-warning {
    background-color: #e67e22;  /* orange warning color */
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.2s ease;
}

.button-warning:hover {
    background-color: #c15a00;  /* darker orange on hover */
}

