:root {
  --brand-primary: #0f5132ee;
  --brand-primary-solid: #14532d;
  --brand-accent: #2f9e44;
  --bg-soft: #f4f6f8;
}

body {
  background: var(--bg-soft);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.app-navbar {
  background: linear-gradient(135deg, var(--brand-primary-solid), #1b6e3c);
}

.app-sidebar {
  width: 240px;
  min-height: calc(100vh - 56px);
  background: #ffffff;
  border-right: 1px solid #e6e9ec;
}

.app-sidebar .nav-link {
  color: #37474f;
  padding: 0.6rem 1.1rem;
  border-left: 3px solid transparent;
  font-size: 0.92rem;
}

.app-sidebar .nav-link:hover {
  background: #eef7f0;
}

.app-sidebar .nav-link.active {
  background: #e6f4ea;
  color: var(--brand-primary-solid);
  border-left-color: var(--brand-accent);
  font-weight: 600;
}

.app-main {
  min-height: calc(100vh - 56px);
}

.card {
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.kpi-card {
  border-radius: 0.9rem;
  color: #fff;
  padding: 1.1rem 1.3rem;
}
.kpi-card h3 { margin: 0; font-size: 1.8rem; font-weight: 700; }
.kpi-card p { margin: 0; opacity: .9; font-size: .85rem; }

.kpi-green  { background: linear-gradient(135deg,#2f9e44,#1b6e3c); }
.kpi-blue   { background: linear-gradient(135deg,#1971c2,#0b4f8a); }
.kpi-orange { background: linear-gradient(135deg,#e8590c,#c04a00); }
.kpi-purple { background: linear-gradient(135deg,#7048e8,#4c2fb0); }
.kpi-red    { background: linear-gradient(135deg,#e03131,#a11212); }

.kpi-card-link { display: block; color: inherit; text-decoration: none; transition: transform .12s ease, box-shadow .12s ease; }
.kpi-card-link:hover, .kpi-card-link:focus { color: inherit; text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.kpi-card-link .kpi-card { cursor: pointer; }

.opm-chart-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 12px; }
.opm-chart-legend-chip { display: inline-block; padding: 4px 14px; border-radius: 999px; color: #fff; font-size: 12px; font-weight: 600; }

.opm-multiselect { position: relative; }
.js-ms-trigger { width: 100%; text-align: left; display: flex; justify-content: space-between; align-items: center; }
.js-ms-trigger .js-ms-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.js-ms-panel {
    display: none;
    position: absolute;
    z-index: 1050;
    top: 100%;
    left: 0;
    margin-top: 2px;
    background: #fff;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0,0,0,.12);
    min-width: 220px;
    max-width: 320px;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px 0;
}
.js-ms-panel.show { display: block; }
.js-ms-row { display: flex; align-items: center; gap: 8px; padding: 6px 12px; cursor: pointer; }
.js-ms-row:hover { background: #f8f9fa; }
.js-ms-row[hidden] { display: none; }
.js-ms-row.js-search-hide { display: none !important; }
.js-ms-row label { cursor: pointer; margin: 0; flex: 1; font-size: 14px; }
.js-ms-search-wrap { position: sticky; top: 0; background: #fff; padding: 8px 10px; border-bottom: 1px solid var(--bs-border-color, #dee2e6); z-index: 1; }
.js-ms-search-box { position: relative; }
.js-ms-search-box i { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 12px; color: #adb5bd; }
.js-ms-search { width: 100%; padding: 6px 10px 6px 26px; font-size: 13px; border: 1px solid var(--bs-border-color, #dee2e6); border-radius: 6px; }
.js-ms-search:focus { outline: none; border-color: #86b7fe; box-shadow: 0 0 0 0.2rem rgba(13,110,253,.15); }
.js-ms-footer { border-top: 1px solid var(--bs-border-color, #dee2e6); padding: 6px 12px; }


.opm-sticky-filters {
    position: sticky;
    top: 56px;
    z-index: 1020;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

.table-thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; }

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg,#14532d,#1b6e3c 60%, #2f9e44);
}
.login-card {
  width: 100%;
  max-width: 400px;
  border-radius: 1rem;
}

@media (max-width: 991.98px) {
  .app-sidebar { width: 260px; }
}


@media (max-width: 767.98px) {
  .btn, .form-select, .form-control { min-height: 40px; }
  .btn-sm, .form-select-sm, .form-control-sm { min-height: 36px; }
  .table-responsive { -webkit-overflow-scrolling: touch; }
  .card { border-radius: 0.6rem; }
  h4 { font-size: 1.25rem; }
}


.app-navbar {
  padding-top: env(safe-area-inset-top);
}
body {
  padding-bottom: env(safe-area-inset-bottom);
}


.opm-sticky-actions {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--bg-soft);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.tab-content .tab-pane:not(.active) { display: none !important; }
.tab-content .tab-pane.active { display: block !important; }


@media (max-width: 576px) {
    .opm-sticky-actions {
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }
}
