/* ============================================================
   Officer Dashboard — Online Activities (payments) statistics
   ============================================================ */
:root {
    --od-primary-700: #153f86;
    --od-primary-600: #1d52a8;
    --od-primary-500: #2462cb;
    --od-ink: #14223b;
    --od-muted: #64748b;
    --od-surface: #ffffff;
    --od-surface-alt: #f7faff;
    --od-border: #e1e9f5;
    --od-border-strong: #c9d8ef;
    --od-shadow: 0 10px 30px rgba(17, 43, 96, 0.08);
    --od-green: #16a34a;
    --od-amber: #d08a1a;
}

.od-wrap {
    font-family: inherit;
    color: var(--od-ink);
    margin: 0 0 24px;
}

/* ---------- Header + filter ---------- */
.od-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    padding: 14px 18px;
    border-radius: 14px;
    background: #1d52a8;
    color: #fff;
    box-shadow: var(--od-shadow);
}
.od-head-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}
/* Push the date filter to the far right; title + body sit together on the left. */
.od-head .od-filter { margin-left: auto; }
.od-head-title .od-ic {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 24px;
}
.od-head-title h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: .2px;
}
.od-head-title p {
    margin: 1px 0 0;
    font-size: 12.5px;
    opacity: .85;
}

/* Centre: body (hall/dept/institute) identity card */
.od-head-body {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(4px);
    max-width: 42%;
}
.od-head-body-ic {
    font-size: 28px;
    opacity: .95;
    flex: 0 0 auto;
}
.od-head-body-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.od-head-body-type {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: .8;
}
.od-head-body-name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* subtle glow behind the hero (decorative, absolutely positioned) */
.od-head { position: relative; overflow: hidden; }
.od-head-glow {
    position: absolute;
    top: -50%;
    right: -6%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
    z-index: 0;
}
/* keep real content above the glow WITHOUT overriding the glow's own absolute
   positioning (that previously forced a 380px-tall header). */
.od-head > *:not(.od-head-glow) { position: relative; z-index: 1; }

.od-filter {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.od-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.od-field label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    opacity: .85;
}
.od-field input[type="date"] {
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.95);
    color: var(--od-ink);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
}
.od-field-hall { min-width: 0; }

/* "Choose Hall" button (opens the modal) */
.od-hall-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
    max-width: 260px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.95);
    color: var(--od-ink);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.od-hall-btn > span:nth-child(2) {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.od-hall-btn .material-icons { font-size: 19px; color: var(--od-primary-600); }
.od-hall-btn .od-hall-caret { color: var(--od-muted); }

/* Hall picker modal */
.od-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 30, 60, 0.55);
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
}
.od-modal.is-open { display: flex; }
.od-modal-box {
    width: 100%;
    max-width: 900px;
    background: var(--od-surface);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.od-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    background: linear-gradient(135deg, #163e82 0%, #2462cb 100%);
    color: #fff;
}
.od-modal-head h3 { margin: 0; font-size: 18px; font-weight: 800; }
.od-modal-x {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    opacity: .85;
}
.od-modal-x:hover { opacity: 1; }
.od-modal-search { padding: 16px 22px 6px; }
.od-modal-search input {
    width: 100%;
    border: 1px solid var(--od-border-strong);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 15px;
    font-family: inherit;
}
.od-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
    padding: 14px 22px 22px;
    max-height: 62vh;
    overflow-y: auto;
}
.od-hallcard {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    padding: 16px 18px;
    border: 1px solid var(--od-border);
    border-radius: 12px;
    background: var(--od-surface);
    cursor: pointer;
    transition: border-color .12s, box-shadow .12s, transform .12s;
    font-family: inherit;
}
.od-hallcard:hover {
    border-color: var(--od-primary-500);
    box-shadow: 0 8px 20px rgba(36,98,203,.14);
    transform: translateY(-2px);
}
.od-hallcard.is-active {
    border-color: var(--od-primary-500);
    background: #eef4fd;
    box-shadow: inset 0 0 0 1px var(--od-primary-500);
}
.od-hallcard-name { font-size: 15px; font-weight: 800; color: var(--od-primary-700); }
.od-hallcard-id { font-size: 12.5px; color: var(--od-muted); font-weight: 600; }
.od-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    background: #ffffff;
    color: var(--od-primary-700);
    font-weight: 800;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: 10px;
    transition: transform .12s, box-shadow .12s;
}
.od-btn .material-icons { font-size: 19px; }
.od-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.od-btn:disabled { opacity: .6; cursor: default; transform: none; box-shadow: none; }

