@import 'bootstrap/dist/css/bootstrap.min.css';
@import '@tabler/core/dist/css/tabler.min.css';
@import '@tabler/icons-webfont/dist/tabler-icons.min.css';

:root{
    --app-bg:#f4f7fb;
    --app-surface:#ffffff;
    --app-text:#172033;
    --app-muted:#667085;
    --app-border:#d9e2ef;
    --app-primary:#206bc4;
    --app-primary-dark:#123d73;
    --app-success:#2fb344;
    --app-danger:#d63939;
    --app-shadow:0 18px 50px rgba(15,23,42,.09);
}

*{
    box-sizing:border-box;
}

body{
    min-height:100vh;
    color:var(--app-text);
    background:var(--app-bg);
}

a{
    text-decoration:none;
}

.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    border-radius:10px;
    font-weight:700;
}

.btn-icon{
    width:34px;
    height:34px;
    padding:0;
}

.form-control,
.form-select{
    min-height:44px;
    border-color:var(--app-border);
    border-radius:10px;
}

.form-control:focus,
.form-select:focus{
    border-color:var(--app-primary);
    box-shadow:0 0 0 3px rgba(32,107,196,.14);
}

.form-label{
    color:#344054;
    font-weight:700;
}

.app-body{
    background:
        radial-gradient(circle at top left, rgba(32,107,196,.12), transparent 28%),
        var(--app-bg);
}

.app-shell{
    display:flex;
    min-height:100vh;
}

.app-sidebar{
    position:sticky;
    top:0;
    z-index:30;
    display:flex;
    flex-direction:column;
    width:280px;
    height:100vh;
    padding:20px;
    color:#e6eefb;
    background:#101828;
    border-right:1px solid rgba(255,255,255,.08);
}

.sidebar-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.sidebar-brand{
    display:inline-flex;
    align-items:center;
    gap:12px;
    min-width:0;
    color:#fff;
    font-size:18px;
    font-weight:800;
}

.sidebar-brand:hover{
    color:#fff;
}

