:root {
    --bg: #f4f1ea;
    --panel: rgba(255, 255, 255, 0.78);
    --panel-strong: #fffdf8;
    --text: #1f1d1a;
    --muted: #6f675f;
    --line: rgba(41, 32, 23, 0.1);
    --brand: #0d7a63;
    --brand-dark: #085244;
    --accent: #f28c28;
    --danger: #b33a3a;
    --shadow: 0 20px 45px rgba(68, 47, 24, 0.08);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    line-height: 1.5;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(242, 140, 40, 0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(13, 122, 99, 0.18), transparent 24%),
        linear-gradient(180deg, #fbf8f1 0%, #f1ece2 100%);
}

html {
    scroll-behavior: smooth;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
    background: #1c1712;
    color: #f6eee2;
    padding: 28px 22px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 24px;
    position: sticky;
    top: 0;
    min-height: 100vh;
}

.sidebar-main {
    display: grid;
    align-content: start;
    gap: 24px;
}

.brand {
    font-size: 30px;
    font-weight: 700;
}

.brand-sub,
.user-meta span,
.hint,
.eyebrow,
.panel-head p {
    color: rgba(255, 244, 229, 0.72);
}

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

.nav a {
    padding: 12px 14px;
    border-radius: 8px;
    color: rgba(255, 244, 229, 0.9);
}

.nav a.active,
.nav a:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-footer {
    display: grid;
    gap: 16px;
    margin-top: auto;
}

.user-meta {
    display: grid;
    gap: 4px;
}

.page {
    padding: 28px;
    display: grid;
    gap: 22px;
    min-width: 0;
}

.hero,
.panel,
.stat-card,
.auth-card,
.install-card {
    background: var(--panel);
    backdrop-filter: blur(14px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero {
    padding: 28px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
}

.hero.compact {
    align-items: center;
}

.hero h1,
.auth-card h1,
.install-card h1 {
    margin: 8px 0 10px;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.05;
}

.hero p,
.auth-card p,
.install-card p {
    margin: 0;
    color: var(--muted);
    max-width: 760px;
    overflow-wrap: anywhere;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-actions form {
    margin: 0;
}

.stats-grid,
.split {
    display: grid;
    gap: 18px;
}

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

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

.split-wide {
    grid-template-columns: 1.35fr 0.9fr;
}

.split-single {
    grid-template-columns: minmax(0, 1fr);
}

.stat-card {
    padding: 22px;
    display: grid;
    gap: 10px;
}

.stat-card span {
    color: var(--muted);
}

.stat-card strong {
    font-size: 42px;
}

.stat-card .stat-label {
    font-size: 20px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.panel {
    padding: 22px;
}

.quota-banner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 18px 20px;
    border-radius: 8px;
    border: 1px solid rgba(13, 122, 99, 0.14);
    background: rgba(13, 122, 99, 0.08);
}

.quota-banner-danger {
    border-color: rgba(179, 58, 58, 0.18);
    background: rgba(179, 58, 58, 0.08);
}

.quota-banner-copy {
    display: grid;
    gap: 6px;
}

.quota-banner-copy strong {
    font-size: 18px;
}

.quota-banner-copy p {
    margin: 0;
    color: var(--muted);
}

.quota-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 16px;
}

.panel-head h2 {
    margin: 0;
    font-size: 22px;
}

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

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

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

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

.compact-grid input {
    min-height: 46px;
}

.check-line {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.check-line input {
    width: auto;
}

.help-text {
    margin: -2px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.template-token-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.token-chip {
    border: 1px solid rgba(13, 122, 99, 0.18);
    background: rgba(13, 122, 99, 0.08);
    color: var(--brand-dark);
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
}

.token-chip:hover {
    background: rgba(13, 122, 99, 0.14);
}

.template-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 13px;
}

.preview-stack {
    display: grid;
    gap: 14px;
}

.template-preview-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    padding: 14px;
    display: grid;
    gap: 10px;
}

.template-preview-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
    flex-wrap: wrap;
}

.template-preview-card pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
}

.placeholder-table {
    display: grid;
    gap: 10px;
}

.placeholder-row {
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.placeholder-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.empty-state-inline {
    border: 1px dashed rgba(20, 18, 16, 0.14);
    border-radius: 8px;
    padding: 18px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.5);
}

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

.media-ready-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
}

