/* Style halaman extensions; urutan selector dipertahankan untuk menjaga cascade. */
.ext-page {
    color: #302823;
}

.ext-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    margin-bottom: 18px;
    border: 1px solid #efd6a0;
    border-radius: 12px;
    background: linear-gradient(105deg, #fff3d8 0%, #fff8eb 62%, #fffdf8 100%);
}

.ext-eyebrow {
    margin: 0 0 7px;
    color: #966516;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
}

.ext-hero h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 650;
    letter-spacing: -0.8px;
}

.ext-subtitle {
    margin: 9px 0 0;
    color: #766554;
    font-size: 12px;
}

.ext-primary,
.ext-secondary,
.ext-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 16px;
    border-radius: 7px;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

.ext-primary {
    border: 1px solid #d98b19;
    background: #ffbd32;
    color: #291c0b;
    box-shadow: 0 3px 8px #8b5a1517;
}

.ext-primary:hover {
    background: #ffca57;
}

.ext-secondary {
    border: 1px solid #e4c27d;
    background: #fff8e8;
    color: #845711;
}

.ext-ghost {
    border: 1px solid #e2dbd2;
    background: #fff;
    color: #635950;
}

.ext-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.ext-stat {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    min-width: 0;
    padding: 18px;
    border: 1px solid #e8e1d8;
    border-radius: 10px;
    background: #fffefa;
}

.ext-stat-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 9px;
    font-size: 17px;
}

.ext-stat-icon--gold {
    background: #fff0d1;
    color: #ae751a;
}

.ext-stat-icon--green {
    background: #eaf6ec;
    color: #3e8050;
}

.ext-stat-icon--gray {
    background: #f0eeeb;
    color: #777069;
}

.ext-stat-icon--blue {
    background: #eaf2fb;
    color: #4777a8;
}

.ext-stat div > span {
    display: block;
    color: #756b62;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ext-stat strong {
    display: block;
    margin: 1px 0 -1px;
    color: #51463c;
    font-size: 25px;
    font-weight: 550;
    line-height: 1.35;
}

.ext-stat small {
    color: #9a9087;
    font-size: 9px;
}

.ext-panel {
    border: 1px solid #e5ded5;
    border-radius: 11px;
    background: #fffefa;
    overflow: hidden;
}

.ext-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid #eee8df;
}

.ext-panel-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 650;
}

.ext-panel-head p {
    margin: 4px 0 0;
    color: #887d73;
    font-size: 10px;
}

.ext-icon-button,
.ext-actions button,
.ext-dialog-close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #e6dfd6;
    border-radius: 7px;
    background: transparent;
    color: #887a69;
}

.ext-icon-button:hover,
.ext-actions button:hover,
.ext-dialog-close:hover {
    background: #fff3dc;
    color: #83570f;
}

.ext-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    border-bottom: 1px solid #eee8df;
    background: #fffcf7;
}

.ext-search {
    display: flex;
    align-items: center;
    gap: 9px;
    width: min(390px, 100%);
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid #dfd8ce;
    border-radius: 7px;
    background: #fff;
    color: #9b8f83;
}

.ext-search input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #443a33;
    font-size: 11px;
}

.ext-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    color: #7d7167;
    font-size: 10px;
}

.ext-filter select {
    min-height: 38px;
    padding: 0 30px 0 10px;
    border: 1px solid #dfd8ce;
    border-radius: 7px;
    background: #fff;
    color: #554b43;
    font-size: 11px;
}

.ext-table-wrap {
    overflow-x: auto;
}

.ext-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.ext-table th {
    padding: 12px 16px;
    background: #faf7f2;
    color: #877b70;
    text-align: left;
    font-size: 9px;
    font-weight: 650;
    letter-spacing: 0.45px;
    text-transform: uppercase;
}

.ext-table td {
    padding: 15px 16px;
    border-top: 1px solid #f0ebe4;
    color: #62584f;
    vertical-align: middle;
}

.ext-table td strong {
    color: #433a33;
    font-weight: 600;
}

.ext-table td small {
    display: block;
    margin-top: 2px;
    color: #958b82;
    font-size: 9px;
}

.ext-table td:nth-child(2) {
    display: flex;
    align-items: center;
    gap: 9px;
}

.ext-user-avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 50%;
    background: #f6e7cb;
    color: #895c17;
    font-weight: 650;
}

.ext-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border: 1px solid #ded8d1;
    border-radius: 20px;
    background: #f5f2ee;
    color: #716961;
    font-size: 9px;
    white-space: nowrap;
}

.ext-status i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.ext-status[data-status="online"] {
    border-color: #bfddc6;
    background: #edf8ef;
    color: #397247;
}

.ext-status[data-status="busy"] {
    border-color: #f0cd91;
    background: #fff5df;
    color: #9a6818;
}

