/* UoG KPI portal — University of Gondar sky blue & gold */
:root {
  --uog-blue: #1f78c8;
  --uog-blue-dark: #155a96;
  --uog-sky: #3d9ee6;
  --uog-gold: #e2b007;
  --uog-navy: #0f2c4c;
  --uog-navy-2: #16395f;
  --surface: #f4f7fb;
  --border: #e3e8ef;
  --text-muted: #5f6b7a;
  --bs-primary: var(--uog-blue);
  --bs-primary-rgb: 31, 120, 200;
  --bs-link-color: var(--uog-blue-dark);
  --bs-link-color-rgb: 21, 90, 150;
  --bs-link-hover-color: var(--uog-navy);
  --bs-body-font-size: .925rem;
  --bs-border-color: var(--border);
}
body.portal { background: var(--surface); }
.btn-primary { --bs-btn-bg: var(--uog-blue); --bs-btn-border-color: var(--uog-blue); --bs-btn-hover-bg: var(--uog-blue-dark); --bs-btn-hover-border-color: var(--uog-blue-dark); --bs-btn-active-bg: var(--uog-navy); }
.btn-outline-primary { --bs-btn-color: var(--uog-blue-dark); --bs-btn-border-color: var(--uog-blue); --bs-btn-hover-bg: var(--uog-blue); --bs-btn-hover-border-color: var(--uog-blue); --bs-btn-active-bg: var(--uog-blue-dark); }
.text-primary { color: var(--uog-blue-dark) !important; }
.skip-link { position: absolute; z-index: 2000; left: 1rem; top: .5rem; background: #fff; padding: .5rem 1rem; border-radius: .375rem; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; flex: 0 0 260px; background: linear-gradient(180deg, var(--uog-navy), var(--uog-navy-2)); color: #cfe0f3; display: flex; flex-direction: column; }
@media (min-width: 992px) { .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; } }
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.1rem 1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand img { background: #fff; border-radius: 50%; padding: 2px; object-fit: contain; }
.sidebar-brand strong { color: #fff; display: block; letter-spacing: .02em; }
.sidebar-brand small { color: var(--uog-gold); font-size: .75rem; }
.sidebar-nav { padding: .5rem .6rem 1rem; flex: 1; }
.nav-section { text-transform: uppercase; font-size: .68rem; letter-spacing: .08em; color: #8fb0d3; padding: 1rem .75rem .35rem; }
.nav-item { display: flex; align-items: center; gap: .65rem; color: #dbe7f5; text-decoration: none; padding: .55rem .75rem; border-radius: .5rem; margin-bottom: 2px; }
.nav-item i { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .9; }
.nav-item:hover, .nav-item:focus-visible { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--uog-blue); color: #fff; box-shadow: inset 3px 0 0 var(--uog-gold); }
.sidebar-foot { font-size: .72rem; color: #8fb0d3; padding: .9rem 1.1rem; border-top: 1px solid rgba(255,255,255,.08); }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1010; display: flex; align-items: center; gap: .75rem; background: #fff; border-bottom: 1px solid var(--border); padding: .6rem 1.5rem; }
.year-form select { min-width: 9rem; }
.user-btn { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--border); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--uog-gold); color: var(--uog-navy); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.main { padding: 1.5rem; max-width: 1600px; width: 100%; }
@media (max-width: 575.98px) { .main { padding: 1rem; } .topbar { padding: .5rem 1rem; } }

/* Page furniture */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.45rem; font-weight: 650; margin: 0 0 .15rem; color: var(--uog-navy); }
.card { border: 1px solid var(--border); border-radius: .75rem; box-shadow: 0 1px 2px rgba(15,44,76,.04); }
.card-header { background: #fff; font-weight: 600; color: var(--uog-navy); border-bottom: 1px solid var(--border); padding: .8rem 1rem; }
.card > .table-responsive:first-child { border-radius: .75rem; }
.table > thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 600; background: #fafbfd; white-space: nowrap; }
.table td, .table th { padding: .65rem .75rem; }
.empty { text-align: center; color: var(--text-muted); padding: 2rem 1rem !important; }
.empty-state { text-align: center; max-width: 560px; margin: 3rem auto; }
.row-link { cursor: pointer; }
.w-meter { min-width: 170px; }
.tw-28 { max-width: 28rem; }
.num-input { max-width: 8.5rem; }
.breadcrumb { margin-bottom: .5rem; }
.steps { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; font-size: .85rem; color: var(--text-muted); }
.steps i { color: var(--uog-blue); }

/* Stats */
.stat .card-body { padding: 1rem 1.1rem; }
.stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 600; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--uog-navy); line-height: 1.2; }
.stat-icon { width: 38px; height: 38px; border-radius: .6rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; margin-bottom: .5rem; }
.score-card { background: linear-gradient(135deg, #fff 55%, #eef6fd); }
.gauge { position: relative; width: 130px; height: 130px; flex: 0 0 130px; }
.gauge canvas { width: 130px !important; height: 130px !important; }
.gauge-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; font-weight: 700; color: var(--uog-navy); }

/* Meters & badges */
.meter { height: .5rem; flex: 1 1 auto; min-width: 70px; background: #e9eef5; }
.meter .progress-bar { width: 0; transition: width .6s ease; }
.rating-success { background: #198754; } .rating-primary { background: var(--uog-blue); }
.rating-info { background: #0b8fae; } .rating-warning { background: #d99a00; color: #1f1a00; } .rating-danger { background: #c8323f; }
.badge-soft-secondary { background: #eef1f5; color: #475467; } .badge-soft-info { background: #e4f3fb; color: #0b6a8f; }
.badge-soft-success { background: #e6f5ec; color: #146c43; } .badge-soft-danger { background: #fdecee; color: #a52834; }

/* Charts */
.chart-box { position: relative; min-height: 280px; }
.chart-box canvas { max-height: 340px; }

/* Plan table */
.plan-table .type-theme td { background: #f1f6fc; font-weight: 650; color: var(--uog-navy); }
.plan-table .type-objective td { background: #fbfcfe; font-weight: 600; }
.plan-table .lvl-1 .name { padding-left: 1.75rem; }
.plan-table .lvl-2 .name { padding-left: 3.25rem; }
.plan-table .lvl-3 .name { padding-left: 4.75rem; }

/* Scorecard */
.scorecard .group-theme th { background: #eaf2fb; color: var(--uog-navy); }
.scorecard .group-objective th { background: #f8fafc; font-weight: 600; font-size: .85rem; padding-left: 1.5rem; }

/* Org tree */
.org-tree ul.tree { list-style: none; margin: 0; padding-left: 1.25rem; border-left: 1px dashed #c9d6e5; }
.org-tree > ul.tree { padding-left: 0; border-left: 0; }
.org-tree li { margin: .15rem 0; }
.org-tree summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .45rem .6rem; border-radius: .5rem; cursor: pointer; list-style: none; }
.org-tree summary::-webkit-details-marker { display: none; }
.org-tree summary::before { content: "\F285"; font-family: bootstrap-icons; font-size: .75rem; color: var(--text-muted); transition: transform .15s; margin-right: .25rem; }
.org-tree details[open] > summary::before { transform: rotate(90deg); }
.org-tree summary.leaf::before { content: "\F287"; font-size: .4rem; }
.org-tree summary:hover { background: #f3f7fc; }
.org-name { flex: 1 1 260px; }
.org-score { display: flex; align-items: center; gap: .6rem; flex: 0 1 340px; }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem;
  background: radial-gradient(circle at 20% 20%, rgba(61,158,230,.35), transparent 40%), radial-gradient(circle at 80% 80%, rgba(226,176,7,.25), transparent 40%), var(--uog-navy); }
.login-card { width: 100%; max-width: 430px; border: 0; border-radius: 1rem; }
.login-card h1 { color: var(--uog-navy); }

.review-card textarea { resize: vertical; }
.timeline .list-group-item { border-left: 3px solid #e3ecf7; }
@media print { .sidebar, .topbar, .btn, form { display: none !important; } .main { padding: 0; } }
@media (min-width: 992px) { .layout { background: linear-gradient(90deg, var(--uog-navy) 260px, var(--surface) 260px); } }
.quarter-table select { min-width: 10.5rem; }

/* Bulk reporting grid */
.bulk-grid .kpi-cell { min-width: 14rem; }
.bulk-grid .q-cell { width: 5.5rem; min-width: 5rem; }
.bulk-grid .annual-cell { min-width: 9rem; }
.bulk-grid .evidence-cell { min-width: 12rem; }

/* Operational plan timeline (Gantt) — geometry set by operations.js from data attributes */
.gantt-row { display: flex; align-items: center; gap: .75rem; min-height: 1.9rem; }
.gantt-label { flex: 0 0 13rem; font-size: .85rem; }
.gantt-track { position: relative; flex: 1; height: 1.25rem; background: var(--surface); border-radius: .25rem; }
.gantt-axis .gantt-track { background: transparent; height: 1.2rem; }
.gantt-month { position: absolute; top: 0; font-size: .7rem; color: var(--text-muted); border-left: 1px solid var(--border); padding-left: 2px; white-space: nowrap; }
.gantt-bar { position: absolute; top: .15rem; height: .95rem; border-radius: .25rem; overflow: hidden; background: #c3cad5; }
.gantt-fill { display: block; height: 100%; background: rgba(15, 44, 76, .45); }
.gantt-today { position: absolute; top: -.3rem; bottom: -.3rem; width: 2px; background: #d03b3b; z-index: 2; }
.gantt-in_progress { background: #7fb3e3; } .gantt-completed { background: #7cc47c; } .gantt-delayed { background: #ef9a9a; }
.gantt-on_hold { background: #fad27a; } .gantt-cancelled { background: #9aa4b2; } .gantt-planned, .gantt-not_started { background: #c3cad5; }
.gantt-key { display: inline-block; width: .9rem; height: .6rem; border-radius: .15rem; vertical-align: middle; }
@media (max-width: 576px) { .gantt-label { flex-basis: 7rem; } }

.notif-unread { background: #f4f8fd; }

/* Institutional calendar */
.cal-grid td { width: 14.28%; height: 6.5rem; vertical-align: top; padding: .25rem; }
.cal-other { background: var(--surface); color: var(--text-muted); }
.cal-today { box-shadow: inset 0 0 0 2px #1f78c8; }
.cal-ev { font-size: .72rem; line-height: 1.2; padding: 1px 4px; margin-top: 2px; border-radius: 3px; border-left: 3px solid; background: #f4f6f9; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-ev a { color: inherit; text-decoration: none; }
.cal-dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; margin-right: .3rem; flex: none; background: currentColor; }
.cal-window { border-color: #1f78c8; color: #1f78c8; } .cal-activity { border-color: #0b8fae; color: #0b8fae; }
.cal-milestone { border-color: #6f42c1; color: #6f42c1; } .cal-action { border-color: #ec835a; color: #b5532b; }
.cal-plan { border-color: #0ca30c; color: #087a08; } .cal-delegation { border-color: #5f6b7a; color: #5f6b7a; }
.cal-institution { border-color: #e2b007; color: #8a6a00; }
.cal-ev.cal-overdue { border-color: #d03b3b; background: #fdecec; color: #a12424; }
@media (max-width: 768px) { .cal-grid td { height: 4.5rem; } .cal-ev { white-space: normal; } }

/* Risk tiers (colour only; labels come from the approved policy) */
.risk-t0 { background: #d7f0d7; color: #0b5d0b; } .risk-t1 { background: #e8f3c4; color: #4d5f00; }
.risk-t2 { background: #fdedb8; color: #6e5200; } .risk-t3 { background: #fbd3bf; color: #8a3410; }
.risk-t4 { background: #f5b5b5; color: #7a1414; }
.risk-heat td { min-width: 4rem; height: 3rem; vertical-align: middle; }

.import-report { white-space: pre-wrap; max-height: 28rem; overflow: auto; }

.cal-eth { font-size: .68rem; }

/* Amharic: bundled Noto Sans Ethiopic (SIL Open Font License), downloaded only when Ethiopic characters are on the page */
@font-face { font-family: "UoG Ethiopic"; src: url("../fonts/NotoSansEthiopic-Regular.ttf") format("truetype");
             font-weight: 400; font-display: swap; unicode-range: U+1200-139F, U+2D80-2DDF, U+AB00-AB2F; }
@font-face { font-family: "UoG Ethiopic"; src: url("../fonts/NotoSansEthiopic-Bold.ttf") format("truetype");
             font-weight: 600 800; font-display: swap; unicode-range: U+1200-139F, U+2D80-2DDF, U+AB00-AB2F; }
body, .tooltip, .popover { font-family: var(--bs-body-font-family), "UoG Ethiopic"; }

.login-other > summary { cursor: pointer; list-style: none; }
.login-other > summary::-webkit-details-marker { display: none; }
.login-other > summary:hover { text-decoration: underline; }