.sidebar-brand-icon{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:42px;
    height:42px;
    flex:0 0 auto;
    border-radius:12px;
    color:#fff;
    background:linear-gradient(135deg, #206bc4, #2fb344);
}

.sidebar-brand-icon i{
    font-size:23px;
}

.sidebar-toggle{
    display:none;
    align-items:center;
    justify-content:center;
    width:40px;
    height:40px;
    border:0;
    border-radius:10px;
    color:#fff;
    background:rgba(255,255,255,.1);
}

.sidebar-toggle i{
    font-size:22px;
}

.sidebar-collapse{
    display:flex;
    flex:1;
    flex-direction:column;
    min-height:0;
    margin-top:28px;
}

.sidebar-collapse.collapse:not(.show){
    display:flex;
}

.sidebar-nav{
    display:grid;
    gap:8px;
}

.sidebar-nav-label{
    margin:4px 10px 8px;
    color:#98a2b3;
    font-size:12px;
    font-weight:800;
    letter-spacing:.08em;
    text-transform:uppercase;
}

.sidebar-link{
    display:flex;
    align-items:center;
    gap:12px;
    padding:12px 14px;
    color:#cbd5e1;
    border-radius:12px;
    font-weight:700;
}

.sidebar-link i{
    width:24px;
    color:#8fb7e8;
    font-size:22px;
}

.sidebar-link:hover,
.sidebar-link.active{
    color:#fff;
    background:rgba(255,255,255,.1);
}

.sidebar-link.active i{
    color:#72e0a0;
}

.sidebar-note{
    display:flex;
    align-items:center;
    gap:10px;
    margin-top:auto;
    padding:14px;
    color:#d7e4f7;
    border:1px solid rgba(255,255,255,.1);
    border-radius:14px;
    background:rgba(255,255,255,.06);
    font-size:13px;
    font-weight:700;
}

.sidebar-note i{
    color:#72e0a0;
    font-size:22px;
}

.app-main{
    display:flex;
    flex:1;
    min-width:0;
    flex-direction:column;
}

.app-topbar{
    position:sticky;
    top:0;
    z-index:20;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    min-height:78px;
    padding:16px 28px;
    background:rgba(244,247,251,.86);
    border-bottom:1px solid rgba(217,226,239,.75);
    backdrop-filter:blur(16px);
}

.topbar-title{
    display:grid;
    gap:2px;
}

.topbar-title strong{
    font-size:20px;
}

.topbar-kicker{
    color:var(--app-muted);
    font-size:12px;
    font-weight:800;
    letter-spacing:.08em;
    text-transform:uppercase;
}

.topbar-actions{
    display:flex;
    align-items:center;
    gap:12px;
}

.topbar-user-toggle{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:0;
    padding:6px 8px;
    color:var(--app-text);
    border:1px solid var(--app-border);
    border-radius:14px;
    background:#fff;
    box-shadow:0 8px 22px rgba(15,23,42,.04);
}

.topbar-user-toggle:hover{
    color:var(--app-text);
}

.topbar-user-meta{
    display:grid;
    min-width:0;
}

.topbar-user-meta strong,
.topbar-user-meta small{
    max-width:180px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.topbar-user-meta small{
    color:var(--app-muted);
}

.topbar-logout{
    min-height:42px;
}

.modern-dropdown{
    border:1px solid var(--app-border);
    border-radius:14px;
    box-shadow:var(--app-shadow);
}

.avatar,
.employee-avatar{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:38px;
    height:38px;
    flex:0 0 auto;
    color:#fff;
    border-radius:50%;
    background:linear-gradient(135deg, #206bc4, #2fb344);
    font-weight:800;
}

.app-content{
    flex:1;
    padding:28px;
}

.page-heading{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:18px;
    margin-bottom:20px;
}

.page-heading h1{
    margin:4px 0 6px;
    color:var(--app-text);
    font-size:30px;
    font-weight:850;
}

.page-heading p{
    margin:0;
    color:var(--app-muted);
}

.page-eyebrow{
    color:var(--app-primary);
    font-size:12px;
    font-weight:850;
    letter-spacing:.08em;
    text-transform:uppercase;
}

.page-actions{
    display:flex;
    gap:10px;
}

.metric-card,
.content-card,
.profile-card{
    border:1px solid rgba(217,226,239,.9);
    border-radius:18px;
    background:var(--app-surface);
    box-shadow:var(--app-shadow);
}

.metric-card{
    display:flex;
    align-items:center;
    gap:16px;
    min-height:142px;
    padding:22px;
}

.metric-icon{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:54px;
    height:54px;
    border-radius:16px;
}

.metric-icon i{
    font-size:28px;
}

.metric-card span{
    color:var(--app-muted);
    font-weight:700;
}

.metric-card strong{
    display:block;
    margin-top:5px;
    color:var(--app-text);
    font-size:34px;
    line-height:1;
}

.metric-card-primary .metric-icon{
    color:#fff;
    background:var(--app-primary);
}

.metric-card-success .metric-icon{
    color:#fff;
    background:var(--app-success);
}

.metric-card-muted .metric-icon{
    color:var(--app-primary);
    background:#e7f0ff;
}

.content-card{
    overflow:hidden;
}

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

.content-card-header h2,
.form-section-title h2{
    margin:0;
    color:var(--app-text);
    font-size:20px;
    font-weight:850;
}

.content-card-header p,
.form-section-title p{
    margin:4px 0 0;
    color:var(--app-muted);
}

.content-card-header > i{
    color:var(--app-primary);
    font-size:34px;
}

.modern-alert{
    display:flex;
    align-items:center;
    gap:10px;
    border:0;
    border-radius:14px;
    font-weight:700;
}

.modern-alert i{
    font-size:22px;
}

.modern-table{
    margin:0;
    vertical-align:middle;
}

.modern-table thead th{
    padding:16px 20px;
    color:#667085;
    background:#f8fafc;
    border-bottom:1px solid var(--app-border);
    font-size:12px;
    font-weight:850;
    letter-spacing:.06em;
    text-transform:uppercase;
}

.modern-table tbody td{
    padding:16px 20px;
    border-bottom:1px solid #edf2f7;
}

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

.table-id{
    display:inline-flex;
    padding:5px 9px;
    color:var(--app-primary);
    border-radius:999px;
    background:#e7f0ff;
    font-weight:800;
}

.employee-cell{
    display:flex;
    align-items:center;
    gap:12px;
    min-width:220px;
}

.employee-cell img{
    width:42px;
    height:42px;
    flex:0 0 auto;
    object-fit:cover;
    border-radius:50%;
}

.employee-cell strong,
.employee-cell span{
    display:block;
}

.employee-cell span{
    color:var(--app-muted);
    font-size:13px;
}

.table-actions{
    display:flex;
    justify-content:flex-end;
    gap:8px;
}

.empty-state{
    display:grid;
    justify-items:center;
    gap:8px;
    padding:34px;
    color:var(--app-muted);
    text-align:center;
}

.empty-state i{
    color:var(--app-primary);
    font-size:42px;
}

.empty-state strong{
    color:var(--app-text);
}

.pagination-wrap{
    margin-top:18px;
}

.form-card{
    padding:26px;
}

.form-section-title{
    display:flex;
    align-items:flex-start;
    gap:14px;
    margin-bottom:24px;
    padding-bottom:20px;
    border-bottom:1px solid var(--app-border);
}

.form-section-title > i{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:44px;
    height:44px;
    flex:0 0 auto;
    color:var(--app-primary);
    border-radius:12px;
    background:#e7f0ff;
    font-size:24px;
}

.form-actions{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    margin-top:24px;
    padding-top:20px;
    border-top:1px solid var(--app-border);
}

.asset-preview-grid{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    padding:12px;
    border:1px solid var(--app-border);
    border-radius:14px;
    background:#f8fafc;
}

.asset-preview-grid a{
    display:inline-flex;
    align-items:center;
    min-height:36px;
    padding:8px 12px;
    color:var(--app-primary);
    border-radius:10px;
    background:#e7f0ff;
    font-weight:800;
}

.qr-thumb-link{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:54px;
    height:54px;
    padding:4px;
    border:1px solid var(--app-border);
    border-radius:12px;
    background:#fff;
}

.qr-thumb{
    width:44px;
    height:44px;
    object-fit:contain;
}

.qr-preview-panel{
    display:flex;
    align-items:center;
    gap:20px;
}

.qr-preview-panel img{
    width:180px;
    height:180px;
    padding:12px;
    object-fit:contain;
    border:1px solid var(--app-border);
    border-radius:18px;
    background:#fff;
}

.qr-preview-panel > div{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.public-profile-page{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
    background:
        radial-gradient(circle at top left, rgba(32,107,196,.16), transparent 34%),
        var(--app-bg);
}

.public-profile-card{
    width:min(100%, 820px);
    padding:28px;
    border:1px solid rgba(217,226,239,.9);
    border-radius:22px;
    background:#fff;
    box-shadow:var(--app-shadow);
}

.profile-card{
    padding:28px;
}

.profile-settings-grid{
    display:grid;
    grid-template-columns:320px minmax(0, 1fr);
    gap:18px;
    align-items:start;
}

.profile-summary-card{
    position:sticky;
    top:104px;
    display:grid;
    justify-items:center;
    padding:28px;
    text-align:center;
    border:1px solid rgba(217,226,239,.9);
    border-radius:18px;
    background:#fff;
    box-shadow:var(--app-shadow);
}

.profile-summary-avatar{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:92px;
    height:92px;
    color:#fff;
    border-radius:28px;
    background:linear-gradient(135deg, #206bc4, #2fb344);
    font-size:34px;
    font-weight:850;
}

.profile-summary-card h2{
    margin:18px 0 4px;
    font-size:24px;
    font-weight:850;
}

.profile-summary-card p{
    max-width:100%;
    margin:0;
    overflow:hidden;
    color:var(--app-muted);
    text-overflow:ellipsis;
    white-space:nowrap;
}

.profile-summary-meta{
    display:grid;
    gap:10px;
    width:100%;
    margin-top:22px;
}

.profile-summary-meta div{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:12px 14px;
    border:1px solid var(--app-border);
    border-radius:14px;
    background:#f8fafc;
}

.profile-summary-meta span{
    color:var(--app-muted);
    font-size:12px;
    font-weight:850;
    letter-spacing:.06em;
    text-transform:uppercase;
}

.profile-summary-meta strong{
    max-width:150px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.profile-settings-stack{
    display:grid;
    gap:18px;
}

.danger-zone{
    border-color:rgba(214,57,57,.22);
}

.danger-zone .form-section-title > i{
    color:var(--app-danger);
    background:#fff1f1;
}

.profile-hero{
    display:flex;
    align-items:center;
    gap:18px;
    padding-bottom:24px;
    border-bottom:1px solid var(--app-border);
}

.profile-hero img,
.profile-hero > span{
    width:92px;
    height:92px;
    flex:0 0 auto;
    border-radius:24px;
}

.profile-hero img{
    object-fit:cover;
}

.profile-hero > span{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    color:#fff;
    background:linear-gradient(135deg, #206bc4, #2fb344);
    font-size:34px;
    font-weight:850;
}

.profile-hero h2{
    margin:0;
    font-size:28px;
    font-weight:850;
}

.profile-hero p{
    margin:4px 0 0;
    color:var(--app-primary);
    font-weight:800;
}

.profile-details{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:14px;
    margin-top:22px;
}

.profile-details div{
    padding:16px;
    border:1px solid var(--app-border);
    border-radius:14px;
    background:#f8fafc;
}

.profile-details span,
.profile-details strong{
    display:block;
}

.profile-details span{
    color:var(--app-muted);
    font-size:12px;
    font-weight:850;
    letter-spacing:.06em;
    text-transform:uppercase;
}

.profile-details strong{
    margin-top:6px;
    word-break:break-word;
}

.profile-detail-wide{
    grid-column:1 / -1;
}

.public-pks-panel{
    display:grid;
    gap:14px;
    margin-top:24px;
    padding-top:24px;
    border-top:1px solid var(--app-border);
}

.public-pks-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
}

.public-pks-header h3{
    margin:2px 0 0;
    font-size:20px;
    font-weight:850;
}

.public-pks-viewer{
    overflow:hidden;
    min-height:520px;
    border:1px solid var(--app-border);
    border-radius:14px;
    background:#f8fafc;
}

.public-pks-viewer iframe{
    display:block;
    width:100%;
    height:70vh;
    min-height:520px;
    border:0;
}

.public-pks-empty{
    display:grid;
    gap:4px;
    padding:16px;
    border:1px solid var(--app-border);
    border-radius:14px;
    background:#f8fafc;
}

.public-pks-empty span{
    color:var(--app-muted);
}

.app-footer{
    padding:0 28px 24px;
}

.footer-inner{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    color:var(--app-muted);
    font-size:13px;
}

.guest-auth-page{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
    background:#eef2f7;
}

.guest-auth-card{
    width:min(100%, 460px);
    padding:28px;
    background:#fff;
    border-radius:12px;
    box-shadow:0 18px 45px rgba(15,23,42,.12);
}

.login-page{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:32px;
    background:
        radial-gradient(circle at top left, rgba(32,107,196,.18), transparent 34%),
        linear-gradient(135deg, #f8fafc 0%, #e8edf5 48%, #dfe7f1 100%);
}

.login-page-inner{
    width:min(100%, 1040px);
}

.login-shell{
    display:grid;
    grid-template-columns:minmax(0, 1.08fr) minmax(360px, .92fr);
    min-height:620px;
    overflow:hidden;
    border-radius:24px;
    background:#fff;
    box-shadow:0 24px 70px rgba(15,23,42,.18);
}

.login-brand-panel{
    position:relative;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    padding:44px;
    color:#fff;
    background:
        linear-gradient(145deg, rgba(10,43,92,.94), rgba(32,107,196,.90)),
        url("data:image/svg+xml,%3Csvg width='720' height='720' viewBox='0 0 720 720' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg opacity='.22'%3E%3Cpath d='M82 170H638M82 306H638M82 442H638M82 578H638M170 82V638M306 82V638M442 82V638M578 82V638' stroke='white' stroke-width='2'/%3E%3Ccircle cx='170' cy='170' r='18' fill='white'/%3E%3Ccircle cx='442' cy='306' r='18' fill='white'/%3E%3Ccircle cx='306' cy='578' r='18' fill='white'/%3E%3C/g%3E%3C/svg%3E");
    background-size:cover;
}

.login-brand{
    display:inline-flex;
    align-items:center;
    gap:12px;
    width:max-content;
    color:#fff;
    font-size:20px;
    font-weight:800;
}

.login-brand:hover{
    color:#fff;
}

.login-brand-icon,
.login-form-icon{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:44px;
    height:44px;
    border-radius:12px;
}

.login-brand-icon{
    background:rgba(255,255,255,.18);
    border:1px solid rgba(255,255,255,.24);
}

.login-brand-icon i,
.login-form-icon i{
    font-size:24px;
}

.login-brand-content{
    max-width:520px;
}

.login-eyebrow{
    display:inline-flex;
    margin-bottom:18px;
    color:#bfdbfe;
    font-size:13px;
    font-weight:800;
    letter-spacing:.08em;
    text-transform:uppercase;
}

.login-brand-content h1{
    margin:0;
    color:#fff;
    font-size:42px;
    font-weight:850;
    line-height:1.12;
}

.login-brand-content p{
    max-width:440px;
    margin:18px 0 0;
    color:#dbeafe;
    font-size:16px;
    line-height:1.7;
}

.login-stats{
    display:flex;
    gap:14px;
}

.login-stats div{
    min-width:128px;
    padding:14px 16px;
    border:1px solid rgba(255,255,255,.18);
    border-radius:14px;
    background:rgba(255,255,255,.12);
}

.login-stats strong,
.login-stats span{
    display:block;
}

.login-stats strong{
    color:#fff;
    font-size:22px;
    line-height:1;
}

.login-stats span{
    margin-top:6px;
    color:#cfe2ff;
    font-size:13px;
}

.login-form-panel{
    display:flex;
    flex-direction:column;
    justify-content:center;
    padding:48px;
}

.login-form-header{
    display:flex;
    align-items:center;
    gap:14px;
    margin-bottom:28px;
}

.login-form-icon{
    flex:0 0 auto;
    color:var(--app-primary);
    background:#e7f0ff;
}

.login-form-header h2{
    margin:0;
    color:var(--app-text);
    font-size:30px;
    font-weight:850;
}

.login-form-header p{
    margin:4px 0 0;
    color:var(--app-muted);
}

.login-form .form-control{
    min-height:48px;
}

.login-options{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin:8px 0 24px;
}

.login-options a{
    color:var(--app-primary);
    font-weight:800;
}

.login-options a:hover{
    text-decoration:underline;
}

.login-submit{
    min-height:48px;
}

@media(max-width:991.98px){
    .app-shell{
        display:block;
    }

    .app-sidebar{
        position:sticky;
        top:0;
        width:100%;
        height:auto;
        padding:12px 16px;
    }

    .sidebar-toggle{
        display:inline-flex;
    }

    .sidebar-collapse{
        display:block;
        flex:none;
        margin-top:12px;
    }

    .sidebar-collapse.collapse:not(.show){
        display:none;
    }

    .sidebar-nav{
        padding-top:6px;
    }

    .sidebar-note{
        display:none;
    }

    .app-topbar{
        min-height:auto;
        padding:14px 16px;
    }

    .topbar-title{
        display:none;
    }

    .topbar-actions{
        width:100%;
        justify-content:space-between;
    }

    .topbar-user-toggle{
        max-width:100%;
    }

    .topbar-user-meta small{
        display:none;
    }

    .app-content{
        padding:18px 16px;
    }

    .app-footer{
        padding:0 16px 18px;
    }
}

@media(max-width:767.98px){
    .page-heading{
        flex-direction:column;
        align-items:stretch;
    }

    .page-heading h1{
        font-size:26px;
    }

    .page-heading .btn,
    .page-actions,
    .page-actions .btn{
        width:100%;
    }

    .page-actions{
        flex-direction:column;
    }

    .metric-card{
        min-height:118px;
    }

    .table-actions{
        justify-content:flex-start;
        flex-wrap:wrap;
        min-width:190px;
    }

    .form-card,
    .profile-card{
        padding:20px;
        border-radius:16px;
    }

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

    .form-actions .btn{
        width:100%;
    }

    .profile-hero{
        align-items:flex-start;
        flex-direction:column;
    }

    .profile-details{
        grid-template-columns:1fr;
    }

    .public-pks-header{
        align-items:flex-start;
        flex-direction:column;
    }

    .public-pks-open{
        width:100%;
    }

    .public-pks-viewer,
    .public-pks-viewer iframe{
        min-height:420px;
    }

    .profile-settings-grid{
        grid-template-columns:1fr;
    }

    .profile-summary-card{
        position:static;
    }

    .footer-inner{
        align-items:flex-start;
        flex-direction:column;
    }

    .guest-auth-page,
    .login-page{
        padding:16px;
    }

    .guest-auth-card{
        padding:22px;
        border-radius:14px;
    }

    .login-shell{
        grid-template-columns:1fr;
        min-height:auto;
        border-radius:18px;
    }

    .login-brand-panel{
        min-height:260px;
        padding:28px;
    }

    .login-brand-content{
        margin-top:32px;
    }

    .login-brand-content h1{
        font-size:28px;
    }

    .login-brand-content p{
        font-size:14px;
    }

    .login-stats{
        display:none;
    }

    .login-form-panel{
        padding:28px;
    }

    .login-form-header{
        align-items:flex-start;
    }

    .login-form-header h2{
        font-size:26px;
    }

    .login-options{
        align-items:flex-start;
        flex-direction:column;
        gap:10px;
    }
}

@media(max-width:575.98px){
    .topbar-user-meta strong{
        max-width:120px;
    }
}