.ext-actions {
    width: 50px;
    text-align: right;
}

.ext-actions button {
    width: 30px;
    height: 30px;
    margin-left: auto;
    border-color: transparent;
}

.ext-empty {
    display: flex;
    min-height: 285px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 38px 20px;
    text-align: center;
}

.ext-empty > span {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border: 1px solid #ecdfca;
    border-radius: 14px;
    background: #fff9ed;
    color: #ad7a29;
    font-size: 21px;
}

.ext-empty h3 {
    margin: 12px 0 4px;
    font-size: 13px;
}

.ext-empty p {
    max-width: 380px;
    margin: 0 0 15px;
    color: #8b8178;
    font-size: 10px;
}

.ext-table-footer {
    padding: 12px 22px;
    border-top: 1px solid #eee8df;
}

.ext-table-footer p {
    margin: 0;
    color: #8e8379;
    font-size: 9px;
}

.ext-dialog {
    width: min(620px, calc(100% - 32px));
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: #fffefa;
    box-shadow: 0 24px 70px #20160f42;
    color: #342b25;
}

.ext-dialog::backdrop {
    background: #1d1714a3;
    backdrop-filter: blur(2px);
}

.ext-dialog form > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 21px 24px;
    border-bottom: 1px solid #ece5dc;
}

.ext-dialog h2 {
    margin: 0;
    font-size: 18px;
}

.ext-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 16px;
    padding: 24px;
}

.ext-form-grid label {
    display: grid;
    gap: 7px;
    color: #62574d;
    font-size: 10px;
}

.ext-form-grid label > span {
    font-weight: 600;
}

.ext-form-grid b {
    color: #b34438;
}

.ext-form-grid input,
.ext-form-grid select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #dcd4ca;
    border-radius: 7px;
    background: #fff;
    color: #3e352f;
    font: inherit;
}

.ext-form-grid input:focus,
.ext-form-grid select:focus {
    border-color: #cf9b42;
    outline: 3px solid #ffbd3224;
}

.ext-form-grid small {
    color: #968b81;
    font-size: 9px;
}

.ext-form-error {
    margin: -8px 24px 18px;
    padding: 9px 11px;
    border: 1px solid #e6b7b1;
    border-radius: 6px;
    background: #fff2f0;
    color: #97443b;
    font-size: 10px;
}

.ext-dialog form > footer {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding: 16px 24px;
    border-top: 1px solid #ece5dc;
    background: #fcf9f5;
}

.ext-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 60;
    max-width: 360px;
    padding: 12px 16px;
    border: 1px solid #c9d9c9;
    border-radius: 8px;
    background: #f1faf1;
    box-shadow: 0 8px 30px #20160f24;
    color: #3d6944;
    font-size: 11px;
}

@media (max-width: 1050px) {
    .ext-stats {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 680px) {
    .ext-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 22px;
    }

    .ext-hero .ext-primary {
        width: 100%;
    }

    .ext-stats {
        gap: 10px;
    }

    .ext-stat {
        padding: 14px 12px;
    }

    .ext-stat-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .ext-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .ext-search {
        width: 100%;
    }

    .ext-filter {
        margin-left: 0;
    }

    .ext-filter select {
        flex: 1;
    }

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

    .ext-table thead {
        display: none;
    }

    .ext-table,
    .ext-table tbody,
    .ext-table tr,
    .ext-table td {
        display: block;
    }

    .ext-table tr {
        padding: 10px 15px;
        border-top: 1px solid #eee8df;
    }

    .ext-table td {
        display: flex !important;
        justify-content: space-between;
        gap: 14px;
        padding: 7px 0;
        border: 0;
        text-align: right;
    }

    .ext-table td::before {
        content: attr(data-label);
        color: #91867c;
        font-size: 9px;
        text-transform: uppercase;
    }

    .ext-table td:nth-child(2) {
        justify-content: flex-end;
    }

    .ext-table td:nth-child(2)::before {
        margin-right: auto;
    }

    .ext-actions {
        width: auto;
    }

    .ext-actions::before {
        display: none;
    }

    .ext-actions button {
        margin-left: auto;
    }

    .ext-toast {
        inset: auto 16px 16px;
        max-width: none;
    }
}

@media (max-width: 420px) {
    .ext-stats {
        grid-template-columns: 1fr;
    }

    .ext-form-grid {
        padding: 20px;
    }

    .ext-dialog form > header,
    .ext-dialog form > footer {
        padding-inline: 20px;
    }
}

.ext-api-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #66816c;
    font-size: 10px;
}

.ext-api-state::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.ext-table th button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
}

.ext-table th button i {
    font-size: 9px;
}

.ext-value-empty {
    color: #aaa199;
}

.ext-status[data-status="registered"] {
    border-color: #bfddc6;
    background: #edf8ef;
    color: #397247;
}

