/* style.css - Dade Initiative Core Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Brand Colors */
    --color-primary: #005F73;      /* Deep Teal */
    --color-primary-dark: #004c5c;
    --color-secondary: #EE9B00;    /* Vibrant Orange */
    --color-secondary-dark: #d58a00;
    --color-accent: #94D2BD;       /* Soft Teal */
    --color-dark: #0A192F;         /* Navy Black */
    --color-light: #F8F9FA;        /* Off White */
    --color-white: #FFFFFF;
    --color-gray-100: #E9ECEF;
    --color-gray-200: #DEE2E6;
    --color-text: #333333;
    --color-text-light: #666666;

    /* Status Colors */
    --color-success: #2a9d8f;
    --color-warning: #e76f51;
    --color-danger: #d90429;
    --color-info: #0077b6;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Shadow & Effects */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(10, 25, 47, 0.08);
    --shadow-lg: 0 8px 24px rgba(10, 25, 47, 0.12);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.4);
    --sidebar-width: 260px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-light);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-dark);
    font-weight: 600;
}

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

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

/* --- AUTH PAGE --- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, var(--color-primary) 0%, var(--color-dark) 90%);
    padding: 20px;
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 40px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 30px;
}

.auth-logo span {
    color: var(--color-secondary);
}

.auth-card h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.auth-card p {
    color: var(--color-text-light);
    margin-bottom: 25px;
    font-size: 14px;
}

/* --- MAIN SYSTEM LAYOUT --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--color-dark);
    color: var(--color-white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header {
    padding: 25px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header img {
    height: 35px;
}

.sidebar-header span {
    color: var(--color-secondary);
}

.sidebar-profile {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-profile img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-accent);
}

.profile-info h4 {
    color: var(--color-white);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.profile-info span {
    font-size: 11px;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 10px;
    flex: 1;
    overflow-y: auto;
}

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

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--color-gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-menu a:hover,
.sidebar-menu li.active a {
    background-color: rgba(148, 210, 189, 0.1);
    color: var(--color-accent);
    padding-left: 20px;
}

.sidebar-menu li.active a {
    border-left: 4px solid var(--color-secondary);
    background-color: rgba(148, 210, 189, 0.15);
    font-weight: 600;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background-color: rgba(0, 0, 0, 0.2);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ff4d4d;
    font-size: 14px;
    font-weight: 600;
}

/* Content Area */
.app-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-title h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

.page-title p {
    color: var(--color-text-light);
    font-size: 14px;
}

/* Mobile Toggle */
.mobile-header-toggle {
    display: none;
    background: var(--color-dark);
    color: var(--color-white);
    padding: 15px 20px;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* --- DASHBOARD ELEMENTS --- */
/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.kpi-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--color-primary);
}

.kpi-card.secondary::after {
    background: var(--color-secondary);
}

.kpi-card.accent::after {
    background: var(--color-accent);
}

.kpi-info h3 {
    font-size: 13px;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.kpi-info .number {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: var(--color-dark);
}

.kpi-icon {
    font-size: 32px;
    opacity: 0.15;
    color: var(--color-dark);
}

/* Dashboard Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

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

.card-panel {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-gray-100);
    margin-bottom: 25px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--color-gray-100);
    padding-bottom: 15px;
}

.panel-header h2 {
    font-size: 18px;
    font-weight: 700;
}

/* Forms Styling */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--color-dark);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1.5px solid var(--color-gray-200);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-text);
    outline: none;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    border-color: var(--color-primary);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Buttons Styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    box-shadow: 0 4px 10px rgba(0, 95, 115, 0.2);
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: var(--color-white);
}

.btn-secondary:hover {
    background-color: var(--color-secondary-dark);
    box-shadow: 0 4px 10px rgba(238, 155, 0, 0.2);
}

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

.btn-outline:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn-light {
    background-color: var(--color-gray-100);
    color: var(--color-text);
}

.btn-light:hover {
    background-color: var(--color-gray-200);
}

.btn-danger {
    background-color: var(--color-danger);
    color: var(--color-white);
}

.btn-danger:hover {
    background-color: #bd0320;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

/* Tables styling */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table-custom {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    text-align: left;
}

.table-custom th {
    background-color: var(--color-gray-100);
    color: var(--color-dark);
    font-weight: 600;
    padding: 14px 18px;
    font-size: 14px;
    border-bottom: 2px solid var(--color-gray-200);
}

.table-custom td {
    padding: 14px 18px;
    font-size: 14px;
    border-bottom: 1px solid var(--color-gray-100);
    color: var(--color-text);
}

.table-custom tr:hover {
    background-color: rgba(148, 210, 189, 0.05);
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-draft { background-color: var(--color-gray-200); color: var(--color-text-light); }
.badge-pending { background-color: rgba(238, 155, 0, 0.15); color: var(--color-secondary-dark); }
.badge-approved { background-color: rgba(42, 157, 143, 0.15); color: var(--color-success); }
.badge-rejected { background-color: rgba(217, 4, 41, 0.15); color: var(--color-danger); }

.badge-priority-high { background-color: rgba(217, 4, 41, 0.15); color: var(--color-danger); }
.badge-priority-medium { background-color: rgba(238, 155, 0, 0.15); color: var(--color-secondary-dark); }
.badge-priority-low { background-color: rgba(0, 119, 182, 0.15); color: var(--color-info); }

/* --- KANBAN BOARD (TASKS) --- */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.kanban-col {
    background-color: var(--color-gray-100);
    border-radius: var(--radius-md);
    padding: 20px;
    height: 640px; /* Fixed standard dashboard height */
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.kanban-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.kanban-col-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.kanban-count {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
}

.kanban-col.pending .kanban-count { background-color: var(--color-info); }
.kanban-col.in-progress .kanban-count { background-color: var(--color-secondary); }
.kanban-col.completed .kanban-count { background-color: var(--color-success); }
.kanban-col.overdue .kanban-count { background-color: var(--color-danger); }

.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
}

/* Custom premium scrollbar for Kanban board cards container */
.kanban-cards::-webkit-scrollbar {
    width: 6px;
}
.kanban-cards::-webkit-scrollbar-track {
    background: transparent;
}
.kanban-cards::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}
.kanban-cards::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

.task-card {
    background: var(--color-white);
    padding: 15px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--color-primary);
    cursor: grab;
    position: relative;
}