.media-ready-preview {
    background: rgba(28, 23, 18, 0.04);
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.media-ready-preview img,
.media-ready-preview video {
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
}

.media-ready-audio,
.media-ready-file {
    width: 100%;
    display: grid;
    gap: 10px;
    justify-items: center;
    text-align: center;
    color: var(--muted);
}

.media-ready-audio audio {
    width: 100%;
}

.media-ready-file strong {
    font-size: 26px;
    color: var(--text);
}

.media-ready-body {
    padding: 16px;
    display: grid;
    gap: 12px;
    min-width: 0;
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

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

.mini-stat {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.68);
    display: grid;
    gap: 6px;
}

.mini-stat span {
    color: var(--muted);
    font-size: 13px;
}

.mini-stat strong {
    font-size: 28px;
    line-height: 1;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

.inline-check {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.inline-check input {
    width: auto;
}

.inline-limit-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-limit-form input {
    width: 110px;
}

.copy-field {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
    flex-wrap: wrap;
}

.copy-field input {
    min-width: 0;
    flex: 1 1 240px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
}

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

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(20, 18, 16, 0.14);
    border-radius: 8px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
}

.select2-container {
    width: 100% !important;
}

.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
    min-height: 48px;
    border: 1px solid rgba(20, 18, 16, 0.14) !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--text);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text);
    line-height: 46px;
    padding-left: 14px;
    padding-right: 40px;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--muted);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px;
    right: 10px;
}

.select2-container--default .select2-selection--multiple {
    padding: 6px 10px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    margin-top: 4px;
    background: rgba(13, 122, 99, 0.08);
    border: 1px solid rgba(13, 122, 99, 0.14);
    border-radius: 999px;
    color: #0c6654;
    padding: 2px 10px;
}

.select2-dropdown {
    border: 1px solid rgba(20, 18, 16, 0.14) !important;
    border-radius: 8px !important;
    overflow: hidden;
    box-shadow: 0 18px 36px rgba(68, 47, 24, 0.12);
}

.select2-search--dropdown {
    padding: 10px;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid rgba(20, 18, 16, 0.14) !important;
    border-radius: 8px;
    padding: 10px 12px;
    min-height: 42px;
}

.select2-results__option {
    padding: 10px 12px;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: var(--brand);
    color: #fff;
}

.select2-container--default .select2-results__option--selected {
    background: rgba(13, 122, 99, 0.08);
    color: var(--text);
}

input,
select {
    min-height: 48px;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.btn {
    appearance: none;
    border: 0;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.18s ease, opacity 0.18s ease;
    white-space: normal;
    text-align: center;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--brand);
    color: #fff;
}

.btn-secondary {
    background: #ece6db;
    color: var(--text);
}

.btn-dark {
    background: #2c261f;
    color: #fff;
}

.btn-danger {
    background: #f8e4e4;
    color: var(--danger);
}

.alert {
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(13, 122, 99, 0.1);
    border-color: rgba(13, 122, 99, 0.15);
    color: #0a5848;
}

.alert-error {
    background: rgba(179, 58, 58, 0.08);
    border-color: rgba(179, 58, 58, 0.14);
    color: #852d2d;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrap .dt-container {
    display: grid;
    gap: 14px;
}

.table-wrap .dt-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.table-wrap .dt-toolbar-left,
.table-wrap .dt-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.table-wrap .dt-layout-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.table-wrap .dt-length,
.table-wrap .dt-search,
.table-wrap .dt-info,
.table-wrap .dt-paging {
    margin: 0;
}

.table-wrap .dt-length label,
.table-wrap .dt-search label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

.table-wrap .dt-input {
    min-height: 42px;
    border: 1px solid rgba(20, 18, 16, 0.14);
    border-radius: 8px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
}

.table-wrap .dt-search input.dt-input {
    min-width: 240px;
}

.table-wrap .dt-paging-button {
    appearance: none;
    border: 1px solid rgba(20, 18, 16, 0.12) !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.92) !important;
    color: var(--text) !important;
    padding: 8px 12px !important;
    margin: 0 4px !important;
}

.table-wrap .dt-paging-button.current,
.table-wrap .dt-paging-button:hover {
    background: var(--brand) !important;
    border-color: var(--brand) !important;
    color: #fff !important;
}

.table-wrap .dt-paging-button.disabled {
    opacity: 0.45;
}

.table-wrap .dt-button,
.table-wrap button.dt-button {
    appearance: none !important;
    border: 1px solid rgba(20, 18, 16, 0.12) !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.92) !important;
    color: var(--text) !important;
    padding: 9px 12px !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.table-wrap .dt-button:hover,