/* ---------- KPI cards ---------- */
.od-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin: 18px 0;
}
.od-kpi {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 16px;
    background: var(--od-surface);
    border: 1px solid var(--od-border);
    box-shadow: var(--od-shadow);
}
.od-kpi-ic {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-size: 26px;
}
.od-kpi-total .od-kpi-ic { background: #e8f5ec; color: var(--od-green); }
.od-kpi-types .od-kpi-ic { background: #eaf1ff; color: var(--od-primary-500); }
.od-kpi-range .od-kpi-ic { background: #fdf1dc; color: var(--od-amber); }
.od-kpi-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.od-kpi-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--od-muted);
}
.od-kpi-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--od-ink);
    line-height: 1.15;
    word-break: break-word;
}
.od-kpi-value-sm { font-size: 16px; font-weight: 800; }
.od-kpi-total .od-kpi-value { color: var(--od-green); }
.od-kpi-top .od-kpi-ic { background: #f3ecff; color: #7c3aed; }
.od-kpi-sub {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--od-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* truncate long "top payment" name */
.od-kpi-top .od-kpi-value-sm {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ---------- Two-column layout: donut + table ---------- */
.od-grid {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: 16px;
    align-items: start;
}
@media (max-width: 900px) {
    .od-grid { grid-template-columns: 1fr; }
}

/* Donut chart (conic-gradient) */
.od-donut {
    position: relative;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    margin: 8px auto 18px;
    background: conic-gradient(#e6ecf5 0 100%);
    transition: background .4s ease;
}
.od-donut::after {
    content: '';
    position: absolute;
    inset: 26px;
    border-radius: 50%;
    background: var(--od-surface);
    box-shadow: inset 0 1px 4px rgba(17,43,96,.06);
}
.od-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.od-donut-c-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--od-muted);
}
.od-donut-c-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--od-ink);
}

/* Legend */
.od-legend { display: flex; flex-direction: column; gap: 8px; }
.od-leg {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.od-leg-dot {
    width: 12px; height: 12px;
    border-radius: 4px;
    flex: 0 0 auto;
}
.od-leg-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--od-ink);
    font-weight: 600;
}
.od-leg-pct { font-weight: 800; color: var(--od-muted); }

/* colour dot before each table row label */
.od-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: 1px;
}

/* ---------- Breakdown panel ---------- */
.od-panel {
    background: var(--od-surface);
    border: 1px solid var(--od-border);
    border-radius: 16px;
    box-shadow: var(--od-shadow);
    overflow: hidden;
}
.od-panel-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 16px 20px;
    background: linear-gradient(180deg, #f2f7ff 0%, #e9f1fb 100%);
    border-bottom: 1px solid var(--od-border);
}
.od-panel-head .material-icons { color: var(--od-primary-500); font-size: 22px; }
.od-panel-head h4 { margin: 0; font-size: 16px; font-weight: 800; color: var(--od-primary-700); }
.od-panel-body { padding: 6px 8px 12px; }

/* Breakdown table */
.od-table {
    width: 100%;
    border-collapse: collapse;
}
.od-table thead th {
    text-align: left;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--od-muted);
    padding: 12px 14px;
    border-bottom: 2px solid var(--od-border);
}
.od-table thead th.od-num { text-align: right; }
.od-table tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--od-border);
    font-size: 15px;
    vertical-align: middle;
}
.od-table tbody tr:last-child td { border-bottom: none; }
.od-table tbody tr:hover { background: var(--od-surface-alt); }
.od-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: #eef3fb;
    color: var(--od-primary-600);
    font-size: 13px;
    font-weight: 800;
}
.od-desc { font-weight: 700; color: var(--od-ink); }
.od-amount {
    text-align: right;
    font-weight: 800;
    font-size: 16px;
    color: var(--od-primary-700);
    white-space: nowrap;
}
.od-share {
    width: 190px;
}
.od-bar {
    height: 8px;
    border-radius: 999px;
    background: #eef2f8;
    overflow: hidden;
}
.od-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2462cb 0%, #4f8cf0 100%);
}
.od-share-pct {
    font-size: 12px;
    font-weight: 700;
    color: var(--od-muted);
    margin-top: 4px;
    display: block;
}

/* Total footer row */
.od-table tfoot td {
    padding: 14px;
    border-top: 2px solid var(--od-border-strong);
    font-size: 15px;
    font-weight: 800;
    color: var(--od-ink);
}
.od-table tfoot .od-amount { color: var(--od-green); font-size: 17px; }

/* States */
.od-loading, .od-empty, .od-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 26px 18px;
    font-size: 15px;
    justify-content: center;
    color: var(--od-muted);
}
.od-error { color: #c0392b; }
.od-loading .material-icons { animation: od-spin 1s linear infinite; }
@keyframes od-spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 640px) {
    .od-head { flex-direction: column; align-items: stretch; }
    .od-filter { justify-content: flex-start; }
    .od-share { display: none; }
    .od-kpi-value { font-size: 22px; }
}