.task-card.high { border-left-color: var(--color-danger); }
.task-card.medium { border-left-color: var(--color-secondary); }
.task-card.low { border-left-color: var(--color-info); }

.task-card h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
}

.task-card p {
    font-size: 12px;
    color: var(--color-text-light);
    margin-bottom: 12px;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    border-top: 1px solid var(--color-gray-100);
    padding-top: 10px;
    margin-top: 10px;
}

.task-assigned {
    font-weight: bold;
    color: var(--color-dark);
}

.task-due {
    color: var(--color-danger);
    font-weight: 500;
}

/* --- GEOGRAPHIC MAP --- */
.map-container {
    height: 450px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-gray-200);
    box-shadow: var(--shadow-sm);
    margin-bottom: 25px;
}

/* Leaflet map visual modifications */
.leaflet-popup-content-value {
    font-family: var(--font-body);
}

.map-card-popup h4 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    margin-bottom: 5px;
    font-size: 15px;
}

.map-card-popup p {
    font-size: 12px;
    margin-bottom: 3px;
    color: var(--color-text);
}

.map-card-popup .ben-badge {
    background: var(--color-accent);
    color: var(--color-primary-dark);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    display: inline-block;
    margin-top: 5px;
}

/* --- PUBLIC IMPACT SNAPSHOT --- */
.public-body {
    background-color: var(--color-dark);
    color: var(--color-white);
    font-family: var(--font-body);
}

.public-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.public-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-weight: bold;
    font-size: 24px;
    color: var(--color-white);
}

.public-logo span {
    color: var(--color-secondary);
}

.public-hero {
    text-align: center;
    padding: 80px 20px 60px;
    background: radial-gradient(circle at 50% 50%, rgba(0, 95, 115, 0.3) 0%, rgba(10, 25, 47, 0) 70%);
}

.public-hero h1 {
    font-size: 48px;
    font-weight: 800;
    color: var(--color-white);
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.public-hero h1 span {
    color: var(--color-accent);
}

.public-hero p {
    font-size: 18px;
    color: var(--color-gray-200);
    max-width: 700px;
    margin: 0 auto 30px;
}

.public-counter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto 50px;
    padding: 0 20px;
}

.counter-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
}

.counter-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--color-accent);
}

.counter-number {
    font-family: var(--font-heading);
    font-size: 42px;
    font-weight: 800;
    color: var(--color-secondary);
    margin-bottom: 5px;
}

.counter-label {
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--color-accent);
    font-weight: bold;
}

/* --- MEDIA EVIDENCE GALLERY --- */
.media-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.media-thumbnail-card {
    background: var(--color-white);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-gray-100);
    position: relative;
    display: flex;
    flex-direction: column;
}

.media-thumbnail-preview {
    height: 150px;
    background-color: var(--color-gray-200);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
}

.media-file-icon {
    font-size: 48px;
    opacity: 0.4;
}

.media-thumbnail-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.media-thumbnail-info h4 {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

.media-thumbnail-info span {
    font-size: 10px;
    color: var(--color-text-light);
}

/* --- PRINT/REPORT STYLE --- */
@media print {
    body {
        background-color: white !important;
        color: black !important;
    }
    .app-sidebar, .top-navbar, .btn, .media-gallery-grid button {
        display: none !important;
    }
    .app-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .card-panel {
        box-shadow: none !important;
        border: none !important;
        page-break-inside: avoid;
    }
    .table-custom th {
        background-color: #f1f1f1 !important;
        color: black !important;
        border-bottom: 2px solid black !important;
    }
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 768px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .app-sidebar.active {
        transform: translateX(0);
    }
    .app-content {
        margin-left: 0 !important;
        padding: 15px;
    }
    .mobile-header-toggle {
        display: flex;
    }
    .top-navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    /* Global Inline and Grid layout overrides for clean mobile stacking */
    .charts-grid, 
    .kpi-grid,
    .meta-grid,
    [style*="display: grid"],
    [style*="display:grid"] {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    /* Override any hardcoded side-by-side structures using inline CSS */
    .charts-grid[style*="grid-template-columns"], 
    [style*="grid-template-columns: 2fr"],
    [style*="grid-template-columns: 2.2fr"],
    [style*="grid-template-columns: 2.5fr"],
    [style*="grid-template-columns: 1.2fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Force tables inside a scrolling responsive layout wrapper */
    .table-responsive {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Clean Leaflet map height adjustments */
    #map {
        height: 350px !important;
    }
    
    /* Adapt standard tables to fit small screen sizes */
    .table-custom {
        font-size: 12px !important;
    }
    .table-custom th, .table-custom td {
        padding: 8px 10px !important;
    }
    
    /* Clean form input spacing on mobile */
    .form-control {
        font-size: 14px !important;
        height: 42px !important;
    }
    
    /* Clean up modal layouts */
    .modal-content, [id*="Modal"] .card-panel {
        width: 100% !important;
        max-width: 95% !important;
        padding: 15px !important;
    }
}