.table-wrap button.dt-button:hover {
    background: var(--brand) !important;
    border-color: var(--brand) !important;
    color: #fff !important;
}

.table-wrap .dt-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-wrap .js-data-table.dataTable thead th {
    border-bottom: 1px solid var(--line);
}

.table-wrap .js-data-table.dataTable tbody tr:last-child td {
    border-bottom: 0;
}

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

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-weight: 600;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(13, 122, 99, 0.1);
    color: #0c6654;
    font-size: 13px;
}

.badge-muted {
    background: rgba(41, 32, 23, 0.08);
    color: var(--muted);
}

.badge-danger {
    background: rgba(179, 58, 58, 0.1);
    color: var(--danger);
}

.action-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-row form {
    margin: 0;
}

.stack-tight {
    display: grid;
    gap: 4px;
}

.chip-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(13, 122, 99, 0.08);
    color: #0c6654;
    font-size: 13px;
    line-height: 1.2;
}

.chip-danger {
    background: rgba(179, 58, 58, 0.1);
    color: var(--danger);
}

.info-list {
    display: grid;
    gap: 14px;
}

.info-row {
    display: grid;
    gap: 8px;
}

.info-row-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.info-row-top strong {
    font-size: 14px;
}

.info-row-top span {
    color: var(--muted);
    font-size: 13px;
}

.info-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(28, 23, 18, 0.08);
    overflow: hidden;
}

.info-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), #2ba07f);
}

.code-block {
    display: grid;
    gap: 12px;
}

.qr-wrap {
    display: flex;
    justify-content: center;
    padding: 12px 0 4px;
}

.qr-image {
    width: min(320px, 100%);
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    padding: 12px;
}

.qr-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    padding-bottom: 8px;
}

.code-block code {
    display: block;
    padding: 12px 14px;
    border-radius: 8px;
    background: #1c1712;
    color: #f8f0e3;
    overflow-wrap: anywhere;
}

.log-details {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    padding: 10px 12px;
}

.log-details summary {
    cursor: pointer;
    color: var(--brand-dark);
    font-weight: 700;
}

.log-pre {
    margin: 10px 0 0;
    padding: 12px;
    border-radius: 8px;
    background: rgba(28, 23, 18, 0.05);
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    overflow-x: auto;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.55;
    max-height: 260px;
}

