:root{
    --bg:#070b14;
    --bg-soft:#0e1422;
    --card:rgba(18,25,42,0.78);
    --card-2:rgba(14,20,34,0.92);
    --line:rgba(255,255,255,0.08);
    --text:#edf2ff;
    --muted:#a5b1c7;
    --primary:#6ea8ff;
    --primary-2:#4b7dff;
    --success:#22c55e;
    --warning:#f59e0b;
    --danger:#ef4444;
    --radius:22px;
    --shadow:0 20px 60px rgba(0,0,0,0.35);
}

*{box-sizing:border-box}
body{
    margin:0;
    font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
    background:
        radial-gradient(circle at top left, rgba(75,125,255,.18), transparent 30%),
        radial-gradient(circle at bottom right, rgba(110,168,255,.12), transparent 25%),
        var(--bg);
    color:var(--text);
}
a{color:var(--primary);text-decoration:none}
img{max-width:100%}

.auth-body{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:30px;
}
.auth-wrap{width:100%;max-width:520px}
.auth-card{
    padding:36px;
    border:1px solid var(--line);
    border-radius:32px;
    box-shadow:var(--shadow);
    background:var(--card);
    backdrop-filter: blur(18px);
}
.brand-logo{
    max-width:220px;
    display:block;
    margin:0 auto 24px;
}
h1,h2,h3{margin:0 0 12px}
.muted{color:var(--muted)}
.alert{
    padding:14px 16px;
    border-radius:14px;
    margin:18px 0;
    font-size:14px;
}
.alert.error{background:rgba(239,68,68,.12);border:1px solid rgba(239,68,68,.25);color:#fecaca}
.alert.success{background:rgba(34,197,94,.12);border:1px solid rgba(34,197,94,.25);color:#bbf7d0}

.form-auth,.main-form{display:grid;gap:18px}
.field{display:grid;gap:8px}
.field label{
    font-size:14px;
    color:#d7e0f4;
    font-weight:600;
}
input,textarea,select{
    width:100%;
    border:1px solid var(--line);
    background:rgba(255,255,255,.04);
    color:var(--text);
    padding:14px 16px;
    border-radius:16px;
    outline:none;
    font-size:15px;
}
textarea{min-height:130px;resize:vertical}
input:focus,textarea:focus,select:focus{
    border-color:rgba(110,168,255,.6);
    box-shadow:0 0 0 4px rgba(110,168,255,.12);
}
.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:none;
    cursor:pointer;
    border-radius:16px;
    padding:14px 18px;
    font-weight:700;
    transition:.2s ease;
}
.btn:hover{transform:translateY(-1px)}
.btn-full{width:100%}
.btn-primary{
    background:linear-gradient(135deg,var(--primary),var(--primary-2));
    color:white;
}
.btn-secondary{
    background:rgba(255,255,255,.06);
    color:var(--text);
    border:1px solid var(--line);
}
.btn-danger{
    background:rgba(239,68,68,.15);
    color:#fecaca;
    border:1px solid rgba(239,68,68,.25);
}
.layout{
    display:grid;
    grid-template-columns:280px 1fr;
    min-height:100vh;
}
.sidebar{
    background:rgba(6,10,18,.9);
    border-right:1px solid var(--line);
    padding:24px;
    position:sticky;
    top:0;
    height:100vh;
}
.sidebar .logo{
    max-width:180px;
    margin-bottom:30px;
}
.sidebar a{
    display:block;
    color:#d7e0f4;
    padding:12px 14px;
    border-radius:14px;
    margin-bottom:8px;
}
.sidebar a:hover,
.sidebar a.active{
    background:rgba(255,255,255,.06);
}
.content{
    padding:30px;
}
.topbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    margin-bottom:24px;
}
.card{
    background:var(--card-2);
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:24px;
    box-shadow:var(--shadow);
}
.grid-2{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:18px;
}
.grid-3{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:18px;
}
.section-title{
    margin-bottom:16px;
    padding-bottom:12px;
    border-bottom:1px solid var(--line);
}
.progress-bar{
    width:100%;
    height:14px;
    background:rgba(255,255,255,.06);
    border-radius:999px;
    overflow:hidden;
}
.progress-bar span{
    display:block;
    height:100%;
    background:linear-gradient(90deg,var(--success),var(--primary));
    border-radius:999px;
}
.repeatable-item{
    border:1px solid var(--line);
    padding:18px;
    border-radius:18px;
    margin-bottom:16px;
    background:rgba(255,255,255,.03);
}
.table{
    width:100%;
    border-collapse:collapse;
}
.table th,.table td{
    border-bottom:1px solid var(--line);
    padding:14px 10px;
    text-align:left;
}
.badge{
    display:inline-flex;
    align-items:center;
    padding:8px 12px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
}
.badge.draft{
    background:linear-gradient(180deg,rgba(245,158,11,.18),rgba(245,158,11,.1));
    color:#fde68a;
    border:1px solid rgba(245,158,11,.25);
}
.badge.in_progress{
    background:linear-gradient(180deg,rgba(59,130,246,.18),rgba(59,130,246,.1));
    color:#bfdbfe;
    border:1px solid rgba(59,130,246,.25);
}
.badge.completed{
    background:linear-gradient(180deg,rgba(34,197,94,.18),rgba(34,197,94,.1));
    color:#bbf7d0;
    border:1px solid rgba(34,197,94,.25);
}
.badge.needs_revision{
    background:linear-gradient(180deg,rgba(239,68,68,.18),rgba(239,68,68,.1));
    color:#fecaca;
    border:1px solid rgba(239,68,68,.25);
}
.file-list{
    display:grid;
    gap:8px;
    margin-top:10px;
}
.file-item{
    padding:10px 12px;
    border:1px solid var(--line);
    border-radius:14px;
    background:rgba(255,255,255,.03);
}
.glass{
    background:rgba(18,25,42,0.78);
    backdrop-filter:blur(18px);
}
.hidden{display:none}

