:root{
    --pink:#FFA0A1;
    --pink-soft:#fff0f0;
    --black:#111111;
    --white:#ffffff;
    --gray:#777777;
    --line:#eeeeee;
    --danger:#d93025;
    --success:#167c3a;
    --warning:#8a5b00;
    --radius:22px;
    --shadow:0 18px 50px rgba(17,17,17,.08);
}

*{box-sizing:border-box}
body{
    margin:0;
    font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color:var(--black);
    background:#fafafa;
}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit}
img{max-width:100%}

.app-shell{
    display:grid;
    grid-template-columns:280px 1fr;
    min-height:100vh;
}
.sidebar{
    background:var(--white);
    border-right:1px solid var(--line);
    padding:26px;
    position:sticky;
    top:0;
    height:100vh;
    display:flex;
    flex-direction:column;
    gap:28px;
}
.brand{
    display:flex;
    align-items:center;
    gap:12px;
    font-weight:800;
    letter-spacing:-.04em;
    font-size:20px;
}
.brand-mark{
    width:44px;
    height:44px;
    border-radius:16px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:var(--pink);
    color:var(--black);
    font-weight:900;
    overflow:hidden;
}
.image-mark{background:transparent;border-radius:0}
.image-mark img{width:44px;height:44px;object-fit:contain}
.nav{display:flex;flex-direction:column;gap:8px}
.nav a{
    padding:13px 14px;
    border-radius:15px;
    color:#555;
    transition:.2s ease;
}
.nav a:hover,.nav a.active{background:var(--black);color:var(--white)}
.sidebar-user{
    margin-top:auto;
    background:var(--pink-soft);
    border:1px solid #ffd6d6;
    border-radius:20px;
    padding:16px;
    display:flex;
    flex-direction:column;
    gap:5px;
}
.sidebar-user small{color:var(--gray)}
.sidebar-user a{font-weight:700;margin-top:8px}

.main{padding:34px;min-width:0}
.topbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:26px;
}
.topbar h1{margin:0;font-size:34px;letter-spacing:-.05em}
.topbar p{margin:8px 0 0;color:var(--gray)}
.toolbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    margin-bottom:24px;
}
.search{display:flex;gap:10px;flex:1;max-width:720px}
.search input{width:100%}

.form{display:flex;flex-direction:column;gap:12px}
.form label{font-weight:700;font-size:14px}
.form-grid{display:grid;gap:14px}
.form-grid.two{grid-template-columns:repeat(2,1fr)}
.form-actions{margin-top:18px;display:flex;justify-content:flex-end}
input,select,textarea{
    width:100%;
    border:1px solid var(--line);
    background:var(--white);
    border-radius:15px;
    padding:13px 14px;
    outline:none;
}
input[type="checkbox"]{width:18px;height:18px;accent-color:var(--pink)}
input:focus,select:focus,textarea:focus{border-color:var(--pink);box-shadow:0 0 0 4px rgba(255,160,161,.25)}
textarea{resize:vertical}
small{color:var(--gray)}

