/* NexoRural Web Dashboard Styles */

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100%;
    margin: 0;
    overflow-x: hidden;
}

/* ========================================
   Main Layout - Sidebar + Content
   ======================================== */

.page {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 250px;
    min-width: 250px;
    max-width: 250px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #1a472a 0%, #0d2818 100%);
    color: white;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background-color: #f4f6f9;
}

.top-row {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 50;
}

/* Content area padding */
.content {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

/* ========================================
   Navigation Menu Styles
   ======================================== */

.nav-menu {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.nav-menu .brand {
    padding: 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    margin-bottom: 0.5rem;
}

.nav-menu .brand-icon {
    font-size: 1.75rem;
}

.nav-menu .brand-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.nav-menu nav {
    padding: 0.5rem;
    flex: 1;
}

.nav-menu .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: rgba(255,255,255,0.85) !important;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}

.nav-menu .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: white !important;
}

.nav-menu .nav-link.active {
    background-color: rgba(255,255,255,0.2);
    color: white !important;
    font-weight: 500;
}

.nav-menu .nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.nav-menu .nav-icon svg {
    stroke: rgba(255,255,255,0.9);
}

.nav-menu .nav-link:hover .nav-icon svg,
.nav-menu .nav-link.active .nav-icon svg {
    stroke: white;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}

/* Tables */
.table th {
    font-weight: 600;
    color: #495057;
    border-top: none;
}

.table-hover tbody tr:hover {
    background-color: rgba(26, 71, 42, 0.05);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.4em 0.6em;
}

/* Buttons */
.btn-primary {
    background-color: #1a472a;
    border-color: #1a472a;
}

.btn-primary:hover {
    background-color: #143a22;
    border-color: #143a22;
}

.btn-outline-primary {
    color: #1a472a;
    border-color: #1a472a;
}

.btn-outline-primary:hover {
    background-color: #1a472a;
    border-color: #1a472a;
}

.btn-success {
    background-color: #28a745;
}

/* Community Cards */
.community-card {
    transition: transform 0.2s;
}

.community-card:hover {
    transform: translateY(-4px);
}

/* Progress bars */
.progress {
    background-color: #e9ecef;
    border-radius: 1rem;
}

.progress-bar {
    border-radius: 1rem;
}

/* KPI Cards */
.card.bg-primary,
.card.bg-success,
.card.bg-info,
.card.bg-warning {
    border: none;
}

.card.bg-primary {
    background: linear-gradient(135deg, #1a472a 0%, #2d5a3f 100%) !important;
}

.card.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #38c95e 100%) !important;
}

.card.bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #2fc5db 100%) !important;
}

.card.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ffcd38 100%) !important;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Pagination */
.pagination .page-link {
    color: #1a472a;
}

.pagination .page-item.active .page-link {
    background-color: #1a472a;
    border-color: #1a472a;
}

/* Loading */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: #1a472a;
    box-shadow: 0 0 0 0.2rem rgba(26, 71, 42, 0.25);
}

/* Responsive - mobile styles */
@media (max-width: 768px) {
    .page {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        height: auto;
        position: relative;
    }

    .content {
        padding: 1rem;
    }

    .nav-menu nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .nav-menu .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}