@media (max-width: 980px){
    .layout{grid-template-columns:1fr}
    .sidebar{
        height:auto;
        position:relative;
    }
    .grid-2,.grid-3{grid-template-columns:1fr}
    .content{padding:18px}
}

.stats-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:18px;
    margin-bottom:24px;
}
.stat-card{
    background:linear-gradient(180deg,rgba(255,255,255,.05),rgba(255,255,255,.025));
    border:1px solid var(--line);
    border-radius:24px;
    padding:22px;
    box-shadow:var(--shadow);
}
.stat-card .k{
    color:var(--muted);
    font-size:13px;
    margin-bottom:8px;
}
.stat-card .v{
    font-size:32px;
    font-weight:800;
    line-height:1;
}
.card-header-flex{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}
.btn-sm{
    padding:9px 12px;
    border-radius:12px;
    font-size:13px;
    font-weight:700;
}
.password-inline{
    display:flex;
    gap:10px;
    align-items:center;
}
.password-inline input{
    flex:1;
}
.collapse-panel.hidden{
    display:none;
}
.collapse-toggle{
    background:rgba(255,255,255,.04);
    border:1px solid var(--line);
    color:var(--text);
}
.collapse-toggle.is-open{
    background:rgba(110,168,255,.12);
    border-color:rgba(110,168,255,.4);
}
.file-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
}
.file-row-left{
    min-width:0;
}
.file-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}
.top-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}
.inline-note{
    font-size:13px;
    color:var(--muted);
}
.badge.logo{background:rgba(59,130,246,.12);color:#bfdbfe}
.badge.photo{background:rgba(34,197,94,.12);color:#bbf7d0}
.badge.document{background:rgba(245,158,11,.12);color:#fde68a}
.badge.extra{background:rgba(168,85,247,.12);color:#ddd6fe}

@media (max-width: 1100px){
    .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (max-width: 700px){
    .stats-grid{grid-template-columns:1fr}
}

.filters-bar{
    display:grid;
    grid-template-columns:1fr 220px;
    gap:14px;
    margin-bottom:20px;
}
.admin-note-box{
    background:rgba(255,255,255,.03);
    border:1px solid var(--line);
    border-radius:18px;
    padding:18px;
}
.autosave-status{
    font-size:13px;
    color:var(--muted);
    margin-top:10px;
}
.magic-box{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    align-items:center;
}
.magic-link{
    word-break:break-all;
    font-size:13px;
    color:var(--muted);
    margin-top:10px;
}
@media (max-width: 900px){
    .filters-bar{
        grid-template-columns:1fr;
    }
}

.stats-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:18px;
    margin:24px 0;
}

.stat-card{
    background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.025));
    border:1px solid rgba(255,255,255,.08);
    border-radius:24px;
    padding:24px;
    box-shadow:0 20px 60px rgba(0,0,0,.28);
    min-height:130px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
}

.stat-card .k{
    font-size:14px;
    color:var(--muted);
    font-weight:600;
    margin-bottom:14px;
    line-height:1.4;
}

.stat-card .v{
    font-size:42px;
    font-weight:800;
    line-height:1;
    color:var(--text);
    letter-spacing:-1px;
}

.stat-card.total .v{
    color:#ffffff;
}

.stat-card.completed .v{
    color:#86efac;
}

.stat-card.progress .v{
    color:#93c5fd;
}

.stat-card.revision .v{
    color:#fca5a5;
}

.filters-bar{
    display:grid;
    grid-template-columns:1fr 240px;
    gap:14px;
    margin-bottom:20px;
}

@media (max-width: 1100px){
    .stats-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

@media (max-width: 700px){
    .stats-grid{
        grid-template-columns:1fr;
    }

    .filters-bar{
        grid-template-columns:1fr;
    }
}

.dashboard-grid-2{
    display:grid;
    grid-template-columns:1.2fr .8fr;
    gap:18px;
    margin-top:24px;
}

.dashboard-grid-3{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:18px;
    margin-top:24px;
}

.panel-list{
    display:grid;
    gap:12px;
}

.panel-item{
    background:rgba(255,255,255,.03);
    border:1px solid rgba(255,255,255,.06);
    border-radius:18px;
    padding:16px;
}

.panel-item .title{
    font-weight:700;
    margin-bottom:6px;
}

.panel-item .meta{
    font-size:13px;
    color:var(--muted);
}

.progress-big{
    margin-top:12px;
}

.progress-big .label{
    display:flex;
    justify-content:space-between;
    font-size:13px;
    color:var(--muted);
    margin-bottom:8px;
}

.progress-big .bar{
    height:16px;
    background:rgba(255,255,255,.06);
    border-radius:999px;
    overflow:hidden;
}

.progress-big .bar span{
    display:block;
    height:100%;
    border-radius:999px;
    background:linear-gradient(90deg,#4ade80,#60a5fa);
}

.timeline{
    display:grid;
    gap:12px;
}

.timeline-item{
    position:relative;
    padding:14px 16px 14px 18px;
    border-radius:18px;
    border:1px solid rgba(255,255,255,.06);
    background:rgba(255,255,255,.03);
}

.timeline-item::before{
    content:"";
    position:absolute;
    left:0;
    top:14px;
    bottom:14px;
    width:4px;
    border-radius:999px;
    background:linear-gradient(180deg,#60a5fa,#4ade80);
}

.checklist-list{
    display:grid;
    gap:10px;
}

.check-item{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:12px 14px;
    border-radius:16px;
    background:rgba(255,255,255,.03);
    border:1px solid rgba(255,255,255,.06);
}

.check-item-left{
    display:flex;
    align-items:center;
    gap:10px;
}

.status-dot{
    width:10px;
    height:10px;
    border-radius:50%;
    background:#64748b;
}
.status-dot.done{
    background:#4ade80;
}

@media (max-width: 1100px){
    .dashboard-grid-2,
    .dashboard-grid-3{
        grid-template-columns:1fr;
    }
}

.section-upload-box{
    margin-top:16px;
    padding:16px;
    border:1px dashed rgba(255,255,255,.12);
    border-radius:18px;
    background:rgba(255,255,255,.02);
}

.section-upload-title{
    font-size:14px;
    font-weight:700;
    margin-bottom:10px;
    color:var(--text);
}

.file-mini-list{
    display:grid;
    gap:8px;
    margin-top:12px;
}

.file-mini-item{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    padding:10px 12px;
    border-radius:14px;
    border:1px solid rgba(255,255,255,.06);
    background:rgba(255,255,255,.03);
    flex-wrap:wrap;
}

.client-anchor-bar{
    position:sticky;
    top:0;
    z-index:40;
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    padding:14px 0 18px;
    background:linear-gradient(180deg,rgba(7,11,20,.98),rgba(7,11,20,.9));
    backdrop-filter:blur(10px);
}

.client-anchor-bar a{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:10px 14px;
    border-radius:999px;
    border:1px solid rgba(255,255,255,.08);
    background:rgba(255,255,255,.04);
    color:var(--text);
    font-size:13px;
    text-decoration:none;
}

.client-anchor-bar a:hover{
    background:rgba(110,168,255,.12);
    border-color:rgba(110,168,255,.3);
}

.sidebar{
    position:sticky;
    top:0;
    height:100vh;
    overflow:auto;
}

.sidebar-nav-sections{
    margin-top:24px;
    padding-top:18px;
    border-top:1px solid rgba(255,255,255,.08);
}

.sidebar-nav-sections a{
    font-size:13px;
    padding:9px 12px;
    margin-bottom:6px;
}