.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    border:0;
    border-radius:14px;
    padding:11px 15px;
    cursor:pointer;
    font-weight:800;
    white-space:nowrap;
}
.btn.full{width:100%}
.btn-dark{background:var(--black);color:var(--white)}
.btn-primary{background:var(--pink);color:var(--black)}
.btn-light{background:#f5f5f5;color:var(--black);border:1px solid var(--line)}
.btn-danger{background:var(--danger);color:var(--white)}
.btn[disabled]{opacity:.65;cursor:not-allowed}
.icon-btn{
    border:0;
    background:#f4f4f4;
    width:40px;
    height:40px;
    border-radius:50%;
    cursor:pointer;
    font-size:26px;
    line-height:1;
}
.inline-form{display:inline-flex}

.section-block,.panel{
    background:var(--white);
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:22px;
    box-shadow:var(--shadow);
    margin-bottom:24px;
}
.narrow-panel{max-width:760px}
.section-title{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    margin-bottom:18px;
}
.section-title h2{margin:0;font-size:20px;letter-spacing:-.03em}
.section-title span{color:var(--gray);font-size:14px}
.compact-title{margin-bottom:12px}

.grid{display:grid;gap:16px}
.cards-grid{grid-template-columns:repeat(auto-fill,minmax(230px,1fr))}
.card{
    border:1px solid var(--line);
    border-radius:22px;
    padding:18px;
    min-height:205px;
    background:var(--white);
    display:flex;
    flex-direction:column;
    gap:14px;
    transition:.2s ease;
    cursor:pointer;
}
.card:hover{transform:translateY(-3px);box-shadow:0 16px 35px rgba(17,17,17,.09);border-color:#ffd1d2}
.card-icon{
    width:52px;
    height:52px;
    border-radius:18px;
    background:var(--pink-soft);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:28px;
}
.card-icon.big{width:76px;height:76px;font-size:42px;margin:0 auto 10px}
.card h3{
    margin:0;
    font-size:16px;
    line-height:1.25;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
}
.card p{margin:8px 0;color:var(--gray);font-size:14px}
.card-actions{margin-top:auto;display:flex;gap:8px;flex-wrap:wrap}
.meta{display:flex;justify-content:space-between;gap:8px;color:var(--gray);font-size:13px;margin-bottom:6px}

.empty-state{
    border:1px dashed #ddd;
    border-radius:18px;
    padding:30px;
    color:var(--gray);
    text-align:center;
    background:#fbfbfb;
}
.empty-state.small{padding:18px}
.breadcrumbs{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:14px;color:var(--gray)}
.breadcrumbs a{font-weight:700;color:var(--black)}

.admin-grid{display:grid;grid-template-columns:360px 1fr;gap:22px;align-items:start}
.admin-grid .wide{min-width:0}
.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:18px}
table{width:100%;border-collapse:collapse;background:var(--white);min-width:780px}
th,td{padding:14px;border-bottom:1px solid var(--line);text-align:left;vertical-align:middle}
th{font-size:13px;text-transform:uppercase;letter-spacing:.04em;color:#666;background:#fbfbfb}
tr:last-child td{border-bottom:0}
.actions-cell{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.actions-cell.center{justify-content:center}
.check-center{text-align:center}
.inline-edit-form{display:grid;grid-template-columns:1fr 1.2fr 120px 110px 1fr auto;gap:8px;align-items:center;min-width:720px}
.status{display:inline-flex;align-items:center;gap:5px;padding:5px 10px;border-radius:999px;font-size:12px;font-weight:800}
.status.active,.status.completed{background:#e8f6ee;color:var(--success)}
.status.inactive{background:#f4f4f4;color:#555}
.status.pending{background:#fff5d9;color:var(--warning)}
.alert{padding:13px 15px;border-radius:15px;margin-bottom:18px;font-weight:700}
.alert-success{background:#e8f6ee;color:var(--success)}
.alert-error{background:#fdeaea;color:var(--danger)}

.login-page{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at top left, var(--pink-soft), transparent 34%), #fafafa;padding:22px}
.login-card{width:min(450px,100%);background:var(--white);border:1px solid var(--line);border-radius:30px;box-shadow:var(--shadow);padding:34px}
.login-brand{margin-bottom:28px;display:flex;align-items:center;gap:16px}
.login-logo{width:74px;height:74px;object-fit:contain;flex:0 0 auto}
.login-card h1{font-size:32px;margin:0 0 8px;letter-spacing:-.05em}
.login-card p{color:var(--gray);margin:0}

.progress-wrap{width:100%}
.progress-meta{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;color:#555;font-size:13px}
.progress-meta strong{color:var(--black)}
.progress-track{height:12px;background:#f1f1f1;border-radius:999px;overflow:hidden}
.progress-bar{height:100%;width:0%;background:var(--pink);border-radius:999px;transition:width .25s ease}
.progress-wrap small{display:block;margin-top:8px;color:var(--gray)}
.progress-wrap.compact{margin-top:10px}
.progress-wrap.compact .progress-track{height:9px}
.progress-wrap.compact small{font-size:12px}

.induction-hero{display:grid;grid-template-columns:1fr minmax(280px,380px);gap:30px;align-items:center}
.induction-hero h2{font-size:28px;letter-spacing:-.04em;margin:0 0 10px}
.induction-hero p{color:var(--gray);margin:0;line-height:1.65}
.course-layout{display:grid;grid-template-columns:1fr 390px;gap:24px;align-items:start}
.viewer-panel{min-height:520px}
.viewer-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:18px}
.viewer-head h2{margin:6px 0 0;font-size:24px;letter-spacing:-.04em}
.eyebrow{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:var(--gray);font-weight:800}
.course-video{width:100%;max-height:68vh;background:#000;border-radius:20px;display:block}
.helper-text{color:var(--gray);font-size:14px;margin:12px 0 0}
.resource-viewer-box{text-align:center;border:1px dashed #ddd;border-radius:22px;padding:48px 20px;background:#fbfbfb}
.resource-viewer-box h3{margin:8px 0}.resource-viewer-box p{color:var(--gray)}
.item-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.item-row{border:1px solid var(--line);border-radius:18px;background:#fff;overflow:hidden;transition:.2s ease}
.item-row.active{border-color:var(--black);box-shadow:0 10px 25px rgba(17,17,17,.06)}
.item-row.done{border-color:#cfe9d8}
.item-row>a{display:grid;grid-template-columns:38px 1fr 34px;gap:10px;align-items:center;padding:13px}
.item-number{width:34px;height:34px;border-radius:12px;background:var(--pink-soft);display:flex;align-items:center;justify-content:center;font-weight:900}
.item-main{min-width:0}.item-main strong{display:block;line-height:1.2}.item-main small{display:block;margin-top:3px}.item-check{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#e8f6ee;color:var(--success);font-weight:900}
.item-row:not(.done) .item-check{background:#f4f4f4;color:transparent}
.order-actions{display:flex;gap:6px;padding:0 13px 13px 61px;flex-wrap:wrap}.order-actions form{display:inline-flex}
.mini-btn{border:1px solid var(--line);background:#f6f6f6;border-radius:10px;min-width:34px;height:32px;cursor:pointer;font-weight:900}.mini-btn.danger{background:#fdeaea;color:var(--danger);border-color:#facaca}

.hidden{display:none!important}
.upload-progress-box{margin-top:18px;padding:18px;border:1px solid #f2d0d1;border-radius:18px;background:#fff;box-shadow:0 12px 30px rgba(0,0,0,.06)}
.upload-progress-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;font-weight:700;color:#111}
.upload-progress-track{width:100%;height:12px;border-radius:999px;background:#f2f2f2;overflow:hidden}
.upload-progress-bar{width:0%;height:100%;border-radius:999px;background:var(--pink);transition:width .2s ease}
.upload-progress-text{margin:10px 0 0;font-size:13px;color:#555}

.modal{display:none;position:fixed;inset:0;background:rgba(0,0,0,.55);padding:24px;z-index:1000}
.modal.show{display:grid;place-items:center}
.modal-dialog{width:min(1100px,100%);max-height:92vh;background:var(--white);border-radius:24px;overflow:hidden;box-shadow:0 30px 80px rgba(0,0,0,.25);display:flex;flex-direction:column}
.modal-head,.modal-foot{padding:16px 18px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;gap:12px}
.modal-foot{border-top:1px solid var(--line);border-bottom:0;justify-content:flex-end}
.modal-body{padding:18px;overflow:auto;min-height:360px;background:#fcfcfc}
.preview-frame{width:100%;height:68vh;border:0;background:var(--white);border-radius:15px}
.preview-image{display:block;max-width:100%;max-height:68vh;margin:0 auto;border-radius:15px}
.preview-video{width:100%;max-height:68vh;border-radius:15px;background:#000}
.preview-fallback{text-align:center;color:var(--gray);padding:80px 20px}

@media(max-width:1180px){.course-layout{grid-template-columns:1fr}.item-list-panel{order:-1}.inline-edit-form{grid-template-columns:1fr 1fr}.admin-grid{grid-template-columns:1fr}}
@media(max-width:980px){.app-shell{grid-template-columns:1fr}.sidebar{position:relative;height:auto;border-right:0;border-bottom:1px solid var(--line)}.nav{display:grid;grid-template-columns:repeat(2,1fr)}.main{padding:22px}.toolbar{align-items:stretch;flex-direction:column}.search{max-width:none}.induction-hero{grid-template-columns:1fr}.form-grid.two{grid-template-columns:1fr}}
@media(max-width:560px){.nav{grid-template-columns:1fr}.search{flex-direction:column}.topbar h1{font-size:28px}.login-card{padding:24px}.login-brand{align-items:flex-start}.cards-grid{grid-template-columns:1fr}.viewer-head{flex-direction:column}.item-row>a{grid-template-columns:34px 1fr 28px}}
