/* Core Dark Reset Layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #020617;
    color: #f8fafc;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styling Component */
aside {
    width: 260px;
    background-color: #0f172a;
    border-right: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
}

.brand {
    font-size: 24px;
    font-weight: 900;
    color: #10b981;
    letter-spacing: 1px;
    margin-bottom: 32px;
}

nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.2s;
    margin-bottom: 6px;
}

nav a.active, nav a:hover {
    background-color: #1e293b;
    color: #ffffff;
}

/* Main Dashboard Space Layout */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

header {
    height: 64px;
    border-bottom: 1px solid #1e293b;
    background-color: #0f172a;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.workspace {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Maps & Operations Panel */
.map-view {
    flex: 1;
    background-color: #020617;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background-color: #0f172a;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #1e293b;
}

.stat-card p {
    font-size: 11px;
    color: #94a3b8;
    font-weight: bold;
    text-transform: uppercase;
}

.stat-card h3 {
    font-size: 18px;
    color: #ffffff;
    margin-top: 4px;
}

.map-placeholder {
    flex: 1;
    background-color: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 480px; /* Establishes a concrete physical footprint */
    height: 480px;     /* Prevents Leaflet container collapse */
    position: relative;
}



/* WhatsApp Communication Sidebar */
.whatsapp-panel {
    width: 320px;
    background-color: #0f172a;
    border-left: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    text-align: center;
}

/* Dispatch feed items */
.dispatch-item {
    background: transparent;
    border-bottom: 1px solid #0b1220;
    text-align: left;
    padding: 8px 0;
}
.dispatch-item strong {
    color: #ffffff;
    display: block;
}

/* Connection status badge */
#conn-status-badge {
    color: #020617;
    background: #94a3b8;
    padding: 6px 8px;
    border-radius: 8px;
    font-weight: 700;
}

/* Seed button subtle style */
#seed-dispatches-btn {
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
}
#seed-dispatches-btn:hover { background:#273244; color:#fff; }
