/* SERIOUS INSTITUTIONAL AESTHETIC */
:root {
    /* Color Palette derived from flag-emblem.png */
    --forest-green: #1a422d;
    --dark-forest: #0d2116;
    --mustard-gold: #c29832;
    --dark-gold: #8c6e24;
    --panel-bg: #f9f8f4;
    --panel-border: #e2dac6;
    --ink-black: #111111;
    --text-muted: #555555;
    --danger-red: #8B0000;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--dark-forest);
    color: var(--ink-black);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.institutional-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    background-color: var(--dark-forest);
    /* Subtle noise or purely solid. Leaving it solidly dark and serious. */
}

h1, h2, h3, h4 {
    font-family: 'EB Garamond', serif;
    font-weight: 700;
    color: var(--ink-black);
}

.app-container {
    display: flex;
    width: 100%;
    max-width: 1400px;
    min-height: 85vh;
    height: auto;
    gap: 40px;
    align-items: stretch; 
}

/* Base Panel Styles */
.admin-panel {
    background-color: var(--panel-bg);
    border: 1px solid var(--mustard-gold);
    border-radius: 2px; /* Very sharp, institutional corners */
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    position: relative;
}

/* Sidebar styling */
.sidebar {
    width: 380px; 
    flex-shrink: 0; 
    display: flex;
    flex-direction: column;
    padding: 40px 30px;
    background-color: #122c1e; /* Extremely dark green */
    border-right: 2px solid var(--mustard-gold);
    color: var(--panel-bg);
}

.sidebar-header {
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(194, 152, 50, 0.4);
    padding-bottom: 25px;
}

.flag-logo {
    width: 100%;          
    max-width: 250px;
    height: auto;
    margin: 0 auto 20px auto;
    display: block;
    border: 2px solid var(--mustard-gold);
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
}

.sidebar-header h1 {
    font-family: 'EB Garamond', serif; 
    font-weight: 700;
    color: var(--mustard-gold);
    font-size: 2.2rem;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.sidebar-header p {
    font-family: 'Inter', sans-serif;
    color: #c9c3b1;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1; 
}

.nav-btn {
    background: transparent;
    border: none;
    color: #aeb2aa;
    padding: 14px 15px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif; 
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
    border-left-color: rgba(194, 152, 50, 0.5);
}

.nav-btn.active {
    color: var(--mustard-gold);
    background: rgba(194, 152, 50, 0.1);
    border-left-color: var(--mustard-gold);
    font-weight: 600;
}

.help-box {
    margin-top: 30px; 
    padding: 20px;
    border: 1px solid rgba(194, 152, 50, 0.4);
    background: rgba(0,0,0,0.2);
}
.help-box h3 {
    color: var(--mustard-gold);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 1px;
}
.help-box p {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 15px;
}

/* Action Buttons */
.action-btn {
    display: block;
    text-align: center;
    background: transparent;
    border: 1px solid var(--mustard-gold);
    color: var(--mustard-gold);
    padding: 10px 15px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.action-btn:hover {
    background: var(--mustard-gold);
    color: var(--dark-forest);
}

/* Main Content Area */
.content-area {
    flex-grow: 1;
    position: relative;
    min-height: 600px;
}

.form-section {
    width: 100%;
    position: absolute;
    top: 0; left: 0; height: 100%;
    padding: 50px 60px;
    opacity: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

.form-section.active {
    opacity: 1;
    pointer-events: all;
    z-index: 10;
}

.section-header {
    margin-bottom: 40px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
}

.section-header h2 {
    font-size: 2.5rem;
    letter-spacing: -0.5px;
}

.subtitle {
    font-family: 'Inter', sans-serif;
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-top: 5px;
}

/* Forms */
.directorate-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
    overflow-y: auto;
    padding-right: 15px;
    padding-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 25px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
}

input[type="text"], input[type="email"], input[type="number"], textarea, .modern-select {
    background-color: #fff;
    border: 1px solid #ccc;
    color: var(--ink-black);
    padding: 12px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    border-radius: 2px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, textarea:focus, .modern-select:focus {
    border-color: var(--mustard-gold);
}

input::placeholder, textarea::placeholder {
    color: #aaa;
}

.modern-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%232a251e%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    background-size: .6em auto;
}

textarea {
    resize: vertical;
}

.radio-group input[type="radio"] {
    margin-right: 5px;
}

/* Institutional Flat Buttons */
.official-btn {
    margin-top: 15px;
    background: var(--mustard-gold);
    color: var(--dark-forest);
    border: none;
    padding: 16px 20px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 2px;
}

.official-btn:hover {
    background: #deb64b;
}

.danger-btn {
    background: var(--danger-red);
    color: #fff;
}
.danger-btn:hover {
    background: #a30000;
}

/* Constitution Text formatting */
.classic-body {
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #222;
}

.scrollable-paper {
    overflow-y: auto;
    padding-right: 20px;
}

.scrollable-paper p {
    margin-bottom: 20px;
    text-align: justify;
}

/* Town Square Layout */
.townsquare-flex {
    display: flex;
    gap: 40px;
    height: 100%;
}

.townsquare-flex > div {
    flex: 1;
    background: #fff;
    border: 1px solid #ddd;
    padding: 30px;
    border-radius: 2px;
}

.townsquare-flex h3 {
    font-family: 'EB Garamond', serif;
    font-size: 1.5rem;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Responsive Overrides */
@media (max-width: 1050px) {
    body { padding: 0; }
    
    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        margin: 0;
        gap: 0;
    }
    
    .sidebar { 
        width: 100%; 
        padding: 30px 20px;
        border-radius: 0;
        border: none;
        border-bottom: 4px solid var(--mustard-gold);
    }
    
    .content-area {
        min-height: auto;
    }

    .form-section {
        position: relative;
        opacity: 1;
        pointer-events: all;
        display: none; 
        padding: 40px 20px;
        height: auto; 
        border-radius: 0; 
        border: none;
    }
    
    .form-section.active { 
        display: flex; 
    }
    
    .form-row, .townsquare-flex { 
        flex-direction: column; 
    }
}