        :root {
            --bg: #07080d;
            --panel: rgba(18, 20, 29, 0.82);
            --panel-strong: rgba(27, 30, 42, 0.94);
            --line: rgba(255, 255, 255, 0.1);
            --line-strong: rgba(255, 255, 255, 0.2);
            --text: #f6f8ff;
            --muted: #97a0b5;
            --dim: #616b80;
            --cyan: #28e8ff;
            --blue: #6d8dff;
            --pink: #ff4fd8;
            --green: #39f59a;
            --amber: #ffbd45;
            --red: #ff5267;
            --shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
            --radius: 8px;
        }

        * {
            box-sizing: border-box;
        }

        html {
            min-height: 100%;
            background: var(--bg);
        }

        body {
            min-height: 100vh;
            margin: 0;
            color: var(--text);
            font-family: "Kanit", system-ui, sans-serif;
            background:
                linear-gradient(115deg, rgba(40, 232, 255, 0.1), transparent 28%),
                linear-gradient(245deg, rgba(255, 79, 216, 0.09), transparent 32%),
                linear-gradient(180deg, #0d1018 0%, #07080d 55%, #05060a 100%);
            overflow-x: hidden;
        }

        body::before {
            content: "";
            position: fixed;
            inset: 0;
            pointer-events: none;
            background-image:
                linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
                linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
            background-size: 42px 42px;
            mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.92), transparent 76%);
            z-index: -2;
        }

        body::after {
            content: "";
            position: fixed;
            inset: 0;
            pointer-events: none;
            background:
                repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 4px),
                radial-gradient(circle at 50% -20%, rgba(40, 232, 255, 0.14), transparent 42%);
            mix-blend-mode: screen;
            opacity: 0.35;
            z-index: -1;
        }

        .app-shell {
            width: min(1440px, calc(100% - 32px));
            margin: 0 auto;
            padding: 26px 0 42px;
        }

        .topbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 18px;
            margin-bottom: 22px;
        }

        .brand {
            display: flex;
            align-items: center;
            gap: 14px;
            min-width: 0;
        }

        .brand-mark {
            width: 52px;
            height: 52px;
            display: grid;
            place-items: center;
            border: 1px solid rgba(40, 232, 255, 0.36);
            border-radius: var(--radius);
            background:
                linear-gradient(135deg, rgba(40, 232, 255, 0.18), rgba(255, 79, 216, 0.12)),
                rgba(255, 255, 255, 0.04);
            box-shadow: 0 0 28px rgba(40, 232, 255, 0.18);
            color: var(--cyan);
            font-size: 1.35rem;
            flex: 0 0 auto;
        }

        .brand h1 {
            margin: 0;
            font-size: clamp(1.55rem, 3vw, 2.65rem);
            line-height: 1;
            font-weight: 800;
            letter-spacing: 0;
        }

        .brand p {
            margin: 7px 0 0;
            color: var(--muted);
            font-size: 0.93rem;
        }

        .status-strip {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            border: 1px solid rgba(57, 245, 154, 0.25);
            border-radius: var(--radius);
            background: rgba(57, 245, 154, 0.08);
            color: #dfffee;
            white-space: nowrap;
        }

        .pulse {
            width: 9px;
            height: 9px;
            border-radius: 50%;
            background: var(--green);
            box-shadow: 0 0 0 0 rgba(57, 245, 154, 0.55);
            animation: pulse 1.7s infinite;
        }

        @keyframes pulse {
            70% { box-shadow: 0 0 0 10px rgba(57, 245, 154, 0); }
            100% { box-shadow: 0 0 0 0 rgba(57, 245, 154, 0); }
        }

        .hero {
            position: relative;
            display: grid;
            grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
            gap: 18px;
            margin-bottom: 18px;
        }

        .hero-main,
        .panel,
        .stat-card {
            border: 1px solid var(--line);
            border-radius: var(--radius);
            background:
                linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.028)),
                var(--panel);
            box-shadow: var(--shadow);
            backdrop-filter: blur(18px);
        }

        .hero-main {
            position: relative;
            min-height: 210px;
            padding: 26px;
            overflow: hidden;
        }

        .hero-main::before {
            content: "";
            position: absolute;
            inset: 0;
            background:
                linear-gradient(90deg, rgba(40, 232, 255, 0.18), transparent 34%),
                linear-gradient(135deg, transparent 0 45%, rgba(255, 189, 69, 0.12) 45% 46%, transparent 46% 100%);
            opacity: 0.8;
        }

        .hero-content {
            position: relative;
            display: grid;
            gap: 18px;
            height: 100%;
        }

        .eyebrow {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            width: fit-content;
            padding: 7px 10px;
            border: 1px solid rgba(40, 232, 255, 0.3);
            border-radius: var(--radius);
            background: rgba(40, 232, 255, 0.09);
            color: var(--cyan);
            font-size: 0.78rem;
            font-weight: 700;
            text-transform: uppercase;
        }

        .hero h2 {
            max-width: 760px;
            margin: 0;
            font-size: clamp(2rem, 5vw, 4.5rem);
            line-height: 0.95;
            font-weight: 800;
            letter-spacing: 0;
        }

        .hero h2 span {
            color: var(--cyan);
            text-shadow: 0 0 28px rgba(40, 232, 255, 0.36);
        }

        .quick-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            align-self: end;
        }

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

        .stat-card {
            padding: 16px;
            min-height: 99px;
        }

        .stat-card .label {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin-bottom: 12px;
            color: var(--muted);
            font-size: 0.82rem;
            text-transform: uppercase;
        }

        .stat-card i {
            color: var(--cyan);
        }

        .stat-card .value {
            font-size: 2rem;
            line-height: 1;
            font-weight: 800;
        }

        .stat-card:nth-child(2) i { color: var(--green); }
        .stat-card:nth-child(3) i { color: var(--amber); }
        .stat-card:nth-child(4) i { color: var(--red); }

        .layout {
            display: grid;
            grid-template-columns: minmax(320px, 0.42fr) minmax(0, 1fr);
            gap: 18px;
            align-items: start;
        }

        .panel {
            padding: 20px;
        }

        .panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
            padding-bottom: 16px;
            margin-bottom: 18px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        }

        .panel-title {
            display: flex;
            align-items: center;
            gap: 10px;
            margin: 0;
            font-size: 1rem;
            font-weight: 800;
            letter-spacing: 0;
            text-transform: uppercase;
        }

        .panel-title i {
            color: var(--cyan);
        }

        .panel-hint {
            color: var(--dim);
            font-size: 0.83rem;
        }

        .form-grid {
            display: grid;
            gap: 14px;
        }

        .field {
            display: grid;
            gap: 8px;
        }

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

        label {
            color: var(--muted);
            font-size: 0.83rem;
            font-weight: 600;
            text-transform: uppercase;
        }

        input,
        select {
            width: 100%;
            min-height: 46px;
            border: 1px solid rgba(255, 255, 255, 0.13);
            border-radius: var(--radius);
            outline: none;
            background: rgba(4, 6, 12, 0.68);
            color: var(--text);
            padding: 0 13px;
            font: 500 0.96rem "Kanit", system-ui, sans-serif;
            transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
        }

        input:focus,
        select:focus {
            border-color: rgba(40, 232, 255, 0.72);
            background: rgba(5, 9, 18, 0.92);
            box-shadow: 0 0 0 4px rgba(40, 232, 255, 0.12);
        }

        input::placeholder {
            color: rgba(151, 160, 181, 0.65);
        }

        .button {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            min-height: 42px;
            border: 1px solid rgba(255, 255, 255, 0.13);
            border-radius: var(--radius);
            padding: 0 14px;
            background: rgba(255, 255, 255, 0.06);
            color: var(--text);
            font: 700 0.9rem "Kanit", system-ui, sans-serif;
            cursor: pointer;
            transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
            white-space: nowrap;
        }

        .button:hover:not(:disabled) {
            transform: translateY(-1px);
            border-color: rgba(40, 232, 255, 0.42);
            background: rgba(40, 232, 255, 0.09);
            box-shadow: 0 10px 28px rgba(40, 232, 255, 0.12);
        }

        .button:disabled {
            cursor: not-allowed;
            opacity: 0.42;
        }

        .button-primary {
            border-color: rgba(40, 232, 255, 0.5);
            background: linear-gradient(135deg, var(--cyan), var(--blue));
            color: #02050a;
            box-shadow: 0 16px 34px rgba(40, 232, 255, 0.2);
        }

        .button-danger {
            border-color: rgba(255, 82, 103, 0.35);
            color: #ffd7dd;
            background: rgba(255, 82, 103, 0.12);
        }

        .button-warn {
            border-color: rgba(255, 189, 69, 0.38);
            color: #ffe4b4;
            background: rgba(255, 189, 69, 0.12);
        }

        .button-success {
            border-color: rgba(57, 245, 154, 0.35);
            color: #dfffee;
            background: rgba(57, 245, 154, 0.11);
        }

        .button-icon {
            width: 38px;
            min-height: 38px;
            padding: 0;
        }

        .button-block {
            width: 100%;
            min-height: 50px;
            font-size: 1rem;
        }

        .toolbar {
            display: grid;
            grid-template-columns: minmax(220px, 1fr) auto;
            gap: 12px;
            margin-bottom: 14px;
        }

        .search-wrap {
            position: relative;
        }

        .search-wrap i {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--dim);
        }

        .search-wrap input {
            padding-left: 40px;
        }

        .bulk-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 9px;
            justify-content: flex-end;
        }

        .filters {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 18px;
        }

        .filter-group {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 8px;
            padding: 8px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: var(--radius);
            background: rgba(4, 6, 12, 0.32);
        }

        .filter-label {
            color: var(--dim);
            font-size: 0.8rem;
            font-weight: 700;
            padding: 0 4px;
            text-transform: uppercase;
        }

        .chip {
            min-height: 34px;
            border: 1px solid transparent;
            border-radius: var(--radius);
            padding: 0 11px;
            background: rgba(255, 255, 255, 0.055);
            color: var(--muted);
            font: 700 0.82rem "Kanit", system-ui, sans-serif;
            cursor: pointer;
            transition: 0.18s ease;
        }

        .chip:hover {
            color: var(--text);
            background: rgba(255, 255, 255, 0.09);
        }

        .chip.active {
            border-color: rgba(40, 232, 255, 0.45);
            background: rgba(40, 232, 255, 0.12);
            color: var(--cyan);
        }

        .table-wrap {
            overflow-x: auto;
            padding-bottom: 2px;
        }

        .table-wrap::-webkit-scrollbar {
            height: 8px;
        }

        .table-wrap::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 999px;
        }

        .table-wrap::-webkit-scrollbar-thumb {
            background: rgba(40, 232, 255, 0.35);
            border-radius: 999px;
        }

        table {
            width: 100%;
            min-width: 890px;
            border-collapse: separate;
            border-spacing: 0 8px;
        }

        th {
            padding: 0 12px 8px;
            color: var(--dim);
            font-size: 0.76rem;
            font-weight: 800;
            text-align: left;
            text-transform: uppercase;
        }

        th:first-child,
        td:first-child {
            text-align: center;
            width: 48px;
        }

        td {
            padding: 13px 12px;
            background: rgba(8, 10, 17, 0.72);
            border-top: 1px solid rgba(255, 255, 255, 0.07);
            border-bottom: 1px solid rgba(255, 255, 255, 0.07);
            vertical-align: middle;
            transition: background 0.18s ease, border-color 0.18s ease;
        }

        td:first-child {
            border-left: 1px solid rgba(255, 255, 255, 0.07);
            border-radius: var(--radius) 0 0 var(--radius);
        }

        td:last-child {
            border-right: 1px solid rgba(255, 255, 255, 0.07);
            border-radius: 0 var(--radius) var(--radius) 0;
        }

        tr:hover td {
            background: rgba(255, 255, 255, 0.06);
            border-color: rgba(40, 232, 255, 0.18);
        }

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

        .key-code {
            max-width: 360px;
            overflow: hidden;
            text-overflow: ellipsis;
            color: #fff;
            font-family: "Consolas", "Courier New", monospace;
            font-size: 0.95rem;
            font-weight: 700;
            white-space: nowrap;
        }

        .badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            min-height: 28px;
            border-radius: var(--radius);
            padding: 0 9px;
            font-size: 0.76rem;
            font-weight: 800;
            text-transform: uppercase;
        }

        .badge-v1 {
            border: 1px solid rgba(255, 82, 103, 0.38);
            background: rgba(255, 82, 103, 0.12);
            color: #ff9aaa;
        }

        .badge-v2 {
            border: 1px solid rgba(57, 245, 154, 0.34);
            background: rgba(57, 245, 154, 0.12);
            color: #8bffc5;
        }

        .badge-v3 {
            border: 1px solid rgba(255, 189, 69, 0.38);
            background: rgba(255, 189, 69, 0.12);
            color: #ffe4b4;
        }

        .plan-pill {
            color: #eaf0ff;
            font-weight: 700;
        }

        .expiry {
            display: grid;
            gap: 3px;
        }

        .expiry strong {
            color: var(--green);
            font-size: 0.88rem;
        }

        .expiry small {
            color: var(--dim);
        }

        .expiry.expired strong {
            color: var(--red);
        }

        .expiry.pending strong {
            color: var(--amber);
        }

        .hwid {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            max-width: 210px;
            border: 1px solid rgba(255, 255, 255, 0.09);
            border-radius: var(--radius);
            padding: 7px 9px;
            background: rgba(255, 255, 255, 0.045);
            color: var(--muted);
            font-family: "Consolas", "Courier New", monospace;
            font-size: 0.76rem;
        }

        .hwid.locked {
            border-color: rgba(40, 232, 255, 0.28);
            background: rgba(40, 232, 255, 0.1);
            color: #bff7ff;
        }

        .actions {
            display: flex;
            flex-wrap: nowrap;
            gap: 7px;
        }

        input[type="checkbox"] {
            width: 18px;
            height: 18px;
            accent-color: var(--cyan);
            cursor: pointer;
        }

        .empty-state {
            padding: 46px 16px;
            text-align: center;
            color: var(--dim);
        }

        .empty-state i {
            display: block;
            margin-bottom: 10px;
            color: rgba(40, 232, 255, 0.36);
            font-size: 2rem;
        }

        .modal-grid {
            display: grid;
            gap: 12px;
            text-align: left;
        }

        .modal-grid label {
            color: #b5bfd6;
        }

        .modal-grid input,
        .modal-grid select {
            background: #090b12;
            border-color: rgba(255, 255, 255, 0.16);
        }

        .swal2-popup {
            border: 1px solid rgba(255, 255, 255, 0.12) !important;
            border-radius: 8px !important;
            background:
                linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
                #11131c !important;
            color: var(--text) !important;
            box-shadow: var(--shadow) !important;
        }

        .swal2-title {
            color: var(--text) !important;
        }

        .swal2-html-container {
            color: var(--muted) !important;
        }

        .aside-stack {
            display: grid;
            gap: 18px;
        }

        @media (max-width: 1080px) {
            .hero,
            .layout {
                grid-template-columns: 1fr;
            }

            .hero-main {
                min-height: 250px;
            }
        }

        @media (max-width: 760px) {
            .app-shell {
                width: min(100% - 22px, 1440px);
                padding-top: 16px;
            }

            .topbar,
            .toolbar {
                grid-template-columns: 1fr;
                flex-direction: column;
                align-items: stretch;
            }

            .status-strip,
            .bulk-actions,
            .quick-actions {
                justify-content: flex-start;
            }

            .hero-main,
            .panel {
                padding: 16px;
            }

            .stat-stack,
            .field-row {
                grid-template-columns: 1fr;
            }

            .brand h1 {
                font-size: 1.65rem;
            }
        }

        @media (max-width: 640px) {
            body {
                background:
                    linear-gradient(145deg, rgba(40, 232, 255, 0.11), transparent 34%),
                    linear-gradient(180deg, #0d1018 0%, #07080d 62%, #05060a 100%);
            }

            .app-shell {
                width: min(100% - 16px, 1440px);
                padding-top: 12px;
                padding-bottom: 18px;
            }

            .topbar {
                gap: 12px;
                margin-bottom: 16px;
            }

            .brand {
                gap: 10px;
            }

            .brand-mark {
                width: 46px;
                height: 46px;
                font-size: 1.25rem;
            }

            .brand h1 {
                font-size: 1.38rem;
                line-height: 1.05;
            }

            .brand p {
                font-size: 0.78rem;
            }

            .status-strip {
                width: 100%;
                min-height: 40px;
            }

            .hero,
            .layout,
            .aside-stack {
                gap: 12px;
            }

            .hero-main {
                min-height: auto;
            }

            .hero-content {
                gap: 14px;
            }

            .hero h2 {
                max-width: 100%;
                font-size: clamp(2.2rem, 14vw, 3.7rem);
                line-height: 0.98;
            }

            .quick-actions,
            .bulk-actions {
                display: grid;
                grid-template-columns: 1fr;
                width: 100%;
            }

            .quick-actions .button,
            .bulk-actions .button {
                width: 100%;
                justify-content: center;
            }

            .stat-stack {
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 10px;
            }

            .stat-card {
                min-height: 112px;
                padding: 14px;
            }

            .stat-card .value {
                font-size: 1.85rem;
            }

            .panel {
                padding: 14px;
            }

            .panel-header {
                gap: 8px;
            }

            .panel-title {
                font-size: 0.98rem;
            }

            .field-row {
                gap: 12px;
            }

            .button,
            input,
            select {
                min-height: 46px;
            }

            .toolbar {
                gap: 10px;
            }

            .filters {
                display: grid;
                gap: 9px;
            }

            .filter-group {
                overflow-x: auto;
                flex-wrap: nowrap;
                scrollbar-width: none;
            }

            .filter-group::-webkit-scrollbar {
                display: none;
            }

            .chip {
                flex: 0 0 auto;
            }

            .table-wrap {
                overflow: visible;
            }

            table,
            thead,
            tbody,
            tr,
            td {
                display: block;
                width: 100%;
            }

            table {
                min-width: 0;
                border-spacing: 0;
            }

            thead {
                display: none;
            }

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

            tr {
                padding: 12px;
                border: 1px solid rgba(255, 255, 255, 0.09);
                border-radius: var(--radius);
                background: rgba(8, 10, 17, 0.72);
            }

            td,
            td:first-child,
            td:last-child {
                display: grid;
                grid-template-columns: 92px minmax(0, 1fr);
                align-items: center;
                gap: 10px;
                width: 100%;
                padding: 9px 0;
                border: 0;
                border-radius: 0;
                background: transparent;
                text-align: left;
            }

            td::before {
                content: attr(data-label);
                color: var(--dim);
                font-size: 0.72rem;
                font-weight: 800;
                text-transform: uppercase;
            }

            tr:hover td {
                background: transparent;
            }

            .key-cell {
                min-width: 0;
            }

            .key-code {
                max-width: 100%;
                min-width: 0;
            }

            .hwid {
                max-width: 100%;
                min-width: 0;
                overflow: hidden;
                text-overflow: ellipsis;
            }

            .actions {
                justify-content: flex-start;
            }

            .empty-state {
                padding: 28px 12px;
            }
        }

        @media (max-width: 380px) {
            .stat-stack {
                grid-template-columns: 1fr;
            }

            .hero h2 {
                font-size: 2.05rem;
            }

            td,
            td:first-child,
            td:last-child {
                grid-template-columns: 1fr;
                gap: 6px;
            }
        }
