/* Dasar halaman */
.sound-page {
    color: #302823;
}

/* Header halaman dan judul */
.sound-heading {
    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%);
}

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

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

.sound-heading h1 + p {
    margin: 9px 0 0;
    color: #766554;
    font-size: 12px;
}

.sound-heading-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tombol dan status interaksi */
.sound-page button {
    cursor: pointer;
    font: inherit;
}

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

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

.sound-page .sound-primary:hover {
    background: #ffca57;
}

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

.sound-page .sound-secondary:hover {
    background: #fff0d1;
}

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

.sound-page button:disabled {
    opacity: 0.5;
    cursor: wait;
}

.sound-page button:focus-visible {
    outline: 3px solid #ffbd3266;
    outline-offset: 2px;
}

/* Pesan informasi dan notifikasi */
.sound-notice {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 10px;
    padding: 12px 14px;
    border: 1px solid #ecdfca;
    border-radius: 8px;
    background: #fff9ed;
    color: #88714e;
    font-size: 11px;
    line-height: 1.6;
}

.sound-notice > i {
    color: #ad7a29;
    margin-top: 2px;
}

.sound-page [data-message]:empty,
.sound-page [data-error]:empty {
    display: none;
}

.sound-page [data-message][hidden] {
    display: none;
}

.sound-message {
    position: relative;
    padding-right: 42px;
}

.sound-message > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.sound-message[data-type="success"] {
    border-color: #bfddc6;
    background: #edf8ef;
    color: #397247;
}

.sound-message[data-type="warning"] {
    border-color: #f0cd91;
    background: #fff5df;
    color: #9a6818;
}

.sound-message[data-type="error"] {
    border-color: #e6b7b1;
    background: #fff2f0;
    color: #97443b;
}

.sound-message[data-type="info"] {
    border-color: #cbdced;
    background: #edf5fc;
    color: #4777a8;
}

.sound-message > i {
    color: inherit;
}

.sound-page .sound-message-close {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: inherit;
    font-size: 12px;
}

.sound-page .sound-message-close:hover {
    background: #0000000a;
}

/* Tabel daftar audio */
.sound-table {
    overflow-x: auto;
    border: 1px solid #e5ded5;
    border-radius: 11px;
    background: #fffefa;
}

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

.sound-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;
    white-space: nowrap;
}

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

.sound-table tbody tr:hover {
    background: #fffcf7;
}

/* Tombol aksi pada tabel */
.sound-row-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

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

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

/* Tampilan daftar kosong */
.sound-table .sound-empty {
    padding: 48px 24px;
    text-align: center;
    color: #8b8178;
}

.sound-empty > i {
    display: block;
    margin-bottom: 12px;
    color: #ad7a29;
    font-size: 26px;
}

.sound-empty > strong {
    display: block;
    margin-bottom: 6px;
    color: #51463c;
    font-size: 13px;
}

.sound-empty > span {
    display: block;
    font-size: 11px;
}

/* Dialog rename audio */
.sound-dialog {
    box-sizing: border-box;
    width: min(620px, calc(100% - 32px));
    max-height: 88vh;
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 12px;
    background: #fffefa;
    box-shadow: 0 24px 70px #20160f42;
    color: #342b25;
}

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

.sound-dialog-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 21px 24px;
    border-bottom: 1px solid #ece5dc;
}

.sound-dialog h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 650;
}

.sound-dialog form > label {
    display: grid;
    gap: 7px;
    margin: 18px 24px;
    color: #62574d;
    font-size: 11px;
    font-weight: 600;
}

.sound-dialog input:not([type="checkbox"]),
.sound-dialog select {
    box-sizing: border-box;
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #dcd4ca;
    border-radius: 7px;
    background: #fff;
    color: #3e352f;
    font: inherit;
    font-weight: 400;
}

.sound-dialog input:focus,
.sound-dialog select:focus {
    border-color: #cf9b42;
    outline: 3px solid #ffbd3224;
}

.sound-dialog input[readonly] {
    background: #faf7f2;
    color: #887d73;
}

.sound-dialog [aria-invalid="true"] {
    border-color: #b34438;
}

.sound-dialog small {
    color: #968b81;
    font-size: 9px;
    line-height: 1.6;
    font-weight: 400;
}

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

/* Visibilitas elemen */
.sound-page [hidden] {
    display: none !important;
}

/* Form upload audio */
.sound-upload {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    margin: 18px 0;
    padding: 20px;
    border: 1px solid #e5ded5;
    border-radius: 11px;
    background: #fffefa;
}

.sound-upload > label {
    display: grid;
    gap: 8px;
    flex: 1;
    min-width: 220px;
    color: #62574d;
    font-size: 11px;
    font-weight: 600;
}

.sound-upload input[type="file"] {
    width: 100%;
    padding: 9px;
    border: 1px solid #dcd4ca;
    border-radius: 7px;
    background: #fff;
    font: inherit;
}

.sound-upload input::file-selector-button {
    margin-right: 12px;
    padding: 6px 10px;
    border: 1px solid #e4c27d;
    border-radius: 5px;
    background: #fff8e8;
    color: #845711;
    cursor: pointer;
}

/* Status operasi dan pesan error */
.sound-status {
    color: #88714e;
    font-size: 11px;
}

.sound-error {
    padding: 12px 14px;
    border: 1px solid #e6b7b1;
    border-radius: 8px;
    background: #fff2f0;
    color: #97443b;
    font-size: 11px;
}

/* Detail audio dan penggunaan dialplan */
.sound-table td small {
    display: block;
    margin-top: 5px;
    color: #968b81;
    font-size: 10px;
}

.sound-table td strong {
    color: #433a33;
}

.sound-table audio {
    width: 220px;
    height: 36px;
}

.sound-table [data-usage] {
    max-width: 300px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.sound-badge {
    color: #895c17;
    cursor: pointer;
}

.sound-row-actions button:disabled {
    cursor: default;
}

.sound-upload [data-replace] {
    color: #895c17;
    font-size: 11px;
    overflow-wrap: anywhere;
}

/* Penyesuaian untuk layar kecil */
@media (max-width: 680px) {
    .sound-heading {
        align-items: flex-start;
        flex-direction: column;
        padding: 22px;
        gap: 18px;
    }

    .sound-heading-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .sound-heading-actions button {
        flex: 1;
    }

    .sound-table table {
        min-width: 850px;
    }

    .sound-upload > label {
        min-width: 0;
        width: 100%;
        flex-basis: 100%;
    }
}

/* Label upload dan informasi penggantian */
.sound-upload-label {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

/* Tombol preview dan pesan kegagalan player */
.sound-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid #e1d7ca;
    border-radius: 8px;
    background: #fffefa;
    color: #796a58;
    font: inherit;
    font-size: 10px;
    white-space: nowrap;
}

.sound-play:hover {
    background: #fff4dc;
    border-color: #d8b978;
}

.sound-table .sound-preview-error {
    color: #97443b;
    max-width: 220px;
    line-height: 1.6;
}
