/* social_forestry_gim.css */

:root {
    --gim-primary: #165b38;
    --gim-secondary: #0f3e26;
    --gim-accent: #a3e635;
    --gim-light: #f3f4f6;
    --gim-text: #374151;
    --gim-border: #e5e7eb;
}

.gim-page {
    background: #fafaf9;
    min-height: 100vh;
    padding-bottom: 100px;
}

.gim-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    margin-top: 50px;
}

/* ── COMMON TITLES ── */
.gim-section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gim-secondary);
    margin-bottom: 15px;
}
.gim-title-bar {
    height: 4px;
    width: 60px;
    background: var(--gim-accent);
    margin-bottom: 25px;
    border-radius: 2px;
}
.gim-title-bar.center { margin: 0 auto 25px auto; }
.gim-section-subtitle {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 40px;
    line-height: 1.6;
    max-width: 800px;
}
.gim-section-subtitle.center { margin: 0 auto 40px auto; text-align: center; }

/* ── TOP GRID (Intro & Hierarchy) ── */
.gim-top-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    margin-bottom: 60px;
}
@media (max-width: 900px) {
    .gim-top-grid { grid-template-columns: 1fr; }
}

.gim-intro-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--gim-text);
    margin-bottom: 20px;
}
.gim-highlight-box {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 20px;
    border-radius: 0 12px 12px 0;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin-top: 30px;
    font-weight: 600;
    color: #1e3a8a;
}
.gim-highlight-box i {
    font-size: 1.5rem;
    margin-top: 3px;
}

/* ── HIERARCHY TREE ── */
.gim-hierarchy-panel {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid var(--gim-border);
}
.gim-hierarchy-title {
    text-align: center;
    font-weight: 800;
    color: var(--gim-secondary);
    margin-bottom: 30px;
    font-size: 1.2rem;
}
.gim-org-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.gim-org-node {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--gim-light);
    padding: 15px 25px;
    border-radius: 99px;
    border: 2px solid transparent;
    z-index: 2;
    min-width: 250px;
}
.gim-org-node.chairman {
    background: var(--gim-secondary);
    color: #fff;
}
.gim-org-node.sec {
    background: #fff;
    border-color: var(--gim-secondary);
}
.gim-org-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}
.gim-org-node.sec .gim-org-icon {
    background: var(--gim-light);
    color: var(--gim-secondary);
}
.gim-org-text {
    display: flex; flex-direction: column;
}
.gim-org-text strong { font-size: 0.95rem; }
.gim-org-text span { font-size: 0.8rem; opacity: 0.8; }
.gim-org-line {
    width: 2px; height: 30px;
    background: var(--gim-border);
}
.gim-org-branches {
    display: flex; flex-direction: column; gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--gim-border);
    position: relative;
    width: 100%;
}
.gim-org-branches::before {
    content: ''; position: absolute;
    top: -20px; left: 50%; width: 2px; height: 20px; background: var(--gim-border);
}
.gim-org-member {
    background: #fff; border: 1px solid var(--gim-border);
    padding: 12px 20px; border-radius: 12px;
    font-size: 0.85rem; font-weight: 600; color: var(--gim-text);
    display: flex; align-items: center; gap: 10px;
}