.link-break {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.standalone {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card,
.install-card {
    width: min(780px, 100%);
    padding: 32px;
}

.auth-card {
    width: min(520px, 100%);
}

.eyebrow {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--brand-dark);
}

.device-mobile-sticky-actions {
    display: none;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .split-wide {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .stats-grid,
    .split,
    .grid-form {
        grid-template-columns: 1fr;
    }

    .shell {
        min-height: auto;
        display: flex;
        flex-direction: column;
    }

    .quota-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .sidebar {
        position: static;
        min-height: auto;
        padding: 18px;
        gap: 18px;
        width: 100%;
    }

    .sidebar-main {
        gap: 18px;
    }

    .nav {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        padding-bottom: 6px;
        scrollbar-width: thin;
    }

    .nav a {
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .sidebar-footer {
        margin-top: 0;
        grid-template-columns: 1fr auto;
        align-items: end;
    }

    .page {
        padding: 18px;
        gap: 18px;
        width: 100%;
    }

    .hero,
    .panel,
    .stat-card,
    .auth-card,
    .install-card {
        padding: 18px;
    }

    .hero {
        flex-direction: column;
        align-items: start;
    }

    .hero.compact {
        align-items: start;
    }

    .hero h1,
    .auth-card h1,
    .install-card h1 {
        font-size: clamp(28px, 7vw, 38px);
    }

    .panel-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .panel-head p {
        max-width: 100%;
    }

    .filter-summary {
        grid-template-columns: 1fr 1fr;
    }

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

    .media-ready-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions,
    .form-actions {
        width: 100%;
    }

    .hero-actions form,
    .form-actions .btn,
    .hero-actions .btn {
        width: 100%;
    }

    .hero-actions > a,
    .hero-actions > button {
        width: 100%;
    }

    .action-row {
        min-width: 180px;
    }

    .action-row form,
    .action-row .btn {
        width: 100%;
    }

    .code-block code {
        font-size: 13px;
    }

    table {
        min-width: 640px;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 15px;
    }

    .brand {
        font-size: 26px;
    }

    .brand-sub {
        font-size: 13px;
    }

    .sidebar {
        padding: 14px;
        gap: 14px;
    }

    .sidebar-footer {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .page {
        padding: 14px;
        gap: 14px;
    }

    .page:has(.device-mobile-sticky-actions) {
        padding-bottom: 108px;
    }

    .hero,
    .panel,
    .stat-card,
    .auth-card,
    .install-card {
        padding: 16px;
    }

    .hero h1,
    .auth-card h1,
    .install-card h1 {
        font-size: clamp(24px, 9vw, 32px);
        line-height: 1.12;
    }

    .stat-card strong {
        font-size: 34px;
    }

    .stat-card .stat-label {
        font-size: 18px;
    }

    .filter-summary {
        grid-template-columns: 1fr;
    }

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

    .mini-stat strong {
        font-size: 24px;
    }

    .inline-limit-form {
        align-items: stretch;
    }

    .inline-limit-form input,
    .inline-limit-form .btn,
    .copy-field,
    .copy-field .btn {
        width: 100%;
    }

    .copy-field {
        align-items: stretch;
    }

    .template-preview-head,
    .template-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .placeholder-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .media-ready-card {
        grid-template-columns: 1fr;
    }

    .media-ready-preview {
        min-height: 180px;
    }

    .qr-meta {
        flex-direction: column;
    }

    .qr-meta .btn,
    .qr-meta strong,
    .qr-meta .badge {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 44px;
    }

    .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 44px;
    }

    table {
        min-width: 560px;
    }

    .table-wrap .dt-layout-row {
        flex-direction: column;
        align-items: stretch;
    }

    .table-wrap .dt-search input.dt-input,
    .table-wrap .dt-length .dt-input,
    .table-wrap .dt-paging,
    .table-wrap .dt-info {
        width: 100%;
    }

    .table-wrap .dt-paging {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-start;
    }

    .table-wrap .dt-paging-button {
        margin: 0 !important;
    }

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

    .table-wrap table {
        min-width: 0;
        border-collapse: separate;
    }

    .table-wrap thead {
        display: none;
    }

    .table-wrap tbody {
        display: grid;
        gap: 12px;
    }

    .table-wrap tbody tr {
        border: 1px solid var(--line);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.82);
        padding: 12px 14px;
        box-shadow: 0 8px 20px rgba(68, 47, 24, 0.05);
    }

    .table-wrap td {
        border-bottom: 1px solid var(--line);
        padding: 9px 0;
        display: grid;
        grid-template-columns: minmax(88px, 110px) minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        overflow-wrap: anywhere;
    }

    .table-wrap td:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .table-wrap td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
        line-height: 1.3;
    }

    .table-wrap td[colspan] {
        display: block;
        padding: 2px 0;
        border-bottom: 0;
    }

    .table-wrap td[colspan]::before {
        content: none;
    }

    .table-wrap .action-row {
        min-width: 0;
        display: grid;
        gap: 8px;
    }

    .table-wrap .action-row form,
    .table-wrap .action-row .btn {
        width: 100%;
    }

    .table-wrap .js-action-heavy-table td[data-label="Status Import"],
    .table-wrap .js-action-heavy-table td[data-label="Status"],
    .table-wrap .js-action-heavy-table td[data-label="Kelola"],
    .table-wrap .js-action-heavy-table td[data-label="Sync"],
    .table-wrap .js-action-heavy-table td[data-label="Import"],
    .table-wrap .js-action-heavy-table td[data-label="Aksi"] {
        order: -1;
    }

    .table-wrap .js-action-heavy-table td[data-label="Nama Grup"],
    .table-wrap .js-action-heavy-table td[data-label="Device"] {
        order: -2;
    }

    .device-mobile-sticky-actions {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        z-index: 40;
        display: grid;
        grid-template-columns: 1.3fr 1fr 1fr 1fr;
        gap: 8px;
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: rgba(255, 253, 248, 0.95);
        backdrop-filter: blur(10px);
        box-shadow: 0 14px 34px rgba(68, 47, 24, 0.14);
    }

    .device-mobile-sticky-actions .btn {
        min-height: 44px;
        padding: 10px 12px;
        font-size: 13px;
    }
}

@media (max-width: 420px) {
    .page {
        padding: 12px;
    }

    .hero,
    .panel,
    .stat-card,
    .auth-card,
    .install-card {
        padding: 14px;
    }

    th,
    td {
        padding: 12px 10px;
    }

    .chip,
    .badge {
        font-size: 12px;
        padding: 6px 9px;
    }

    .device-mobile-sticky-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
