/* Admin Dashboard Specific Styles */
/* Inherits root variables and utility classes from styles.css automatically */

.admin-body {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-light);
    overflow-x: hidden;
}

/* Sidebar */
.admin-sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 0;
    border-right: 1px solid var(--border-light);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 50;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(101, 163, 13, 0.1);
}

.sidebar-logo img {
    height: 40px;
    border-radius: 10px;
}

.sidebar-logo h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.sidebar-logo span {
    color: var(--button-green);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(104, 189, 98, 0.1);
    color: var(--button-green);
}

.sidebar-nav a .material-icons {
    font-size: 20px;
}

.back-link {
    margin-top: auto;
    border-top: 1px solid rgba(101, 163, 13, 0.1);
}

/* Main Content Area */
.admin-main {
    flex: 1;
    margin-left: 280px;
    padding: 2.5rem 3rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.page-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 0.8rem 1.2rem;
    border-radius: 100px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-light);
}

.avatar {
    width: 40px;
    height: 40px;
    background: rgba(104, 189, 98, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--button-green);
}

.admin-name {
    display: block;
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 0.95rem;
}

.admin-role {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    padding: 1.8rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon .material-icons {
    font-size: 30px;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-dark);
}

/* Charts Grid */
.chart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.chart-panel {
    padding: 1.8rem;
}

.canvas-container {
    position: relative;
    height: 300px;
    width: 100%;
}

@media (max-width: 1024px) {
    .chart-grid {
        grid-template-columns: 1fr;
    }
}

/* Dashboard Panels & Tables */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.dashboard-panel {
    padding: 2rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.panel-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.view-all {
    color: var(--button-green);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
}

.view-all:hover {
    text-decoration: underline;
}

.table-container {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    color: var(--text-muted);
    font-weight: 600;
    padding: 1rem 1.2rem;
    border-bottom: 2px solid var(--border-light);
    font-size: 0.95rem;
}

.admin-table td {
    padding: 1.2rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--primary-dark);
    font-weight: 500;
    vertical-align: middle;
}

.admin-table tr:hover td {
    background: rgba(104, 189, 98, 0.02);
}

/* Status Badges */
.badge {
    display: inline-flex;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
}

.badge.pending {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.badge.solved {
    background: rgba(104, 189, 98, 0.1);
    color: var(--button-green);
}

.badge.paid {
    background: rgba(104, 189, 98, 0.1);
    color: var(--button-green);
}

/* Action Buttons */
.action-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--button-green);
    color: white;
    border-color: var(--button-green);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-muted);
}

.empty-state.hidden {
    display: none;
}

.empty-state .material-icons {
    font-size: 48px;
    opacity: 0.5;
    margin-bottom: 1rem;
}

/* Sidebar Village Widget */
.village-info-widget {
    margin-top: auto;
    background: rgba(104, 189, 98, 0.05);
    border: 1px solid rgba(104, 189, 98, 0.2);
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1rem;
}

.village-info-widget h4 {
    font-size: 0.95rem;
    color: var(--primary-dark);
    margin-bottom: 0.4rem;
}

.village-info-widget p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 1rem;
}

.village-stats {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.v-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px dashed rgba(101, 163, 13, 0.2);
}

.v-stat:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.v-stat span {
    color: var(--text-muted);
}

.v-stat strong {
    color: var(--button-green);
    font-weight: 700;
}