:root {
    --primary-color: #2F6C4F; /* Nature green */
    --primary-light: #4A9073;
    --primary-dark: #1F4A35;
    --secondary-color: #8C6A48; /* Earthy brown */
    --accent-color: #E6B566; /* Warm yellow/sun */
    --bg-color: #F4F7F5; /* Soft light grayish green */
    --card-bg: #FFFFFF;
    --text-main: #333333;
    --text-muted: #666666;
    --border-color: #E2E8E4;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

ul {
    list-style: none;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 15px;
}

/* Header */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo img {
    height: 50px;
}

.nav-menu {
    display: flex;
    gap: 20px;
}

.nav-menu li a {
    color: var(--text-main);
    font-weight: 500;
    font-size: 15px;
    padding: 8px 12px;
    border-radius: 6px;
}

.nav-menu li a:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.nav-auth {
    display: flex;
    gap: 15px;
}

.btn-login, .btn-register {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.btn-login {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-login:hover {
    background: var(--primary-color);
    color: #fff;
}

.btn-register {
    background: var(--primary-color);
    color: #fff;
}

.btn-register:hover {
    background: var(--primary-dark);
}

/* Hero Section */
.hero {
    position: relative;
    background: url('img/bg1.jpg') no-repeat center center/cover;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    border-bottom: 5px solid var(--primary-color);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(31, 74, 53, 0.6); /* Greenish dark overlay */
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 20px;
}

.hero-content h2 {
    color: #fff;
    font-size: 42px;
    margin-bottom: 10px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.hero-content p {
    font-size: 18px;
    margin-bottom: 20px;
}

.address-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    font-size: 14px;
}

/* Layout */
.main-wrapper {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 40px;
    padding: 50px 0;
}
.content-main { grid-column: 2; grid-row: 1; }
.sidebar { grid-column: 1; grid-row: 1; }

/* News Feed */
.section-title {
    font-size: 28px;
    margin-bottom: 30px;
    border-left: 5px solid var(--primary-color);
    padding-left: 15px;
}

.news-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.news-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.news-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.impotant {
    color: #D32F2F;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 700;
    background: #FFEBEE;
    padding: 3px 8px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
}

.news-text {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.news-meta {
    font-size: 13px;
    color: #888;
    display: flex;
    gap: 15px;
}

.news-meta i {
    color: var(--primary-light);
    margin-right: 5px;
}

.btn-read-more {
    background: var(--primary-light);
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.btn-read-more:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    font-weight: 500;
}

.pagination a.active, .pagination a:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Sidebar */
.sidebar-block {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid var(--border-color);
}

.sidebar-header {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg-color);
}

.sidebar-header img {
    width: 24px;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.sidebar-menu a {
    display: block;
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 6px;
    transition: var(--transition);
}

.sidebar-menu a:hover {
    background: var(--bg-color);
    color: var(--primary-color);
    padding-left: 18px;
}

.sbnews {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--border-color);
}

.sbnews:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sbnews .title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
}

.sbnews p {
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
}

.sbnews .link {
    font-size: 13px;
    color: var(--primary-light);
}

/* Footer */
footer {
    background: var(--primary-dark);
    color: #fff;
    padding: 40px 0 20px;
    text-align: center;
}

.footer-logo img {
    height: 60px;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
}

.footer-social {
    margin-bottom: 20px;
    color: #ccc;
}

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

.copyright {
    font-size: 13px;
    color: #999;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    margin-top: 20px;
}

.copyright a {
    color: #fff;
}

/* Responsive */
@media (max-width: 992px) {
    .main-wrapper {
        display: flex;
        flex-direction: column;
    }
    .content-main { order: 1; }
    .sidebar { order: 2; }

    .nav-menu {
        display: none; /* In real project, use JS for mobile menu */
    }
}

/* =========================================
   SUBPAGES AND COMPONENTS
========================================= */

/* Subpage Header */
.subpage-header {
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
}
.subpage-title {
    font-size: 28px;
    color: var(--primary-dark);
}

/* Documents Grid */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.doc-card {
    display: flex;
    align-items: center;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--card-bg);
    transition: var(--transition);
}
.doc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    border-color: var(--primary-light);
}
.doc-icon {
    font-size: 36px;
    margin-right: 20px;
    width: 40px;
    text-align: center;
}
.doc-icon.pdf { color: #e53e3e; }
.doc-icon.word { color: #3182ce; }
.doc-icon.excel { color: #38a169; }

/* Forms (Login / Register / Feedback) */
.form-container {
    max-width: 500px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 35px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.form-container.wide {
    max-width: 100%;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--primary-dark);
}
.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
    font-size: 15px;
    background: #fff;
    color: var(--text-main);
}
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(47, 108, 79, 0.15);
}
.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
    transition: var(--transition);
}
.btn-submit:hover {
    background: var(--primary-dark);
}

