/* =====================================================
   REUSABLE PAGE LAYOUT
   ===================================================== */

.app-page {
    min-height: calc(100vh - 64px);
    padding: 32px 20px;
    background:
        radial-gradient(
            circle at top left,
            rgba(63, 81, 181, 0.08),
            transparent 32%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(0, 150, 136, 0.06),
            transparent 30%
        ),
        #f7f8fc;
}

.app-container {
    width: 100%;
}


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

.app-card {
    width: 100%;
    overflow: hidden;
    padding: 0 !important;
    border: 1px solid rgba(63, 81, 181, 0.1);
    border-radius: 20px !important;
    background-color: #ffffff;
}

.app-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 32px;
}

.app-card-body {
    padding: 32px;
}


/* =====================================================
   IDENTITY / PROFILE HEADER
   ===================================================== */

.app-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 20px;
}

.app-identity-content {
    min-width: 0;
}

.app-avatar,
.app-avatar-image {
    width: 82px !important;
    height: 82px !important;
    flex-shrink: 0;
    border-radius: 50%;
}

.app-avatar {
    font-size: 25px !important;
    font-weight: 700 !important;
    box-shadow: 0 8px 22px rgba(63, 81, 181, 0.22);
}

.app-avatar-image {
    object-fit: cover;
    border: 3px solid rgba(63, 81, 181, 0.14);
    box-shadow: 0 8px 22px rgba(32, 36, 58, 0.14);
}

.app-title {
    color: #20243a !important;
    font-weight: 700 !important;
    word-break: break-word;
}

.app-subtitle {
    margin-top: 3px !important;
    word-break: break-word;
}


/* =====================================================
   BADGES
   ===================================================== */

.app-badge-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.app-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.app-badge--primary {
    color: #3f51b5;
    background-color: rgba(63, 81, 181, 0.09);
}

.app-badge--success {
    color: #147963;
    background-color: rgba(0, 150, 136, 0.1);
}

.app-badge--warning {
    color: #9c6200;
    background-color: rgba(255, 152, 0, 0.12);
}

.app-badge--error {
    color: #c62828;
    background-color: rgba(244, 67, 54, 0.1);
}


/* =====================================================
   REUSABLE FORM
   ===================================================== */

.app-form {
    width: 100%;
}

.app-page .mud-input-outlined-border {
    border-radius: 10px !important;
}

.app-page .mud-input-root {
    min-height: 46px;
}

.app-page .mud-input-control-input-container {
    min-height: 46px;
}

.app-page .mud-input-adornment .mud-icon-root {
    color: #70758a;
}

.app-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

.app-action-button,
.app-header-action {
    min-height: 44px;
    border-radius: 9px !important;
    text-transform: none !important;
    font-weight: 600 !important;
}

.app-action-button {
    min-width: 130px;
}


/* =====================================================
   LOADING AND ERRORS
   ===================================================== */

.app-loading-card {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.app-alert {
    border-radius: 12px !important;
}

.app-alert-content {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}


/* =====================================================
   TABLET
   ===================================================== */

@media (max-width: 768px) {
    .app-page {
        padding: 22px 14px;
    }

    .app-card-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 24px;
    }

    .app-card-body {
        padding: 24px;
    }

    .app-identity {
        width: 100%;
    }

    .app-header-action {
        width: 100%;
    }
}


/* =====================================================
   MOBILE
   ===================================================== */

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

    .app-card {
        border-radius: 14px !important;
    }

    .app-card-header {
        align-items: center;
        padding: 22px 18px;
        text-align: center;
    }

    .app-card-body {
        padding: 22px 16px;
    }

    .app-identity {
        flex-direction: column;
    }

    .app-identity-content {
        width: 100%;
    }

    .app-avatar,
    .app-avatar-image {
        width: 72px !important;
        height: 72px !important;
    }

    .app-badge-list {
        justify-content: center;
    }

    .app-form-actions {
        flex-direction: column-reverse;
    }

    .app-action-button {
        width: 100%;
    }

    .app-alert-content {
        align-items: stretch;
        flex-direction: column;
    }
}








/* =====================================================
   REUSABLE LIST AND GRID LAYOUT
   ===================================================== */

.app-list-page {
    width: 100%;
    padding: 24px 16px;
}

.app-list-title {
    font-weight: 600 !important;
    color: var(--mud-palette-text-primary);
}

.app-filter-card,
.app-grid-card {
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 10px !important;
}