.ext-loading {
    display: flex;
    min-height: 245px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #897e74;
    font-size: 10px;
}

.ext-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #eee5d7;
    border-top-color: #bd8122;
    border-radius: 50%;
    animation: ext-spin 0.75s linear infinite;
}

.ext-loading p {
    margin: 10px 0 0;
}

@keyframes ext-spin {
    to {
        transform: rotate(360deg);
    }
}

.ext-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ext-pagination {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #736960;
    font-size: 9px;
}

.ext-pagination button {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    padding: 0;
    border: 1px solid #e1dad1;
    border-radius: 6px;
    background: #fff;
    color: #776b60;
}

.ext-pagination button:disabled,
[data-ext-refresh]:disabled {
    cursor: wait;
    opacity: 0.45;
}

.ext-toast--error {
    border-color: #e6b7b1;
    background: #fff2f0;
    color: #97443b;
}

@media (max-width: 680px) {
    .ext-table-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .ext-pagination {
        align-self: stretch;
        justify-content: space-between;
    }
}

@media (min-width: 681px) {
    .ext-table td:nth-child(2) {
        display: table-cell;
    }
}

.ext-status[data-status="unregistered"] {
    border-color: #ded8d1;
    background: #f5f2ee;
    color: #716961;
}

.ext-hero-actions,
.ext-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ext-action-heading {
    width: 132px;
    text-align: center !important;
}

.ext-row-actions {
    justify-content: center;
    white-space: nowrap;
}

.ext-row-actions button {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #e6dfd6;
    border-radius: 7px;
    background: #fff;
    color: #786c61;
}

.ext-row-actions button:hover {
    border-color: #e4c27d;
    background: #fff3dc;
    color: #83570f;
}

.ext-row-actions [data-ext-delete]:hover {
    border-color: #e6b7b1;
    background: #fff2f0;
    color: #a33f35;
}

.ext-row-actions button:disabled {
    opacity: 0.5;
}

.ext-row-actions .is-spinning i {
    animation: ext-spin 0.75s linear infinite;
}

/* Status registrasi berada di antara judul dialog dan tombol tutup. */
.ext-dialog form > header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
}

.ext-dialog form > header > div:first-child {
    min-width: 0;
}

.ext-dialog-registration {
    grid-column: 2;
    justify-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}

.ext-dialog-registration[hidden] {
    display: none;
}

/* Badge status dan user agent memakai ukuran seragam, tanpa bingkai kartu. */
.ext-dialog-registration > strong,
.ext-dialog-registration > small {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid #e5ded5;
    border-radius: 20px;
    background: #f5f2ee;
    color: #716961;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.ext-dialog-registration > strong {
    gap: 6px;
    white-space: nowrap;
}

.ext-dialog-registration > strong::before {
    content: "";
    width: 7px;
    height: 7px;
    flex-shrink: 0;
    border-radius: 50%;
    background: currentColor;
}

.ext-dialog-registration[data-registration="registered"] > strong {
    border-color: #bfddc6;
    background: #edf8ef;
    color: #397247;
}

.ext-dialog form > header > .ext-dialog-close {
    grid-column: 3;
    justify-self: end;
}

/* Header tetap ringkas pada ponsel; status turun di bawah judul. */
@media (max-width: 640px) {
    .ext-dialog form > header {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .ext-dialog form > header > .ext-dialog-close {
        grid-column: 2;
        grid-row: 1;
    }

    .ext-dialog-registration {
        grid-column: 1 / -1;
        grid-row: 2;
        max-width: 100%;
    }
}

.ext-dialog form > footer > span {
    flex: 1;
}

.ext-danger-text {
    padding: 8px 0;
    border: 0;
    background: transparent;
    color: #a33f35;
    font-size: 11px;
    font-weight: 600;
}

.ext-danger-text:hover {
    color: #762a24;
}

.ext-dialog button:disabled {
    cursor: wait;
    opacity: 0.55;
}

@media (max-width: 680px) {
    .ext-hero-actions {
        width: 100%;
    }

    .ext-hero-actions button {
        flex: 1;
    }

    .ext-row-actions {
        justify-content: flex-end;
    }

    .ext-table td:last-child::before {
        margin-right: auto;
    }
}

.ext-table-wrap {
    padding: 8px 16px;
}

.ext-table {
    border: 1px solid #eee8df;
    border-radius: 8px;
    overflow: hidden;
}

@media (max-width: 680px) {
    .ext-table-wrap {
        padding: 6px 10px;
    }
}

.ext-pagination {
    gap: 4px;
}

.ext-pagination button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 34px;
    height: 36px;
    padding: 0 10px;
    gap: 5px;
    line-height: 1;
    text-align: center;
}

