/* =====================================================
   SQUID2 GLOBAL STYLESHEET
   Extracted from app/views/layout/header.php's inline <style>
   ===================================================== */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --ep-navy: #0a1628;
    --ep-navy-light: #0d2040;
    --ep-green: #1EB400;
    --ep-green-hover: #19a000;
    --ep-blue: #0050A0;
    --ep-blue-light: #0068cc;
    --ep-orange: #FFAA00;
    --ep-orange-light: #ffbe33;
    --primary-color: #1EB400;
    --sidebar-bg: #0a1628;
    --sidebar-hover: #0d2040;
    --border-color: #e2e8f0;
    --text-primary: #0a1628;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --bg-body: #f7f8fc;
    --bg-card: #ffffff;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(10, 22, 40, 0.04);
    --shadow-md: 0 2px 16px rgba(10, 22, 40, 0.06);
    --shadow-lg: 0 8px 30px rgba(10, 22, 40, 0.1);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background: var(--bg-body);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
}

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================= SIDEBAR ================= */
.app-sidebar {
    background: var(--sidebar-bg);
    transition: width var(--transition), transform var(--transition);
    box-shadow: 2px 0 20px rgba(10, 22, 40, 0.15);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    overflow: hidden;
}
.sidebar-brand {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #ffffff;
    flex-shrink: 0;
}
.brand-link { display: flex; align-items: center; justify-content: center; text-decoration: none; transition: opacity 0.2s; }
.brand-link:hover { opacity: 0.8; }
.brand-image { max-height: 40px; width: auto; max-width: 100%; }
.brand-text { display: none; }
.sidebar-wrapper { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: 1rem; }
.app-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.625rem 1rem;
    margin: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 0.875rem; font-weight: 450; letter-spacing: 0.01em;
}
.app-sidebar .nav-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.app-sidebar .nav-link.active {
    background: var(--ep-green); color: #fff; font-weight: 600;
    box-shadow: 0 2px 8px rgba(30, 180, 0, 0.3);
}
.app-sidebar .nav-icon { width: 20px; text-align: center; flex-shrink: 0; }
.nav-arrow { margin-left: auto; opacity: 0.5; transition: transform var(--transition); font-size: 0.7rem; }
.menu-open > a .nav-arrow { transform: rotate(90deg); }
.app-sidebar .nav-header {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.65rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    padding: 1rem 1rem 0.375rem; margin-top: 0.25rem;
}
.nav-treeview { padding-left: 0; overflow: hidden; max-height: 0; transition: max-height 0.3s ease; }
.menu-open > .nav-treeview { max-height: 1000px; }
.nav-treeview .nav-link { padding-left: 3rem; font-size: 0.825rem; color: rgba(255, 255, 255, 0.55); }
.nav-treeview .nav-link:hover { color: #fff; }

/* ================= COLLAPSED SIDEBAR ================= */
body.sidebar-collapse .app-sidebar { width: var(--sidebar-collapsed-width) !important; overflow: visible; }
body.sidebar-collapse .app-sidebar .nav-link p,
body.sidebar-collapse .app-sidebar .nav-link .right,
body.sidebar-collapse .app-sidebar .nav-arrow,
body.sidebar-collapse .brand-text { display: none !important; }
body.sidebar-collapse .app-sidebar .nav-link { justify-content: center; padding: 0.75rem; }
body.sidebar-collapse .brand-link { justify-content: center; padding: 0; }
body.sidebar-collapse .brand-image { max-height: 32px; }
body.sidebar-collapse .app-sidebar .nav-treeview {
    position: fixed; left: var(--sidebar-collapsed-width); top: auto;
    min-width: 220px; background: var(--sidebar-bg); border-radius: var(--radius-md);
    padding: 0.5rem; display: none; z-index: 9999;
    box-shadow: var(--shadow-lg); max-height: none;
}
body.sidebar-collapse .app-sidebar li.nav-item:hover > .nav-treeview { display: block; }
body.sidebar-collapse .app-sidebar .nav-treeview .nav-link { padding-left: 1rem; justify-content: flex-start; }
body.sidebar-collapse .app-sidebar .nav-treeview .nav-link p { display: inline-block !important; }

/* ================= HEADER / NAVBAR ================= */
.app-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 0.5rem 1rem;
}
.app-header .nav-link {
    color: var(--text-secondary);
    transition: all var(--transition);
    padding: 0.5rem 1rem; border-radius: var(--radius-sm);
    font-size: 0.875rem;
}
.app-header .nav-link:hover { color: var(--ep-green); background: rgba(30, 180, 0, 0.05); }

