/* ======================================================
   BUTTON EFFECTS ONLY (NO COLORS)
   ====================================================== */
.btn-effects{
    position: relative;
    overflow: hidden; /* required for ripple */
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.btn-effects:hover{
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}
.btn-effects:active{
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.btn-effects::after{
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transform: scale(1);
    transition: opacity 0.6s, transform 0.6s;
}
.btn-effects:active::after{
    opacity: 1;
    transform: scale(18);
    transition: 0s;
    top: var(--y, 50%);
    left: var(--x, 50%);
}
.btn-effects:active{
    --x: 50%;
    --y: 50%;
}

/* ======================================================
   AUTH BACKGROUND + LAYERING
   ====================================================== */
.auth-main{
    position: relative;
    min-height: 100vh;
    background: url("../images/bg/smartie_bg.webp") no-repeat center center;
    background-size: cover;
}

/* Overlay base (light/dark set below) */
.auth-main::before{
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* COMMON LAYERING */
.auth-wrapper,
.auth-form,
.card{
    position: relative;
    z-index: 2;
}

.img-white{
    filter: brightness(0) invert(1);
}

/* LIGHT MODE */
[data-pc-theme="light"] .auth-main::before{
    background: rgba(0, 0, 0, 0.55);
}

[data-pc-theme="light"] .auth-form .card{
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(6px);
    border-radius: 12px;
}

/* DARK MODE */
[data-pc-theme="dark"] .auth-main::before{
    background: rgba(0, 0, 0, 0.75);
}

[data-pc-theme="dark"] .auth-form .card{
    background: rgba(18, 18, 18, 0.94);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    color: #eaeaea;
}

/* ======================================================
   PAGE TOP LOADER
   ====================================================== */
#page-loader{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 9999;
    background: transparent;
    pointer-events: none;
}

#page-loader .page-loader-bar{
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #198754, #28a745, #20c997);
    transition: width 0.35s ease, opacity 0.4s ease;
    box-shadow: 0 0 6px rgba(25, 135, 84, 0.6);
}

/* ======================================================
   SHARED UTILITIES
   ====================================================== */
.cur-pointer{ cursor: pointer; }

.isDisabled{
    pointer-events: none;
    opacity: 0.55;
}

.btn-group-xs .btn{
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* ======================================================
   HEADER PANELS
   ====================================================== */
.min-w-0{ min-width: 0; }

.pc-head-link.header-icon-button{
    border: 0;
    background: transparent;
}

.header-user-toggle{
    padding-inline: .45rem;
}

.header-avatar{
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(var(--bs-primary-rgb), .12);
    color: var(--bs-primary);
    font-size: .8rem;
    font-weight: 800;
    line-height: 1;
}

.header-avatar-lg{
    width: 46px;
    height: 46px;
    font-size: 1rem;
    flex: 0 0 auto;
}

.header-notification-menu{
    width: min(420px, calc(100vw - 24px));
}

.header-notification-scroll{
    max-height: min(520px, calc(100vh - 210px));
    overflow-y: auto;
    padding: .5rem;
}

.header-notification-item{
    display: flex;
    gap: .85rem;
    padding: .85rem;
    border-radius: 8px;
    color: var(--bs-body-color);
    text-decoration: none;
    transition: background-color .16s ease, transform .16s ease;
}

.header-notification-item:hover{
    background: rgba(var(--bs-primary-rgb), .06);
    color: var(--bs-body-color);
    transform: translateY(-1px);
}

.header-notification-icon{
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(var(--bs-primary-rgb), .10);
    color: var(--bs-primary);
    font-size: 1.1rem;
    flex: 0 0 auto;
}

.header-notification-item.is-warning .header-notification-icon{
    background: rgba(var(--bs-warning-rgb), .14);
    color: #b7791f;
}

.header-notification-item.is-danger .header-notification-icon{
    background: rgba(var(--bs-danger-rgb), .12);
    color: var(--bs-danger);
}

.header-notification-copy{
    display: grid;
    gap: .15rem;
    min-width: 0;
}

.header-notification-title{
    font-size: .92rem;
    font-weight: 700;
    line-height: 1.25;
}

.header-notification-body{
    color: var(--bs-secondary-color);
    font-size: .82rem;
    line-height: 1.35;
}

.header-notification-meta{
    color: var(--bs-secondary-color);
    font-size: .76rem;
}

.header-empty-state{
    display: flex;
    gap: .85rem;
    align-items: center;
    padding: 1rem;
}

.header-empty-state > i{
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(145, 158, 171, .12);
    color: var(--bs-secondary-color);
    font-size: 1.15rem;
    flex: 0 0 auto;
}

.header-profile-menu{
    width: min(340px, calc(100vw - 24px));
    padding: .5rem;
}

.header-profile-card{
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .85rem;
}

.header-company-card{
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 0 .35rem .5rem;
    padding: .75rem;
    border: 1px solid rgba(145, 158, 171, .18);
    border-radius: 8px;
    background: rgba(145, 158, 171, .08);
}

.header-company-card img,
.header-company-card > span{
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
    padding: 3px;
    flex: 0 0 auto;
}

.header-company-card > span{
    background: rgba(var(--bs-primary-rgb), .10);
    color: var(--bs-primary);
    padding: 0;
}

body[data-pc-theme="dark"] .pc-h-dropdown{
    background: #1f2329;
    border-color: rgba(255,255,255,.11);
    color: rgba(255,255,255,.88);
}

body[data-pc-theme="dark"] .header-notification-item:hover{
    background: rgba(255,255,255,.06);
}

body[data-pc-theme="dark"] .header-notification-body,
body[data-pc-theme="dark"] .header-notification-meta{
    color: rgba(255,255,255,.62);
}

body[data-pc-theme="dark"] .header-company-card{
    background: rgba(255,255,255,.05);
    border-color: rgba(255,255,255,.11);
}

body[data-pc-theme="dark"] .header-company-card img{
    background: #fff;
}

/* ======================================================
   APPEARANCE PICKER
   ====================================================== */
.appearance-panel{
    width: 320px;
    max-width: calc(100vw - 24px);
    background: #ffffff;
    box-shadow: -16px 0 36px rgba(15, 23, 42, 0.16);
}

.appearance-panel-header,
.appearance-panel-footer{
    padding: 18px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.appearance-panel-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.appearance-panel-footer{
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    border-bottom: 0;
}

.appearance-icon-btn{
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 8px;
    color: #334155;
    background: #ffffff;
}

.appearance-icon-btn:hover{
    background: #f8fafc;
}

.appearance-panel-body{
    padding: 18px;
}

.appearance-section + .appearance-section{
    margin-top: 22px;
}

.appearance-section-title{
    margin-bottom: 10px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.appearance-mode-grid{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.appearance-mode-option{
    min-height: 64px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 8px;
    color: #334155;
    background: #f8fafc;
    font-weight: 600;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.appearance-mode-option i{
    font-size: 1.25rem;
}

.appearance-mode-option:hover,
.appearance-mode-option.active{
    border-color: #2563eb;
    color: #1d4ed8;
    background: #eff6ff;
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.12);
}

.appearance-accent-grid{
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.appearance-accent-option{
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 8px;
    background: #ffffff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.appearance-accent-option span{
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-color);
}

.appearance-accent-option:hover,
.appearance-accent-option.active{
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
    transform: translateY(-1px);
}

body[data-pc-theme="dark"] .appearance-panel{
    background: #111827;
    color: rgba(255,255,255,.92);
}

body[data-pc-theme="dark"] .appearance-panel-header,
body[data-pc-theme="dark"] .appearance-panel-footer{
    border-color: rgba(255,255,255,.10);
}

body[data-pc-theme="dark"] .appearance-icon-btn,
body[data-pc-theme="dark"] .appearance-mode-option,
body[data-pc-theme="dark"] .appearance-accent-option{
    border-color: rgba(255,255,255,.12);
    color: rgba(255,255,255,.86);
    background: #172033;
}

body[data-pc-theme="dark"] .appearance-mode-option:hover,
body[data-pc-theme="dark"] .appearance-mode-option.active{
    border-color: #60a5fa;
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.18);
}

body[data-pc-theme="dark"] .appearance-icon-btn:hover{
    background: #1f2937;
}

@media (max-width: 575.98px){
    .appearance-panel{
        width: min(100vw, 330px);
    }
}

/* ======================================================
   LOGIN PAGE ENHANCEMENT
   ====================================================== */
.auth-login-enhanced .auth-wrapper.v5{
    justify-content: center;
    padding: 24px 16px;
}

.auth-login-enhanced .auth-form .card{
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.18);
}

.auth-login-enhanced .auth-form .card .card-body{
    padding: 32px;
}

.auth-login-enhanced .login-logo{
    width: auto;
    height: 80px;
    max-width: 100%;
    object-fit: contain;
}

.auth-login-enhanced h4{
    color: #1f2937;
    font-size: 1.5rem;
    line-height: 1.25;
    letter-spacing: 0;
}

.auth-login-enhanced #LoginForm .form-control{
    min-height: 46px;
    border-color: #cfd7e3;
    border-radius: 12px;
    background: #f8fbff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-login-enhanced #LoginForm .form-control:focus{
    border-color: #4078ff;
    background: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(64, 120, 255, 0.14);
}

.auth-login-enhanced #passwordToggleIcon{
    color: #4b5563;
    font-size: 1.1rem;
}

.auth-login-enhanced #LoginBtn{
    min-height: 48px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(64, 120, 255, 0.22);
}

