:root{
  --bg:#f3f4f6;
  --card:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --brand:#0b6bff;
  --sidebar:#111827;
  --sidebar2:#0b1220;
  --success:#16a34a;
  --warning:#f59e0b;
  --danger:#ef4444;
}

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

.app{
  display:flex;
  min-height:100%;
}

.sidebar{
  width:260px;
  background:linear-gradient(180deg,var(--sidebar),var(--sidebar2));
  color:#fff;
  padding:18px 14px;
  position:sticky;
  top:0;
  height:100vh;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:900;
  letter-spacing:.2px;
  margin-bottom:18px;
}
.brand .dot{width:10px;height:10px;border-radius:999px;background:var(--brand);box-shadow:0 0 0 6px rgba(11,107,255,.18)}
.section-title{
  margin:18px 10px 8px 10px;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.9px;
  color:rgba(255,255,255,.55);
}
.nav a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 10px;
  margin:4px 6px;
  border-radius:10px;
  color:rgba(255,255,255,.86);
  text-decoration:none;
  font-weight:700;
}
.nav a:hover{background:rgba(255,255,255,.08)}
.nav a.active{background:rgba(11,107,255,.20); outline:1px solid rgba(11,107,255,.25)}

.content{
  flex:1;
  padding:26px 26px 40px;
}

.h1{
  font-size:38px;
  font-weight:900;
  margin:0 0 6px 0;
}
.breadcrumbs{
  color:var(--muted);
  margin-bottom:16px;
  font-size:14px;
}
.breadcrumbs a{color:var(--brand);text-decoration:none}
.toolbar{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  margin:14px 0;
}
.tabs{
  display:flex;
  gap:10px;
}
.tab{
  padding:8px 12px;
  border-radius:10px;
  background:#fff;
  border:1px solid var(--line);
  font-weight:800;
  color:var(--muted);
  text-decoration:none;
}
.tab.active{
  border-color:rgba(22,163,74,.35);
  color:var(--success);
}
.tab.trash.active{
  border-color:rgba(245,158,11,.35);
  color:var(--warning);
}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:14px;
  box-shadow:0 10px 28px rgba(0,0,0,.06);
}

.card-header{
  padding:14px 16px;
  border-bottom:1px solid var(--line);
  font-weight:900;
  display:flex;
  align-items:center;
  gap:10px;
}
.card-body{padding:16px}
.grid-2{
  display:grid;
  grid-template-columns: 420px 1fr;
  gap:16px;
}
@media (max-width: 1100px){
  .grid-2{grid-template-columns:1fr}
  .sidebar{display:none}
}

.label{font-size:13px;color:var(--muted);margin-bottom:6px}
.input, select, textarea{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  font-size:15px;
}
.row{margin-bottom:12px}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius:10px;
  border:1px solid var(--line);
  background:#fff;
  cursor:pointer;
  font-weight:900;
  text-decoration:none;
  color:var(--text);
}
.btn.primary{background:var(--brand);border-color:var(--brand);color:#fff}
.btn.ghost{background:transparent;color:var(--brand);border-color:rgba(11,107,255,.35)}
.btn.danger{background:var(--danger);border-color:var(--danger);color:#fff}

.table{
  width:100%;
  border-collapse:collapse;
}
.table th,.table td{
  padding:12px 10px;
  border-bottom:1px solid var(--line);
  vertical-align:top;
  font-size:14px;
}
.table th{color:var(--muted);font-weight:900}
.small{font-size:12px;color:var(--muted)}
.badge{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  font-weight:900;
  font-size:12px;
  border:1px solid transparent;
}
.badge.ok{background:rgba(22,163,74,.10);color:var(--success);border-color:rgba(22,163,74,.25)}
.badge.wait{background:rgba(245,158,11,.12);color:#a16207;border-color:rgba(245,158,11,.28)}
.badge.del{background:rgba(239,68,68,.10);color:#b91c1c;border-color:rgba(239,68,68,.22)}
.search{
  display:flex;
  gap:10px;
  align-items:center;
}
.search input{max-width:420px}

.preview{
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  padding:14px;
  min-height:520px;
  overflow:auto;
}
.preview h2,h3{margin-top:0}
.help-line{
  margin:10px 0 12px;
  padding:10px 12px;
  background:#f9fafb;
  border:1px dashed rgba(107,114,128,.4);
  border-radius:12px;
  font-size:13px;
  color:#111827;
}
.help-line code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;font-size:12px}
.signature-box{
  margin-top:18px;
  padding-top:12px;
  border-top:1px solid var(--line);
}
.canvas{
  border:1px dashed rgba(107,114,128,.55);
  border-radius:12px;
  width:100%;
  height: 340px;
  touch-action:none;
}
