/* =========================================================
   MASTER PAGE
========================================================= */

.admin-master-page {
    width: 100%;
}

.master-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.master-page-header-content {
    min-width: 0;
}

.master-breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 7px;
    color: #9aa2ad;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.master-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #7f8996;
    text-decoration: none;
}

.master-breadcrumb a:hover {
    color: #6d7785;
}

.master-breadcrumb a i {
    color: #8e98a5;
    font-size: 12px;
}

.master-breadcrumb > i {
    color: #c1c7cf;
    font-size: 9px;
}

.master-breadcrumb > span {
    color: #9aa2ad;
}

.master-page-title {
    margin: 0 0 4px;
    color: #242424;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.35;
}

.master-page-subtitle {
    margin: 0;
    color: #7b8088;
    font-size: 13px;
    line-height: 1.5;
}

.master-page-header-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* =========================================================
   BUTTON
========================================================= */

.master-primary-button,
.master-secondary-button,
.master-danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
}

.master-primary-button {
    border: 1px solid var(--layout-primary);
    background: var(--layout-primary);
    color: #ffffff;
}

.master-primary-button:hover {
    border-color: var(--layout-primary-dark);
    background: var(--layout-primary-dark);
    color: #ffffff;
}

.master-secondary-button {
    border: 1px solid #dfe2e6;
    background: #fff;
    color: #626b76;
}

.master-secondary-button:hover {
    border-color: #cfd4da;
    background: #f7f7f7;
    color: #424951;
}

.master-danger-button {
    border: 1px solid #dc4b4b;
    background: #dc4b4b;
    color: #fff;
}

.master-danger-button:hover {
    border-color: #c93e3e;
    background: #c93e3e;
    color: #fff;
}

/* =========================================================
   ALERT
========================================================= */

.master-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 14px;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.master-alert i {
    margin-top: 1px;
    font-size: 15px;
    flex-shrink: 0;
}

.master-alert-success {
    border-color: #d5ecdf;
    background: #f1faf5;
    color: #287c55;
}

.master-alert-danger {
    border-color: #f2d5d5;
    background: #fff5f5;
    color: #b23b3b;
}

/* =========================================================
   CARD
========================================================= */

.master-card {
    overflow: visible;
    border: 1px solid #e9eaec;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(20, 25, 30, 0.035);
}

.master-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #eef0f2;
}

.master-card-header h2 {
    margin: 0 0 3px;
    color: #292d32;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
}

.master-card-header p {
    margin: 0;
    color: #9299a2;
    font-size: 12px;
    line-height: 1.4;
}

.master-card-total {
    flex-shrink: 0;
    color: #7d858f;
    font-size: 12px;
    font-weight: 600;
}

/* =========================================================
   TABLE
========================================================= */

.master-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.master-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    table-layout: auto;
}

.master-table thead th {
    height: 38px;
    padding: 0 14px;
    border-bottom: 1px solid #eef0f2;
    background: #fafbfc;
    color: #89919b;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    text-align: left;
    white-space: nowrap;
}

.master-table tbody td {
    height: 54px;
    padding: 8px 14px;
    border-bottom: 1px solid #f0f1f3;
    color: #68717c;
    font-size: 12px;
    vertical-align: middle;
}

.master-table tbody tr:last-child td {
    border-bottom: 0;
}

.master-table tbody tr:hover {
    background: #fcfcfc;
}

.master-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 7px;
    background: #f5f6f7;
    color: #7f8790;
    font-size: 11px;
    font-weight: 600;
}

.master-name {
    color: #30343a;
    font-size: 12px;
    font-weight: 600;
}

/* =========================================================
   ACTION BUTTON
========================================================= */

.master-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #858e98;
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

.master-action-button:hover,
.master-action-button[aria-expanded="true"] {
    background: #f3f4f5;
    color: #4f5863;
}

.master-action-button i {
    font-size: 16px;
}

/* =========================================================
   GLOBAL ACTION MENU
   Tidak lagi berada di dalam table.
========================================================= */

.master-global-action-menu {
    position: fixed;
    z-index: 1080;
    min-width: 150px;
    padding: 5px;
    border: 1px solid #e5e7ea;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(25, 30, 35, 0.12);
}

.master-global-action-menu[hidden] {
    display: none;
}