/* Voting / Polls */
.poll-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    background: var(--card-bg);
    border-left: 5px solid var(--primary-color);
}
.poll-card.closed {
    border-left-color: #a0aec0;
    opacity: 0.85;
}
.poll-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}
.poll-badge.active {
    background: #e6fffa;
    color: #2f855a;
}
.poll-badge.closed {
    background: #edf2f7;
    color: #4a5568;
}
.poll-progress-bg {
    height: 10px;
    background: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    margin-top: 12px;
}
.poll-progress-bar {
    height: 100%;
    background: var(--primary-color);
}

/* Forum */
.forum-container {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}
.forum-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1.5fr;
    background: var(--bg-color);
    padding: 15px 20px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
}
.forum-cat {
    background: #e2e8f0;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 13px;
    color: #4a5568;
    text-transform: uppercase;
}
.forum-row {
    display: grid;
    grid-template-columns: 3fr 1fr 1.5fr;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    transition: background 0.2s;
}
.forum-row:hover {
    background: #f8fafc;
}
.forum-row:last-child {
    border-bottom: none;
}
.forum-icon {
    font-size: 26px;
    color: var(--primary-light);
    margin-right: 20px;
    width: 30px;
    text-align: center;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}
.gallery-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    border: 1px solid var(--border-color);
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.gallery-item:hover img {
    transform: scale(1.08);
}
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(31, 74, 53, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    color: #fff;
    font-size: 28px;
}
.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* Debtors Table */
.table-responsive {
    overflow-x: auto;
}
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid var(--border-color);
}
.table th, .table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}
.table tr:last-child td {
    border-bottom: none;
}
.table tr:hover {
    background: #f8fafc;
}
.text-danger {
    color: #e53e3e;
    font-weight: 600;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.08);
    z-index: 2000;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--border-color);
}
.mobile-bottom-nav .nav-item {
    flex: 1;
    text-align: center;
    padding: 12px 0 10px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}
.mobile-bottom-nav .nav-item i { font-size: 22px; }
.mobile-bottom-nav .nav-item.active {
    color: var(--primary-color);
}
.mobile-bottom-nav .nav-item:hover {
    color: var(--primary-color);
}

@media (max-width: 992px) {
    .mobile-bottom-nav { display: flex; }
    body { padding-bottom: 60px; }
    footer { padding-bottom: 80px; }
}

/* --- Dropdown Menus --- */
.nav-dropdown {
    position: relative;
}
.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 220px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border-radius: var(--border-radius);
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid var(--border-color);
}
.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-dropdown-menu li a {
    display: block !important;
    padding: 10px 20px !important;
    border-radius: 0 !important;
    font-weight: 500 !important;
}
.nav-dropdown-menu li a:hover {
    background: var(--bg-color) !important;
}

/* Sidebar Dropdown */
.sidebar-submenu {
    display: none;
    padding-left: 0;
    margin-top: 5px;
    margin-bottom: 5px;
    border-left: 2px solid var(--border-color);
    margin-left: 15px;
}
.sidebar-dropdown:hover .sidebar-submenu {
    display: block;
    animation: fadeIn 0.3s ease;
}
.sidebar-submenu li { margin-bottom: 2px; }
.sidebar-submenu a { font-size: 13px !important; padding: 6px 15px !important; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Forum Posts */
.post-card {
    display: flex;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}
.post-author {
    background: var(--bg-color);
    padding: 20px;
    width: 200px;
    border-right: 1px solid var(--border-color);
    text-align: center;
    flex-shrink: 0;
}
.post-author.admin {
    background: #e6fffa;
}
.post-author .avatar {
    width: 60px;
    height: 60px;
    background: #cbd5e1;
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
}
.post-author.admin .avatar {
    background: #38a169;
}
.post-content {
    padding: 20px;
    flex-grow: 1;
}

@media (max-width: 576px) {
    .post-card {
        flex-direction: column;
    }
    .post-author {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        display: flex;
        align-items: center;
        padding: 15px;
        text-align: left;
        gap: 15px;
    }
    .post-author .avatar {
        margin: 0;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

/* Document Categories */
.docs-category-title {
    font-size: 20px;
    color: var(--primary-dark);
    margin-top: 35px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}
.docs-category-title:first-of-type {
    margin-top: 0;
}

/* Folder Icons */
.doc-icon.folder {
    color: #ecc94b; /* Warm yellow/gold for folders */
}
