
.topbar-lite{display:flex;align-items:center;justify-content:space-between;margin:-8px 0 16px 0;gap:12px}
.topbar-lite .hello{display:flex;flex-direction:column;gap:4px}
.topbar-lite .hello h1{margin:0}
.topbar-lite .desc{color:var(--muted)}
.topbar-lite .right{display:flex;align-items:center;gap:12px;margin-left:auto}
.clock-ams{position:relative;display:flex;align-items:center;gap:10px;border:1px solid var(--border);background:var(--panel);border-radius:12px;padding:8px 12px}
.clock-ams .bg{width:28px;height:28px;border-radius:8px;display:inline-block;background:linear-gradient(180deg,#dbeafe,#93c5fd)}
.clock-ams.morning .bg{background:linear-gradient(180deg,#fef9c3,#fde68a)}
.clock-ams.day .bg{background:linear-gradient(180deg,#bae6fd,#60a5fa)}
.clock-ams.evening .bg{background:linear-gradient(180deg,#fecaca,#fca5a5)}
.clock-ams.night .bg{background:linear-gradient(180deg,#1f2937,#0f172a)}
.clock-ams .time{font-weight:800;letter-spacing:.5px}
.clock-ams .tz{font-size:12px;color:var(--muted)}
.userbox{position:relative}
.userbox details{position:relative}
.userbox summary{list-style:none;display:flex;align-items:center;gap:8px;border:1px solid var(--border);background:var(--panel);border-radius:999px;padding:6px 10px;cursor:pointer}
.userbox summary::-webkit-details-marker{display:none}
.userbox .avatar{width:24px;height:24px;border-radius:999px;background:color-mix(in oklab,var(--brand-500) 30%, #fff);display:grid;place-items:center;font-weight:700}
.userbox .menu{position:absolute;right:0;top:calc(100% + 8px);background:var(--panel);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow);padding:6px;min-width:180px;z-index:30}
.userbox .menu a{display:block;padding:8px 10px;border-radius:10px;color:var(--text);text-decoration:none}
.userbox .menu a:hover{background:var(--panel-2)}


.notifbox{position:relative}
.notifbox details{position:relative}
.notifbox summary{list-style:none;display:flex;align-items:center;justify-content:center;width:40px;height:40px;border:1px solid var(--border);background:var(--panel);border-radius:999px;cursor:pointer;position:relative}
.notifbox summary::-webkit-details-marker{display:none}
.notifbox .notif-icon{display:inline-flex;align-items:center;justify-content:center;line-height:1;color:var(--text)}
.notif-icon svg{display:block;width:18px;height:18px}
.notif-summary.is-unread .notif-icon{color:#ef4444}
.notifbox .notif-badge{position:absolute;top:-4px;right:-4px;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--danger);color:#fff;font-size:11px;font-weight:800;display:flex;align-items:center;justify-content:center;border:2px solid var(--bg)}
.notifbox .menu{position:absolute;right:0;top:calc(100% + 8px);background:var(--panel);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow);padding:6px;min-width:320px;max-width:360px;z-index:30}
.notifbox .notif-item{display:block;padding:10px;border-radius:10px;color:var(--text);text-decoration:none}
.notifbox .notif-item:hover{background:var(--panel-2)}
.notifbox .notif-item.is-unread .notif-title{font-weight:800}
.notifbox .notif-title{font-weight:700}
.notifbox .notif-body{margin-top:2px}
.notifbox .notif-empty{padding:10px}
.notifbox .notif-footer{margin-top:4px;border-top:1px solid var(--border);padding-top:6px}
.notifbox .notif-footer a{display:block;padding:8px 10px;border-radius:10px;color:var(--text);text-decoration:none}
.notifbox .notif-footer a:hover{background:var(--panel-2)}
.notifbox .notif-footer .notif-linkbtn{width:100%;display:block;padding:8px 10px;border-radius:10px;color:var(--text);text-decoration:none;background:transparent;border:0;text-align:left;cursor:pointer;font:inherit}
.notifbox .notif-footer .notif-linkbtn:hover{background:var(--panel-2)}
.tabs{display:flex;gap:8px;margin:12px 0}
.tab{border:1px solid var(--border);background:var(--panel);border-radius:999px;padding:6px 10px;cursor:pointer}
.tab.active{background:var(--primary);color:var(--text-inv);border-color:transparent}
.tabpanes>.pane{display:none}.tabpanes>.pane.active{display:block}
.kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.kpi{padding:14px;border:1px solid var(--border);border-radius:12px;background:var(--panel);box-shadow:var(--shadow)}
.kpi .val{font-size:24px;font-weight:900;color:#198754}
.kpi .label{color:var(--muted);font-size:12px}
@media(max-width:900px){.kpis{grid-template-columns:1fr}}



.userbox img.avatar{object-fit:cover;display:block}

/* Hide topbar greeting on dashboard to avoid double greeting in content */
body[data-route="" ] .topbar-lite .hello,
body[data-route="home"] .topbar-lite .hello,
body[data-route="home/index"] .topbar-lite .hello,
body[data-route="dashboard"] .topbar-lite .hello{display:none!important}

/* Dashboard layout */
.dash-wrap{display:flex;flex-direction:column;gap:14px}
.dash-hero{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}
.dash-hero__title{font-size:22px;font-weight:900;line-height:1.1;margin-bottom:6px}
.dash-hero__text{color:var(--muted);max-width:720px}
.dash-date{font-weight:800;color:var(--muted)}

.dash-grid{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:14px;align-items:start}
.dash-grid--bottom{grid-template-columns:minmax(0,1fr) 360px}
.dash-col{min-width:0}
.dash-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.dash-card{padding:14px}
.dash-card__head{display:flex;flex-direction:column;gap:4px;margin-bottom:10px}
.dash-card__head--split{flex-direction:row;align-items:flex-start;justify-content:space-between;gap:10px}
.dash-card__title{font-weight:900}
.dash-card__sub{color:var(--muted);font-size:12px}

.dash-chart{position:relative}
.dash-canvas{width:100%;display:block;cursor:pointer}

/* Chart tooltip */
.dash-tip{position:absolute;z-index:6;pointer-events:none;opacity:0;transform:translate(-50%,-100%);transition:opacity .08s ease;left:0;top:0}
.dash-tip.is-on{opacity:1}
.dash-tip__box{position:relative;background:rgba(15,23,42,.92);color:#fff;border:1px solid rgba(255,255,255,.08);border-radius:12px;padding:8px 10px;box-shadow:0 10px 25px rgba(0,0,0,.25);min-width:120px}
.dash-tip__label{font-size:12px;opacity:.85;margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dash-tip__val{font-weight:900;letter-spacing:.2px}
.dash-tip__arrow{position:absolute;left:50%;bottom:-6px;transform:translateX(-50%);width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid rgba(15,23,42,.92)}
.dash-legend{display:flex;gap:10px;align-items:center;margin-top:8px;color:var(--muted);font-size:12px;flex-wrap:wrap}
.dash-legend .dot{width:10px;height:10px;border-radius:999px;display:inline-block}
.dash-legend .dot--a{background:#2563eb}
.dash-legend .dot--b{background:#16a34a}
.dash-legend .dot--c{background:#f59e0b}
.dash-legend .dot--d{background:#7c3aed}
.dash-legend .lbl{margin-right:8px}

.dash-due{display:flex;flex-direction:column;gap:12px}
.dash-due__label{font-weight:800;margin-bottom:6px}
.dash-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.dash-li{border:1px solid var(--border);border-radius:12px;background:var(--panel);box-shadow:var(--shadow)}
.dash-li__a{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:10px 12px;text-decoration:none;color:var(--text)}
.dash-li__a:hover{background:var(--panel-2)}
.dash-li__t{display:flex;flex-direction:column;gap:2px;min-width:0}
.dash-li__doc{font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dash-li__cmp{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dash-li__sum{font-weight:900;white-space:nowrap}

.dash-events{display:flex;flex-direction:column;gap:10px}
.dash-ev{display:flex;gap:12px;align-items:flex-start;border:1px solid var(--border);border-radius:12px;background:var(--panel);padding:10px 12px;box-shadow:var(--shadow)}
.dash-ev__time{min-width:120px}
.dash-ev__date{font-weight:800}
.dash-ev__title{font-weight:800}

.dash-mood{display:flex;flex-direction:column}
.dash-mood__row{display:flex;gap:8px;align-items:center;justify-content:space-between;margin-top:2px}
.mood{width:48px;height:48px;border-radius:14px;border:1px solid var(--border);background:var(--panel);font-size:22px;cursor:pointer;transition:transform .08s ease}
.mood:active{transform:scale(.97)}
.mood.is-active{outline:2px solid var(--primary);border-color:transparent}
.mood--1{background:color-mix(in oklab, var(--danger) 12%, var(--panel))}
.mood--2{background:color-mix(in oklab, #f97316 12%, var(--panel))}
.mood--3{background:color-mix(in oklab, #94a3b8 14%, var(--panel))}
.mood--4{background:color-mix(in oklab, #22c55e 12%, var(--panel))}
.mood--5{background:color-mix(in oklab, #16a34a 18%, var(--panel))}
.dash-mood__msg{margin-top:10px;min-height:22px;color:var(--muted);font-weight:700}

/* Modal (dashboard-only) */
.dash-modal{position:fixed;inset:0;display:none;z-index:80}
.dash-modal[aria-hidden="false"]{display:block}
.dash-modal__backdrop{position:absolute;inset:0;background:rgba(0,0,0,.45)}
.dash-modal__panel{position:relative;margin:6vh auto 0 auto;max-width:920px;background:var(--bg);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow);padding:16px;max-height:88vh;overflow:auto}
.dash-modal__close{position:absolute;top:10px;right:12px;border:none;background:transparent;font-size:22px;cursor:pointer;color:var(--muted)}
.dash-modal__title{font-weight:900;margin:4px 0 12px 0}
.dash-modal__cols{display:grid;grid-template-columns:1fr 1fr;gap:14px}

@media(max-width:1100px){
  .dash-grid,.dash-grid--bottom{grid-template-columns:1fr}
  .dash-modal__cols{grid-template-columns:1fr}
  .dash-cards{grid-template-columns:1fr}
}