/* ── LANDSCAPE TIERS ── */
.gim-landscape-tiers {
    display: flex; gap: 30px; margin-bottom: 50px;
}
.gim-tier-card {
    flex: 1; background: #fff;
    padding: 30px; border-radius: 20px;
    border: 1px solid var(--gim-border);
    box-shadow: 0 5px 15px rgba(0,0,0,0.02);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s;
}
.gim-tier-card:hover { transform: translateY(-5px); }
.gim-tier-card.active { border-color: var(--gim-accent); box-shadow: 0 10px 30px rgba(163, 230, 53, 0.2); }
.gim-tier-icon {
    width: 60px; height: 60px;
    background: var(--gim-light); color: var(--gim-secondary);
    border-radius: 50%; font-size: 1.5rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px auto;
}
.gim-tier-card.active .gim-tier-icon { background: var(--gim-secondary); color: var(--gim-accent); }
.gim-tier-card h5 { font-size: 1.2rem; font-weight: 800; margin-bottom: 10px; color: var(--gim-secondary); }
.gim-tier-card p { font-size: 0.9rem; color: #6b7280; line-height: 1.6; }
@media(max-width: 800px) { .gim-landscape-tiers { flex-direction: column; } }

/* ── L2 DASHBOARD CARDS ── */
.gim-l2-dashboard {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px;
    margin-bottom: 50px;
}
.gim-l2-card {
    background: #fff; border-radius: 24px; padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.06); border: 1px solid var(--gim-border);
    display: flex; flex-direction: column;
}
.gim-l2-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px;
}
.gim-l2-header h4 { margin: 0; font-size: 1.5rem; font-weight: 800; color: var(--gim-secondary); }
.gim-l2-badge { background: #dcfce7; color: #166534; padding: 6px 12px; border-radius: 99px; font-size: 0.8rem; font-weight: 700; }

.gim-stacked-bar {
    width: 100%; height: 30px; border-radius: 99px; display: flex; overflow: hidden; margin-bottom: 30px;
    background: var(--gim-light);
}
.gim-stack-segment {
    height: 100%; transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
}
.gim-stack-segment:hover::after {
    content: attr(data-val); position: absolute; top: -30px; left: 50%; transform: translateX(-50%);
    background: #000; color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 700;
}
/* Colors for segments */
.gim-stack-segment.scrub { background: #fcd34d; }
.gim-stack-segment.open { background: #6ee7b7; }
.gim-stack-segment.mod { background: #34d399; }
.gim-stack-segment.dense { background: #059669; }
.gim-stack-segment.other { background: #9ca3af; }

.gim-l2-stats { display: flex; justify-content: space-between; margin-bottom: 25px; padding-bottom: 25px; border-bottom: 1px dashed var(--gim-border); }
.gim-stat-item { display: flex; flex-direction: column; }
.gim-stat-label { font-size: 0.8rem; color: #6b7280; font-weight: 600; text-transform: uppercase; margin-bottom: 5px; }
.gim-stat-val { font-size: 1.3rem; font-weight: 800; color: var(--gim-secondary); }

.gim-l2-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.8rem; font-weight: 600; color: #4b5563; }
.gim-leg-item { display: flex; align-items: center; gap: 6px; }
.gim-leg-color { width: 12px; height: 12px; border-radius: 3px; }
.gim-leg-color.scrub { background: #fcd34d; }
.gim-leg-color.open { background: #6ee7b7; }
.gim-leg-color.mod { background: #34d399; }
.gim-leg-color.dense { background: #059669; }
.gim-leg-color.other { background: #9ca3af; }

/* ── TOTALS ── */
.gim-state-totals {
    display: flex; gap: 20px;
}
.gim-total-box {
    flex: 1; display: flex; align-items: center; gap: 20px;
    padding: 25px; border-radius: 16px; background: #fff; border: 1px solid var(--gim-border);
}
.gim-total-box i { font-size: 2rem; color: var(--gim-accent); }
.gim-total-box.alt i { color: #3b82f6; }
.gim-total-box.dark { background: var(--gim-secondary); color: #fff; border: none; }
.gim-total-box.dark i { color: #fff; }
.gim-total-box.dark .gim-tb-info span { color: rgba(255,255,255,0.7); }
.gim-tb-info { display: flex; flex-direction: column; }
.gim-tb-info span { font-size: 0.85rem; font-weight: 600; color: #6b7280; margin-bottom: 5px; }
.gim-tb-info strong { font-size: 1.1rem; font-weight: 800; }
@media (max-width: 900px) { .gim-state-totals { flex-direction: column; } }

/* ── COMPREHENSIVE DATA GRIDS ── */
.gim-table-wrapper {
    background: #fff;
    border: 1px solid var(--gim-border);
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.06);
    overflow: hidden;
}

.gim-premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    margin-bottom: 20px;
}

.gim-premium-table th {
    background: var(--gim-secondary);
    color: #fff;
    padding: 15px 20px;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,0.1);
}
.gim-premium-table th:last-child { border-right: none; }
.gim-premium-table tr:first-child th:first-child { border-top-left-radius: 12px; }
.gim-premium-table tr:first-child th:last-child { border-top-right-radius: 12px; }

.gim-premium-table td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--gim-border);
    color: #4b5563;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.gim-premium-table tbody tr:hover td {
    background: #f9fafb;
}
.gim-premium-table tbody tr:last-child td {
    border-bottom: none;
}

.gim-num {
    text-align: right;
    font-weight: 800;
    color: var(--gim-primary) !important;
}