.auth-login-enhanced .link-primary{
    transition: color 0.2s ease;
}

.auth-login-enhanced .link-primary:hover{
    color: #245ee8 !important;
}

@media (max-width: 575.98px){
    .auth-login-enhanced .auth-wrapper.v5{
        padding: 14px;
    }

    .auth-login-enhanced .auth-form .card .card-body{
        padding: 28px 24px;
    }

    .auth-login-enhanced .login-logo{
        height: 72px;
    }

    .auth-login-enhanced h4{
        font-size: 1.35rem;
    }
}

/* ======================================================
   SETTINGS SIDEBAR NAV
   ====================================================== */
.settings-nav .list-group-item{
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    font-size: 14px;
}

.settings-nav .list-group-item:hover{
    background: #f5f5f8;
    border-left-color: #198754;
}

.settings-nav .list-group-item.active{
    background: #198754;
    color: #fff;
    font-weight: 600;
}

.settings-nav .list-group-item.active i{
    color: #fff !important;
}

/* ======================================================
   BADGES
   ====================================================== */
.permission-badge{
    display: inline-block;
    padding: 1px 10px;
    border: 1px solid #198754;
    background: #e8f5e9;
    border-radius: 12px;
    margin: 3px;
    font-size: 11px;
}

.perm-no{
    min-width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #555;
    background: #fff;
}

