/* Conjunto Residencial Parque Los Granados — Sistema de Gestión */
/* Palette: teal green (#1c785f) from logo */

/* Reset & base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 20px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #1a2e28;
    background-color: #f5f8f7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.site-header {
    background-color: #1c785f;
    color: #ffffff;
    padding: 0.5rem 1.5rem;
    box-shadow: 0 2px 8px rgba(28, 120, 95, 0.25);
}

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

.brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
}

/* Login page — logo + form layout */
.login-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
}

.login-logo {
    flex: 0 0 auto;
}

.login-logo img {
    height: auto;
    max-width: 280px;
}

.login-layout .auth-container {
    flex: 0 0 400px;
    margin: 0;
}

@media (max-width: 768px) {
    .login-layout {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1rem;
    }
    .login-logo img {
        max-width: 180px;
    }
    .login-layout .auth-container {
        flex: 0 0 auto;
        width: 100%;
    }
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-links a,
.btn-link {
    color: #d4ede5;
    text-decoration: none;
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
}

.nav-links a:hover,
.btn-link:hover {
    color: #ffffff;
}

.nav-admin {
    font-weight: 600;
}

.nav-user {
    color: #b8dcd2;
    font-size: 0.875rem;
}

/* Main */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Auth forms */
.auth-container {
    max-width: 480px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(28, 120, 95, 0.08);
}

.auth-title {
    font-size: 1.5rem;
    color: #1c785f;
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-intro {
    color: #5a7a6e;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a2e28;
}

.form-group input {
    padding: 0.6rem 0.75rem;
    border: 1px solid #c8d6d1;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.15s;
}

.form-group input:focus {
    outline: none;
    border-color: #1c785f;
    box-shadow: 0 0 0 3px rgba(28, 120, 95, 0.15);
}

.field-error {
    font-size: 0.8rem;
    color: #c0392b;
}

.btn {
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s;
}

.btn-primary {
    background-color: #1c785f;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #23997e;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background-color: #fdeaea;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.auth-links {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

.auth-links a {
    color: #1c785f;
    font-weight: 600;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-links p {
    margin-bottom: 0.5rem;
}

/* Messages (Django contrib.messages) */
.messages {
    max-width: 480px;
    margin: 0 auto 1rem;
}

/* Dashboard */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

.container h1 {
    font-size: 1.75rem;
    color: #1c785f;
    margin-bottom: 0.25rem;
}

.building-address {
    color: #5a7a6e;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.card {
    background: #ffffff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(28, 120, 95, 0.06);
    text-align: center;
}

.stats-card .card-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stats-card .card-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1c785f;
}

.stats-card .card-label {
    font-size: 0.85rem;
    color: #5a7a6e;
    margin-top: 0.25rem;
}

.quick-links {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.quick-links .btn {
    display: inline-block;
    background-color: #1c785f;
    color: #ffffff;
    text-decoration: none;
    padding: 0.65rem 1.25rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.15s;
}

.quick-links .btn:hover {
    background-color: #23997e;
}

.section {
    margin-bottom: 2.5rem;
}

.section h2 {
    font-size: 1.25rem;
    color: #1c785f;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #c8e0d7;
}

/* Tables */
.data-table,
.maintenance-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(28, 120, 95, 0.06);
}

.data-table thead th,
.maintenance-table thead th {
    background-color: #1c785f;
    color: #ffffff;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody td,
.maintenance-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e8eeeb;
    font-size: 0.9rem;
    color: #1a2e28;
}

.data-table tbody tr:last-child td,
.maintenance-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover,
.maintenance-table tbody tr:hover {
    background-color: #edf5f2;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-scheduled {
    background-color: #d1ecf1;
    color: #0c5460;
}

.badge-in_progress {
    background-color: #fff3cd;
    color: #856404;
}

.badge-completed {
    background-color: #d4edda;
    color: #155724;
}

.badge-overdue,
.badge-vencido {
    background-color: #fdeaea;
    color: #c0392b;
}

.badge-pending,
.badge-pendiente {
    background-color: #ffeaa7;
    color: #856404;
}

.badge-paid,
.badge-pagado {
    background-color: #d4edda;
    color: #155724;
}

/* Status row tints */
.status-overdue,
.status-vencido {
    background-color: #fff5f5;
}

.status-completed,
.status-pagado {
    background-color: #f8fdf8;
}

.status-pending,
.status-pendiente {
    background-color: #fffefa;
}

/* Empty state */
.empty-message {
    text-align: center;
    color: #5a7a6e;
    padding: 2rem;
    font-style: italic;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.pagination a {
    color: #1c785f;
    font-weight: 600;
    text-decoration: none;
}

.pagination a:hover {
    text-decoration: underline;
}

/* Footer */
.site-footer {
    background-color: #155e49;
    color: #b8dcd2;
    text-align: center;
    padding: 1rem;
    font-size: 0.875rem;
}