/* ================= MAIN CONTENT ================= */
.app-main { background: var(--bg-body); min-height: 100vh; }
.app-content { padding-bottom: 2rem; }

/* ================= UTILITY / OVERRIDES ================= */
.shadow { box-shadow: unset !important; }
.opacity-75 { opacity: unset !important; }

.sidebar-wrapper::-webkit-scrollbar { width: 6px; }
.sidebar-wrapper::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); }
.sidebar-wrapper::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; }
.sidebar-wrapper::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

@media (max-width: 768px) {
    .app-sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); z-index: 1050; }
    body.sidebar-open .app-sidebar { transform: translateX(0); }
    body.sidebar-open::before {
        content: ''; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0, 0, 0, 0.5); z-index: 1040;
    }
}

/* ================= LOADING ================= */
.page-loading {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; opacity: 1; transition: opacity 0.3s ease;
}
.page-loading.loaded { opacity: 0; pointer-events: none; }
.spinner {
    width: 40px; height: 40px;
    border: 4px solid var(--border-color); border-top-color: var(--ep-green);
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= PRINT ================= */
@media print {
    .app-header, .app-sidebar { display: none !important; }
    .app-main { margin-left: 0 !important; }
    .app-content { padding: 0 !important; }
}

/* ================= PAGE STYLES ================= */
.squid-content { max-width: 1600px; margin: 0 auto; }
.animate-fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.page-title h1 { font-size: 1.5rem; font-weight: 700; color: var(--ep-navy); margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.page-subtitle { color: var(--text-muted); margin: 0.25rem 0 0 0; font-size: 0.875rem; }
.mb-6 { margin-bottom: 1.5rem; }

/* ================= KPI GRID & CARDS ================= */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-bottom: 1.5rem; }
@media (max-width: 1200px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .kpi-grid { grid-template-columns: 1fr; } }
.kpi-card { padding: 1.25rem; border-radius: var(--radius-md); background: var(--bg-card);
            border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); transition: all var(--transition); }
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-card--primary { border-left: 3px solid var(--ep-blue); }
.kpi-card--success { border-left: 3px solid var(--ep-green); }
.kpi-card--warning { border-left: 3px solid var(--ep-orange); }
.kpi-card--info    { border-left: 3px solid var(--ep-blue-light); }
.kpi-card--neutral { border-left: 3px solid var(--text-muted); }
.kpi-header { display: flex; justify-content: space-between; align-items: flex-start; }
.kpi-label  { color: var(--text-muted); font-size: 0.8125rem; margin-bottom: 0.25rem;
              font-weight: 500; text-transform: uppercase; letter-spacing: 0.03em; }