/* ======================================================
   CARD SURFACES
   ====================================================== */
.role-card,
.module-card,
.perm-card,
.role-box{
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    background: #fff;
    transition: background 0.15s ease;
}

.role-card:hover,
.module-card:hover,
.perm-card:hover{
    background: #f8fafc;
}

/* Active highlight */
.role-card.is-active{
    border-color: rgba(25, 135, 84, 0.35);
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.12);
}

/* ======================================================
   STAFF META BOX
   ====================================================== */
.staff-meta{
    border: 1px dashed rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    padding: 12px;
    background: #fafbfc;
}

/* ======================================================
   PERMISSION BADGE ANIMATIONS
   ====================================================== */
.role-perm-badges.is-updating{
    opacity: 0.35;
    transition: opacity 0.15s ease;
}

.role-perm-badges.flash{
    animation: permFlash 0.6s ease;
}

@keyframes permFlash{
    0%{ transform: scale(1); }
    35%{ transform: scale(1.01); }
    100%{ transform: scale(1); }
}

/* ======================================================
   TEXT HELPERS
   ====================================================== */
.text-truncate-2{
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ======================================================
   MODERN UI (HERO, CARDS, TILES, PROFILE)
   ====================================================== */

/* Slim module header */
.module-hero{
    border-radius: 16px;
    padding: 18px 18px;
    color: #fff;
    background: linear-gradient(135deg, black 0%, #20c997 100%);
    box-shadow: 0 18px 42px rgba(0,0,0,.18);
    position: relative;
    overflow: hidden;
}
.module-hero::after{
    content:"";
    position:absolute;
    right:-70px;
    top:-90px;
    width:240px;
    height:240px;
    border-radius:999px;
    background: rgba(255,255,255,.18);
    filter: blur(0.5px);
}
.module-hero .hero-icon{
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display:flex;
    align-items:center;
    justify-content:center;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.25);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
    font-size: 26px;
}

/* Modern cards */
.card-modern{
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(0,0,0,.08);
    background: #fff;
}

/* Quick action tiles */
.action-tile{
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,.06);
    background: #fff;
    padding: 16px;
    height: 100%;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
    position: relative;
    overflow: hidden;
}
.action-tile:hover{
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0,0,0,.12);
}
.action-icon{
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display:flex;
    align-items:center;
    justify-content:center;
    background: #f2f4f8;
    font-size: 20px;
}
.action-title{ font-weight: 700; }
.action-desc{ color: #6c757d; font-size: 13px; }

/* Compact profile strip */
.profile-strip img{
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 14px;
}

/* MODULE TILES – CLEAN & DISTINCT */
.module-tile.card{
    cursor: pointer;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,.08);
    background: linear-gradient(180deg, #ffffff 0%, #f3f5f9 100%);
    box-shadow:
            0 10px 28px rgba(0,0,0,.14),
            inset 0 1px 0 rgba(255,255,255,.95);
    transition: transform .18s ease, box-shadow .18s ease;
    position: relative;
    overflow: hidden;
}
.module-tile.card::before{
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 5px;
    width: 100%;
    background: linear-gradient(90deg, #dee2e6, #f8f9fa);
}
.module-tile.card:hover{
    transform: translateY(-6px);
    box-shadow:
            0 20px 45px rgba(0,0,0,.20),
            inset 0 1px 0 rgba(255,255,255,1);
}
.module-tile.card:hover::after{
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(0,0,0,.06), transparent 70%);
    pointer-events: none;
}
.module-icon{
    font-size: 52px;
    line-height: 1;
    margin-bottom: 6px;
    color: #495057;
}
.module-label{
    font-weight: 700;
    font-size: 15px;
    letter-spacing: .3px;
    color: #212529;
}

/* ======================================================
   FORMS (MODERN / ADMINDEK FRIENDLY)
   ====================================================== */

/* Spacing */
.form-group.row.pb-3 {
    padding-bottom: 14px !important;
}

/* ------------------------------------------------------
   Inputs & Selects (ALL SIZES)
   ------------------------------------------------------ */
.form-control,
.form-select {
    border-radius: 10px;
}

/* Optional: smoother focus (recommended) */
.form-control:focus,
.form-select:focus {
    box-shadow: none;
    border-color: #ced4da;
}

/* ------------------------------------------------------
   Buttons
   ------------------------------------------------------ */
.btn-round {
    border-radius: 999px;
}

.btn-soft {
    background: #f7f8fb;
    border: 1px solid #eef1f6;
}

/* ------------------------------------------------------
   Divider
   ------------------------------------------------------ */
.divider-soft {
    border-top: 1px dashed #e9edf3;
    margin: 10px 0 14px;
}

/* ------------------------------------------------------
   Input Groups (ALL SIZES)
   ------------------------------------------------------ */
.input-group {
    border-radius: 10px;
    overflow: hidden; /* clips inner corners cleanly */
}

/* Let the group control rounding */
.input-group > .form-control,
.input-group > .form-select{
    border-radius: 0;
}

/* Optional: input-group text consistency */
.input-group-text {
    border-radius: 0;
}

/* ------------------------------------------------------
   Validation states (keeps rounding intact)
   ------------------------------------------------------ */
.form-control.is-valid,
.form-control.is-invalid,
.form-select.is-valid,
.form-select.is-invalid {
    border-radius: 10px;
}



/* ======================================================
   PROFILE PAGE ENHANCEMENT
   ====================================================== */
.section-title{
    font-weight: 700;
    font-size: 14px;
    color: #2b2f38;
}

/* ===== Hero ===== */
.profile-hero{
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #eef1f6;
    box-shadow: 0 8px 20px rgba(18,38,63,.04);
}
.profile-hero-top{
    background: linear-gradient(135deg,#47a447,#47a447cc);
    padding: 18px;
    color: #fff;
}
.profile-hero-bottom{
    background: #fff;
    padding: 14px 18px;
}

/* ===== Avatar (hero) ===== */
.avatar-wrap{
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,.75);
    background: rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.avatar-wrap img{
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dashboard profile picture: force true circle + proper crop */
.change-profile .profile-dp{
    width: 100px;          /* matches wid-100 */
    height: 100px;         /* matches wid-100 */
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.change-profile .profile-dp img{
    width: 100% !important;
    height: 100% !important;      /* overrides .img-fluid height:auto */
    object-fit: cover;
    object-position: center;
    display: block;               /* avoids baseline/inline shifts */
}

/* ===== Meta pills ===== */
.meta-pill{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.25);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
}

/* ===== Sticky left ===== */
@media(min-width:992px){
    .sticky-left{ position: sticky; top: 92px; }
}

/* ===== Profile Nav ===== */
.profile-nav-list{
    border: 1px solid #eef1f6;
    border-radius: 14px;
    overflow: hidden;
}
.profile-nav-list .list-group-item{
    border: 0;
    border-bottom: 1px solid #f0f2f7;
    border-left: 3px solid transparent;
    padding: 12px 14px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.profile-nav-list .list-group-item i{
    width: 24px;
    text-align: center;
    font-size: 18px;
    color: #47a447;
}
.profile-nav-list .list-group-item:hover{
    background: #f7f8fb;
    border-left-color: #47a447;
    cursor: pointer;
}
.profile-nav-list .list-group-item.active{
    background: #47a447;
    border-left-color: #47a447;
    color: #fff;
    font-weight: 700;
}
.profile-nav-list .list-group-item.active i{ color:#fff; }

/* ===== Profile Photo Alert ===== */
.profile-photo-alert{
    background: #dff3df;
    border: 1px solid rgba(71,164,71,.22);
    border-radius: 18px;
    padding: 16px 18px;
}
.profile-photo-wrap{ flex-shrink: 0; }

.profile-photo-circle{
    width: 78px;
    height: 78px;
    border-radius: 50%;
    overflow: hidden;
    background: #47a447;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255,255,255,.92);
    box-shadow: 0 10px 22px rgba(0,0,0,.12);
}
.profile-photo-img{ width: 100%; height: 100%; object-fit: cover; }
.profile-photo-initials{ color:#fff; font-weight: 800; font-size: 26px; }

@media(max-width:480px){
    .profile-photo-circle{ width: 64px; height: 64px; }
    .profile-photo-initials{ font-size: 22px; }
}
.profile-photo-text{
    font-size: 13px;
    line-height: 1.45;
    color: #3b3f45;
}

/* ======================================================
   DARK MODE OVERRIDES (Porto/PC theme switch uses data-pc-theme)
   ====================================================== */

/* Settings nav */
body[data-pc-theme="dark"] .settings-nav .list-group-item{ color: rgba(255,255,255,.82); }
body[data-pc-theme="dark"] .settings-nav .list-group-item:hover{ background: rgba(255,255,255,.06); }
body[data-pc-theme="dark"] .settings-nav .list-group-item.active{
    background: #198754;
    color: #fff;
}

/* Page loader glow stronger */
body[data-pc-theme="dark"] #page-loader .page-loader-bar{
    box-shadow: 0 0 10px rgba(25,135,84,.75);
}

/* Permission badge */
body[data-pc-theme="dark"] .permission-badge{
    border-color: rgba(25,135,84,.65);
    background: rgba(25,135,84,.14);
    color: rgba(255,255,255,.86);
}

/* Card surfaces */
body[data-pc-theme="dark"] .role-card,
body[data-pc-theme="dark"] .module-card,
body[data-pc-theme="dark"] .perm-card,
body[data-pc-theme="dark"] .role-box{
    background: rgba(255,255,255,.03);
    border-color: rgba(255,255,255,.10);
}
body[data-pc-theme="dark"] .role-card:hover,
body[data-pc-theme="dark"] .module-card:hover,
body[data-pc-theme="dark"] .perm-card:hover{
    background: rgba(255,255,255,.06);
}
body[data-pc-theme="dark"] .role-card.is-active{
    border-color: rgba(25,135,84,.55);
    box-shadow: 0 0 0 3px rgba(25,135,84,.18);
}

/* perm number */
body[data-pc-theme="dark"] .perm-no{
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.85);
    border-color: rgba(255,255,255,.15);
}

/* Disabled */
body[data-pc-theme="dark"] .isDisabled{ opacity: .45; }

/* Updating state */
body[data-pc-theme="dark"] .role-perm-badges.is-updating{ opacity: .30; }

/* Module hero */
body[data-pc-theme="dark"] .module-hero{ box-shadow: 0 18px 42px rgba(0,0,0,.45); }
body[data-pc-theme="dark"] .module-hero::after{ background: rgba(255,255,255,.08); }
body[data-pc-theme="dark"] .module-hero .hero-icon{
    background: rgba(0,0,0,.18);
    border-color: rgba(255,255,255,.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

/* Modern cards */
body[data-pc-theme="dark"] .card-modern{
    background: none;
    border-color: rgba(255,255,255,.08);
    box-shadow: 0 14px 34px rgba(0,0,0,.55);
}

/* Action tiles */
body[data-pc-theme="dark"] .action-tile{
    background: none;
    border-color: rgba(255,255,255,.10);
}
body[data-pc-theme="dark"] .action-tile:hover{ box-shadow: 0 18px 40px rgba(0,0,0,.70); }
body[data-pc-theme="dark"] .action-icon{ background: rgba(255,255,255,.06); }
body[data-pc-theme="dark"] .action-desc{ color: rgba(255,255,255,.65); }
body[data-pc-theme="dark"] .action-title{ color: rgba(255,255,255,.92); }

/* Text-muted override */
body[data-pc-theme="dark"] .profile-strip .text-muted,
body[data-pc-theme="dark"] .text-muted{
    color: rgba(255,255,255,.65) !important;
}

/* Module tiles (dark) */
body[data-pc-theme="dark"] .module-tile.card{
    border-color: rgba(255,255,255,.10);
    background: linear-gradient(180deg, #292a2c 0%, #161617 100%);
    box-shadow:
            0 12px 32px rgba(0,0,0,.65),
            inset 0 1px 0 rgba(255,255,255,.04);
}
body[data-pc-theme="dark"] .module-tile.card::before{
    background: linear-gradient(90deg, rgba(255,255,255,.12), rgba(255,255,255,.04));
}
body[data-pc-theme="dark"] .module-tile.card:hover{
    box-shadow:
            0 22px 50px rgba(0,0,0,.85),
            inset 0 1px 0 rgba(255,255,255,.06);
}
body[data-pc-theme="dark"] .module-tile.card:hover::after{
    background: radial-gradient(circle at top, rgba(255,255,255,.08), transparent 70%);
}
body[data-pc-theme="dark"] .module-icon{ color: rgba(255,255,255,.85); }
body[data-pc-theme="dark"] .module-label{ color: rgba(255,255,255,.92); }

/* Profile (dark) - keep existing look but readable */
body[data-pc-theme="dark"] .section-title{ color: rgba(255,255,255,.82); }
body[data-pc-theme="dark"] .profile-hero{
    border-color: rgba(255,255,255,.08);
    box-shadow: 0 14px 34px rgba(0,0,0,.55);
}
body[data-pc-theme="dark"] .profile-hero-bottom{
    background: rgba(255,255,255,.03);
}
body[data-pc-theme="dark"] .profile-nav-list{
    border-color: rgba(255,255,255,.08);
}
body[data-pc-theme="dark"] .profile-nav-list .list-group-item{
    border-bottom-color: rgba(255,255,255,.06);
    color: rgba(255,255,255,.82);
}
body[data-pc-theme="dark"] .profile-nav-list .list-group-item:hover{
    background: rgba(255,255,255,.06);
}
body[data-pc-theme="dark"] .profile-photo-text{
    color: rgba(255,255,255,.72);
}
body[data-pc-theme="dark"] .profile-photo-alert{
    background: rgba(25,135,84,.14);
    border-color: rgba(25,135,84,.25);
}

/* ======================================================
   TABLE ACTION BUTTONS
   ====================================================== */
.table .btn{
    --smartie-table-btn-size: 32px;
    min-height: var(--smartie-table-btn-size);
    height: var(--smartie-table-btn-size);
    max-height: var(--smartie-table-btn-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding-block: 0;
    padding-inline: .625rem;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
    flex: 0 0 auto;
}

.table .btn i{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
    line-height: 1;
}

.table .btn:has(> i:only-child){
    width: var(--smartie-table-btn-size);
    min-width: var(--smartie-table-btn-size);
    max-width: var(--smartie-table-btn-size);
    padding-inline: 0;
}

.table td .btn-group,
.table td .btn-toolbar,
.table td .d-flex:has(.btn),
.table td .d-inline-flex:has(.btn){
    align-items: center;
    flex-wrap: nowrap;
}

.table td .btn-group > .btn{
    flex: 0 0 auto;
}

.table td .dropdown-toggle.btn::after{
    margin-left: .35rem;
}

@media (max-width: 575.98px){
    .table .btn{
        --smartie-table-btn-size: 30px;
        padding-inline: .5rem;
    }
}

/* ======================================================
   DARK REPORT AND TABLE SURFACES
   ====================================================== */
@media screen{
    body[data-pc-theme="dark"] .pc-content .card:not(.bg-transparent){
        background-color: rgba(255, 255, 255, .035);
        border-color: rgba(255, 255, 255, .11);
        color: rgba(255, 255, 255, .86);
    }

    body[data-pc-theme="dark"] .pc-content .card-header,
    body[data-pc-theme="dark"] .pc-content .card-footer{
        background-color: rgba(255, 255, 255, .045);
        border-color: rgba(255, 255, 255, .11);
        color: rgba(255, 255, 255, .88);
    }

    body[data-pc-theme="dark"] .pc-content .card-body{
        color: rgba(255, 255, 255, .84);
    }

    body[data-pc-theme="dark"] .pc-content .report-summary,
    body[data-pc-theme="dark"] .pc-content .summary-tile,
    body[data-pc-theme="dark"] .pc-content .summary-box,
    body[data-pc-theme="dark"] .pc-content .meta-box,
    body[data-pc-theme="dark"] .pc-content .policy-panel,
    body[data-pc-theme="dark"] .pc-content .allocation-block,
    body[data-pc-theme="dark"] .pc-content .assist-panel,
    body[data-pc-theme="dark"] .pc-content .staff-meta,
    body[data-pc-theme="dark"] .pc-content .company-logo-empty,
    body[data-pc-theme="dark"] .pc-content .empty-state{
        background: rgba(255, 255, 255, .055) !important;
        border-color: rgba(255, 255, 255, .12) !important;
        color: rgba(255, 255, 255, .88);
    }

    body[data-pc-theme="dark"] .pc-content :is(
        .report-summary,
        .summary-tile,
        .summary-box,
        .meta-box,
        .policy-panel,
        .allocation-block,
        .assist-panel,
        .staff-meta,
        .company-logo-empty,
        .empty-state
    ) :is(h1, h2, h3, h4, h5, h6){
        color: rgba(255, 255, 255, .92);
    }

    body[data-pc-theme="dark"] .table{
        --bs-table-color: rgba(255, 255, 255, .82);
        --bs-table-bg: transparent;
        --bs-table-border-color: rgba(255, 255, 255, .10);
        --bs-table-striped-bg: rgba(255, 255, 255, .03);
        --bs-table-hover-bg: rgba(255, 255, 255, .055);
        color: var(--bs-table-color);
        border-color: var(--bs-table-border-color);
    }

    body[data-pc-theme="dark"] .table > :not(caption) > * > *{
        border-color: var(--bs-table-border-color);
    }

    body[data-pc-theme="dark"] .table-light{
        --bs-table-bg: rgba(255, 255, 255, .09);
        --bs-table-color: rgba(255, 255, 255, .86);
        --bs-table-border-color: rgba(255, 255, 255, .12);
        background-color: var(--bs-table-bg) !important;
        color: var(--bs-table-color) !important;
        border-color: var(--bs-table-border-color) !important;
    }

    body[data-pc-theme="dark"] .table-light > th,
    body[data-pc-theme="dark"] .table-light > td,
    body[data-pc-theme="dark"] thead.table-light th,
    body[data-pc-theme="dark"] tfoot.table-light th,
    body[data-pc-theme="dark"] tfoot.table-light td,
    body[data-pc-theme="dark"] tr.table-light > th,
    body[data-pc-theme="dark"] tr.table-light > td{
        background-color: var(--bs-table-bg) !important;
        color: var(--bs-table-color) !important;
        border-color: var(--bs-table-border-color) !important;
    }

    body[data-pc-theme="dark"] .pc-content .bg-light,
    body[data-pc-theme="dark"] .pc-content .badge.bg-light,
    body[data-pc-theme="dark"] .pc-content .company-pill.bg-light{
        background-color: rgba(255, 255, 255, .085) !important;
        border-color: rgba(255, 255, 255, .14) !important;
        color: rgba(255, 255, 255, .84) !important;
    }

    body[data-pc-theme="dark"] .pc-content .badge.text-dark,
    body[data-pc-theme="dark"] .pc-content .bg-light.text-dark,
    body[data-pc-theme="dark"] .pc-content .company-pill.bg-light strong{
        color: rgba(255, 255, 255, .88) !important;
    }

    body[data-pc-theme="dark"] .pc-content .btn-light{
        --bs-btn-color: rgba(255, 255, 255, .86);
        --bs-btn-bg: rgba(255, 255, 255, .075);
        --bs-btn-border-color: rgba(255, 255, 255, .14);
        --bs-btn-hover-color: rgba(255, 255, 255, .95);
        --bs-btn-hover-bg: rgba(255, 255, 255, .12);
        --bs-btn-hover-border-color: rgba(255, 255, 255, .20);
        --bs-btn-active-color: rgba(255, 255, 255, .95);
        --bs-btn-active-bg: rgba(255, 255, 255, .16);
        --bs-btn-active-border-color: rgba(255, 255, 255, .22);
        background-color: var(--bs-btn-bg) !important;
        border-color: var(--bs-btn-border-color) !important;
        color: var(--bs-btn-color) !important;
    }

    body[data-pc-theme="dark"] .score-ring{
        background: conic-gradient(var(--bs-primary) calc(var(--score) * 1%), rgba(255, 255, 255, .14) 0) !important;
    }

    body[data-pc-theme="dark"] .score-ring > span{
        background: #1f2329 !important;
        color: rgba(255, 255, 255, .9);
    }

    body[data-pc-theme="dark"] .audit-meta pre{
        background: rgba(255, 255, 255, .055) !important;
        border-color: rgba(255, 255, 255, .12) !important;
        color: rgba(255, 255, 255, .82);
    }
}

/* ======================================================
   ACCOUNT SECURITY SETTINGS
   ====================================================== */
.security-summary-card .security-icon{
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--bs-primary-rgb), .1);
    color: var(--bs-primary);
    font-size: 1.6rem;
    flex: 0 0 auto;
}

.security-meta{
    display: grid;
    gap: 1rem;
}

.security-meta > div{
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: .85rem;
    border-bottom: 1px solid rgba(145, 158, 171, .18);
}

.security-meta > div:last-child{
    border-bottom: 0;
    padding-bottom: 0;
}

.security-meta span{
    color: var(--bs-secondary-color);
}

.security-meta strong{
    text-align: right;
    font-weight: 600;
}

.security-callout{
    display: flex;
    gap: .85rem;
    align-items: flex-start;
    padding: 1rem;
    border: 1px solid rgba(var(--bs-primary-rgb), .16);
    border-radius: 8px;
    background: rgba(var(--bs-primary-rgb), .04);
}

.security-callout > i{
    color: var(--bs-primary);
    font-size: 1.45rem;
    line-height: 1;
    margin-top: .1rem;
}

.security-callout.is-enabled{
    border-color: rgba(var(--bs-success-rgb), .2);
    background: rgba(var(--bs-success-rgb), .06);
}

.security-callout.is-enabled > i{
    color: var(--bs-success);
}

.security-method-card{
    padding: 1rem;
    border: 1px solid rgba(145, 158, 171, .18);
    border-radius: 8px;
    background: var(--bs-card-bg);
}

.security-method-card.is-active{
    border-color: rgba(var(--bs-success-rgb), .28);
    box-shadow: 0 0 0 1px rgba(var(--bs-success-rgb), .04);
}

.security-method-icon{
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--bs-primary-rgb), .10);
    color: var(--bs-primary);
    font-size: 1.35rem;
    flex: 0 0 auto;
}

.security-qr-wrap{
    width: min(100%, 260px);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: 1px solid rgba(145, 158, 171, .22);
    border-radius: 8px;
    background: #fff;
}

.security-qr-img{
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.security-qr-placeholder{
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-secondary-color);
    background: rgba(145, 158, 171, .08);
    border-radius: 6px;
    font-size: 3rem;
}

.security-secret{
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    padding: .55rem .7rem;
    border-radius: 6px;
    background: rgba(145, 158, 171, .12);
    color: var(--bs-body-color);
}

body[data-pc-theme="dark"] .security-qr-wrap{
    background: #fff;
}

body[data-pc-theme="dark"] .security-method-card{
    background: rgba(255, 255, 255, .035);
    border-color: rgba(255, 255, 255, .11);
}

body[data-pc-theme="dark"] .security-method-card.is-active{
    border-color: rgba(var(--bs-success-rgb), .42);
}

body[data-pc-theme="dark"] .security-method-card .badge.bg-light{
    background: rgba(255, 255, 255, .09) !important;
    color: rgba(255, 255, 255, .78) !important;
}

body[data-pc-theme="dark"] .security-secret{
    background: rgba(255, 255, 255, .08);
}

/* ======================================================
   MODAL VIEWPORT CONTAINMENT
   ====================================================== */
.modal:not(.modal-lightbox):not(.notification-modal){
    --smartie-modal-gap: 1rem;
}

.modal:not(.modal-lightbox):not(.notification-modal) .modal-dialog{
    margin-top: var(--smartie-modal-gap);
    margin-bottom: var(--smartie-modal-gap);
}

.modal.fade.modal-animate:not(.modal-lightbox):not(.notification-modal) .modal-dialog{
    height: calc(100dvh - (var(--smartie-modal-gap) * 2));
    max-height: calc(100dvh - (var(--smartie-modal-gap) * 2));
}

.modal:not(.modal-lightbox):not(.notification-modal) .modal-content{
    max-height: calc(100dvh - (var(--smartie-modal-gap) * 2));
    overflow: hidden;
}

.modal:not(.modal-lightbox):not(.notification-modal) .modal-header,
.modal:not(.modal-lightbox):not(.notification-modal) .modal-footer{
    flex-shrink: 0;
}

.modal:not(.modal-lightbox):not(.notification-modal) .modal-body{
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal:not(.modal-lightbox):not(.notification-modal) .modal-footer{
    gap: .5rem;
}

.modal:not(.modal-lightbox):not(.notification-modal) .modal-footer > small{
    max-width: min(56ch, 100%);
    line-height: 1.35;
}

@media (max-width: 575.98px){
    .modal:not(.modal-lightbox):not(.notification-modal){
        --smartie-modal-gap: .5rem;
    }

    .modal:not(.modal-lightbox):not(.notification-modal) .modal-footer{
        align-items: stretch;
    }

    .modal:not(.modal-lightbox):not(.notification-modal) .modal-footer > small{
        flex-basis: 100%;
    }

    .modal:not(.modal-lightbox):not(.notification-modal) .modal-footer .d-flex{
        width: 100%;
        justify-content: flex-end;
    }
}

