/* Portal Styles */

/* Login Pages */
.portal-body {
    min-height: 100vh;
    background: var(--bg-alt);
}

.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.login-left {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--primary-dark) 100%);
    padding: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.login-branding {
    position: relative;
    z-index: 1;
    color: white;
    max-width: 400px;
}

.login-branding .logo {
    color: white;
    margin-bottom: 40px;
    display: inline-flex;
}

.login-branding .logo-icon {
    color: var(--accent-light);
}

.login-branding h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.login-branding p {
    font-size: 1.1rem;
    opacity: 0.85;
    line-height: 1.7;
    margin-bottom: 40px;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius);
    backdrop-filter: blur(5px);
}

.login-feature svg {
    width: 24px;
    height: 24px;
    color: var(--accent-light);
    flex-shrink: 0;
}

.login-feature span {
    font-weight: 500;
}

.login-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 50px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.login-box h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.login-box > p {
    color: var(--text-light);
    margin-bottom: 32px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form input {
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.login-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(199,111,58,0.1);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-light);
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.forgot-link {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

.btn-full {
    width: 100%;
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.login-divider span {
    padding: 0 16px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--primary);
    font-weight: 500;
}

.login-footer a:hover {
    color: var(--accent);
}

.login-footer span {
    margin: 0 12px;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--primary);
    color: white;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-logo {
    padding: 0 24px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 24px;
}

.sidebar-logo .logo {
    color: white;
    font-size: 1.3rem;
}

.sidebar-logo .logo-icon {
    color: var(--accent-light);
    width: 24px;
    height: 24px;
}

.sidebar-nav {
    flex: 1;
    padding: 0 12px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    color: rgba(255,255,255,0.7);
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 4px;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-nav a.active {
    background: var(--accent);
    color: white;
}

.sidebar-nav svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-section {
    padding: 16px 24px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: 0.8rem;
    opacity: 0.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    background: var(--bg-alt);
    min-height: 100vh;
}

.dashboard-header {
    background: white;
    padding: 24px 40px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h1 {
    font-size: 1.5rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notification-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all var(--transition);
}

.notification-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.notification-btn svg {
    width: 20px;
    height: 20px;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-body {
    padding: 40px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    background: var(--limestone);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.stat-card-icon svg {
    width: 24px;
    height: 24px;
}

.stat-card-badge {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
}

.stat-card-badge.positive {
    background: #dcfce7;
    color: #166534;
}

.stat-card-badge.neutral {
    background: var(--limestone);
    color: var(--text);
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Dashboard Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.dashboard-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

/* Unit Info Card */
.unit-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.unit-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.unit-detail-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.unit-detail-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
}

.unit-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.unit-status.active {
    background: #dcfce7;
    color: #166534;
}

.unit-status.active::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
}

/* Payment History Table */
.payment-table {
    width: 100%;
    border-collapse: collapse;
}

.payment-table th,
.payment-table td {
    text-align: left;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.payment-table th {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.payment-table tr:last-child td {
    border-bottom: none;
}

.payment-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.payment-status.paid {
    background: #dcfce7;
    color: #166534;
}

.payment-status.pending {
    background: #fef3c7;
    color: #92400e;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    width: 100%;
}

.quick-action-btn:hover {
    border-color: var(--accent);
    background: var(--limestone);
}

.quick-action-btn svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.quick-action-btn span {
    font-weight: 500;
    color: var(--primary);
}

/* Payment Card */
.payment-due-card {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.payment-due-card h4 {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 8px;
    font-family: 'Inter', sans-serif;
    color: white;
}

.payment-due-amount {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.payment-due-date {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-bottom: 20px;
}

.payment-due-card .btn {
    background: white;
    color: var(--accent);
    width: 100%;
}

.payment-due-card .btn:hover {
    background: var(--limestone);
}

/* Admin Dashboard Specific */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.occupancy-chart {
    height: 200px;
    background: var(--bg-alt);
    border-radius: var(--radius);
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 20px;
}

.chart-bar {
    width: 40px;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-light) 100%);
    border-radius: 4px 4px 0 0;
    position: relative;
}

.chart-bar::after {
    content: attr(data-label);
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Customer Table */
.customer-table {
    width: 100%;
    border-collapse: collapse;
}

.customer-table th,
.customer-table td {
    text-align: left;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.customer-table th {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-alt);
}

.customer-table tr:hover {
    background: var(--bg-alt);
}

.customer-name {
    display: flex;
    align-items: center;
    gap: 12px;
}

.customer-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Unit Grid for Admin */
.units-grid-admin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.unit-box {
    aspect-ratio: 1;
    background: var(--bg-alt);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}

.unit-box:hover {
    border-color: var(--accent);
}

.unit-box.occupied {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.unit-box.available {
    background: #dcfce7;
    border-color: #22c55e;
}

.unit-box-number {
    font-weight: 700;
    font-size: 1.1rem;
}

.unit-box-size {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid,
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .login-container {
        grid-template-columns: 1fr;
    }

    .login-left {
        display: none;
    }

    .login-box {
        padding: 30px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid,
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-body {
        padding: 20px;
    }

    .unit-info {
        grid-template-columns: 1fr;
    }
}
