:root {
            --ink: #26324b;
            --ink-soft: #667085;
            --cream: #fffaf0;
            --paper: #ffffff;
            --yellow: #ffd84d;
            --yellow-soft: #fff1a8;
            --red: #ef4f4f;
            --red-dark: #c93644;
            --mint: #63d2a6;
            --mint-dark: #24966f;
            --sky: #70c7e8;
            --purple: #8e7bd7;
            --orange: #ff9b50;
            --line: #eee7d7;
            --shadow: 0 14px 34px rgba(72, 59, 31, .12);
            --shadow-small: 0 7px 18px rgba(72, 59, 31, .10);
            --radius: 24px;
        }

        * {
            box-sizing: border-box;
        }

        html {
            scroll-behavior: smooth;
        }

        body {
            margin: 0;
            min-height: 100vh;
            font-size: 16px;
            color: var(--ink);
            background:
                radial-gradient(circle at 7% 9%, rgba(255, 216, 77, .22) 0 8px, transparent 9px),
                radial-gradient(circle at 92% 14%, rgba(112, 199, 232, .2) 0 10px, transparent 11px),
                radial-gradient(circle at 15% 88%, rgba(99, 210, 166, .17) 0 7px, transparent 8px),
                var(--cream);
            background-size: 92px 92px, 128px 128px, 118px 118px, auto;
            font-family: "Mali", cursive;
            -webkit-font-smoothing: antialiased;
        }

        button,
        input,
        select,
        textarea {
            font: inherit;
        }

        button {
            color: inherit;
        }

        button:focus-visible,
        input:focus-visible,
        select:focus-visible,
        textarea:focus-visible {
            outline: 4px solid rgba(112, 199, 232, .34);
            outline-offset: 2px;
        }

        .app-shell {
            width: min(1480px, calc(100% - 32px));
            margin: 0 auto;
            padding: 22px 0 60px;
        }

        .hero {
            position: relative;
            min-height: 220px;
            overflow: hidden;
            padding: 34px 330px 30px 38px;
            border: 3px solid rgba(38, 50, 75, .09);
            border-radius: 34px;
            background:
                linear-gradient(125deg, rgba(255, 255, 255, .22), transparent 42%),
                var(--yellow);
            box-shadow: var(--shadow);
            isolation: isolate;
        }

        .hero::before,
        .hero::after {
            content: "";
            position: absolute;
            border: 3px solid rgba(255, 255, 255, .54);
            border-radius: 50%;
            z-index: -1;
        }

        .hero::before {
            width: 160px;
            height: 160px;
            left: 48%;
            top: -96px;
        }

        .hero::after {
            width: 78px;
            height: 78px;
            left: 59%;
            bottom: -44px;
        }

        .eyebrow {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 7px 13px;
            border: 2px solid rgba(38, 50, 75, .12);
            border-radius: 999px;
            background: rgba(255, 255, 255, .72);
            font-size: 13px;
            font-weight: 700;
            transform: rotate(-1deg);
        }

        .pulse-dot {
            width: 9px;
            height: 9px;
            border-radius: 50%;
            background: var(--mint-dark);
            box-shadow: 0 0 0 0 rgba(36, 150, 111, .45);
            animation: pulse 2s infinite;
        }

        h1 {
            max-width: 760px;
            margin: 18px 0 8px;
            font-size: clamp(30px, 4.6vw, 58px);
            line-height: 1.04;
            letter-spacing: -2px;
        }

        .hero p {
            max-width: 720px;
            margin: 0;
            color: rgba(38, 50, 75, .78);
            font-size: clamp(14px, 1.5vw, 18px);
            font-weight: 600;
        }

        .hero-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 21px;
        }

        .meta-chip {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            padding: 8px 12px;
            border-radius: 14px;
            background: rgba(255, 255, 255, .72);
            font-size: 12px;
            font-weight: 700;
        }

        .mascot-stage {
            position: absolute;
            right: 34px;
            bottom: -12px;
            width: 265px;
            height: 245px;
            filter: drop-shadow(0 14px 12px rgba(73, 52, 21, .16));
            transform-origin: 50% 90%;
        }

        .shinchan-img {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: contain;
            object-position: center bottom;
            animation: heroRearDance 1.15s ease-in-out infinite;
            transform-origin: 50% 88%;
            user-select: none;
            pointer-events: none;
        }

        .speech {
            position: absolute;
            right: 222px;
            top: 33px;
            width: 128px;
            padding: 10px 11px;
            border: 3px solid var(--ink);
            border-radius: 18px 18px 6px 18px;
            background: #fff;
            font-size: 12px;
            font-weight: 700;
            text-align: center;
            transform: rotate(3deg);
            animation: wiggle 2.8s ease-in-out infinite;
        }

        .speech::after {
            content: "";
            position: absolute;
            right: -13px;
            bottom: 5px;
            width: 20px;
            height: 18px;
            border-right: 3px solid var(--ink);
            border-bottom: 3px solid var(--ink);
            background: #fff;
            transform: skewX(-35deg) rotate(-10deg);
        }

        .mascot {
            position: absolute;
            right: 20px;
            bottom: 0;
            width: 190px;
            height: 218px;
        }

        .mascot-head {
            position: absolute;
            left: 27px;
            top: 14px;
            width: 138px;
            height: 116px;
            border: 4px solid var(--ink);
            border-radius: 46% 48% 52% 45%;
            background: #f5b681;
            transform: rotate(-4deg);
            z-index: 3;
        }

        .mascot-hair {
            position: absolute;
            left: 24px;
            top: 6px;
            width: 140px;
            height: 47px;
            border: 4px solid var(--ink);
            border-bottom: 0;
            border-radius: 64% 54% 10% 8%;
            background: #1d2539;
            transform: rotate(-4deg);
            z-index: 4;
            clip-path: polygon(0 0, 100% 0, 100% 62%, 86% 50%, 76% 78%, 64% 53%, 50% 78%, 38% 52%, 24% 75%, 10% 52%, 0 64%);
        }

        .brow {
            position: absolute;
            top: 44px;
            width: 35px;
            height: 10px;
            border-radius: 999px;
            background: var(--ink);
        }

        .brow.left {
            left: 15px;
            transform: rotate(5deg);
        }

        .brow.right {
            right: 17px;
            transform: rotate(-4deg);
        }

        .eye {
            position: absolute;
            top: 61px;
            width: 10px;
            height: 13px;
            border-radius: 50%;
            background: var(--ink);
            animation: blink 4.8s infinite;
        }

        .eye.left {
            left: 33px;
        }

        .eye.right {
            right: 35px;
        }

        .cheek {
            position: absolute;
            top: 76px;
            width: 20px;
            height: 10px;
            border-radius: 50%;
            background: rgba(239, 79, 79, .28);
        }

        .cheek.left {
            left: 10px;
        }

        .cheek.right {
            right: 11px;
        }

        .mouth {
            position: absolute;
            left: 56px;
            top: 82px;
            width: 25px;
            height: 17px;
            border: 4px solid var(--ink);
            border-top: 0;
            border-radius: 0 0 50% 50%;
            transform: rotate(4deg);
        }

        .mascot-body {
            position: absolute;
            left: 48px;
            top: 116px;
            width: 94px;
            height: 61px;
            border: 4px solid var(--ink);
            border-radius: 23px 26px 12px 13px;
            background: var(--red);
            z-index: 2;
        }

        .mascot-shorts {
            position: absolute;
            left: 54px;
            top: 169px;
            width: 83px;
            height: 31px;
            border: 4px solid var(--ink);
            border-radius: 7px 7px 12px 12px;
            background: var(--yellow);
            z-index: 2;
        }

        .limb {
            position: absolute;
            border: 4px solid var(--ink);
            border-radius: 999px;
            background: #f5b681;
            z-index: 1;
        }

        .arm-left {
            left: 19px;
            top: 124px;
            width: 56px;
            height: 19px;
            transform: rotate(-36deg);
        }

        .arm-right {
            right: 12px;
            top: 123px;
            width: 58px;
            height: 19px;
            transform: rotate(35deg);
        }

        .leg-left {
            left: 54px;
            top: 192px;
            width: 23px;
            height: 29px;
            transform: rotate(8deg);
        }

        .leg-right {
            right: 54px;
            top: 192px;
            width: 23px;
            height: 29px;
            transform: rotate(-8deg);
        }

        .spark {
            position: absolute;
            font-size: 22px;
            animation: twinkle 1.8s ease-in-out infinite alternate;
        }

        .spark.one {
            left: 3px;
            top: 62px;
        }

        .spark.two {
            right: 0;
            top: 73px;
            animation-delay: .7s;
        }

        .section {
            margin-top: 22px;
        }

        .kpi-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 16px;
        }

        .kpi-card {
            position: relative;
            min-height: 148px;
            overflow: hidden;
            padding: 20px 20px 18px;
            border: 2px solid rgba(38, 50, 75, .07);
            border-radius: var(--radius);
            background: var(--paper);
            box-shadow: var(--shadow-small);
            transition: transform .2s ease, box-shadow .2s ease;
        }

        .kpi-card:hover {
            transform: translateY(-4px) rotate(-.3deg);
            box-shadow: var(--shadow);
        }

        .kpi-card::after {
            content: "";
            position: absolute;
            right: -25px;
            bottom: -37px;
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background: var(--card-color, var(--yellow));
            opacity: .18;
        }

        .kpi-card.red {
            --card-color: var(--red);
        }

        .kpi-card.mint {
            --card-color: var(--mint);
        }

        .kpi-card.sky {
            --card-color: var(--sky);
        }

        .kpi-card.purple {
            --card-color: var(--purple);
        }

        .kpi-top {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
        }

        .kpi-label {
            color: var(--ink-soft);
            font-size: 15px;
            font-weight: 700;
        }

        .kpi-icon {
            display: grid;
            width: 41px;
            height: 41px;
            place-items: center;
            border-radius: 14px;
            background: color-mix(in srgb, var(--card-color, var(--yellow)) 25%, white);
            font-size: 21px;
            transform: rotate(3deg);
        }

        .kpi-value {
            margin-top: 11px;
            font-size: clamp(27px, 3.4vw, 42px);
            line-height: 1;
            font-weight: 700;
        }

        .kpi-foot {
            margin-top: 9px;
            color: var(--ink-soft);
            font-size: 13px;
            font-weight: 600;
        }

        .kpi-card> :not(.kpi-shinchan) {
            position: relative;
            z-index: 2;
        }

        .kpi-card .kpi-value,
        .kpi-card .kpi-foot {
            max-width: calc(100% - 76px);
        }

        .kpi-shinchan {
            position: absolute;
            right: 3px;
            bottom: -8px;
            z-index: 1;
            width: 92px;
            height: 116px;
            object-fit: contain;
            object-position: center bottom;
            filter: drop-shadow(0 8px 7px rgba(38, 50, 75, .16));
            transform-origin: 50% 88%;
            pointer-events: none;
            user-select: none;
        }

        .kpi-shinchan.records {
            animation: mascotSway 2.2s ease-in-out infinite;
        }

        .kpi-shinchan.people {
            animation: mascotWave 1.8s ease-in-out infinite;
        }

        .kpi-shinchan.success {
            animation: mascotJump 1.35s ease-in-out infinite;
        }

        .kpi-shinchan.pending {
            animation: mascotWait 2.6s ease-in-out infinite;
        }

        .chart-grid {
            display: grid;
            grid-template-columns: minmax(0, 1.6fr) minmax(310px, .8fr);
            gap: 18px;
        }

        .panel {
            overflow: hidden;
            border: 2px solid rgba(38, 50, 75, .07);
            border-radius: var(--radius);
            background: var(--paper);
            box-shadow: var(--shadow-small);
        }

        .panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 20px 22px 10px;
        }

        .panel-heading-with-mascot {
            display: flex;
            align-items: center;
            gap: 12px;
            min-width: 0;
        }

        .section-shinchan {
            width: 70px;
            height: 76px;
            flex: 0 0 70px;
            object-fit: contain;
            filter: drop-shadow(0 6px 5px rgba(38, 50, 75, .14));
            transform-origin: 50% 86%;
            pointer-events: none;
            user-select: none;
        }

        .section-shinchan.chart {
            animation: mascotPoint 2s ease-in-out infinite;
        }

        .section-shinchan.status {
            animation: mascotPeek 2.4s ease-in-out infinite;
        }

        .panel-title {
            margin: 0;
            font-size: 21px;
        }

        .panel-subtitle {
            margin-top: 3px;
            color: var(--ink-soft);
            font-size: 13px;
            font-weight: 600;
        }

        .panel-badge {
            padding: 7px 10px;
            border-radius: 999px;
            background: var(--yellow-soft);
            font-size: 13px;
            font-weight: 700;
            white-space: nowrap;
        }

        .trend-toolbar {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 4px 20px 8px;
        }

        .month-nav {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .month-label {
            min-width: 112px;
            text-align: center;
            font-size: 15px;
            font-weight: 700;
        }

        .bar-chart-wrap {
            overflow-x: auto;
            padding: 4px 18px 16px;
            scrollbar-color: var(--yellow) transparent;
        }

        .bar-chart-canvas {
            position: relative;
            min-width: 620px;
            min-height: 292px;
        }

        .bar-chart-canvas svg {
            display: block;
            height: 260px;
            overflow: visible;
        }

        .chart-legend {
            display: flex;
            flex-wrap: wrap;
            gap: 9px 15px;
            padding: 4px 6px 0;
        }

        .chart-legend-item {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            font-size: 13px;
            font-weight: 700;
        }

        .chart-legend-dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
        }

        .chart-empty {
            display: grid;
            min-height: 240px;
            place-items: center;
            color: var(--ink-soft);
            font-size: 14px;
            font-weight: 700;
            text-align: center;
        }

        .grid-line {
            stroke: #eee7d7;
            stroke-width: 1;
            stroke-dasharray: 5 5;
        }

        .axis-label {
            fill: #7c7568;
            font-family: "Mali", cursive;
            font-size: 12px;
            font-weight: 600;
        }

        .bar-mark {
            transform-box: fill-box;
            transform-origin: center bottom;
            animation: riseBar .55s cubic-bezier(.2, .75, .25, 1.08) both;
        }

        .bar-value-label {
            fill: var(--ink);
            font-family: "Mali", cursive;
            font-size: 14px;
            font-weight: 700;
        }

        .axis-right-label {
            font-size: 13px;
            font-weight: 700;
        }

        .bars-scroll {
            overflow-x: auto;
            padding: 12px 20px 20px;
            scrollbar-color: var(--yellow) transparent;
        }

        .bar-chart {
            display: flex;
            min-width: 470px;
            height: 240px;
            align-items: flex-end;
            gap: 12px;
            padding: 24px 10px 0;
            border-bottom: 2px dashed var(--line);
            background: repeating-linear-gradient(to top, transparent 0 51px, rgba(238, 231, 215, .65) 52px 53px);
        }

        .bar-group {
            display: flex;
            flex: 1 0 64px;
            height: 100%;
            flex-direction: column;
            justify-content: flex-end;
            align-items: center;
            gap: 7px;
        }

        .bar-value {
            color: var(--ink-soft);
            font-size: 10px;
            font-weight: 700;
            white-space: nowrap;
        }

        .bar {
            width: min(48px, 70%);
            min-height: 7px;
            border: 3px solid rgba(38, 50, 75, .07);
            border-radius: 14px 14px 7px 7px;
            background: linear-gradient(180deg, var(--sky), #4aa9d0);
            box-shadow: inset 0 -6px 0 rgba(38, 50, 75, .06);
            transform-origin: bottom;
            animation: growBar .65s cubic-bezier(.2, .75, .25, 1.1) both;
        }

        .bar-group:nth-child(3n+2) .bar {
            background: linear-gradient(180deg, var(--mint), #42b88a);
        }

        .bar-group:nth-child(3n) .bar {
            background: linear-gradient(180deg, var(--yellow), #efb934);
        }

        .bar-label {
            min-height: 31px;
            font-size: 10px;
            font-weight: 700;
            text-align: center;
        }

        .donut-wrap {
            display: grid;
            grid-template-columns: 150px 1fr;
            gap: 18px;
            align-items: center;
            padding: 22px;
        }

        .donut {
            position: relative;
            width: 150px;
            height: 150px;
            border-radius: 50%;
            background: conic-gradient(var(--mint) 0 70%, var(--red) 70% 82%, var(--yellow) 82% 100%);
            transition: background .3s ease;
            animation: pop .5s ease both;
        }

        .donut::after {
            content: "";
            position: absolute;
            inset: 29px;
            border-radius: 50%;
            background: white;
            box-shadow: inset 0 0 0 2px var(--line);
        }

        .donut-center {
            position: absolute;
            inset: 0;
            z-index: 1;
            display: grid;
            place-content: center;
            text-align: center;
            pointer-events: none;
        }

        .donut-center strong {
            font-size: 23px;
            line-height: 1;
        }

        .donut-center span {
            margin-top: 5px;
            color: var(--ink-soft);
            font-size: 9px;
            font-weight: 700;
        }

        .legend {
            display: grid;
            gap: 10px;
        }

        .legend-row {
            display: grid;
            grid-template-columns: 11px 1fr auto;
            gap: 8px;
            align-items: center;
            font-size: 11px;
            font-weight: 600;
        }

        .legend-dot {
            width: 11px;
            height: 11px;
            border-radius: 4px;
        }

        .legend-value {
            font-weight: 700;
        }

        .data-panel {
            margin-top: 18px;
        }

        .data-titlebar {
            display: flex;
            min-height: 92px;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            padding: 13px 20px 8px;
            background: linear-gradient(90deg, #fff8d8, #fff);
            border-bottom: 2px dashed var(--line);
        }

        .data-titlebar h2 {
            margin: 0;
            font-size: 22px;
        }

        .data-titlebar p {
            margin: 4px 0 0;
            color: var(--ink-soft);
            font-size: 13px;
            font-weight: 600;
        }

        .data-shinchan {
            width: 88px;
            height: 86px;
            object-fit: contain;
            object-position: center bottom;
            filter: drop-shadow(0 6px 5px rgba(38, 50, 75, .14));
            animation: mascotWrite 1.9s ease-in-out infinite;
            transform-origin: 50% 90%;
            pointer-events: none;
            user-select: none;
        }

        .toolbar {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 18px 20px;
            border-bottom: 2px dashed var(--line);
        }

        .toolbar-left {
            display: flex;
            flex: 1 1 650px;
            flex-wrap: wrap;
            gap: 10px;
        }

        .search-box {
            position: relative;
            flex: 1 1 280px;
        }

        .search-box span {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            pointer-events: none;
        }

        .search-box input {
            padding-left: 42px;
        }

        .control {
            min-height: 44px;
            border: 2px solid #e9e2d2;
            border-radius: 14px;
            background: #fffdf8;
            color: var(--ink);
            font-size: 14px;
            font-weight: 600;
            transition: border .18s ease, box-shadow .18s ease;
        }

        input.control,
        select.control,
        textarea.control {
            width: 100%;
            padding: 10px 13px;
        }

        select.control {
            width: auto;
            min-width: 145px;
        }

        .control:focus {
            border-color: var(--sky);
            box-shadow: 0 0 0 4px rgba(112, 199, 232, .18);
            outline: none;
        }

        .btn {
            display: inline-flex;
            min-height: 43px;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 10px 16px;
            border: 0;
            border-radius: 14px;
            background: #f4f1e8;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            transition: transform .17s ease, filter .17s ease, box-shadow .17s ease;
        }

        .btn:hover {
            transform: translateY(-2px);
            filter: saturate(1.08);
            box-shadow: var(--shadow-small);
        }

        .btn:active {
            transform: translateY(0) scale(.98);
        }

        .btn:disabled {
            opacity: .55;
            cursor: wait;
            transform: none;
        }

        .btn-primary {
            border: 2px solid var(--ink);
            background: var(--red);
            color: #fff;
            box-shadow: 4px 4px 0 var(--ink);
        }

        .btn-primary:hover {
            box-shadow: 3px 5px 0 var(--ink);
        }

        .btn-yellow {
            border: 2px solid var(--ink);
            background: var(--yellow);
            box-shadow: 3px 3px 0 var(--ink);
        }

        .btn-danger {
            background: #fee7e7;
            color: var(--red-dark);
        }

        .btn-ghost {
            background: transparent;
        }

        .icon-btn {
            width: 34px;
            min-height: 34px;
            padding: 0;
            border-radius: 10px;
        }

        .table-scroll {
            overflow-x: auto;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            min-width: 1460px;
        }

        th,
        td {
            padding: 13px 11px;
            border-bottom: 1px solid var(--line);
            vertical-align: middle;
            text-align: left;
        }

        th {
            position: sticky;
            top: 0;
            z-index: 2;
            overflow: visible;
            background: #fff8d8;
            color: #685b37;
            font-size: 13px;
            font-weight: 700;
            white-space: nowrap;
        }

        td {
            font-size: 14px;
            font-weight: 500;
        }

        .th-heading {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 7px;
            min-height: 28px;
        }

        .th-filter-btn {
            position: relative;
            display: inline-grid;
            width: 24px;
            height: 24px;
            flex: 0 0 24px;
            place-items: center;
            padding: 0;
            border: 0;
            border-radius: 7px;
            background: rgba(255, 255, 255, .65);
            color: #887440;
            cursor: pointer;
        }

        .th-filter-btn::before {
            content: "";
            width: 11px;
            height: 10px;
            background: currentColor;
            clip-path: polygon(0 0, 100% 0, 63% 45%, 63% 100%, 37% 82%, 37% 45%);
        }

        .th-filter-btn:hover,
        .th-filter-btn.open {
            background: var(--yellow);
            color: var(--ink);
        }

        .th-filter-btn.active::after {
            content: "";
            position: absolute;
            right: 2px;
            top: 2px;
            width: 6px;
            height: 6px;
            border: 2px solid #fff8d8;
            border-radius: 50%;
            background: var(--red);
        }

        #clearColumnFilters::before {
            content: "↺";
            width: auto;
            height: auto;
            background: none;
            clip-path: none;
            font-size: 16px;
            font-weight: 700;
            line-height: 1;
        }

        .th-filter-popover {
            position: absolute;
            top: calc(100% - 3px);
            right: 6px;
            z-index: 20;
            display: none;
            width: 190px;
            padding: 9px;
            border: 2px solid #e1d6bd;
            border-radius: 12px;
            background: white;
            box-shadow: 0 12px 28px rgba(72, 59, 31, .18);
        }

        .th-filter-popover.show {
            display: block;
            animation: pop .16s ease both;
        }

        .column-filter {
            width: 100%;
            min-width: 78px;
            min-height: 36px;
            padding: 6px 8px;
            border: 2px solid #e9e2d2;
            border-radius: 10px;
            background: white;
            color: var(--ink);
            font-size: 12px;
            font-weight: 600;
        }

        tbody tr {
            transition: background .16s ease, transform .16s ease;
        }

        tbody tr:hover {
            background: #fffdf6;
        }

        .number {
            text-align: right;
            font-variant-numeric: tabular-nums;
        }

        .file-code {
            display: inline-block;
            padding: 5px 8px;
            border-radius: 9px;
            background: #eff7fb;
            color: #287a9f;
            font-weight: 700;
            letter-spacing: .2px;
        }

        .muted {
            color: #a19b8f;
        }

        .note-cell {
            max-width: 170px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .status-pill {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 6px 9px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 700;
            white-space: nowrap;
        }

        .status-complete {
            color: #17724f;
            background: #ddf8eb;
        }

        .status-fixed {
            color: #53602c;
            background: #f0f5cf;
        }

        .status-issue {
            color: #b2303e;
            background: #fee4e7;
        }

        .status-pending {
            color: #8a6418;
            background: #fff0be;
        }

        .status-fixing {
            color: #70520c;
            background: #ffedaa;
        }

        .status-incomplete {
            color: #355f96;
            background: #e3efff;
        }

        .status-inconsistent {
            color: #7c2f91;
            background: #f4e3fa;
        }

        .table-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 13px 18px 17px;
            color: var(--ink-soft);
            font-size: 13px;
            font-weight: 600;
        }

        .pagination {
            display: flex;
            align-items: center;
            gap: 7px;
        }

        .empty-state {
            display: grid;
            place-items: center;
            min-height: 250px;
            padding: 30px;
            text-align: center;
        }

        .empty-state[hidden],
        [hidden] {
            display: none !important;
        }

        .empty-art {
            font-size: 58px;
            animation: wiggle 2.4s ease-in-out infinite;
        }

        .empty-state h3 {
            margin: 8px 0 4px;
        }

        .empty-state p {
            margin: 0;
            color: var(--ink-soft);
            font-size: 12px;
        }

        .modal-backdrop {
            position: fixed;
            inset: 0;
            z-index: 50;
            display: none;
            place-items: center;
            padding: 18px;
            background: rgba(38, 50, 75, .46);
            backdrop-filter: blur(5px);
        }

        .modal-backdrop.show {
            display: grid;
            animation: fadeIn .18s ease both;
        }

        .modal {
            width: min(780px, 100%);
            max-height: calc(100vh - 36px);
            overflow: auto;
            border: 3px solid var(--ink);
            border-radius: 26px;
            background: var(--paper);
            box-shadow: 10px 12px 0 rgba(38, 50, 75, .23);
            animation: pop .22s ease both;
        }

        .modal.small {
            width: min(440px, 100%);
        }

        .modal-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
            padding: 21px 22px 14px;
            border-bottom: 2px dashed var(--line);
        }

        .modal-header h2 {
            margin: 0;
            font-size: 20px;
        }

        .modal-header p {
            margin: 5px 0 0;
            color: var(--ink-soft);
            font-size: 11px;
            font-weight: 600;
        }

        .modal-body {
            padding: 20px 22px;
        }

        .form-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 15px;
        }

        .field.full {
            grid-column: 1 / -1;
        }

        .field label {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin-bottom: 7px;
            font-size: 14px;
            font-weight: 700;
        }

        .required {
            color: var(--red);
        }

        textarea.control {
            min-height: 90px;
            resize: vertical;
        }

        .check-card {
            display: flex;
            min-height: 48px;
            align-items: center;
            gap: 10px;
            padding: 10px 13px;
            border: 2px solid #e9e2d2;
            border-radius: 14px;
            background: #fffdf8;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
        }

        .check-card input {
            width: 19px;
            height: 19px;
            accent-color: var(--mint-dark);
        }

        .modal-footer {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            padding: 15px 22px 22px;
        }

        .toast-stack {
            position: fixed;
            right: 18px;
            bottom: 18px;
            z-index: 100;
            display: grid;
            gap: 10px;
            width: min(360px, calc(100% - 36px));
        }

        .toast {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            padding: 13px 15px;
            border: 2px solid var(--ink);
            border-radius: 16px;
            background: white;
            box-shadow: 5px 6px 0 rgba(38, 50, 75, .18);
            font-size: 12px;
            font-weight: 700;
            animation: toastIn .25s ease both;
        }

        .toast.error {
            border-color: var(--red-dark);
            background: #fff1f2;
            color: #9f2434;
        }

        .loading {
            position: fixed;
            inset: 0;
            z-index: 200;
            display: grid;
            place-items: center;
            background: rgba(255, 250, 240, .82);
            backdrop-filter: blur(6px);
            transition: opacity .2s ease, visibility .2s ease;
        }

        .loading.hide {
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
        }

        .loading-card {
            display: grid;
            place-items: center;
            gap: 14px;
            padding: 24px 30px;
            border: 3px solid var(--ink);
            border-radius: 24px;
            background: var(--yellow);
            box-shadow: 7px 8px 0 var(--ink);
            font-weight: 700;
        }

        .loading-shinchan {
            display: block;
            width: 118px;
            height: 130px;
            object-fit: contain;
            object-position: center bottom;
            filter: drop-shadow(0 9px 7px rgba(38, 50, 75, .18));
            animation: mascotJump 1.15s ease-in-out infinite;
        }

        .demo-banner {
            display: none;
            margin: 12px 0 0;
            padding: 9px 12px;
            border: 2px dashed #9f7c1f;
            border-radius: 13px;
            background: #fff6c9;
            color: #725712;
            font-size: 11px;
            font-weight: 700;
        }

        .demo-banner.show {
            display: block;
        }

        .rights-list {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 14px;
        }

        .right-chip {
            padding: 7px 11px;
            border-radius: 999px;
            background: #fff1a8;
            font-size: 13px;
            font-weight: 700;
        }

        @keyframes pulse {
            70% {
                box-shadow: 0 0 0 9px rgba(36, 150, 111, 0);
            }

            100% {
                box-shadow: 0 0 0 0 rgba(36, 150, 111, 0);
            }
        }

        @keyframes mascotFloat {

            0%,
            100% {
                transform: translateY(0) rotate(-1deg);
            }

            50% {
                transform: translateY(-8px) rotate(1.2deg);
            }
        }

        @keyframes heroRearDance {

            0%,
            100% {
                transform: translate(0, 0) rotate(-2deg);
            }

            25% {
                transform: translate(-5px, -2px) rotate(2deg);
            }

            50% {
                transform: translate(0, -7px) rotate(-1deg);
            }

            75% {
                transform: translate(5px, -2px) rotate(3deg);
            }
        }

        @keyframes mascotSway {

            0%,
            100% {
                transform: rotate(-3deg) translateY(0);
            }

            50% {
                transform: rotate(3deg) translateY(-4px);
            }
        }

        @keyframes mascotWave {

            0%,
            100% {
                transform: rotate(-2deg) translateY(0);
            }

            50% {
                transform: rotate(2deg) translateY(-5px);
            }
        }

        @keyframes mascotJump {

            0%,
            100% {
                transform: translateY(1px) scale(1);
            }

            50% {
                transform: translateY(-10px) scale(1.03);
            }
        }

        @keyframes mascotWait {

            0%,
            100% {
                transform: translateY(0);
            }

            45% {
                transform: translateY(-3px);
            }

            55% {
                transform: translateY(-3px) rotate(2deg);
            }
        }

        @keyframes mascotPoint {

            0%,
            100% {
                transform: rotate(-2deg);
            }

            50% {
                transform: rotate(3deg) translateY(-4px);
            }
        }

        @keyframes mascotPeek {

            0%,
            100% {
                transform: translateX(0) rotate(-2deg);
            }

            50% {
                transform: translateX(5px) rotate(2deg);
            }
        }

        @keyframes mascotWrite {

            0%,
            100% {
                transform: rotate(-1deg) translateY(0);
            }

            50% {
                transform: rotate(1.5deg) translateY(-4px);
            }
        }

        @keyframes wiggle {

            0%,
            100% {
                transform: rotate(2deg);
            }

            50% {
                transform: rotate(-3deg);
            }
        }

        @keyframes blink {

            0%,
            46%,
            50%,
            100% {
                transform: scaleY(1);
            }

            48% {
                transform: scaleY(.12);
            }
        }

        @keyframes twinkle {
            from {
                transform: scale(.75) rotate(-8deg);
                opacity: .5;
            }

            to {
                transform: scale(1.18) rotate(8deg);
                opacity: 1;
            }
        }

        @keyframes growBar {
            from {
                transform: scaleY(0);
            }

            to {
                transform: scaleY(1);
            }
        }

        @keyframes pop {
            from {
                opacity: 0;
                transform: scale(.92);
            }

            to {
                opacity: 1;
                transform: scale(1);
            }
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        @keyframes toastIn {
            from {
                transform: translateX(35px);
                opacity: 0;
            }

            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        @keyframes riseBar {
            from {
                opacity: .2;
                transform: scaleY(.05);
            }

            to {
                opacity: 1;
                transform: scaleY(1);
            }
        }

        @media (max-width: 1100px) {
            .hero {
                padding-right: 285px;
            }

            .kpi-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            .chart-grid {
                grid-template-columns: 1fr;
            }

            .donut-wrap {
                grid-template-columns: 180px 1fr;
            }

            .donut {
                width: 170px;
                height: 170px;
            }
        }

        @media (max-width: 760px) {
            .app-shell {
                width: min(100% - 20px, 720px);
                padding-top: 10px;
            }

            .hero {
                min-height: 305px;
                padding: 25px 22px 150px;
                border-radius: 27px;
            }

            .hero h1 {
                letter-spacing: -1px;
            }

            .hero p {
                max-width: 100%;
            }

            .mascot-stage {
                right: 4px;
                bottom: -22px;
                transform: scale(.74);
                transform-origin: right bottom;
            }

            .speech {
                right: 184px;
                top: auto;
                bottom: 94px;
                width: 108px;
            }

            .kpi-grid {
                gap: 10px;
            }

            .kpi-card {
                min-height: 132px;
                padding: 16px;
                border-radius: 19px;
            }

            .kpi-label {
                font-size: 14px;
            }

            .kpi-shinchan {
                width: 82px;
                height: 102px;
            }

            .kpi-foot {
                font-size: 12px;
            }

            .panel,
            .data-panel {
                border-radius: 20px;
            }

            .panel-header {
                flex-wrap: wrap;
                padding: 15px 16px 8px;
            }

            .panel-heading-with-mascot {
                gap: 8px;
            }

            .section-shinchan {
                width: 58px;
                height: 64px;
                flex-basis: 58px;
            }

            .panel-badge {
                margin-left: auto;
            }

            .data-titlebar {
                min-height: 82px;
                padding: 10px 15px 6px;
            }

            .data-titlebar h2 {
                font-size: 16px;
            }

            .data-shinchan {
                width: 76px;
                height: 74px;
            }

            .donut-wrap {
                grid-template-columns: 135px 1fr;
                padding: 18px;
            }

            .donut {
                width: 132px;
                height: 132px;
            }

            .donut::after {
                inset: 25px;
            }

            .toolbar {
                padding: 15px;
            }

            select.control {
                flex: 1 1 135px;
                min-width: 0;
            }

            .btn-primary {
                flex: 1 1 100%;
            }

            .table-scroll {
                overflow: visible;
                padding: 10px;
            }

            table,
            thead,
            tbody,
            tr,
            th,
            td {
                display: block;
                min-width: 0;
            }

            thead {
                display: none;
            }

            tbody {
                display: grid;
                gap: 10px;
            }

            tbody tr {
                padding: 12px;
                border: 2px solid var(--line);
                border-radius: 17px;
                background: #fff;
                box-shadow: 0 4px 10px rgba(72, 59, 31, .06);
            }

            tbody td {
                display: grid;
                grid-template-columns: minmax(105px, .8fr) minmax(0, 1.25fr);
                gap: 10px;
                padding: 7px 4px;
                border: 0;
                text-align: left;
            }

            tbody td::before {
                content: attr(data-label);
                color: var(--ink-soft);
                font-size: 12px;
                font-weight: 700;
            }

            .note-cell {
                max-width: none;
                white-space: normal;
                word-break: break-word;
            }

            .actions-cell {
                align-items: center;
            }

            .table-footer {
                padding: 11px 15px 16px;
            }

            .form-grid {
                grid-template-columns: 1fr;
            }

            .field.full {
                grid-column: auto;
            }
        }

        @media (max-width: 460px) {
            .kpi-grid {
                grid-template-columns: 1fr;
            }

            .hero-meta {
                display: none;
            }

            .hero {
                min-height: 275px;
                padding-bottom: 130px;
            }

            .mascot-stage {
                transform: scale(.66);
            }

            .donut-wrap {
                grid-template-columns: 1fr;
                justify-items: center;
            }

            .legend {
                width: 100%;
            }

            .panel-badge {
                display: none;
            }

            .data-titlebar p {
                max-width: 220px;
            }

            .modal-body,
            .modal-header,
            .modal-footer {
                padding-left: 16px;
                padding-right: 16px;
            }

            .modal-footer {
                flex-direction: column-reverse;
            }

            .modal-footer .btn {
                width: 100%;
            }
        }

        @media (prefers-reduced-motion: reduce) {

            *,
            *::before,
            *::after {
                animation-duration: .001ms !important;
                animation-iteration-count: 1 !important;
                scroll-behavior: auto !important;
                transition-duration: .001ms !important;
            }
        }

/* --- fix: filter popover โดนขอบซ้ายของ .table-scroll ตัด --- */
th:first-child .th-filter-popover,
th:nth-child(2) .th-filter-popover {
    right: auto;
    left: 0;
}

/* --- checkbox ไม่ประสงค์เบิก --- */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--red-dark);
}

.claim-flag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 9px;
    background: #fdeaea;
    color: var(--red-dark);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
