:root{
    --pink:#FFA0A1;
    --pink-soft:#fff0f0;
    --black:#111111;
    --white:#ffffff;
    --gray:#777777;
    --line:#eeeeee;
    --danger:#d93025;
    --success:#167c3a;
    --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}

.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:42px;
    height:42px;
    border-radius:14px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:var(--pink);
    color:var(--black);
    font-weight:900;
}
.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}
input,select,textarea{
    width:100%;
    border:1px solid var(--line);
    background:var(--white);
    border-radius:15px;
    padding:13px 14px;
    outline:none;
}
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-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)}
.icon-btn{
    border:0;
    background:#f4f4f4;
    width:40px;
    height:40px;
    border-radius:50%;
    cursor:pointer;
    font-size:26px;
    line-height:1;
}

.section-block,.panel{
    background:var(--white);
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:22px;
    box-shadow:var(--shadow);
    margin-bottom:24px;
}
.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}

.grid{display:grid;gap:16px}
.cards-grid{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}
.card{
    border:1px solid var(--line);
    border-radius:22px;
    padding:18px;
    min-height:185px;
    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 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}
.meta{display:flex;justify-content:space-between;gap:8px;color:var(--gray);font-size:13px;margin-bottom:6px}
.folder-card{cursor:pointer}

.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)}
.folder-description{color:var(--gray);margin-top:-5px;margin-bottom:22px}

.admin-grid{
    display:grid;
    grid-template-columns:360px 1fr;
    gap:22px;
    align-items:start;
}
.admin-grid .wide{min-width:0}
.checks{display:flex;flex-direction:column;gap:8px}
.checks label{font-weight:500}
.check-center{display:flex;justify-content:center}

.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:18px}
table{width:100%;border-collapse:collapse;background:var(--white);min-width:760px}
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 form{display:inline-flex}
.status{padding:5px 10px;border-radius:999px;font-size:12px;font-weight:800}
.status.active{background:#e8f6ee;color:var(--success)}
.status.inactive{background:#f4f4f4;color:#555}

.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(430px,100%);
    background:var(--white);
    border:1px solid var(--line);
    border-radius:30px;
    box-shadow:var(--shadow);
    padding:34px;
}
.login-brand{margin-bottom:28px}
.login-card h1{font-size:32px;margin:0 0 8px;letter-spacing:-.05em}
.login-card p{color:var(--gray);margin:0 0 22px}

.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: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}
    .admin-grid{grid-template-columns:1fr}
    .toolbar{align-items:stretch;flex-direction:column}
    .search{max-width:none}
}
@media(max-width:560px){
    .nav{grid-template-columns:1fr}
    .search{flex-direction:column}
    .topbar h1{font-size:28px}
    .login-card{padding:24px}
}