.master-global-action-menu button {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 9px;
    min-height: 34px;
    padding: 7px 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #555e68;
    font-size: 12px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.master-global-action-menu button:hover {
    background: #f5f6f7;
    color: #343a40;
}

.master-global-action-menu button i {
    width: 16px;
    color: #7d8792;
    font-size: 13px;
    text-align: center;
}

.master-global-action-menu button.danger {
    color: #c94a4a;
}

.master-global-action-menu button.danger i {
    color: #d05a5a;
}

.master-global-action-menu button.danger:hover {
    background: #fff3f3;
    color: #b63d3d;
}

/* =========================================================
   EMPTY STATE
========================================================= */

.master-empty {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 5px;
    padding: 42px 20px;
    color: #8d949d;
    text-align: center;
}

.master-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 4px;
    border-radius: 10px;
    background: #f5f6f7;
    color: #929aa4;
}

.master-empty-icon i {
    font-size: 19px;
}

.master-empty strong {
    color: #4b525a;
    font-size: 13px;
    font-weight: 600;
}

.master-empty span {
    max-width: 300px;
    color: #949ba4;
    font-size: 12px;
    line-height: 1.5;
}

.master-empty-button {
    margin-top: 8px;
}

/* =========================================================
   PAGINATION
========================================================= */

.master-pagination {
    display: flex;
    justify-content: flex-end;
    padding: 13px 20px;
    border-top: 1px solid #eef0f2;
}

.master-pagination .pagination {
    margin: 0;
    gap: 4px;
}

.master-pagination .page-link {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid #e3e6e9;
    border-radius: 7px;
    color: #737b85;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.master-pagination .page-link:hover {
    background: #f7f8f9;
    color: #4f5760;
}

.master-pagination .page-item.active .page-link {
    border-color: #1677f0;
    background: #1677f0;
    color: #fff;
}

/* =========================================================
   MODAL
========================================================= */

.master-modal {
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(20, 25, 30, 0.15);
}

.master-modal .modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid #eef0f2;
}

.master-modal .modal-title {
    margin: 0 0 3px;
    color: #292d32;
    font-size: 15px;
    font-weight: 700;
}

.master-modal .modal-header p {
    margin: 0;
    color: #9299a2;
    font-size: 12px;
}

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

.master-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 13px 20px;
    border-top: 1px solid #eef0f2;
}

.master-form-label {
    display: block;
    margin-bottom: 6px;
    color: #4f5760;
    font-size: 12px;
    font-weight: 600;
}

.master-form-input {
    display: block;
    width: 100%;
    height: 40px;
    padding: 8px 11px;
    border: 1px solid #dfe3e7;
    border-radius: 7px;
    outline: none;
    background: #fff;
    color: #3e454d;
    font-size: 12px;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.master-form-input::placeholder {
    color: #a8afb7;
}

.master-form-input:focus {
    border-color: #8bbcf4;
    box-shadow: 0 0 0 3px rgba(22, 119, 240, 0.08);
}

/* =========================================================
   CONFIRM MODAL
========================================================= */

.master-confirm-modal {
    padding: 24px;
    border: 0;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 14px 40px rgba(20, 25, 30, 0.15);
}

.master-confirm-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin: 0 auto 12px;
    border-radius: 50%;
}

.master-confirm-icon.danger {
    background: #fff0f0;
    color: #d34f4f;
}

.master-confirm-icon i {
    font-size: 19px;
}

.master-confirm-modal h5 {
    margin: 0 0 6px;
    color: #292d32;
    font-size: 15px;
    font-weight: 700;
}

.master-confirm-modal p {
    margin: 0;
    color: #858c95;
    font-size: 12px;
    line-height: 1.5;
}

.master-confirm-modal p strong {
    color: #4c535b;
}

.master-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.master-confirm-actions form {
    margin: 0;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 768px) {
    .master-page-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .master-page-header-actions {
        width: 100%;
    }

    .master-page-header-actions .master-primary-button {
        width: 100%;
    }

    .master-page-title {
        font-size: 22px;
    }

    .master-card-header {
        padding: 16px;
    }

    .master-table thead th,
    .master-table tbody td {
        padding-left: 12px;
        padding-right: 12px;
    }

    .master-pagination {
        justify-content: center;
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .master-page-title {
        font-size: 20px;
    }

    .master-page-subtitle {
        font-size: 12px;
    }

    .master-card-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .master-card-total {
        font-size: 11px;
    }

    .master-table thead th,
    .master-table tbody td {
        font-size: 11px;
    }

    .master-modal .modal-body {
        padding: 16px;
    }

    .master-modal .modal-footer {
        padding: 12px 16px;
    }

    .master-confirm-actions {
        flex-direction: column-reverse;
    }

    .master-confirm-actions .master-secondary-button,
    .master-confirm-actions .master-danger-button {
        width: 100%;
    }
}
