/* Scoped dashboard canvas and graph layout for App Tahfiz. */
@media screen and (min-width:801px) {
  :root:not([data-tmf-theme="dark"]) body:has(.app-frame) {
    background:#e5e9ef!important;
    background-image:none!important;
  }
  body:has(.app-frame) .app-frame,
  body:has(.app-frame) .app-frame.sidebar-collapsed {
    width:calc(100% - 32px)!important;
    max-width:none!important;
    margin:16px auto!important;
    min-height:calc(100dvh - 32px)!important;
    box-shadow:0 12px 42px #29374a17!important;
    border:0;
  }
  :root:not([data-tmf-theme="dark"]) body:has(.app-frame) .app-frame,
  :root:not([data-tmf-theme="dark"]) body:has(.app-frame) .app-frame.sidebar-collapsed {
    border:1px solid #d3dbe6;
  }
}
body:has(.app-frame) .main {
  width:100%;
  min-width:0;
}
body:has(.app-frame) .main > * {
  max-width:100%;
  min-width:0;
}
#tmf-attendance-app,
#tmf-guardian-attendance-app {
  width:100%;
  min-width:0;
}
#tmf-attendance-app .attendance-panel,
#tmf-guardian-attendance-app .attendance-panel {
  width:100%;
  max-width:none!important;
  min-width:0;
}
.dashboard-trend {
  width:100%;
  min-width:0;
  margin-bottom:25px;
}
.chart-box {
  min-width:0;
}
.chart-graph {
  display:grid;
  grid-template-columns:36px minmax(0,1fr);
  gap:12px;
  width:100%;
  min-width:0;
  margin-top:12px;
}
.chart-content {min-width:0}
.chart-plot {
  position:relative;
  width:100%;
  height:clamp(225px,22vw,315px);
  min-width:0;
  overflow:visible;
}
.chart-box .chart-svg {
  display:block;
  width:100%;
  height:100%;
  overflow:visible;
}
.chart-y-axis {
  position:relative;
  height:clamp(225px,22vw,315px);
  text-align:right;
  color:#8495ac;
  font-size:11px;
  line-height:1;
  font-variant-numeric:tabular-nums;
}
.chart-y-axis span {
  position:absolute;
  right:0;
  transform:translateY(-50%);
}
.chart-y-axis span:nth-child(1) {top:8.403%}
.chart-y-axis span:nth-child(2) {top:36.134%}
.chart-y-axis span:nth-child(3) {top:63.866%}
.chart-y-axis span:nth-child(4) {top:91.597%}
.chart-x-axis {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 0 0;
  font-size:11px;
  color:#7588a2;
  font-weight:600;
}
.chart-x-axis span {flex:0 0 auto;text-align:center}
.chart-point {
  position:absolute;
  z-index:2;
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  padding:0;
  transform:translate(-50%,-50%);
  border:0;
  border-radius:50%;
  background:transparent;
  cursor:pointer;
  touch-action:manipulation;
}
.chart-point-dot {
  display:block;
  height:13px;
  width:13px;
  border:2px solid #3377d6;
  border-radius:50%;
  background:#fff;
  box-shadow:0 0 0 2px #ffffffb8;
  transition:box-shadow .16s,transform .16s;
  pointer-events:none;
}
.chart-point.zero .chart-point-dot {
  width:8px;
  height:8px;
  border-width:1px;
  background:#92b6e8;
}
.chart-point:is(:hover,:focus-visible,:active,.is-active) {z-index:5}
.chart-point:is(:hover,:focus-visible,:active,.is-active) .chart-point-dot {
  transform:scale(1.35);
  box-shadow:0 0 0 5px #3377d624;
}
.chart-point:focus-visible {outline:2px solid #245bb0;outline-offset:2px}
.chart-tooltip {
  position:absolute;
  left:50%;
  bottom:calc(100% + 5px);
  transform:translateX(-50%) translateY(4px);
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:140px;
  padding:9px 11px;
  border:1px solid #dce5f2;
  border-radius:10px;
  background:#fff;
  box-shadow:0 8px 26px #1b38552b;
  color:#546980;
  font-size:11px;
  line-height:1.35;
  font-weight:500;
  white-space:nowrap;
  pointer-events:none;
  opacity:0;
  visibility:hidden;
  transition:opacity .12s,transform .12s,visibility .12s;
}
.chart-tooltip strong {font-size:13px;color:#1f5aa8}
.chart-point.below .chart-tooltip {
  bottom:auto;
  top:calc(100% + 5px);
  transform:translateX(-50%) translateY(-4px);
}
.chart-point.start .chart-tooltip {left:0;transform:translateX(-5%) translateY(4px)}
.chart-point.end .chart-tooltip {left:100%;transform:translateX(-95%) translateY(4px)}
.chart-point:is(:hover,:focus-visible,:active,.is-active) .chart-tooltip {
  opacity:1;
  visibility:visible;
  transform:translateX(-50%) translateY(0);
}
.chart-point.start:is(:hover,:focus-visible,:active,.is-active) .chart-tooltip {transform:translateX(-5%) translateY(0)}
.chart-point.end:is(:hover,:focus-visible,:active,.is-active) .chart-tooltip {transform:translateX(-95%) translateY(0)}
.chart-foot {gap:12px;flex-wrap:wrap}
:root[data-tmf-theme="dark"] .chart-point-dot {
  background:#142238;
  box-shadow:0 0 0 2px #142238;
  border-color:#80b3ff;
}
:root[data-tmf-theme="dark"] .chart-point.zero .chart-point-dot {background:#80b3ff}
:root[data-tmf-theme="dark"] .chart-tooltip {
  background:#233852;
  border-color:#42607f;
  color:#cbd8e8;
}
:root[data-tmf-theme="dark"] .chart-tooltip strong {color:#a6caff}
:root[data-tmf-theme="dark"] .chart-y-axis,
:root[data-tmf-theme="dark"] .chart-x-axis {color:#b0c2d9}
@media screen and (max-width:600px) {
  .chart-graph {grid-template-columns:28px minmax(0,1fr);gap:8px}
  .chart-plot,.chart-y-axis {height:230px}
  .chart-x-axis {font-size:10px;padding-top:7px}
  .chart-y-axis {font-size:10px}
  .chart-point {width:38px;height:38px}
  .chart-tooltip {font-size:10px;min-width:120px}
  .chart-foot {font-size:10px}
}
@media (prefers-reduced-motion:reduce) {
  .chart-point-dot,.chart-tooltip {transition:none}
}

/* Keep target text inside the progress ring. */
.app-frame .target-panel .ring-wrap .ring-center {
  width:90px;
  max-width:calc(100% - 20px);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  text-align:center;
}
.app-frame .target-panel .ring-wrap .ring-center > strong {
  display:block;
  max-width:100%;
  white-space:nowrap;
  line-height:1.12;
}
.app-frame .target-panel .ring-wrap .ring-center > span {
  display:block;
  width:100%;
  margin:0;
  white-space:normal;
  overflow-wrap:break-word;
  text-wrap:balance;
  line-height:1.22;
}
@media screen and (max-width:600px) {
  .app-frame .target-panel .ring-wrap .ring-center {
    width:76px;
    gap:2px;
  }
}