.ext-page-number {
    display: grid;
    place-items: center;
    min-width: 54px;
    height: 29px;
    padding: 0 9px;
    border: 1px solid #d8a94f;
    border-radius: 6px;
    background: #fff4dc;
    color: #744c0e;
    font-weight: 650;
}

.ext-pagination button:disabled {
    cursor: not-allowed;
    background: #f7f4f0;
    color: #aaa19a;
}

@media (max-width: 520px) {
    .ext-pagination button span {
        display: none;
    }

    .ext-pagination button {
        width: 32px;
        min-width: 32px;
        padding: 0;
    }
}

.ext-page-numbers {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ext-page-numbers button {
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
}

.ext-page-numbers button.is-active {
    border-color: #d8a94f;
    background: #fff0cf;
    color: #744c0e;
    font-weight: 700;
}

.ext-page-ellipsis,
.ext-page-empty {
    display: grid;
    place-items: center;
    min-width: 22px;
    height: 36px;
    color: #8f847a;
}

.ext-dialog--wide {
    width: min(920px, calc(100% - 32px));
    max-height: calc(100vh - 40px);
}

.ext-dialog--wide form {
    max-height: calc(100vh - 40px);
    overflow: auto;
}

.ext-dialog--wide form > header,
.ext-dialog--wide form > footer {
    position: sticky;
    z-index: 3;
    background: #fffefa;
}

.ext-dialog--wide form > header {
    top: 0;
}

.ext-dialog--wide form > footer {
    bottom: 0;
}

.ext-layer-list {
    display: grid;
    gap: 24px;
    padding: 22px 24px 26px;
}

.ext-form-layer {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.ext-form-layer legend {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 0 0 16px;
    color: #675e56;
    font-size: 12px;
    font-weight: 700;
}

.ext-form-layer legend::after {
    content: "";
    height: 2px;
    flex: 1;
    margin-left: 12px;
    background: #d7d0c8;
}

.ext-layer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

.ext-layer-field {
    display: grid;
    grid-template-columns: minmax(120px, 0.75fr) minmax(180px, 1.25fr);
    align-items: center;
    gap: 6px 14px;
    color: #62574d;
    font-size: 10px;
}

.ext-layer-field > span {
    font-weight: 600;
}

.ext-layer-field b {
    color: #b34438;
}

.ext-layer-field input,
.ext-layer-field select {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #dcd4ca;
    border-radius: 7px;
    background: #fff;
    color: #3e352f;
    font: inherit;
}

.ext-layer-field select[multiple] {
    min-height: 92px;
    padding: 5px;
}

.ext-layer-field input[readonly] {
    background: #f5f2ee;
    color: #7f756c;
}

.ext-layer-field input:focus,
.ext-layer-field select:focus {
    border-color: #cf9b42;
    outline: 3px solid #ffbd3224;
}

.ext-layer-field small {
    grid-column: 2;
    color: #968b81;
    font-size: 9px;
}

@media (max-width: 820px) {
    .ext-layer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .ext-layer-list {
        padding: 18px;
    }

    .ext-layer-field {
        grid-template-columns: 1fr;
    }

    .ext-layer-field small {
        grid-column: 1;
    }
}

.ext-password-control {
    position: relative;
    display: block;
}

.ext-password-control input {
    padding-right: 42px;
}

.ext-password-control button {
    position: absolute;
    top: 50%;
    right: 5px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 30px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #7d7167;
}

.ext-password-control button:hover {
    background: #fff3dc;
    color: #83570f;
}

.ext-layer-field--transfer {
    align-items: start;
}

.ext-transfer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.ext-transfer > div:not(.ext-transfer-actions) {
    display: grid;
    gap: 5px;
}

.ext-transfer small {
    color: #887d73;
    font-size: 9px;
}

.ext-transfer select {
    min-height: 128px;
    padding: 5px;
}

.ext-transfer-actions {
    display: grid;
    gap: 7px;
}

.ext-transfer-actions button {
    width: 34px;
    height: 32px;
    padding: 0;
    border: 1px solid #dcd4ca;
    border-radius: 6px;
    background: #fff;
    color: #6d6259;
    font-weight: 700;
}

.ext-transfer-actions button:hover {
    border-color: #cf9b42;
    background: #fff3dc;
    color: #83570f;
}

@media (max-width: 560px) {
    .ext-transfer {
        grid-template-columns: 1fr;
    }

    .ext-transfer-actions {
        grid-template-columns: 1fr 1fr;
        justify-content: center;
    }

    .ext-transfer-actions button {
        width: 100%;
    }
}

.ext-field-help {
    display: inline-flex;
    margin-left: 4px;
    color: #6f9fc4;
    font-size: 11px;
    cursor: help;
    vertical-align: middle;
}

.ext-field-help:focus {
    border-radius: 50%;
    outline: 2px solid #8ab6d8;
    outline-offset: 2px;
}