.app-filter-actions {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.app-user-information {
    min-width: 160px;
}

.app-user-information .mud-typography {
    overflow-wrap: anywhere;
}

.app-grid-status {
    min-width: 105px;
    white-space: nowrap;
}

.app-grid-card .mud-table-head {
    background-color: var(--mud-palette-background-grey);
}

.app-grid-card .mud-table-head .mud-table-cell {
    font-weight: 600;
    white-space: nowrap;
}

.app-grid-card .mud-table-body .mud-table-cell {
    vertical-align: middle;
}

.app-grid-card .mud-table-pagination {
    border-top: 1px solid var(--mud-palette-lines-default);
}






















/* Tablet */
@media (max-width: 959px) {
    .app-list-page {
        padding: 18px 12px;
    }

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

    .app-filter-actions .mud-button-root {
        flex: 1;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .app-list-page {
        padding: 12px 8px;
    }

    .app-list-title {
        text-align: center;
    }

    .app-filter-card {
        padding: 12px !important;
    }

    .app-grid-card {
        padding: 6px !important;
        overflow: visible;
    }

    .app-filter-actions {
        width: 100%;
    }

    .app-filter-actions .mud-button-root {
        min-height: 40px;
    }

    .app-user-information {
        min-width: 0;
        max-width: calc(100vw - 145px);
    }

    .app-grid-card .mud-table-root {
        min-width: 0;
    }

    .app-grid-card .mud-table-body .mud-table-row {
        margin-bottom: 12px;
        overflow: hidden;
        border: 1px solid var(--mud-palette-lines-default);
        border-radius: 8px;
        background-color: var(--mud-palette-surface);
    }

    .app-grid-card .mud-table-body .mud-table-cell {
        min-height: 44px;
        padding: 10px 14px;
        white-space: normal;
    }

    .app-grid-status {
        min-width: 0;
    }

    .app-grid-actions {
        min-width: 0;
        justify-content: flex-end;
    }

    .app-grid-card .mud-table-pagination {
        overflow-x: auto;
    }
}



/* Mobile */
@media (max-width: 600px) {
    .app-list-page {
        padding: 12px 8px;
    }

    .app-list-title {
        text-align: center;
    }

    .app-filter-card {
        padding: 12px !important;
    }

    .app-grid-card {
        padding: 6px !important;
    }

    .app-filter-actions {
        width: 100%;
    }

    .app-filter-actions .mud-button-root {
        min-height: 40px;
    }

    .app-user-information {
        min-width: 0;
        max-width: calc(100vw - 145px);
    }

    .app-grid-card .mud-table-pagination {
        overflow-x: auto;
    }
}





.app-grid-actions {
    min-width: 100px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
}

@media (max-width: 959px) {
    .app-grid-actions {
        min-width: 0;
        justify-content: flex-end;
    }
}
















/* =====================================================
   REUSABLE DETAIL PAGE
   ===================================================== */

.app-detail-card {
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 10px !important;
    background-color: var(--mud-palette-surface);
}

.app-detail-header {
    padding: 24px;
    background-color: var(--mud-palette-surface);
}

.app-detail-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 18px;
}

.app-detail-avatar,
.app-detail-avatar-image {
    width: 72px !important;
    height: 72px !important;
    flex-shrink: 0;
}

.app-detail-avatar-image {
    object-fit: cover;
    border: 2px solid var(--mud-palette-primary);
    border-radius: 50%;
}

.app-detail-summary {
    min-width: 0;
}

.app-detail-email {
    overflow-wrap: anywhere;
}

.app-detail-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.app-detail-header-action {
    width: 100%;
    max-width: 180px;
    margin-left: auto;
}

.app-detail-body {
    padding: 24px;
}

.app-detail-body .mud-input-root {
    min-height: 44px;
}

.app-detail-body .mud-input-outlined-border {
    border-radius: 8px !important;
}

/* Tablet */
@media (max-width: 959px) {
    .app-detail-header,
    .app-detail-body {
        padding: 20px;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .app-detail-header,
    .app-detail-body {
        padding: 16px;
    }

    .app-detail-identity {
        align-items: flex-start;
        gap: 14px;
    }

    .app-detail-avatar,
    .app-detail-avatar-image {
        width: 58px !important;
        height: 58px !important;
    }

    .app-detail-summary .app-title {
        font-size: 1.25rem !important;
    }

    .app-detail-header-action {
        max-width: none;
        margin-left: 0;
    }

    .app-detail-badges {
        align-items: flex-start;
    }

    .app-form-actions {
        display: flex;
        flex-direction: column-reverse;
        gap: 8px;
    }

    .app-form-actions .app-action-button {
        width: 100%;
        min-height: 42px;
    }
}




























