:root{
  --bg:#f4f6f9;
  --panel:#ffffff;
  --side:#eef1f6;
  --text:#111827;
  --muted:#6b7280;
  --border:#e5e7eb;
  --shadow: 0 14px 40px rgba(17,24,39,.08);
  --radius:16px;
  --accent:#5b5ce6;
  --accent2:#7c3aed;
  --danger:#ef4444;
  --ok:#16a34a;
  --warn:#f59e0b;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color:var(--text);
  background:var(--bg);
}

a{color:inherit}
.layout{
  display:flex;
  min-height:100vh;
}

.sidebar{
  width:280px;
  background:var(--side);
  border-right:1px solid var(--border);
  padding:22px 18px;
  display:flex;
  flex-direction:column;
  gap:18px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:4px 6px;
}
.brand img{
  width:60px; height:60px;
  border-radius:12px;
  background:#fff;
  box-shadow: 0 10px 18px rgba(0,0,0,.08);
  object-fit:cover;
}
.brand .title{
  font-weight:800;
  letter-spacing:.5px;
}
.brand .role{
  font-size:13px;
  color:var(--muted);
  margin-top:2px;
}

.nav{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:10px;
}
.nav a{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  padding:10px 12px;
  border-radius:12px;
  color:var(--text);
}
.nav a .dot{
  width:10px;
  height:10px;
  border-radius:999px;
  background:#c7cdd8;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.55);
}
.nav a.active{
  background: rgba(91,92,230,.12);
}
.nav a.active .dot{
  background: var(--accent);
}
.nav a:hover{
  background: rgba(17,24,39,.04);
}

.side-footer{
  margin-top:auto;
  padding-top:12px;
  font-size:13px;
  color:var(--muted);
}

.main{
  flex:1;
  padding:22px 26px 32px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
}
.topbar h1{
  margin:0;
  font-size:30px;
  letter-spacing:-.02em;
}
.top-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:1px solid var(--border);
  background:#fff;
  padding:10px 14px;
  border-radius:999px;
  cursor:pointer;
  text-decoration:none;
  font-weight:600;
  box-shadow: 0 10px 18px rgba(0,0,0,.05);
}
.btn:hover{transform:translateY(-1px)}
.btn:active{transform:translateY(0px)}
.btn.primary{
  border: none;
  color:#fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.btn.danger{
  border:1px solid rgba(239,68,68,.35);
  color: var(--danger);
  background:#fff;
  box-shadow:none;
}
.btn.small{padding:8px 12px; font-size:13px}
.btn.plain{box-shadow:none}

.chips{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin: 10px 0 18px;
}
.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--border);
  background:#fff;
  padding:8px 12px;
  border-radius:999px;
  font-size:14px;
  color:var(--text);
}
.chip .dot{
  width:9px; height:9px;
  border-radius:999px;
  background:#c7cdd8;
}
.chip.ok .dot{background:var(--ok)}
.chip.bad .dot{background:var(--danger)}
.chip.warn .dot{background:var(--warn)}
.chip code{font-size:12px; color:var(--muted)}

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:18px;
}

.card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:18px;
  overflow:hidden;
}
.card h2{
  margin:0 0 10px;
  font-size:20px;
}
.card p{
  margin:8px 0;
  color:var(--muted);
  line-height:1.45;
}

.form-row{
  margin-top:12px;
}
label{
  display:block;
  font-size:14px;
  color:var(--muted);
  margin-bottom:6px;
}
input[type="text"], input[type="password"], select, textarea{
  width:100%;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  font-size:14px;
  outline:none;
  background:#fff;
}
textarea{min-height:120px; resize:vertical}
input[type="file"]{width:100%}

.dropzone{
  border:1px dashed #cdd5e1;
  background: #fbfcff;
  border-radius:14px;
  padding:16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.dropzone.dragover{
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(91,92,230,.12);
}
.dropzone .dz-left{
  display:flex; flex-direction:column; gap:4px;
}
.dropzone .dz-title{
  font-weight:700;
}
.dropzone .dz-sub{
  font-size:13px;
  color:var(--muted);
}

.filelist{
  margin:10px 0 0;
  padding-left:18px;
  color:var(--muted);
  font-size:14px;
}

.options{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
  margin-top:10px;
}
.check{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:14px;
  color:var(--text);
}
.check input{transform:scale(1.1)}

.range-wrap{
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
}
input[type="range"]{width:100%}
.range-label{
  min-width:140px;
  font-weight:700;
  text-align:right;
}

.progress{
  height:10px;
  background:#eef2ff;
  border-radius:999px;
  overflow:hidden;
  border:1px solid rgba(91,92,230,.18);
  margin-top:12px;
}
.progress > div{
  height:100%;
  width:0%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius:999px;
  transition: width .25s ease;
}
.progress-text{
  margin-top:8px;
  font-size:14px;
  color:var(--muted);
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.results{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:14px;
  margin-top:14px;
}
.result{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background:#fff;
  box-shadow: 0 12px 26px rgba(0,0,0,.06);
}
.result .meta{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}
.result .name{
  font-weight:800;
  font-size:14px;
  word-break:break-word;
}
.result .small{
  font-size:12px;
  color:var(--muted);
  margin-top:2px;
}
.result .preview{
  margin-top:10px;
}
.result img{
  width:100%;
  height:160px;
  object-fit:contain;
  border-radius:12px;
  background:#f8fafc;
  border:1px solid var(--border);
}
.result audio{
  width:100%;
  margin-top:10px;
}
.result .actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}

.footer{
  margin-top:18px;
  color:var(--muted);
  font-size:13px;
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.alert{
  border:1px solid rgba(239,68,68,.35);
  background:#fff;
  border-radius:14px;
  padding:12px;
  color: var(--danger);
  font-weight:700;
  margin-top:10px;
}
.okbox{
  border:1px solid rgba(22,163,74,.25);
  background:#fff;
  border-radius:14px;
  padding:12px;
  color: var(--ok);
  font-weight:700;
  margin-top:10px;
}

/* Responsive */
@media (max-width: 980px){
  .grid{grid-template-columns:1fr}
  .results{grid-template-columns:1fr}
  .sidebar{width:240px}
}
@media (max-width: 760px){
  .layout{flex-direction:column}
  .sidebar{width:100%; flex-direction:row; align-items:center; gap:10px; overflow:auto}
  .nav{flex-direction:row; gap:6px; margin-top:0}
  .nav a{white-space:nowrap}
  .side-footer{display:none}
  .main{padding:16px}
  .topbar{flex-direction:column; align-items:flex-start}
  .top-actions{width:100%; justify-content:flex-start}
}
