:root{--bg:#f5f7fb;--ink:#171b22;--muted:#667085;--line:#d8dee8;--panel:rgba(255,255,255,.96);--dark:#20242b;--red:#e21d2d;--red-dark:#b70f1d;--teal:#0e8f86;--blue:#255d8f;--shadow:0 22px 58px rgba(25,30,40,.13)}
*{box-sizing:border-box}
html,body{width:100%;max-width:100%;min-height:100%;overflow-x:hidden}
body{margin:0;font-family:"Cairo",Tahoma,Arial,sans-serif;color:var(--ink);background:radial-gradient(circle at 12% 8%,rgba(226,29,45,.1),transparent 26rem),radial-gradient(circle at 90% 10%,rgba(14,143,134,.12),transparent 26rem),linear-gradient(135deg,#fbfcfe,var(--bg));letter-spacing:0}
img,svg,video{max-width:100%;height:auto}
a{text-decoration:none;color:inherit}
button,input,textarea,select{font:inherit}
.ambient{position:fixed;inset:0;pointer-events:none;background-image:linear-gradient(rgba(32,37,46,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(32,37,46,.035) 1px,transparent 1px);background-size:42px 42px;mask-image:linear-gradient(to bottom,#000,transparent 78%)}

.btn{border:0;border-radius:8px;padding:12px 20px;min-height:46px;display:inline-flex;align-items:center;justify-content:center;font-weight:800;cursor:pointer;transition:.22s}
.btn:hover{transform:translateY(-2px)}
.btn.primary{color:#fff;background:linear-gradient(135deg,var(--red),var(--red-dark));box-shadow:0 18px 36px rgba(226,29,45,.22)}
.btn.ghost{background:#fff;border:1px solid var(--line)}
.btn.full{width:100%}
.btn.small{min-height:34px;padding:7px 12px;font-size:13px}
.btn:disabled{opacity:.55;cursor:not-allowed;transform:none}

.landing{width:min(1180px,calc(100% - 32px));margin:0 auto;padding:32px 0}
.hero{min-height:82vh;display:grid;grid-template-columns:1.1fr .9fr;gap:30px;align-items:center}
.hero h1{font-size:clamp(34px,6vw,70px);line-height:1.1;margin:14px 0}
.hero p{color:var(--muted);font-size:19px;line-height:1.9}
.hero-logo{width:190px;margin-bottom:24px}
.eyebrow{color:var(--red);font-weight:800}
.hero-actions,.action-list{display:flex;flex-wrap:wrap;gap:12px;margin-top:24px}
.hero-panel,.auth-art{border-radius:8px;padding:30px;color:#fff;background:linear-gradient(145deg,rgba(32,36,43,.97),rgba(13,15,20,.95));box-shadow:var(--shadow)}
.hero-panel{min-height:480px;display:grid;align-content:end}
.metric-card,.mini-grid,.auth-highlights span{background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.12);border-radius:8px;padding:20px}
.metric-card strong{display:block;font-size:58px}
.mini-grid{margin-top:14px;display:grid;grid-template-columns:1fr auto;gap:12px}
.feature-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}
.feature-strip article,.stat-card,.panel,.auth-card{background:var(--panel);border:1px solid rgba(216,222,232,.9);border-radius:8px;box-shadow:var(--shadow);backdrop-filter:blur(16px)}
.feature-strip article{padding:18px;font-weight:800}

.auth-layout{min-height:100vh;display:grid;grid-template-columns:minmax(360px,510px) 1fr;gap:24px;padding:24px}
.auth-card{padding:30px;display:grid;gap:16px;align-content:center}
.auth-card img{width:160px}
.auth-card h1{margin:0;font-size:30px}
.form-note,.empty{color:var(--muted);line-height:1.7}
.demo-box{display:grid;gap:5px;padding:12px;border-radius:8px;background:#f7f9fc;color:var(--muted)}
.auth-art{display:grid;align-content:end}
.auth-art h2{font-size:clamp(32px,5vw,56px);line-height:1.2}
.auth-art p{color:rgba(255,255,255,.75);line-height:1.9}
.auth-highlights{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}

label{display:grid;gap:8px;font-weight:800}
input,textarea,select{width:100%;min-width:0;border:1px solid var(--line);border-radius:8px;padding:11px 12px;background:#fff;color:var(--ink);outline:none}
textarea{min-height:96px;resize:vertical}
input:focus,textarea:focus,select:focus{border-color:var(--red);box-shadow:0 0 0 4px rgba(226,29,45,.1)}

.sidebar{position:fixed;top:18px;bottom:18px;right:18px;width:280px;padding:20px;color:#fff;background:linear-gradient(180deg,rgba(32,36,43,.98),rgba(25,28,34,.98));border-radius:8px;box-shadow:var(--shadow);display:flex;flex-direction:column;z-index:3}
.brand{display:flex;align-items:center;gap:12px;font-weight:800;margin-bottom:24px}
.brand img{width:122px}
.sidebar nav{display:grid;gap:8px}
.sidebar nav a,.logout{color:rgba(255,255,255,.82);padding:12px;border-radius:8px;transition:.2s}
.sidebar nav a:hover,.sidebar nav a.active,.logout:hover{color:#fff;background:rgba(255,255,255,.1)}
.logout{margin-top:auto}
.nav-badge{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;margin-right:6px;padding:0 7px;border-radius:999px;color:#fff;background:var(--red);font-size:12px}

.app-shell{min-height:100vh;margin-right:316px;padding:22px 22px 60px;position:relative}
.topbar{min-height:92px;display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}
.topbar p{margin:0;color:var(--muted)}
.topbar h1{margin:2px 0 0;font-size:clamp(28px,3vw,42px)}
.role-pill,.lock-badge{padding:9px 14px;border-radius:8px;background:#fff;border:1px solid var(--line);font-weight:800;white-space:nowrap}
.lock-badge.locked{color:var(--red);background:rgba(226,29,45,.08)}
.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:16px}
.stat-card,.panel{min-width:0;padding:22px}
.stat-card span,.stat-card small{color:var(--muted)}
.stat-card strong{display:block;font-size:clamp(24px,2.2vw,32px);margin:8px 0;overflow-wrap:anywhere}
.dashboard-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px}
.manager-layout{grid-template-columns:320px minmax(0,1fr)}
.panel h2{margin:0 0 16px}
.section-head{display:flex;justify-content:space-between;gap:14px;align-items:center;margin-bottom:16px}
.action-list a{flex:1 1 220px;padding:16px;border-radius:8px;background:#fff;border:1px solid var(--line);font-weight:800}
.clean-list{line-height:2;color:var(--muted)}

.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.form-grid .wide{grid-column:1/-1}
.rating-row{display:grid;grid-template-columns:minmax(170px,1.2fr) repeat(4,minmax(92px,1fr));gap:10px;align-items:center;background:#f4f7fb;border:1px solid #edf0f4;border-radius:8px;padding:12px}
.radio-pill input{position:absolute;opacity:0}
.radio-pill span{display:grid;place-items:center;min-height:42px;border-radius:8px;background:#fff;border:1px solid var(--line);cursor:pointer;text-align:center}
.radio-pill input:checked+span{color:#fff;background:var(--dark);border-color:var(--dark)}
.text-question{background:#fff;border:1px solid var(--line);border-radius:8px;padding:16px}
.table-wrap{width:100%;overflow-x:auto}
table{width:100%;border-collapse:collapse;min-width:760px}
th,td{padding:12px;border-bottom:1px solid var(--line);text-align:right;vertical-align:middle}
th{color:var(--muted);font-size:13px}
td small{display:block;color:var(--muted)}
.employee-list{display:grid;gap:10px}
.employee-list a{padding:13px;border:1px solid var(--line);border-radius:8px;background:#fff}
.employee-list a.active{border-color:var(--red);box-shadow:0 0 0 4px rgba(226,29,45,.09)}
.alert{padding:13px 16px;border-radius:8px;background:rgba(14,143,134,.1);color:#08665f;border:1px solid rgba(14,143,134,.2);margin-bottom:16px;font-weight:800}
.alert.danger{background:rgba(226,29,45,.1);color:var(--red-dark)}
.status-pill{display:inline-flex;justify-content:center;min-width:84px;padding:6px 10px;border-radius:8px;font-weight:800;border:1px solid var(--line);background:#fff}
.pending{color:#8a5a00;background:#fff7e3}
.approved{color:#087443;background:#e8fff4}
.rejected{color:#b42318;background:#fff0f0}
.mission-actions{display:grid;grid-template-columns:auto minmax(150px,1fr) auto;gap:8px}
.notification-list{display:grid;gap:10px}
.notification-item{display:grid;gap:5px;padding:14px;border:1px solid var(--line);border-radius:8px;background:#fff}
.notification-item.unread{border-color:rgba(226,29,45,.32);background:rgba(226,29,45,.045)}
.notification-item span,.notification-item small{color:var(--muted)}
.reveal{opacity:0;transform:translateY(18px);transition:.7s}
.reveal.visible{opacity:1;transform:translateY(0)}

@media(max-width:1180px){
    .stats-grid{grid-template-columns:repeat(2,1fr)}
    .dashboard-grid,.manager-layout{grid-template-columns:1fr}
}

@media(max-width:920px){
    html{
        width:100%!important;
        max-width:100%!important;
        min-height:0!important;
        height:auto!important;
        overflow-x:hidden!important;
        overflow-y:auto!important;
    }

    body{
        width:100%!important;
        max-width:100%!important;
        min-height:0!important;
        height:auto!important;
        overflow-x:hidden!important;
        overflow-y:auto!important;
        margin:0!important;
        padding:0!important;
        touch-action:pan-y;
    }

    body::before,
    body::after,
    html::before,
    html::after{
        display:none!important;
        content:none!important;
        height:0!important;
        min-height:0!important;
        max-height:0!important;
    }

    .ambient,
    audio,
    #notifySound{
        display:none!important;
        height:0!important;
        min-height:0!important;
        max-height:0!important;
        overflow:hidden!important;
    }

    .landing{
        width:100%;
        padding:12px;
    }

    .hero,
    .auth-layout{
        grid-template-columns:1fr;
        gap:14px;
        min-height:0!important;
        height:auto!important;
        padding:10px;
    }

    .auth-layout{
        align-content:start;
    }

    .hero h1{font-size:32px}
    .hero p{font-size:15px}
    .hero-logo{width:128px}
    .hero-actions{display:grid;grid-template-columns:1fr}
    .hero-panel,.auth-art{min-height:0!important;height:auto!important;padding:18px}
    .feature-strip,.stats-grid,.form-grid,.auth-highlights{grid-template-columns:1fr}
    .auth-card{padding:18px}
    .auth-card img{width:118px}

    .sidebar{
        position:fixed!important;
        top:0!important;
        right:0!important;
        bottom:auto!important;
        width:min(86vw,340px)!important;
        max-width:340px!important;
        height:100dvh!important;
        min-height:0!important;
        max-height:100dvh!important;
        padding:18px 16px!important;
        border-radius:0!important;
        overflow-y:auto!important;
        overflow-x:hidden!important;
        transform:translateX(110%);
        transition:transform .24s ease;
        z-index:10000!important;
        box-shadow:-22px 0 48px rgba(15,23,42,.22);
    }

    body.sidebar-open .sidebar{
        transform:translateX(0);
    }

    .brand{
        display:grid!important;
        grid-template-columns:86px minmax(0,1fr);
        align-items:center;
        gap:12px;
        width:100%;
        min-height:0!important;
        height:auto!important;
        margin-bottom:14px;
        padding:10px 8px;
    }

    .brand img{
        width:86px!important;
        max-width:86px!important;
        max-height:58px!important;
        object-fit:contain;
    }

    .brand span{
        font-size:15px;
        font-weight:800;
        line-height:1.35;
        white-space:normal;
        overflow-wrap:anywhere;
    }

    .sidebar nav{
        display:flex!important;
        flex-direction:column!important;
        gap:9px!important;
        width:100%;
        overflow:visible!important;
        padding:0!important;
        margin:0!important;
    }

    .sidebar nav a,
    .logout{
        display:flex!important;
        align-items:center;
        justify-content:flex-start;
        width:100%!important;
        min-height:48px;
        flex:0 0 auto;
        white-space:normal!important;
        padding:12px 14px!important;
        font-size:14px;
        line-height:1.45;
        text-align:right;
        box-sizing:border-box;
    }

    .logout{
        justify-content:center;
        margin-top:18px!important;
    }

    .app-shell{
        display:block;
        min-height:0!important;
        height:auto!important;
        max-height:none!important;
        margin:0!important;
        width:100%;
        max-width:100%;
        padding:72px 10px 10px!important;
        overflow:visible!important;
        position:relative;
    }

    main,
    section,
    article,
    .dashboard-grid,
    .stats-grid,
    .panel,
    .stat-card,
    .table-wrap{
        min-height:0!important;
        height:auto!important;
        max-height:none!important;
    }

    .topbar{
        min-height:0!important;
        display:grid;
        grid-template-columns:minmax(0,1fr) auto;
        gap:12px;
        align-items:center;
        margin-bottom:14px;
        padding-inline-start:58px;
    }

    .topbar h1{font-size:24px;line-height:1.35}
    .topbar p{font-size:13px}
    .role-pill{white-space:nowrap}

    .section-head{
        align-items:flex-start;
        flex-direction:column;
    }

    .dashboard-grid,
    .stats-grid{
        gap:14px!important;
        margin:0!important;
        padding:0!important;
    }

    .panel,
    .stat-card{
        width:100%;
        max-width:100%;
        padding:14px;
        margin:0 0 12px!important;
    }

    .panel:last-child,
    .stat-card:last-child,
    section:last-child,
    article:last-child,
    .dashboard-grid:last-child,
    .stats-grid:last-child{
        margin-bottom:0!important;
        padding-bottom:0!important;
    }

    .panel h2{font-size:20px}
    .action-list{display:grid;grid-template-columns:1fr}
    .btn{width:100%}
    input,textarea,select{max-width:100%;min-height:44px}
    .rating-row{grid-template-columns:1fr 1fr;max-width:100%;overflow:hidden}
    .rating-row strong{grid-column:1/-1}

    .table-wrap{
        overflow:visible;
        max-width:100%;
    }

    table{
        min-width:0;
        border-collapse:separate;
        border-spacing:0 10px;
    }

    thead{display:none}
    tbody,tr,td{display:block;width:100%}

    tr{
        background:#fff;
        border:1px solid var(--line);
        border-radius:8px;
        padding:10px;
        box-shadow:0 10px 24px rgba(25,30,40,.07);
        overflow-wrap:anywhere;
    }

    td{
        border-bottom:1px solid #edf0f4;
        padding:9px 4px;
    }

    td:last-child{border-bottom:0}
    .mission-actions{grid-template-columns:1fr;width:100%}
    .notification-item{overflow-wrap:anywhere}

    .reveal{
        opacity:1!important;
        transform:none!important;
        transition:none!important;
    }

    #enableNotifySound{
        position:fixed!important;
        left:12px!important;
        bottom:12px!important;
        width:auto!important;
        max-width:calc(100vw - 24px)!important;
        min-height:38px!important;
        padding:8px 12px!important;
        margin:0!important;
    }

    body.sidebar-open{
        height:100dvh!important;
        max-height:100dvh!important;
        overflow:hidden!important;
    }

    body.sidebar-open .app-shell{
        display:none!important;
    }
}

@media(max-width:420px){
    .sidebar{
        width:90vw!important;
        padding:16px 12px!important;
    }

    .brand{
        grid-template-columns:76px minmax(0,1fr);
    }

    .brand img{
        width:76px!important;
        max-width:76px!important;
        max-height:52px!important;
    }

    .sidebar nav a,
    .logout{
        min-height:46px;
        padding:11px 12px!important;
        font-size:14px;
    }

    .topbar h1{font-size:21px}
    .app-shell{padding-bottom:8px!important}
}