/* =====================================================
   APP.CSS
   Layout & App-Specific Styles
   ===================================================== */

/*#region BASE RESET */
html, body {
    height: 100%;
    margin: 0;
    font-family: Inter, Segoe UI, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

a {
    color: var(--mud-palette-primary);
    text-decoration: none;
}
/*#endregion */

/*#region APP ROOT */
#app {
    min-height: 100vh;
}

.page-container {
    padding: 16px;
}

@media (max-width: 960px) {
    .page-container {
        padding: 12px;
    }
}

@media (max-width: 600px) {
    .page-container {
        padding: 8px;
    }
}
/*#endregion */

/*#region MUDBLAZOR TUNING */
.mud-button-root {
    line-height: 1 !important;
}

.mud-input-control > label {
    font-size: 0.8rem;
}

.mud-input {
    font-size: 0.9rem;
}
/*#endregion */

/*#region SIDEBAR CONTENT */
.sidebar-menu {
    padding-top: 12px;
}

.sidebar-brand {
    font-weight: 600;
    font-size: 0.9rem;
}

.brand-text {
    margin-left: 8px;
}

.sidebar-user-chip {
    width: 100%;
    justify-content: center;
    margin-top: 12px;
}
/*#endregion */

/*#region FORM VALIDATION */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--mud-palette-success);
}

.invalid {
    outline: 1px solid var(--mud-palette-error);
}

.validation-message {
    color: var(--mud-palette-error);
    font-size: 0.75rem;
}
/*#endregion */

/*#region LOADING */
.loading-progress {
    position: absolute;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: auto;
}
/*#endregion */


/*#region SNACKBAR */
.mud-snackbar-provider,
.mud-snackbar-container {
    z-index: 5000 !important;
}

.mud-snackbar-location-top-right,
.mud-snackbar-location-top-left,
.mud-snackbar-location-top-center {
    top: calc(var(--topbar-height) + 12px) !important;
}
/*#endregion */

/* #region TABLER-STYLE TABLES (MudBlazor)*/ 

/* Table container */
.mud-table {
    background-color: transparent;
}

    /* Header */
    .mud-table thead th {
        background-color: transparent;
        color: var(--mud-palette-text-secondary);
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        border-bottom: 1px solid var(--mud-palette-divider);
        padding: 12px 16px;
    }

    /* Rows */
    .mud-table tbody tr {
        background-color: transparent;
        transition: background-color 0.15s ease;
    }

        /* Hover (Tabler subtle hover) */
        .mud-table tbody tr:hover {
            background-color: color-mix( in srgb, var(--mud-palette-surface) 96%, white );
        }

    /* Cells */
    .mud-table tbody td {
        border-bottom: 1px solid var(--mud-palette-divider);
        padding: 12px 16px;
    }

/* Zebra striping (VERY subtle) */
.mud-table-striped tbody tr:nth-child(even) {
    background-color: color-mix( in srgb, var(--mud-palette-surface) 98%, white );
}

/* Dense tables */
.mud-table-dense tbody td {
    padding: 8px 12px;
}

/*.action-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mud-table-cell {
    vertical-align: middle !important;
}*/
.action-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.mud-table-cell {
    vertical-align: middle !important;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Theme-aware text color */
.user-name {
    color: var(--mud-palette-text-primary);
    font-weight: 600;
}

.login-time {
    color: var(--mud-palette-text-secondary);
}

.center-table th,
.center-table td {
    text-align: center;
    vertical-align: middle;
    
}

.center-table thead th {
    white-space: nowrap;
}

/*.fullscreen-loader {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.9);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}*/

.fullscreen-loader {
    position: fixed;
    inset: 0;
    background: white; /* 🔥 match global loader */

    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}




.pdf-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.pdf-container {
    width: 60%;
    height: 85%;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pdf-header {
    padding: 10px 15px;
    /*    background-color: var(--mud-palette-primary);*/
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pdf-title {
    font-weight: 600;
    font-size: 16px;
}

.pdf-frame {
    width: 100%;
    height: 100%;
    border: none;
}

.profile-avatar-box {
    width: 120px;
    height: 120px;
    margin: 0 auto 16px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    background-color: #f5f5f5;
}

.profile-avatar-icon {
    font-size: 70px !important;
    color: #9e9e9e;
}


.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}
.profile-avatar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.avatar-edit-btn {
    width: 75px;
    min-width: 75px !important;
    height: 32px;
    border-radius: 20px !important;
    background: white !important;
    margin-top: -10px;
}

.header-profile-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

#profile-image-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-image-backdrop {
    position: relative;
}

.profile-image-preview {
    max-width: 80vw;
    max-height: 80vh;
    border-radius: 12px;
}

.profile-image-close {
    position: absolute;
    top: -50px;
    right: 0;
    border: none;
    background: transparent;
    color: white;
    font-size: 32px;
    cursor: pointer;
}