.kpi-icon { width: 40px; height: 40px; border-radius: var(--radius-sm);
            display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.kpi-card--primary .kpi-icon { background: rgba(0, 80, 160, 0.08); color: var(--ep-blue); }
.kpi-card--success .kpi-icon { background: rgba(30, 180, 0, 0.08); color: var(--ep-green); }
.kpi-card--warning .kpi-icon { background: rgba(255, 170, 0, 0.1); color: #cc8800; }
.kpi-card--info    .kpi-icon { background: rgba(0, 104, 204, 0.08); color: var(--ep-blue-light); }
.kpi-card--neutral .kpi-icon { background: rgba(10, 22, 40, 0.06); color: var(--text-secondary); }
.kpi-value { font-size: 1.5rem; font-weight: 700; color: var(--ep-navy); line-height: 1.2; margin: 0 0 0.25rem 0; }
.kpi-sub, .kpi-note { font-size: 0.875rem; color: var(--text-muted); margin: 0; }

/* ================= FILTER BAR ================= */
.filter-bar { background: var(--bg-card); border-radius: var(--radius-md); border: 1px solid var(--border-color);
              padding: 1.25rem; margin-bottom: 1.5rem; box-shadow: var(--shadow-sm); }
.filter-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.search-wrapper { position: relative; flex: 1; min-width: 200px; }
.search-icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.search-input { width: 100%; padding: 0.5rem 0.75rem 0.5rem 2.25rem;
                border: 1px solid var(--border-color); border-radius: var(--radius-sm);
                font-size: 0.875rem; transition: all var(--transition); }
.search-input:focus { outline: none; border-color: var(--ep-green); box-shadow: 0 0 0 3px rgba(30, 180, 0, 0.1); }
.filter-item { display: flex; align-items: center; gap: 0.5rem; }
.filter-label { font-size: 0.75rem; font-weight: 600; color: #6b7280; text-transform: uppercase; }
.filter-select { padding: 0.5rem 2rem 0.5rem 0.75rem; border: 1px solid var(--border-color);
                 border-radius: var(--radius-sm); font-size: 0.875rem; background-color: var(--bg-card);
                 cursor: pointer; transition: all var(--transition); }
.filter-select:focus { outline: none; border-color: var(--ep-green); box-shadow: 0 0 0 3px rgba(30, 180, 0, 0.1); }

/* ================= BUTTONS ================= */
.btn--success { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.5rem 1rem;
                background: var(--ep-green); color: white; border: none; border-radius: var(--radius-sm);
                font-weight: 500; font-size: 0.875rem; text-decoration: none; cursor: pointer;
                transition: all var(--transition); }
.btn--success:hover { background: var(--ep-green-hover); color: white; text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--ep-green) !important; border-color: var(--ep-green) !important;
               font-weight: 500; border-radius: var(--radius-sm); transition: all var(--transition); }
.btn-primary:hover, .btn-primary:focus { background: var(--ep-green-hover) !important;
    border-color: var(--ep-green-hover) !important; box-shadow: 0 2px 8px rgba(30, 180, 0, 0.3) !important; }
.btn-outline-primary { color: var(--ep-green) !important; border-color: var(--ep-green) !important; }
.btn-outline-primary:hover { background: var(--ep-green) !important; color: #fff !important; }
.btn-success { background: var(--ep-green) !important; border-color: var(--ep-green) !important; }
.btn-success:hover { background: var(--ep-green-hover) !important; border-color: var(--ep-green-hover) !important; }
.btn { border-radius: var(--radius-sm); font-weight: 500; font-size: 0.875rem; transition: all var(--transition); }
.btn-outline-secondary { border-color: var(--border-color); color: var(--text-secondary); }
.btn-outline-secondary:hover { background: var(--ep-navy); border-color: var(--ep-navy); color: #fff; }

/* ================= FORMS ================= */
.form-row { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-end; }
.form-group { display: flex; flex-direction: column; gap: 0.375rem; min-width: 160px; }
.form-label { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em; }
.form-select, .form-input { padding: 0.5rem 0.75rem; border: 1px solid var(--border-color);
                             border-radius: var(--radius-sm); font-size: 0.875rem;
                             background-color: var(--bg-card); min-width: 140px; transition: all var(--transition); }
.form-select:focus, .form-input:focus { outline: none; border-color: var(--ep-green); box-shadow: 0 0 0 3px rgba(30, 180, 0, 0.1); }
.form-control:focus { border-color: var(--ep-green); box-shadow: 0 0 0 3px rgba(30, 180, 0, 0.1); }

/* ================= DATA SECTIONS & TABLES ================= */
.data-section { background: var(--bg-card); border-radius: var(--radius-lg); border: 1px solid var(--border-color);
                overflow: hidden; box-shadow: var(--shadow-sm); }
.section-header { display: flex; align-items: center; gap: 0.5rem; padding: 1rem 1.25rem;
                  background: var(--bg-body); border-bottom: 1px solid var(--border-color); }
.section-header h4 { font-size: 1rem; font-weight: 600; color: var(--ep-navy); }
.data-table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--bg-body); border-bottom: 1px solid var(--border-color); }
.data-table th { padding: 0.75rem 1rem; text-align: left; font-size: 0.7rem; font-weight: 600;
                 color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.data-table td { padding: 0.875rem 1rem; border-bottom: 1px solid #f1f3f5; font-size: 0.875rem; color: var(--text-secondary); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(30, 180, 0, 0.02); }
.cell-primary { font-weight: 500; color: var(--ep-navy); }
.text-right  { text-align: right !important; }
.text-center { text-align: center !important; }
.mono { font-family: 'SF Mono', 'Fira Code', Consolas, monospace; font-size: 0.8125rem; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }

/* ================= BADGES ================= */
.badge { display: inline-flex; align-items: center; padding: 0.25rem 0.625rem; font-size: 0.6875rem;
         font-weight: 600; border-radius: 9999px; text-transform: uppercase; letter-spacing: 0.03em; }
.badge--neutral { background: #f1f3f5; color: var(--text-muted); }
.badge--success { background: rgba(30, 180, 0, 0.1);  color: #168900; }
.badge--danger  { background: #fee2e2;                color: #dc2626; }
.badge--warning { background: rgba(255, 170, 0, 0.12); color: #cc8800; }
.badge--info    { background: rgba(0, 80, 160, 0.08);  color: var(--ep-blue); }

/* ================= UTILITY CLASSES ================= */
.d-flex { display: flex !important; }
.items-center { align-items: center !important; }
.justify-end  { justify-content: flex-end !important; }
.gap-2  { gap: 0.5rem !important; }
.p-6    { padding: 1.5rem !important; }
.border-t { border-top: 1px solid #e2e8f0 !important; }
.m-0    { margin: 0 !important; }
.mb-4   { margin-bottom: 1rem !important; }
.text-sm   { font-size: 0.875rem !important; }
.text-base { font-size: 1rem !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-tertiary  { color: var(--text-muted) !important; }
.text-primary   { color: var(--ep-blue) !important; }
.fw-semibold { font-weight: 600; }

/* ================= CARDS & MISC ================= */
.card { border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); border-radius: var(--radius-md); background: var(--bg-card); }
.card-header { background: var(--bg-card); border-bottom: 1px solid var(--border-color);
               padding: 1rem 1.25rem; font-weight: 600; color: var(--ep-navy); }
.stat-card { padding: 1.25rem; border-radius: var(--radius-md); background: var(--bg-card);
             box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); }
.stat-card .stat-icon { width: 48px; height: 48px; border-radius: var(--radius-sm);
                        display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; color: var(--ep-navy); margin: 0; }
.stat-card .stat-label { color: var(--text-muted); font-size: 0.875rem; margin: 0; }
.quick-link { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem;
              background: var(--bg-body); border-radius: var(--radius-sm); text-decoration: none;
              color: var(--text-secondary); font-size: 0.875rem; transition: all var(--transition); }
.quick-link:hover { background: rgba(30, 180, 0, 0.06); color: var(--ep-green); }
a { color: var(--ep-blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--ep-blue-light); text-decoration: none; }
.alert { border-radius: var(--radius-md); border: none; font-size: 0.875rem; }
.table > :not(caption) > * > * { border-bottom-color: #f1f3f5; }
.table thead th { font-size: 0.7rem; font-weight: 600; color: var(--text-muted);
                  text-transform: uppercase; letter-spacing: 0.04em; border-bottom-color: var(--border-color); }
.table-hover > tbody > tr:hover { background-color: rgba(30, 180, 0, 0.02); }
.h3, h3 { color: var(--ep-navy); font-weight: 700; }
.progress-bar { background-color: var(--ep-green); }
.dropdown-menu { border-radius: var(--radius-sm); border: 1px solid var(--border-color); box-shadow: var(--shadow-md); }
.dropdown-item:active { background-color: var(--ep-green); }
.modal-content { border-radius: var(--radius-lg); border: none; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom-color: var(--border-color); }
.modal-footer { border-top-color: var(--border-color); }
.page-item.active .page-link { background-color: var(--ep-green); border-color: var(--ep-green); }
.page-link { color: var(--text-secondary); border-color: var(--border-color);
             border-radius: var(--radius-sm) !important; margin: 0 0.125rem; }
.page-link:hover { color: var(--ep-green); background-color: rgba(30, 180, 0, 0.05); }
.list-group-item { border-color: var(--border-color); }
.list-group-item-action:hover { background-color: rgba(30, 180, 0, 0.04); }
.form-control { border-color: var(--border-color); border-radius: var(--radius-sm); transition: all var(--transition); }
.form-select { border-radius: var(--radius-sm); }
